[PATCH 10/11] m68k: probe CPU identity for ColdFire 54xx types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The ColdFire 54xx family of SoCs (including 5470, 5471, 5472, 5473, 5474
and 5475) have a JTAG Identification Register that can be used to
determine the exact SoC family member. Read this at startup to report the
exact SoC type and its revision number.

Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxxxxx>
---
 arch/m68k/coldfire/m54xx.c       | 27 +++++++++++++++++++++++++++
 arch/m68k/include/asm/m54xxsim.h | 12 ++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/arch/m68k/coldfire/m54xx.c b/arch/m68k/coldfire/m54xx.c
index 8e3c8fee8327..f2db95a53069 100644
--- a/arch/m68k/coldfire/m54xx.c
+++ b/arch/m68k/coldfire/m54xx.c
@@ -25,6 +25,7 @@
 #include <asm/mcfuart.h>
 #include <asm/mcfclk.h>
 #include <asm/m54xxgpt.h>
+#include <asm/setup.h>
 #ifdef CONFIG_MMU
 #include <asm/mmu_context.h>
 #endif
@@ -87,10 +88,36 @@ static void mcf54xx_reset(void)
 
 /***************************************************************************/
 
+static void __init m54xx_probe_cpu(void)
+{
+	switch (__raw_readl(MCF_JTAG_ID)) {
+	case MCFJTAGID_5470:
+		m68k_cpuname = "5470";
+		break;
+	case MCFJTAGID_5471:
+		m68k_cpuname = "5471";
+		break;
+	case MCFJTAGID_5472:
+		m68k_cpuname = "5472";
+		break;
+	case MCFJTAGID_5473:
+		m68k_cpuname = "5473";
+		break;
+	case MCFJTAGID_5474:
+		m68k_cpuname = "5474";
+		break;
+	case MCFJTAGID_5475:
+		m68k_cpuname = "5475";
+		break;
+	}
+}
+
 void __init config_BSP(char *commandp, int size)
 {
 	mach_reset = mcf54xx_reset;
 	mach_sched_init = hw_timer_init;
+
+	m54xx_probe_cpu();
 	m54xx_uarts_init();
 	m54xx_i2c_init();
 
diff --git a/arch/m68k/include/asm/m54xxsim.h b/arch/m68k/include/asm/m54xxsim.h
index 6a9b62e3f376..8dc541897827 100644
--- a/arch/m68k/include/asm/m54xxsim.h
+++ b/arch/m68k/include/asm/m54xxsim.h
@@ -119,4 +119,16 @@
 #define MCFI2C_BASE0		(MCF_MBAR + 0x8f00)
 #define MCFI2C_SIZE0		0x40
 
+/*
+ * JTAG Identification.
+ */
+#define MCF_JTAG_ID		(MCF_MBAR + 0x50)
+
+#define MCFJTAGID_5470		0x1801701d
+#define MCFJTAGID_5471		0x1801601d
+#define MCFJTAGID_5472		0x1801501d
+#define MCFJTAGID_5473		0x1801401d
+#define MCFJTAGID_5474		0x1801301d
+#define MCFJTAGID_5475		0x1801201d
+
 #endif	/* m54xxsim_h */
-- 
2.25.1




[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux