Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e241bc2 authored by Shashank Mittal's avatar Shashank Mittal
Browse files

coresight-tpdm: add fix for MSR erratum



Some TPDMs require to program MSR registers after enabling the DSB
subunit.
This change adds support for such TPDMs.

Change-Id: Iff5c1d73f752c8f9ff483e37cf65f9fe8e2901ca
Signed-off-by: default avatarShashank Mittal <mittals@codeaurora.org>
parent cb71834d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -85,11 +85,14 @@ its hardware characteristcs.
	  monitor connected to the aggregator on each port. Should be specified
	  in pairs (port, cmb element size).

* Optional property for TPDM:
* Optional properties for TPDM:

	* qcom,clk-enable: specifies whether additional clock bit needs to be
	  set for M4M TPDM.

	* qcom,msr-fix-req: boolean, indicating if MSRs need to be programmed
	  after enabling the subunit.

Example:

1. Sinks
+9 −1
Original line number Diff line number Diff line
@@ -257,6 +257,7 @@ struct tpdm_drvdata {
	int			traceid;
	uint32_t		version;
	bool			msr_support;
	bool			msr_fix_req;
};

static void __tpdm_enable_gpr(struct tpdm_drvdata *drvdata)
@@ -479,6 +480,7 @@ static void __tpdm_enable_dsb(struct tpdm_drvdata *drvdata)
		val = val & ~BIT(1);
	tpdm_writel(drvdata, val, TPDM_DSB_TIER);

	if (!drvdata->msr_fix_req)
		__tpdm_config_dsb_msr(drvdata);

	val = tpdm_readl(drvdata, TPDM_DSB_CR);
@@ -501,6 +503,9 @@ static void __tpdm_enable_dsb(struct tpdm_drvdata *drvdata)
	/* Set the enable bit */
	val = val | BIT(0);
	tpdm_writel(drvdata, val, TPDM_DSB_CR);

	if (drvdata->msr_fix_req)
		__tpdm_config_dsb_msr(drvdata);
}

static void __tpdm_enable_cmb(struct tpdm_drvdata *drvdata)
@@ -3633,6 +3638,9 @@ static int tpdm_probe(struct platform_device *pdev)
	drvdata->clk_enable = of_property_read_bool(pdev->dev.of_node,
						    "qcom,clk-enable");

	drvdata->msr_fix_req = of_property_read_bool(pdev->dev.of_node,
						     "qcom,msr-fix-req");

	mutex_init(&drvdata->lock);

	drvdata->clk = devm_clk_get(dev, "core_clk");