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

Commit aeef0212 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "CoreSight: Enabling CoreSight on a secured device"

parents 73c340ac 90095b2a
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -182,9 +182,6 @@ static int csr_probe(struct platform_device *pdev)
	struct resource *res;
	struct coresight_desc *desc;

	if (coresight_fuse_access_disabled())
		return -EPERM;

	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
+12 −3
Original line number Diff line number Diff line
@@ -1401,9 +1401,6 @@ static int cti_probe(struct platform_device *pdev)
	struct device_node *cpu_node;
	const __be32 *cpu_phandle;

	if (coresight_fuse_access_disabled())
		return -EPERM;

	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
@@ -1436,6 +1433,15 @@ static int cti_probe(struct platform_device *pdev)
	if (ret)
		return ret;

	ret = clk_prepare_enable(drvdata->clk);
	if (ret)
		return ret;

	if (!coresight_authstatus_enabled(drvdata->base))
		goto err0;

	clk_disable_unprepare(drvdata->clk);

	drvdata->gpio_trigin = devm_kzalloc(dev, sizeof(struct cti_pctrl),
					    GFP_KERNEL);
	if (!drvdata->gpio_trigin)
@@ -1536,6 +1542,9 @@ err:
	if (drvdata->cti_save && !drvdata->cti_hwclk)
		clk_disable_unprepare(drvdata->clk);
	return ret;
err0:
	clk_disable_unprepare(drvdata->clk);
	return -EPERM;
}

static int cti_remove(struct platform_device *pdev)
+12 −3
Original line number Diff line number Diff line
@@ -807,9 +807,6 @@ static int dbgui_probe(struct platform_device *pdev)
	struct msm_dump_entry dump_entry;
	void *baddr;

	if (coresight_fuse_access_disabled())
		return -EPERM;

	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
@@ -841,6 +838,15 @@ static int dbgui_probe(struct platform_device *pdev)
	if (!drvdata->base)
		return -ENOMEM;

	ret = clk_prepare_enable(drvdata->clk);
	if (ret)
		return ret;

	if (!coresight_authstatus_enabled(drvdata->base))
		goto err;

	clk_disable_unprepare(drvdata->clk);

	baddr = devm_kzalloc(dev, resource_size(res), GFP_KERNEL);
	if (baddr) {
		drvdata->reg_data.addr = virt_to_phys(baddr);
@@ -909,6 +915,9 @@ static int dbgui_probe(struct platform_device *pdev)

	dev_info(dev, "DebugUI initializaed\n");
	return 0;
err:
	clk_disable_unprepare(drvdata->clk);
	return -EPERM;
}

static int dbgui_remove(struct platform_device *pdev)
+9 −7
Original line number Diff line number Diff line
@@ -2249,10 +2249,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);
@@ -2299,9 +2295,6 @@ static int etm_probe(struct platform_device *pdev)
		goto err0;
	}

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

	drvdata->clk = devm_clk_get(dev, "core_clk");
	if (IS_ERR(drvdata->clk)) {
		ret = PTR_ERR(drvdata->clk);
@@ -2316,6 +2309,15 @@ 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);

	get_online_cpus();

	/*
+11 −9
Original line number Diff line number Diff line
@@ -3456,10 +3456,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);
@@ -3512,11 +3508,6 @@ static int etm_probe(struct platform_device *pdev)
		goto err0;
	}

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

	ret = clk_set_rate(drvdata->clk, CORESIGHT_CLK_RATE_TRACE);
	if (ret)
		goto err0;
@@ -3525,6 +3516,17 @@ 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);
	}

	get_online_cpus();

	/*
Loading