summaryrefslogtreecommitdiff
path: root/cpu/mcf52x2/cpu.c
diff options
context:
space:
mode:
authorroy zang <tie-fei.zang@freescale.com>2007-01-30 16:43:18 +0800
committerZang Tiefei <roy@bus.ap.freescale.net>2007-01-30 16:43:18 +0800
commitc1c52e38d35ff01f08b55377126c979a08fbdb1d (patch)
tree2c4b7c384ccfc8834693ef392d30b10fc3899237 /cpu/mcf52x2/cpu.c
parentfdef388758506765d4d6a7155c8f1584c63ff581 (diff)
parentf8db84f132b1e335f20f96138a1f09ed97b08664 (diff)
downloadu-boot-imx-c1c52e38d35ff01f08b55377126c979a08fbdb1d.zip
u-boot-imx-c1c52e38d35ff01f08b55377126c979a08fbdb1d.tar.gz
u-boot-imx-c1c52e38d35ff01f08b55377126c979a08fbdb1d.tar.bz2
Merge branch 'master' into hpc2
Diffstat (limited to 'cpu/mcf52x2/cpu.c')
-rw-r--r--cpu/mcf52x2/cpu.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/cpu/mcf52x2/cpu.c b/cpu/mcf52x2/cpu.c
index aa6b2bd..ce59d39 100644
--- a/cpu/mcf52x2/cpu.c
+++ b/cpu/mcf52x2/cpu.c
@@ -49,11 +49,43 @@
#endif
#ifdef CONFIG_M5271
+/*
+ * Both MCF5270 and MCF5271 are members of the MPC5271 family. Try to
+ * determine which one we are running on, based on the Chip Identification
+ * Register (CIR).
+ */
int checkcpu (void)
{
char buf[32];
+ unsigned short cir; /* Chip Identification Register */
+ unsigned short pin; /* Part identification number */
+ unsigned char prn; /* Part revision number */
+ char *cpu_model;
+
+ cir = mbar_readShort(MCF_CCM_CIR);
+ pin = cir >> MCF_CCM_CIR_PIN_LEN;
+ prn = cir & MCF_CCM_CIR_PRN_MASK;
+
+ switch (pin) {
+ case MCF_CCM_CIR_PIN_MCF5270:
+ cpu_model = "5270";
+ break;
+ case MCF_CCM_CIR_PIN_MCF5271:
+ cpu_model = "5271";
+ break;
+ default:
+ cpu_model = NULL;
+ break;
+ }
+
+ if (cpu_model)
+ printf("CPU: Freescale ColdFire MCF%s rev. %hu, at %s MHz\n",
+ cpu_model, prn, strmhz(buf, CFG_CLK));
+ else
+ printf("CPU: Unknown - Freescale ColdFire MCF5271 family"
+ " (PIN: 0x%x) rev. %hu, at %s MHz\n",
+ pin, prn, strmhz(buf, CFG_CLK));
- printf ("CPU: Freescale Coldfire MCF5271 at %s MHz\n", strmhz(buf, CFG_CLK));
return 0;
}