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

Commit b9f48ba0 authored by Charan Teja Reddy's avatar Charan Teja Reddy Committed by Gerrit - the friendly Code Review server
Browse files

coresight: add the authentication logic for coresight etm



Add the authentication logic that depends on the CoreSight AUTHSTATUS
register rather than the fuses that helps in collecting the CPU trace
on the secure device if ETM is functional.

Change-Id: I7ca410cc7b72a98235101f64f090c65e37603d27
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent 1c10389d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1930,6 +1930,10 @@ static void etm_init_arch_data(void *info)
	 */
	etm_set_prog(drvdata);

	/* check the state of the fuse */
	if (!coresight_authstatus_enabled(drvdata->base))
			goto out;

	/* find all capabilities */
	etmidr = etm_readl(drvdata, ETMIDR);
	drvdata->arch = BMVAL(etmidr, 4, 11);
@@ -1984,7 +1988,7 @@ static void etm_init_arch_data(void *info)
			drvdata->data_trace_support = false;
	} else
		drvdata->data_trace_support = false;

out:
	etm_set_pwrdwn(drvdata);
	ETM_LOCK(drvdata);
}
@@ -2249,10 +2253,6 @@ static int etm_probe(struct platform_device *pdev)
	struct resource *res;
	struct device_node *cpu_node;

	if (coresight_fuse_access_disabled() ||
	    coresight_fuse_apps_access_disabled())
		return -EPERM;

	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
+8 −8
Original line number Diff line number Diff line
@@ -3003,6 +3003,10 @@ static void etm_init_arch_data(void *info)

	ETM_UNLOCK(drvdata);

	/* check the state of the fuse */
	if (!coresight_authstatus_enabled(drvdata->base))
		goto out;

	/* find all capabilities */
	/* tracing capabilities of trace unit */
	etmidr0 = etm_readl(drvdata, TRCIDR0);
@@ -3182,7 +3186,7 @@ static void etm_init_arch_data(void *info)
		drvdata->reduced_cntr_support = true;
	else
		drvdata->reduced_cntr_support = false;

out:
	ETM_LOCK(drvdata);
}

@@ -3531,10 +3535,6 @@ static int etm_probe(struct platform_device *pdev)
	struct resource *res;
	struct device_node *cpu_node;

	if (coresight_fuse_access_disabled() ||
	    coresight_fuse_apps_access_disabled())
		return -EPERM;

	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
@@ -3587,9 +3587,6 @@ static int etm_probe(struct platform_device *pdev)
		goto err0;
	}

	/* parse clock gating control DT and disable clock gating */
	etm_parse_cgc_data(pdev, drvdata);

	ret = clk_set_rate(drvdata->clk, CORESIGHT_CLK_RATE_TRACE);
	if (ret)
		goto err0;
@@ -3640,6 +3637,9 @@ static int etm_probe(struct platform_device *pdev)
	}
	mutex_unlock(&drvdata->mutex);

	/* parse clock gating control DT and disable clock gating */
	etm_parse_cgc_data(pdev, drvdata);

	return 0;
err1:
	if (--count == 0) {