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

Commit 79a0e0c2 authored by Sarangdhar Joshi's avatar Sarangdhar Joshi
Browse files

soc: qcom: jtagv8-etm: disable etm save and restore support



Memory mapped accesses for ETM registers are not supported on
MSM8996 V2 when OS lock is set and there seems to be some
stability issues while using system interface for ETM registers.
Add support to disable save and restore functionality for ETM
registers based on a device tree property.

Change-Id: I3825b60d7eeef93e150b2c453e071336f3a92672
Signed-off-by: default avatarSarangdhar Joshi <spjoshi@codeaurora.org>
parent 04a4c1d9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ qcom,coresight-jtagmm-cpu : specifies phandle for the cpu associated with the
			    jtag-mm device
qcom,si-enable : boolean, indicating etm save and restore is supported via
		 system instructions
qcom,save-restore-disable : boolean, to disable etm save and restore
			    functionality

Example:
jtag_mm: jtagmm@fc332000 {
+10 −0
Original line number Diff line number Diff line
@@ -220,6 +220,7 @@ struct etm_ctx {
	uint8_t			nr_resource;
	uint8_t			nr_ss_cmp;
	bool			si_enable;
	bool			save_restore_disabled;
	bool			save_restore_enabled;
	bool			os_lock_present;
	bool			init;
@@ -1413,6 +1414,9 @@ void msm_jtag_etm_save_state(void)

	cpu = raw_smp_processor_id();

	if (etm[cpu]->save_restore_disabled)
		return;

	if (etm[cpu] && etm[cpu]->save_restore_enabled) {
		if (etm[cpu]->si_enable)
			etm_si_save_state(etm[cpu]);
@@ -1428,6 +1432,9 @@ void msm_jtag_etm_restore_state(void)

	cpu = raw_smp_processor_id();

	if (etm[cpu]->save_restore_disabled)
		return;

	/*
	 * Check to ensure we attempt to restore only when save
	 * has been done is accomplished by callee function.
@@ -1561,6 +1568,9 @@ static int jtag_mm_etm_probe(struct platform_device *pdev, uint32_t cpu)

	etmdata->si_enable = of_property_read_bool(pdev->dev.of_node,
						   "qcom,si-enable");
	etmdata->save_restore_disabled = of_property_read_bool(
					 pdev->dev.of_node,
					 "qcom,save-restore-disable");

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