From 32d11d58159a575f08a982cad8a5a941ffe5cc3d Mon Sep 17 00:00:00 2001 From: arun c Date: Thu, 4 Dec 2008 15:57:15 +0530 Subject: [PATCH 1/6] Coldfire: XL Bus minor fixes According to coldfire manual data timeout > address time out also use correct macro to program XARB_CFG Signed-off-by: Arun C --- cpu/mcf547x_8x/cpu_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu/mcf547x_8x/cpu_init.c b/cpu/mcf547x_8x/cpu_init.c index 1ba57835e5..96a3132b78 100644 --- a/cpu/mcf547x_8x/cpu_init.c +++ b/cpu/mcf547x_8x/cpu_init.c @@ -49,14 +49,14 @@ void cpu_init_f(void) volatile xlbarb_t *xlbarb = (volatile xlbarb_t *) MMAP_XARB; xlbarb->adrto = 0x2000; - xlbarb->datto = 0x2000; + xlbarb->datto = 0x2500; xlbarb->busto = 0x3000; - xlbarb->cfg = XARB_SR_AT | XARB_SR_DT; + xlbarb->cfg = XARB_CFG_AT | XARB_CFG_DT; /* Master Priority Enable */ - xlbarb->pri = 0; xlbarb->prien = 0xff; + xlbarb->pri = 0; #if (defined(CONFIG_SYS_CS0_BASE) && defined(CONFIG_SYS_CS0_MASK) && defined(CONFIG_SYS_CS0_CTRL)) fbcs->csar0 = CONFIG_SYS_CS0_BASE; From c3a9e6374210679a81f611c1bcf968988bc20e41 Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Wed, 18 Feb 2009 11:49:31 +0000 Subject: [PATCH 2/6] ColdFire: Fix M54451 serial boot dram setup The serial boot dram extended/standard mode register was not setup and was using default DRAM setup causing the U-boot was unstable to boot up in serial mode. Signed-off-by: TsiChung Liew --- cpu/mcf5445x/start.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/mcf5445x/start.S b/cpu/mcf5445x/start.S index d5a7f937f2..26fb2ce0cb 100644 --- a/cpu/mcf5445x/start.S +++ b/cpu/mcf5445x/start.S @@ -243,9 +243,9 @@ wait1000: nop #elif defined(CONFIG_M54451EVB) /* Issue LEMR */ - move.l #(CONFIG_SYS_SDRAM_MODE), (%a2) + move.l #(CONFIG_SYS_SDRAM_MODE), (%a1) nop - move.l #(CONFIG_SYS_SDRAM_EMOD), (%a2) + move.l #(CONFIG_SYS_SDRAM_EMOD), (%a1) nop #endif From d6e4baf49987fc6f75e8574c0c27301a828b3132 Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Tue, 27 Jan 2009 12:57:47 +0000 Subject: [PATCH 3/6] ColdFire: Provide gzip image size V2 & V3 platforms Default gzip bootm size is 8MB. Some platforms require more than 8MB Signed-off-by: TsiChung Liew --- include/configs/M52277EVB.h | 1 + include/configs/M5235EVB.h | 1 + include/configs/M5253DEMO.h | 1 + include/configs/M5253EVBE.h | 1 + include/configs/M5275EVB.h | 3 ++- include/configs/M53017EVB.h | 1 + include/configs/M5329EVB.h | 1 + include/configs/M5373EVB.h | 1 + 8 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/configs/M52277EVB.h b/include/configs/M52277EVB.h index 5d5966fc03..053a914eb7 100644 --- a/include/configs/M52277EVB.h +++ b/include/configs/M52277EVB.h @@ -246,6 +246,7 @@ /* Initial Memory map for Linux */ #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20)) +#define CONFIG_SYS_BOOTM_LEN (CONFIG_SYS_SDRAM_SIZE << 20) /* * Configuration for environment diff --git a/include/configs/M5235EVB.h b/include/configs/M5235EVB.h index 8c66f879e8..6b26c0bbc2 100644 --- a/include/configs/M5235EVB.h +++ b/include/configs/M5235EVB.h @@ -197,6 +197,7 @@ */ /* Initial Memory map for Linux */ #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20)) +#define CONFIG_SYS_BOOTM_LEN (CONFIG_SYS_SDRAM_SIZE << 20) /*----------------------------------------------------------------------- * FLASH organization diff --git a/include/configs/M5253DEMO.h b/include/configs/M5253DEMO.h index 378e45a446..1fea6c36a6 100644 --- a/include/configs/M5253DEMO.h +++ b/include/configs/M5253DEMO.h @@ -200,6 +200,7 @@ * the maximum mapped by the Linux kernel during initialization ?? */ #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20)) +#define CONFIG_SYS_BOOTM_LEN (CONFIG_SYS_SDRAM_SIZE << 20) /* FLASH organization */ #define CONFIG_SYS_FLASH_BASE (CONFIG_SYS_CS0_BASE) diff --git a/include/configs/M5253EVBE.h b/include/configs/M5253EVBE.h index 86de97d7d0..cf8b773c28 100644 --- a/include/configs/M5253EVBE.h +++ b/include/configs/M5253EVBE.h @@ -164,6 +164,7 @@ * the maximum mapped by the Linux kernel during initialization ?? */ #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20)) +#define CONFIG_SYS_BOOTM_LEN (CONFIG_SYS_SDRAM_SIZE << 20) /* FLASH organization */ #define CONFIG_SYS_FLASH_BASE CONFIG_SYS_CS0_BASE diff --git a/include/configs/M5275EVB.h b/include/configs/M5275EVB.h index db48d7608b..210bb2deff 100644 --- a/include/configs/M5275EVB.h +++ b/include/configs/M5275EVB.h @@ -190,7 +190,8 @@ * have to be in the first 8 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization ?? */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial mmap for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20)) +#define CONFIG_SYS_BOOTM_LEN (CONFIG_SYS_SDRAM_SIZE << 20) /*----------------------------------------------------------------------- * FLASH organization diff --git a/include/configs/M53017EVB.h b/include/configs/M53017EVB.h index df54c606be..07c85c4f5e 100644 --- a/include/configs/M53017EVB.h +++ b/include/configs/M53017EVB.h @@ -196,6 +196,7 @@ * the maximum mapped by the Linux kernel during initialization ?? */ #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20)) +#define CONFIG_SYS_BOOTM_LEN (CONFIG_SYS_SDRAM_SIZE << 20) /*----------------------------------------------------------------------- * FLASH organization diff --git a/include/configs/M5329EVB.h b/include/configs/M5329EVB.h index 1f1586a215..a2d17c361c 100644 --- a/include/configs/M5329EVB.h +++ b/include/configs/M5329EVB.h @@ -196,6 +196,7 @@ * the maximum mapped by the Linux kernel during initialization ?? */ #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20)) +#define CONFIG_SYS_BOOTM_LEN (CONFIG_SYS_SDRAM_SIZE << 20) /*----------------------------------------------------------------------- * FLASH organization diff --git a/include/configs/M5373EVB.h b/include/configs/M5373EVB.h index 19916876d3..98d800f310 100644 --- a/include/configs/M5373EVB.h +++ b/include/configs/M5373EVB.h @@ -196,6 +196,7 @@ * the maximum mapped by the Linux kernel during initialization ?? */ #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20)) +#define CONFIG_SYS_BOOTM_LEN (CONFIG_SYS_SDRAM_SIZE << 20) /*----------------------------------------------------------------------- * FLASH organization From 42b68af1062f75bb4a91cf47e329a7e8100cd815 Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Tue, 27 Jan 2009 15:19:35 +0000 Subject: [PATCH 4/6] ColdFire: PLATFORM_CPPFLAGS updates for new compiler Update PLATFORM_CPPFLAGS to accept 4.3.x version of ColdFire compiler. Signed-off-by: TsiChung Liew --- cpu/mcf5227x/config.mk | 4 ++-- cpu/mcf523x/config.mk | 2 +- cpu/mcf52x2/config.mk | 2 +- cpu/mcf532x/config.mk | 2 +- cpu/mcf5445x/config.mk | 2 +- cpu/mcf547x_8x/config.mk | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cpu/mcf5227x/config.mk b/cpu/mcf5227x/config.mk index 8d60fd66bf..8eab49dff9 100644 --- a/cpu/mcf5227x/config.mk +++ b/cpu/mcf5227x/config.mk @@ -24,8 +24,8 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) -PLATFORM_CPPFLAGS += -mcpu=5208 -fPIC +ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) +PLATFORM_CPPFLAGS += -mcpu=52277 -fPIC else PLATFORM_CPPFLAGS += -m5307 -fPIC endif diff --git a/cpu/mcf523x/config.mk b/cpu/mcf523x/config.mk index 93645a31e0..fc7945451f 100644 --- a/cpu/mcf523x/config.mk +++ b/cpu/mcf523x/config.mk @@ -24,7 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) PLATFORM_CPPFLAGS += -mcpu=5235 -fPIC else PLATFORM_CPPFLAGS += -m5307 -fPIC diff --git a/cpu/mcf52x2/config.mk b/cpu/mcf52x2/config.mk index 650e340aee..829273617b 100644 --- a/cpu/mcf52x2/config.mk +++ b/cpu/mcf52x2/config.mk @@ -34,7 +34,7 @@ is5275:=$(shell grep CONFIG_M5275 $(TOPDIR)/include/$(cfg)) is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg)) -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) ifneq (,$(findstring CONFIG_M5249,$(is5249))) PLATFORM_CPPFLAGS += -mcpu=5249 diff --git a/cpu/mcf532x/config.mk b/cpu/mcf532x/config.mk index 16a0bc3264..0cb90ac4e2 100644 --- a/cpu/mcf532x/config.mk +++ b/cpu/mcf532x/config.mk @@ -24,7 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) PLATFORM_CPPFLAGS += -mcpu=5329 -fPIC else PLATFORM_CPPFLAGS += -m5307 -fPIC diff --git a/cpu/mcf5445x/config.mk b/cpu/mcf5445x/config.mk index 67efa07af7..b0b49f7b26 100644 --- a/cpu/mcf5445x/config.mk +++ b/cpu/mcf5445x/config.mk @@ -24,7 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) PLATFORM_CPPFLAGS += -mcpu=54455 -fPIC else PLATFORM_CPPFLAGS += -m5407 -fPIC diff --git a/cpu/mcf547x_8x/config.mk b/cpu/mcf547x_8x/config.mk index 567b281926..83102abbbb 100644 --- a/cpu/mcf547x_8x/config.mk +++ b/cpu/mcf547x_8x/config.mk @@ -24,7 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) PLATFORM_CPPFLAGS += -mcpu=5485 -fPIC else PLATFORM_CPPFLAGS += -m5407 -fPIC From 9017d9325a5067b2ab0d70a2d3c907620c9ab7f8 Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Mon, 2 Mar 2009 19:16:45 +0000 Subject: [PATCH 5/6] ColdFire: Fix M5329EVB and M5373EVB nand issue The Nand flash was unable to read and write properly due to Nand Chip Select (nCE) setup was in reverse order. Also, increase the Nand time out value to 60. Signed-off-by: TsiChung Liew --- board/freescale/m5329evb/nand.c | 6 ++++-- board/freescale/m5373evb/nand.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/board/freescale/m5329evb/nand.c b/board/freescale/m5329evb/nand.c index cf27dda2ff..16025f91e2 100644 --- a/board/freescale/m5329evb/nand.c +++ b/board/freescale/m5329evb/nand.c @@ -47,10 +47,12 @@ static void nand_hwcontrol(struct mtd_info *mtdinfo, int cmd, unsigned int ctrl) ulong IO_ADDR_W = (ulong) this->IO_ADDR_W; IO_ADDR_W &= ~(SET_ALE | SET_CLE); - *nCE &= 0xFFFB; if (ctrl & NAND_NCE) + *nCE &= 0xFFFB; + else *nCE |= 0x0004; + if (ctrl & NAND_CLE) IO_ADDR_W |= SET_CLE; if (ctrl & NAND_ALE) @@ -78,7 +80,7 @@ int board_nand_init(struct nand_chip *nand) gpio->pclrr_timer = 0; gpio->podr_timer = 0; - nand->chip_delay = 50; + nand->chip_delay = 60; nand->ecc.mode = NAND_ECC_SOFT; nand->cmd_ctrl = nand_hwcontrol; diff --git a/board/freescale/m5373evb/nand.c b/board/freescale/m5373evb/nand.c index 3ebef059e1..df8c03b8a2 100644 --- a/board/freescale/m5373evb/nand.c +++ b/board/freescale/m5373evb/nand.c @@ -47,10 +47,12 @@ static void nand_hwcontrol(struct mtd_info *mtdinfo, int cmd, unsigned int ctrl) ulong IO_ADDR_W = (ulong) this->IO_ADDR_W; IO_ADDR_W &= ~(SET_ALE | SET_CLE); - *nCE &= 0xFFFB; if (ctrl & NAND_NCE) + *nCE &= 0xFFFB; + else *nCE |= 0x0004; + if (ctrl & NAND_CLE) IO_ADDR_W |= SET_CLE; if (ctrl & NAND_ALE) @@ -82,7 +84,7 @@ int board_nand_init(struct nand_chip *nand) gpio->pclrr_timer = 0; gpio->podr_timer = 0; - nand->chip_delay = 50; + nand->chip_delay = 60; nand->ecc.mode = NAND_ECC_SOFT; nand->cmd_ctrl = nand_hwcontrol; From 8d8235f84d3ef3f29b7d14e741369b5824b5bb4a Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Tue, 17 Mar 2009 11:21:43 +0000 Subject: [PATCH 6/6] ColdFire: Fix incorrect definition Signed-off-by: TsiChung Liew --- include/asm-m68k/m5301x.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/asm-m68k/m5301x.h b/include/asm-m68k/m5301x.h index 52bbb87e27..80cefc40aa 100644 --- a/include/asm-m68k/m5301x.h +++ b/include/asm-m68k/m5301x.h @@ -601,4 +601,8 @@ #define RTC_OCEN_OSCBYP (0x00000010) #define RTC_OCEN_CLKEN (0x00000008) +/* SDRAM */ +#define SDRAMC_SDCR_CKE (0x40000000) +#define SDRAMC_SDCR_REF (0x10000000) + #endif /* m5301x_h */