[PATCH 08/11] m68knommu: probe CPU identity for ColdFire 528x types

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

 



The ColdFire 528x family of SoCs (including 5280 and 5282) 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 5282 USer Manual only lists the ID number for the 5282, so that is
the only ID we can currently check for.

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

diff --git a/arch/m68k/coldfire/m528x.c b/arch/m68k/coldfire/m528x.c
index 51a6a6236e12..b8f7c9af0620 100644
--- a/arch/m68k/coldfire/m528x.c
+++ b/arch/m68k/coldfire/m528x.c
@@ -24,6 +24,7 @@
 #include <asm/mcfsim.h>
 #include <asm/mcfuart.h>
 #include <asm/mcfclk.h>
+#include <asm/setup.h>
 
 /***************************************************************************/
 
@@ -123,6 +124,16 @@ void wildfiremod_halt(void)
 }
 #endif
 
+static void __init m528x_probe_cpu(void)
+{
+	u16 v;
+
+	v = readw(MCF_CIR);
+	if (MCFCIR_PIN(v) == MCFCIR_5282)
+		m68k_cpuname = "5282";
+	m68k_cpurevision = MCFCIR_PRN(v);
+}
+
 void __init config_BSP(char *commandp, int size)
 {
 #ifdef CONFIG_WILDFIRE
@@ -132,6 +143,8 @@ void __init config_BSP(char *commandp, int size)
 	mach_halt = wildfiremod_halt;
 #endif
 	mach_sched_init = hw_timer_init;
+
+	m528x_probe_cpu();
 	m528x_uarts_init();
 	m528x_fec_init();
 	m528x_qspi_init();
diff --git a/arch/m68k/include/asm/m528xsim.h b/arch/m68k/include/asm/m528xsim.h
index 1b582e852520..85623c7e84fb 100644
--- a/arch/m68k/include/asm/m528xsim.h
+++ b/arch/m68k/include/asm/m528xsim.h
@@ -252,5 +252,14 @@
 #define	MCFI2C_BASE0		(MCF_IPSBAR + 0x300)
 #define	MCFI2C_SIZE0		0x40
 
+/*
+ * Chip Indentification
+ */
+#define MCF_CIR			(MCF_IPSBAR + 0x11000A)
+#define MCFCIR_PRN(x)		((x) & 0xff)		/* Chip revision */
+#define MCFCIR_PIN(x)		((x) >> 8)		/* Chip ID */
+
+#define MCFCIR_5282		0x20
+
 /****************************************************************************/
 #endif	/* m528xsim_h */
-- 
2.25.1




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

  Powered by Linux