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

Commit 97df2c0e authored by Charan Teja Reddy's avatar Charan Teja Reddy
Browse files

soc: qcom: jtagv8: disable the etm save-restore based on soc version



Disable the ETM save-restore logic across the power collapse for
MSM8953 HW SoC revision 1.0 as it have issues in accessing the ETM
registers while CPU frequency scales above nominal when T32 attached.

Change-Id: I92367f569694749af501a50c67c550b8816a1b9d
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent cfa6eaba
Loading
Loading
Loading
Loading
+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),