The ColdFire 527x family of SoCs (including 5271 and 5275) 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. Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxxxxx> --- arch/m68k/coldfire/m527x.c | 22 ++++++++++++++++++++++ arch/m68k/include/asm/m527xsim.h | 10 ++++++++++ 2 files changed, 32 insertions(+) diff --git a/arch/m68k/coldfire/m527x.c b/arch/m68k/coldfire/m527x.c index 037f3e520acc..8f9cda3d4dba 100644 --- a/arch/m68k/coldfire/m527x.c +++ b/arch/m68k/coldfire/m527x.c @@ -23,6 +23,7 @@ #include <asm/mcfsim.h> #include <asm/mcfuart.h> #include <asm/mcfclk.h> +#include <asm/setup.h> /***************************************************************************/ @@ -133,13 +134,34 @@ static void __init m527x_fec_init(void) /***************************************************************************/ +static void __init m527x_probe_cpu(void) +{ + u16 v; + + v = readw(MCF_CIR); + + switch (MCFCIR_PIN(v)) { + case MCFCIR_5275: + m68k_cpuname = "5275"; + break; + case MCFCIR_5271: + m68k_cpuname = "5271"; + break; + } + + m68k_cpurevision = MCFCIR_PRN(v); +} + void __init config_BSP(char *commandp, int size) { mach_sched_init = hw_timer_init; + + m527x_probe_cpu(); m527x_uarts_init(); m527x_fec_init(); m527x_qspi_init(); m527x_i2c_init(); + clkdev_add_table(m527x_clk_lookup, ARRAY_SIZE(m527x_clk_lookup)); } diff --git a/arch/m68k/include/asm/m527xsim.h b/arch/m68k/include/asm/m527xsim.h index 2a517b31e728..900470b1996d 100644 --- a/arch/m68k/include/asm/m527xsim.h +++ b/arch/m68k/include/asm/m527xsim.h @@ -362,5 +362,15 @@ #define MCFI2C_BASE0 (MCF_IPSBAR + 0x300) #define MCFI2C_SIZE0 0x40 +/* + * Chip Identification. + */ +#define MCF_CIR (MCF_IPSBAR + 0x11000A) +#define MCFCIR_PRN(x) ((x) & 0x3f) /* Chip revision */ +#define MCFCIR_PIN(x) ((x) >> 6) /* Chip ID */ + +#define MCFCIR_5271 0x32 +#define MCFCIR_5275 0x3b + /****************************************************************************/ #endif /* m527xsim_h */ -- 2.25.1