]> git.sur5r.net Git - u-boot/commitdiff
* Patch by Imre Deak, 26 May 2004:
authorwdenk <wdenk>
Wed, 9 Jun 2004 15:25:53 +0000 (15:25 +0000)
committerwdenk <wdenk>
Wed, 9 Jun 2004 15:25:53 +0000 (15:25 +0000)
  On OMAP1610 platforms check if booting from RAM(CS0) or flash(CS3).
  Set flash base accordingly, and decide whether to do or skip board
  specific setup steps.

* Patch by Josef Baumgartner, 26 May 2004:
  Add missing define in include/asm-m68k/global_data.h

CHANGELOG
Makefile
board/omap1610inn/flash.c
board/omap1610inn/omap1610innovator.c
board/omap1610inn/platform.S
include/asm-m68k/global_data.h
include/configs/omap1610h2.h
include/configs/omap1610inn.h

index 7922cdefb08e4f7c929de45b65837e8d838b4371..21dddf13b10c8fb5ab3d5de14b54f479c3722ce4 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,14 @@
 Changes since U-Boot 1.1.1:
 ======================================================================
 
+* Patch by Imre Deak, 26 May 2004:
+  On OMAP1610 platforms check if booting from RAM(CS0) or flash(CS3).
+  Set flash base accordingly, and decide whether to do or skip board
+  specific setup steps.
+
+* Patch by Josef Baumgartner, 26 May 2004:
+  Add missing define in include/asm-m68k/global_data.h
+
 * Patch by Josef Baumgartner, 25 May 2004:
   Add missing functions get_ticks() and get_tbclk() in lib_m68k/time.c
 
index ee667879f1218e011545f8b575ab8e53db36b8d5..4b9596de5a17f525ab3046b72bb63ee8f3071456 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1020,7 +1020,7 @@ shannon_config    :       unconfig
 
 xtract_trab = $(subst _bigram,,$(subst _bigflash,,$(subst _old,,$(subst _config,,$1))))
 
-xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
+xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$(subst _config,,$1))))
 
 xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
 
@@ -1045,12 +1045,17 @@ omap5912osk_config :    unconfig
 omap1610inn_config \
 omap1610inn_cs0boot_config \
 omap1610inn_cs3boot_config \
+omap1610inn_cs_autoboot_config \
 omap1610h2_config \
 omap1610h2_cs0boot_config \
-omap1610h2_cs3boot_config :    unconfig
+omap1610h2_cs3boot_config \
+omap1610h2_cs_autoboot_config: unconfig
        @if [ "$(findstring _cs0boot_, $@)" ] ; then \
                echo "#define CONFIG_CS0_BOOT" >> ./include/config.h ; \
                echo "... configured for CS0 boot"; \
+       elif [ "$(findstring _cs_autoboot_, $@)" ] ; then \
+               echo "#define CONFIG_CS_AUTOBOOT" >> ./include/config.h ; \
+               echo "... configured for CS_AUTO boot"; \
        else \
                echo "#define CONFIG_CS3_BOOT" >> ./include/config.h ; \
                echo "... configured for CS3 boot"; \
index 9b7e4ad023add6ee1801e7d602bad9fa5e0faf93..c8e4c9e25abb6aee3dc1b160aa56061f3ef847b1 100644 (file)
@@ -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;
index 521eee34c39f2213e3c87dc234a974ef747ff546..ab1dabeb9ff99babd42cab64cecd2c14700112c3 100644 (file)
 #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;
