From 363d1d8f9c99b63daef81f5985cab3fc00edde5c Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Tue, 23 Jan 2007 13:25:22 +0100 Subject: [ColdFire MCF5271 family] Add CPU detection based on the value of Chip Identification Register (CIR). 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; } diff --git a/include/asm-m68k/m5271.h b/include/asm-m68k/m5271.h index 765414f..e0f02cf 100644 --- a/include/asm-m68k/m5271.h +++ b/include/asm-m68k/m5271.h @@ -57,6 +57,12 @@ #define MCF_GPIO_PAR_FECI2C 0x100047 #define MCF_GPIO_PAR_UART 0x100048 +#define MCF_CCM_CIR 0x11000A +#define MCF_CCM_CIR_PRN_MASK 0x3F +#define MCF_CCM_CIR_PIN_LEN 6 +#define MCF_CCM_CIR_PIN_MCF5270 0x2e +#define MCF_CCM_CIR_PIN_MCF5271 0x80 + #define MCF_GPIO_AD_ADDR23 0x80 #define MCF_GPIO_AD_ADDR22 0x40 #define MCF_GPIO_AD_ADDR21 0x20 -- cgit v0.10.2 From 0ed47bb119cd2c4c16edb2548789148f9e6dc9de Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Tue, 23 Jan 2007 14:11:22 +0100 Subject: [iDMR] Using MII-related commands on iDRM board doesn't work now (e.g., "mii device" results in "Unexpected exception"). Fixing this properly requires some clean-up in the FEC drivers infrastructure for ColdFire, so this commit disables MII commads for now. diff --git a/include/configs/idmr.h b/include/configs/idmr.h index 48915b3..8143f0d 100644 --- a/include/configs/idmr.h +++ b/include/configs/idmr.h @@ -83,8 +83,7 @@ */ #define CONFIG_COMMANDS ((CONFIG_CMD_DFL | \ CFG_CMD_PING | \ - CFG_CMD_NET | \ - CFG_CMD_MII) & \ + CFG_CMD_NET) & \ ~(CFG_CMD_LOADS | \ CFG_CMD_LOADB)) @@ -194,4 +193,9 @@ /* Port configuration */ #define CFG_FECI2C 0xF0 + +#if (CONFIG_COMMANDS & CFG_CMD_MII) +#error MII commands don't work on iDMR board and sholud not be enabled. +#endif /* (CONFIG_COMMANDS & CFG_CMD_MII) */ + #endif /* _IDMR_H */ -- cgit v0.10.2 From f7db33101fbc9c8f0a10738ce87034875a17aeb9 Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Tue, 23 Jan 2007 14:21:14 +0100 Subject: [iDMR] Flash driver on initialisation write-protects some sectors, currently sectors 0-3. Sector 3 does not need to be protected, though (U-boot occupies sectors 0-1 and the environment sector 2). This commit fixes this, i.e., only sectors 0-2 are protected. diff --git a/board/idmr/flash.c b/board/idmr/flash.c index ba9b009..33512b8 100644 --- a/board/idmr/flash.c +++ b/board/idmr/flash.c @@ -97,7 +97,7 @@ unsigned long flash_init (void) flash_protect (FLAG_PROTECT_SET, CFG_FLASH_BASE, - CFG_FLASH_BASE + 0x30000, &flash_info[0]); + CFG_FLASH_BASE + 0x2ffff, &flash_info[0]); return size; } -- cgit v0.10.2 From 2daf046ba627f85f44195815778140039636244e Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Tue, 23 Jan 2007 17:22:06 +0100 Subject: [iDMR] Add MTD and JFFS2 support, also add default partition definition. diff --git a/include/configs/idmr.h b/include/configs/idmr.h index 8143f0d..b1dbe2c 100644 --- a/include/configs/idmr.h +++ b/include/configs/idmr.h @@ -83,6 +83,7 @@ */ #define CONFIG_COMMANDS ((CONFIG_CMD_DFL | \ CFG_CMD_PING | \ + CFG_CMD_JFFS2 | \ CFG_CMD_NET) & \ ~(CFG_CMD_LOADS | \ CFG_CMD_LOADB)) @@ -194,6 +195,17 @@ /* Port configuration */ #define CFG_FECI2C 0xF0 + +/* Dynamic MTD partition support */ +#define CONFIG_JFFS2_CMDLINE +#define MTDIDS_DEFAULT "nor0=idmr-0" + +#define MTDPARTS_DEFAULT "mtdparts=idmr-0:128k(u-boot)," \ + "64k(env)," \ + "640k(kernel)," \ + "2m(rootfs)," \ + "-(user)"; + #if (CONFIG_COMMANDS & CFG_CMD_MII) #error MII commands don't work on iDMR board and sholud not be enabled. #endif /* (CONFIG_COMMANDS & CFG_CMD_MII) */ -- cgit v0.10.2