[PATCH 04/11] m68knommu: probe CPU identity for ColdFire 523x types

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

 



The ColdFire 523x family of SoCs (including 5232, 5233, 5234 and 5235)
have a Chip Identification Register (CIR) 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.

The ColdFire M5235 Reference Manual only seems to list a single ID
number (assumed to be for the 5235) at this time. So only the single
exact type of 5235 can currently be reported.

Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxxxxx>
---
 arch/m68k/coldfire/m523x.c       | 13 +++++++++++++
 arch/m68k/include/asm/m523xsim.h |  9 +++++++++
 2 files changed, 22 insertions(+)

diff --git a/arch/m68k/coldfire/m523x.c b/arch/m68k/coldfire/m523x.c
index 83a997313393..264f3ce49914 100644
--- a/arch/m68k/coldfire/m523x.c
+++ b/arch/m68k/coldfire/m523x.c
@@ -22,6 +22,7 @@
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
 #include <asm/mcfclk.h>
+#include <asm/setup.h>
 
 /***************************************************************************/
 
@@ -84,9 +85,21 @@ static void __init m523x_fec_init(void)
 
 /***************************************************************************/
 
+static void __init m523x_probe_cpu(void)
+{
+	u16 v;
+
+	v = readw(MCF_CIR);
+	if (MCFCIR(v) == MCFCIR_5235)
+		m68k_cpuname = "5235";
+	m68k_cpurevision = MCFCIR_PRN(v);
+}
+
 void __init config_BSP(char *commandp, int size)
 {
 	mach_sched_init = hw_timer_init;
+
+	m523x_probe_cpu();
 	m523x_fec_init();
 	m523x_qspi_init();
 	m523x_i2c_init();
diff --git a/arch/m68k/include/asm/m523xsim.h b/arch/m68k/include/asm/m523xsim.h
index aacabb028372..bec5dd073519 100644
--- a/arch/m68k/include/asm/m523xsim.h
+++ b/arch/m68k/include/asm/m523xsim.h
@@ -217,5 +217,14 @@
 #define	MCFI2C_BASE0		(MCF_IPSBAR + 0x300)
 #define	MCFI2C_SIZE0		0x40
 
+/*
+ * Chip Indentification
+ */
+#define MCF_CIR			(MCF_IPSBAR + 0x11000A)
+#define MCFCIR_PRN(x)		((x) & 0x3f)		/* Chip revision */
+#define MCFCIR_PIN(x)		(((x) >> 6) & 0x3ff)	/* Chip ID */
+
+#define MCFCIR_5235		0x80
+
 /****************************************************************************/
 #endif	/* m523xsim_h */
-- 
2.25.1




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

  Powered by Linux