[PATCH RFC 4/8] soc: Add information to identify the J742S2 SoC family

Manorit Chawdhry m-chawdhry at ti.com
Tue Dec 17 12:07:21 CET 2024


J742S2 has the same part number as J784S4 but JTAG_DEVICE_ID has a
PKG bit that tells about J742S2.

Add support for reading JTAG_DEVICE_ID and set family as J742S2 based
on that.

Link: https://www.ti.com/lit/pdf/spruje3 (TRM)
Signed-off-by: Manorit Chawdhry <m-chawdhry at ti.com>
---
 arch/arm/mach-k3/include/mach/hardware.h        |  2 ++
 arch/arm/mach-k3/include/mach/j784s4_hardware.h |  4 ++++
 drivers/soc/soc_ti_k3.c                         | 17 +++++++++++++++--
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/include/mach/hardware.h b/arch/arm/mach-k3/include/mach/hardware.h
index b191d53a0f580aacd9283f06f057b47858864fe5..a26af0b6e3c95693ea6f144a3274ee193767c6c9 100644
--- a/arch/arm/mach-k3/include/mach/hardware.h
+++ b/arch/arm/mach-k3/include/mach/hardware.h
@@ -62,6 +62,8 @@
 #define JTAG_ID_PARTNO_J722S	0xbba0
 #define JTAG_ID_PARTNO_J784S4	0xbb80
 
+#define JTAG_DEVICE_ID_PKG_J742S2 0x7
+
 #define K3_SOC_ID(id, ID) \
 static inline bool soc_is_##id(void) \
 { \
diff --git a/arch/arm/mach-k3/include/mach/j784s4_hardware.h b/arch/arm/mach-k3/include/mach/j784s4_hardware.h
index 0ffe238cdaef99e3889abf8016427f54ce69b6ac..14eb739ba7301a56ef739602cc864ae1723cf637 100644
--- a/arch/arm/mach-k3/include/mach/j784s4_hardware.h
+++ b/arch/arm/mach-k3/include/mach/j784s4_hardware.h
@@ -15,6 +15,10 @@
 #define MCU_CTRL_MMR0_BASE				0x40f00000
 #define CTRL_MMR0_BASE					0x00100000
 
+#define CTRLMMR_WKUP_JTAG_DEVICE_ID		(WKUP_CTRL_MMR0_BASE + 0x18)
+#define JTAG_DEV_PKG_MASK			GENMASK(2, 0)
+#define JTAG_DEV_PKG_SHIFT			0
+
 #define CTRLMMR_MAIN_DEVSTAT				(CTRL_MMR0_BASE + 0x30)
 #define MAIN_DEVSTAT_BOOT_MODE_B_MASK			BIT(0)
 #define MAIN_DEVSTAT_BOOT_MODE_B_SHIFT			0
diff --git a/drivers/soc/soc_ti_k3.c b/drivers/soc/soc_ti_k3.c
index a3acca4d394273aad53efd3eee200ecdda50c31b..f8e64395ae3f18513837a88cf91d340fc11bb346 100644
--- a/drivers/soc/soc_ti_k3.c
+++ b/drivers/soc/soc_ti_k3.c
@@ -18,9 +18,14 @@ struct soc_ti_k3_plat {
 static const char *get_family_string(u32 idreg)
 {
 	const char *family;
+	u32 jtag_dev_id;
+	u32 pkg;
 	u32 soc;
 
+	jtag_dev_id = readl(CTRLMMR_WKUP_JTAG_DEVICE_ID);
+
 	soc = (idreg & JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
+	pkg = (jtag_dev_id & JTAG_DEV_PKG_MASK) >> JTAG_DEV_PKG_SHIFT;
 
 	switch (soc) {
 	case JTAG_ID_PARTNO_AM62X:
@@ -51,8 +56,16 @@ static const char *get_family_string(u32 idreg)
 		family = "J722S";
 		break;
 	case JTAG_ID_PARTNO_J784S4:
-		family = "J784S4";
-		break;
+		{
+			/* Keep default family as J784S4 */
+			family = "J784S4";
+			switch (pkg) {
+			case JTAG_DEVICE_ID_PKG_J742S2:
+				family = "J742S2";
+				break;
+			}
+			break;
+		}
 	default:
 		family = "Unknown Silicon";
 	};

-- 
2.34.1



More information about the U-Boot mailing list