index 441edc28aedf51d3818f4ac571ba3c85ebf44f0a..d694f94bb9d01b05d715f7f31980b7e37e6f7af2 100644 (file)
@@ -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
index f8a3d88084288271ec7666de9690556b1b97f4dc..f68352f12068dd05266d1023d2591a97d8f9054a 100644 (file)
@@ -56,6 +56,7 @@ typedef       struct  global_data {
  */
 #define        GD_FLG_RELOC    0x00001         /* Code was relocated to RAM            */
 #define        GD_FLG_DEVINIT  0x00002         /* Devices have been initialized        */
+#define        GD_FLG_SILENT   0x00004         /* Silent mode                          */
 
 #if 0
 extern gd_t *global_data;
index e512f912a922afddcbba9704d2d5783598bd6981..b2b0fe721bcb2a01dc74752844b3759dc61f7c2d 100644 (file)
 /*-----------------------------------------------------------------------
  * Physical Memory Map
  */
-#define CONFIG_NR_DRAM_BANKS   1       /* we have 1 bank of DRAM */
-#define PHYS_SDRAM_1   0x10000000      /* SDRAM Bank #1 */
+#define CONFIG_NR_DRAM_BANKS   1               /* we have 1 bank of DRAM */
+#define PHYS_SDRAM_1           0x10000000      /* SDRAM Bank #1 */
 #define PHYS_SDRAM_1_SIZE      0x02000000      /* 32 MB */
 
-#ifdef CONFIG_CS0_BOOT
-#define PHYS_FLASH_1   0x0C000000
-#endif
-#ifdef CONFIG_CS3_BOOT
-#define PHYS_FLASH_1   0x00000000
+#define PHYS_FLASH_1_BM1       0x00000000      /* Flash Bank #1 if booting from flash */
+#define PHYS_FLASH_1_BM0       0x0C000000      /* Flash Bank #1 if booting from RAM */
+
+#ifdef CONFIG_CS_AUTOBOOT                      /* Determine CS assignment in runtime */
+                               
+#ifndef __ASSEMBLY__
+extern unsigned long omap_flash_base;          /* set in flash__init */
 #endif
+#define CFG_FLASH_BASE         omap_flash_base
+
+#elif defined(CONFIG_CS0_BOOT)
+
+#define CFG_FLASH_BASE         PHYS_FLASH_1_BM0
 
-#define CFG_FLASH_BASE PHYS_FLASH_1
+#else
+
+#define CFG_FLASH_BASE         PHYS_FLASH_1_BM1
+
+#endif
 
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
index da8043db28da6ce7a6e78983801c7fd6e9fd0de0..cbf828c56be42dbc870b490c40bb8be623358869 100644 (file)
 /*-----------------------------------------------------------------------
  * Physical Memory Map
  */
-#define CONFIG_NR_DRAM_BANKS   1       /* we have 1 bank of DRAM */
-#define PHYS_SDRAM_1   0x10000000      /* SDRAM Bank #1 */
+#define CONFIG_NR_DRAM_BANKS   1               /* we have 1 bank of DRAM */
+#define PHYS_SDRAM_1           0x10000000      /* SDRAM Bank #1 */
 #define PHYS_SDRAM_1_SIZE      0x02000000      /* 32 MB */
 
-#ifdef CONFIG_CS0_BOOT
-#define PHYS_FLASH_1   0x0C000000
-#endif
-#ifdef CONFIG_CS3_BOOT
-#define PHYS_FLASH_1   0x00000000
+#define PHYS_FLASH_1_BM1       0x00000000      /* Flash Bank #1 if booting from flash */
+#define PHYS_FLASH_1_BM0       0x0C000000      /* Flash Bank #1 if booting from RAM */
+
+#ifdef CONFIG_CS_AUTOBOOT                      /* Determine CS assignment in runtime */
+                               
+#ifndef __ASSEMBLY__
+extern unsigned long omap_flash_base;          /* set in flash__init */
 #endif
+#define CFG_FLASH_BASE         omap_flash_base
+
+#elif defined(CONFIG_CS0_BOOT)
+
+#define CFG_FLASH_BASE         PHYS_FLASH_1_BM0
 
-#define CFG_FLASH_BASE PHYS_FLASH_1
+#else
+
+#define CFG_FLASH_BASE         PHYS_FLASH_1_BM1
+
+#endif
 
 /*-----------------------------------------------------------------------
  * FLASH and environment organization