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

Commit 9d46aa65 authored by Charan Teja Reddy's avatar Charan Teja Reddy
Browse files

coresight: add the fuse check logic for coresight etm



Reintroduce the fuse check for ETM as accessing the registers of ETM
when the CPU is offline during the bootup cause the external abort.

Change-Id: Ic4730500e860b0eff445354b8b20171b6e46431b
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent 1c2c6d7f
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2249,6 +2249,10 @@ 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);
@@ -2309,12 +2313,6 @@ static int etm_probe(struct platform_device *pdev)
	if (ret)
		goto err0;

	if (!coresight_authstatus_enabled(drvdata->base)) {
		clk_disable_unprepare(drvdata->clk);
		wakeup_source_trash(&drvdata->ws);
		return -EPERM;
	}

	if (count++ == 0)
		register_hotcpu_notifier(&etm_cpu_notifier);

+5 −7
Original line number Diff line number Diff line
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -3531,6 +3531,10 @@ 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);
@@ -3594,12 +3598,6 @@ static int etm_probe(struct platform_device *pdev)
	if (ret)
		goto err0;

	if (!coresight_authstatus_enabled(drvdata->base)) {
		clk_disable_unprepare(drvdata->clk);
		wakeup_source_trash(&drvdata->ws);
		return -EPERM;
	}

	if (count++ == 0) {
		register_hotcpu_notifier(&etm_cpu_notifier);
		register_hotcpu_notifier(&etm_cpu_dying_notifier);