diff options
Diffstat (limited to 'board/omap1610inn')
-rw-r--r-- | board/omap1610inn/flash.c | 5 | ||||
-rw-r--r-- | board/omap1610inn/omap1610innovator.c | 10 | ||||
-rw-r--r-- | board/omap1610inn/platform.S | 11 |
3 files changed, 24 insertions, 2 deletions
diff --git a/board/omap1610inn/flash.c b/board/omap1610inn/flash.c index 9b7e4ad..c8e4c9e 100644 --- a/board/omap1610inn/flash.c +++ b/board/omap1610inn/flash.c @@ -89,11 +89,12 @@ unsigned long flash_init (void) { int i; ulong size = 0; + for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) { switch (i) { case 0: - flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]); - flash_get_offsets (PHYS_FLASH_1, &flash_info[i]); + flash_get_size ((FPW *) CFG_FLASH_BASE, &flash_info[i]); + flash_get_offsets (CFG_FLASH_BASE, &flash_info[i]); /* to reset the lock bit */ flash_unlock(&flash_info[i]); break; diff --git a/board/omap1610inn/omap1610innovator.c b/board/omap1610inn/omap1610innovator.c index 521eee3..ab1dabe 100644 --- a/board/omap1610inn/omap1610innovator.c +++ b/board/omap1610inn/omap1610innovator.c @@ -36,6 +36,10 @@ #include <./configs/omap1510.h> #endif +#ifdef CONFIG_CS_AUTOBOOT +unsigned long omap_flash_base; +#endif + void flash__init (void); void ether__init (void); void set_muxconf_regs (void); @@ -95,6 +99,12 @@ void flash__init (void) { #define EMIFS_GlB_Config_REG 0xfffecc0c unsigned int regval; + +#ifdef CONFIG_CS_AUTOBOOT + /* Check swapping of CS0 and CS3, set flash base accordingly */ + omap_flash_base = ((*((u32 *)OMAP_EMIFS_CONFIG_REG) & 0x02) == 0) ? + PHYS_FLASH_1_BM0 : PHYS_FLASH_1_BM1; +#endif regval = *((volatile unsigned int *) EMIFS_GlB_Config_REG); /* Turn off write protection for flash devices. */ regval = regval | 0x0001; diff --git a/board/omap1610inn/platform.S b/board/omap1610inn/platform.S index 441edc2..d694f94 100644 --- a/board/omap1610inn/platform.S +++ b/board/omap1610inn/platform.S @@ -71,6 +71,12 @@ platformsetup: ldr r1, VAL_ARM_IDLECT3 str r1, [r0] +#ifdef CONFIG_CS_AUTOBOOT /* do the setup depending on boot mode */ + ldr r0, CONF_STATUS + ldr r1, [r0] + tst r1, #0x02 + beq disable_wd /* booting from RAM, skip setup */ +#endif mov r1, #0x01 /* PER_EN bit */ ldr r0, REG_ARM_RSTCT2 @@ -118,6 +124,7 @@ lock_end: /*------------------------------------------------------* * Turn off the watchdog during init... * *------------------------------------------------------*/ +disable_wd: ldr r0, REG_WATCHDOG ldr r1, WATCHDOG_VAL1 str r1, [r0] @@ -281,6 +288,10 @@ common_tc: /* the literal pools origin */ .ltorg +#ifdef CONFIG_CS_AUTOBOOT +CONF_STATUS: + .word 0xfffe1130 /* 32 bits */ +#endif REG_TC_EMIFS_CONFIG: /* 32 bits */ .word 0xfffecc0c |