[PATCH 3/3] coresight etm4x: Add pr_debug statement for Coresight component PID/CID

Steve Clevenger scclevenger at os.amperecomputing.com
Thu Jan 19 16:51:56 PST 2023


Add pr_debug statement to provide visibility into Coresight component PID
and CID settings. This helped debug an intermittent clock related issue
resulting in bad PID/CID values.

Signed-off-by: Steve Clevenger <scclevenger at os.amperecomputing.com>
---
 drivers/amba/bus.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index ff7454a38058..7c432442862c 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -136,6 +136,7 @@ static int amba_read_periphid(struct amba_device *dev)
 	u32 size, pid, cid;
 	void __iomem *tmp;
 	int i, ret;
+	u32 cid_addr, pid_addr;
 
 	ret = dev_pm_domain_attach(&dev->dev, true);
 	if (ret) {
@@ -178,6 +179,12 @@ static int amba_read_periphid(struct amba_device *dev)
 	for (cid = 0, i = 0; i < 4; i++)
 		cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) << (i * 8);
 
+	/* physical address as meaningful */
+	cid_addr = (u64)(dev->res.start + size - 0x20);
+	pid_addr = (u64)(dev->res.start + size - 0x10);
+
+	pr_debug("pid  (%llX): %08X  cid  (%llX): %08X\n", pid_addr, pid, cid_addr, cid);
+
 	if (cid == CORESIGHT_CID) {
 		/* set the base to the start of the last 4k block */
 		void __iomem *csbase = tmp + size - 4096;
-- 
2.25.1




More information about the linux-arm-kernel mailing list