diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2009-06-18 08:23:01 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-06-30 08:24:22 -0500 |
commit | 480f61790565d77432b70b4016b73f2ae27d530f (patch) | |
tree | 4c6db90668cfcd3c5d7254fda0329d562d4edbaa | |
parent | 3e88337b225bf796f6df21d0a7f591530e9d4ce0 (diff) | |
download | u-boot-imx-480f61790565d77432b70b4016b73f2ae27d530f.zip u-boot-imx-480f61790565d77432b70b4016b73f2ae27d530f.tar.gz u-boot-imx-480f61790565d77432b70b4016b73f2ae27d530f.tar.bz2 |
86xx: Add CPU_TYPE_ENTRY support
Unify with 83xx and 85xx and use CPU_TYPE_ENTRY. We are going to use
this to convey the # of cores and DDR width in the near future so its
good to keep in sync.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r-- | cpu/mpc86xx/cpu.c | 33 | ||||
-rw-r--r-- | include/asm-ppc/processor.h | 2 |
2 files changed, 22 insertions, 13 deletions
diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c index d47cc5e..438d902 100644 --- a/cpu/mpc86xx/cpu.c +++ b/cpu/mpc86xx/cpu.c @@ -31,6 +31,21 @@ #include <tsec.h> #include <asm/fsl_law.h> +struct cpu_type cpu_type_list [] = { + CPU_TYPE_ENTRY(8610, 8610), + CPU_TYPE_ENTRY(8641, 8641), + CPU_TYPE_ENTRY(8641D, 8641D), +}; + +struct cpu_type *identify_cpu(u32 ver) +{ + int i; + for (i = 0; i < ARRAY_SIZE(cpu_type_list); i++) + if (cpu_type_list[i].soc_ver == ver) + return &cpu_type_list[i]; + + return NULL; +} /* * Default board reset function @@ -53,6 +68,7 @@ checkcpu(void) char buf1[32], buf2[32]; volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile ccsr_gur_t *gur = &immap->im_gur; + struct cpu_type *cpu; uint msscr0 = mfspr(MSSCR0); svr = get_svr(); @@ -62,20 +78,13 @@ checkcpu(void) puts("CPU: "); - switch (ver) { - case SVR_8641: - puts("8641"); - break; - case SVR_8641D: - puts("8641D"); - break; - case SVR_8610: - puts("8610"); - break; - default: + cpu = identify_cpu(ver); + if (cpu) { + puts(cpu->name); + } else { puts("Unknown"); - break; } + printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr); puts("Core: "); diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index e7db1c6..65546ad 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -1021,7 +1021,7 @@ struct cpu_type { struct cpu_type *identify_cpu(u32 ver); -#if defined(CONFIG_MPC85xx) +#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) #define CPU_TYPE_ENTRY(n, v) \ { .name = #n, .soc_ver = SVR_##v, } #else |