summaryrefslogtreecommitdiff
path: root/board/freescale/m52277evb/m52277evb.c
diff options
context:
space:
mode:
authorTsiChung Liew <Tsi-Chung.Liew@freescale.com>2008-10-21 15:37:02 +0000
committerJohn Rigby <jrigby@freescale.com>2008-11-03 09:45:58 -0700
commita21d0c2cc9add8894d971ab791f4032f077db817 (patch)
treeeaddbc5fea591e99652a4b2c08221c88d1e48e85 /board/freescale/m52277evb/m52277evb.c
parentb202816c61042c183fe67d097a5893b0f2dafba0 (diff)
downloadu-boot-imx-a21d0c2cc9add8894d971ab791f4032f077db817.zip
u-boot-imx-a21d0c2cc9add8894d971ab791f4032f077db817.tar.gz
u-boot-imx-a21d0c2cc9add8894d971ab791f4032f077db817.tar.bz2
ColdFire: Add SBF support for M52277EVB
Add serial boot support Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
Diffstat (limited to 'board/freescale/m52277evb/m52277evb.c')
-rw-r--r--board/freescale/m52277evb/m52277evb.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/board/freescale/m52277evb/m52277evb.c b/board/freescale/m52277evb/m52277evb.c
index 838a6de..9109edb 100644
--- a/board/freescale/m52277evb/m52277evb.c
+++ b/board/freescale/m52277evb/m52277evb.c
@@ -38,8 +38,18 @@ int checkboard(void)
phys_size_t initdram(int board_type)
{
+ u32 dramsize;
+
+#ifdef CONFIG_CF_SBF
+ /*
+ * Serial Boot: The dram is already initialized in start.S
+ * only require to return DRAM size
+ */
+ dramsize = CONFIG_SYS_SDRAM_SIZE * 0x100000;
+#else
volatile sdramc_t *sdram = (volatile sdramc_t *)(MMAP_SDRAM);
- u32 dramsize, i;
+ volatile gpio_t *gpio = (volatile gpio_t *)(MMAP_GPIO);
+ u32 i;
dramsize = CONFIG_SYS_SDRAM_SIZE * 0x100000;
@@ -49,6 +59,8 @@ phys_size_t initdram(int board_type)
}
i--;
+ gpio->mscr_sdram = CONFIG_SYS_SDRAM_DRV_STRENGTH;
+
sdram->sdcs0 = (CONFIG_SYS_SDRAM_BASE | i);
sdram->sdcfg1 = CONFIG_SYS_SDRAM_CFG1;
@@ -56,24 +68,30 @@ phys_size_t initdram(int board_type)
/* Issue PALL */
sdram->sdcr = CONFIG_SYS_SDRAM_CTRL | 2;
+ __asm__("nop");
/* Issue LEMR */
- /*sdram->sdmr = CONFIG_SYS_SDRAM_EMOD; */
sdram->sdmr = CONFIG_SYS_SDRAM_MODE;
+ __asm__("nop");
+ sdram->sdmr = CONFIG_SYS_SDRAM_EMOD;
+ __asm__("nop");
udelay(1000);
/* Issue PALL */
sdram->sdcr = CONFIG_SYS_SDRAM_CTRL | 2;
+ __asm__("nop");
/* Perform two refresh cycles */
sdram->sdcr = CONFIG_SYS_SDRAM_CTRL | 4;
+ __asm__("nop");
sdram->sdcr = CONFIG_SYS_SDRAM_CTRL | 4;
+ __asm__("nop");
- sdram->sdcr = (CONFIG_SYS_SDRAM_CTRL & ~0x80000000) | 0x10000c00;
+ sdram->sdcr = (CONFIG_SYS_SDRAM_CTRL & ~0x80000000) | 0x10000C00;
udelay(100);
-
+#endif
return (dramsize);
};