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

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

Merge "ARM: dts: msm: enable the etm registers save-restore on MSM8953"

parents c707739d 438a8706
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1198,7 +1198,6 @@
		      <0x6190000 0x1000>;
		reg-names = "etm-base", "debug-base";

		qcom,save-restore-disable;
		qcom,coresight-jtagmm-cpu = <&CPU0>;

		clocks = <&clock_gcc clk_qdss_clk>,
@@ -1212,7 +1211,6 @@
		      <0x6192000 0x1000>;
		reg-names = "etm-base", "debug-base";

		qcom,save-restore-disable;
		qcom,coresight-jtagmm-cpu = <&CPU1>;

		clocks = <&clock_gcc clk_qdss_clk>,
@@ -1226,7 +1224,6 @@
		      <0x6194000 0x1000>;
		reg-names = "etm-base", "debug-base";

		qcom,save-restore-disable;
		qcom,coresight-jtagmm-cpu = <&CPU2>;

		clocks = <&clock_gcc clk_qdss_clk>,
@@ -1240,7 +1237,6 @@
		      <0x6196000 0x1000>;
		reg-names = "etm-base", "debug-base";

		qcom,save-restore-disable;
		qcom,coresight-jtagmm-cpu = <&CPU3>;

		clocks = <&clock_gcc clk_qdss_clk>,
@@ -1254,7 +1250,6 @@
		      <0x61b0000 0x1000>;
		reg-names = "etm-base", "debug-base";

		qcom,save-restore-disable;
		qcom,coresight-jtagmm-cpu = <&CPU4>;

		clocks = <&clock_gcc clk_qdss_clk>,
@@ -1268,7 +1263,6 @@
		      <0x61b2000 0x1000>;
		reg-names = "etm-base", "debug-base";

		qcom,save-restore-disable;
		qcom,coresight-jtagmm-cpu = <&CPU5>;

		clocks = <&clock_gcc clk_qdss_clk>,
@@ -1282,7 +1276,6 @@
		      <0x61b4000 0x1000>;
		reg-names = "etm-base", "debug-base";

		qcom,save-restore-disable;
		qcom,coresight-jtagmm-cpu = <&CPU6>;

		clocks = <&clock_gcc clk_qdss_clk>,
@@ -1296,7 +1289,6 @@
		      <0x61b6000 0x1000>;
		reg-names = "etm-base", "debug-base";

		qcom,save-restore-disable;
		qcom,coresight-jtagmm-cpu = <&CPU7>;

		clocks = <&clock_gcc clk_qdss_clk>,
+21 −1
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
@@ -35,6 +35,7 @@
#include <soc/qcom/jtag.h>
#include <asm/smp_plat.h>
#include <asm/etmv4x.h>
#include <soc/qcom/socinfo.h>

#define CORESIGHT_LAR		(0xFB0)

@@ -180,6 +181,7 @@

#define TZ_DBG_ETM_FEAT_ID	(0x8)
#define TZ_DBG_ETM_VER		(0x400000)
#define HW_SOC_ID_M8953		(293)

#define etm_writel(etm, val, off)	\
		   __raw_writel(val, etm->base + off)
@@ -1545,6 +1547,21 @@ static struct notifier_block jtag_mm_etm_notifier = {
	.notifier_call = jtag_mm_etm_callback,
};

static bool skip_etm_save_restore(void)
{
	uint32_t id;
	uint32_t version;

	id = socinfo_get_id();
	version = socinfo_get_version();

	if (HW_SOC_ID_M8953 == id && 1 == SOCINFO_VERSION_MAJOR(version) &&
		0 == SOCINFO_VERSION_MINOR(version))
		return true;

	return false;
}

static int jtag_mm_etm_probe(struct platform_device *pdev, uint32_t cpu)
{
	struct etm_ctx *etmdata;
@@ -1571,6 +1588,9 @@ static int jtag_mm_etm_probe(struct platform_device *pdev, uint32_t cpu)
					 pdev->dev.of_node,
					 "qcom,save-restore-disable");

	if (skip_etm_save_restore())
		etmdata->save_restore_disabled = 1;

	/* Allocate etm state save space per core */
	etmdata->state = devm_kzalloc(dev,
				      MAX_ETM_STATE_SIZE * sizeof(uint64_t),