board.c: check for u-boot on mmc on all configurations, not just those with managed...
authorSteve Sakoman <steve@sakoman.com>
Fri, 1 Aug 2008 15:03:41 +0000 (08:03 -0700)
committerSteve Sakoman <steve@sakoman.com>
Fri, 1 Aug 2008 15:03:41 +0000 (08:03 -0700)
lib/board.c

index 6c85937..171cdaf 100644 (file)
@@ -50,7 +50,7 @@ init_fnc_t *init_sequence[] = {
        serial_init,            /* serial communications setup */
        print_info,
 #endif
-       nand_init,              /* board specific nand init */
+       nand_init,              /* board specific nand init */
        NULL,
 };
 
@@ -68,35 +68,35 @@ void start_armboot (void)
 
        buf =  (uchar*) CFG_LOADADDR;
 
-       if ((get_mem_type() == MMC_ONENAND) || (get_mem_type() == MMC_NAND)){
-#ifdef CFG_PRINTF
-                       printf("Booting from mmc . . .\n");
+#ifdef CONFIG_MMC
+       /* first try mmc */
+       buf += mmc_boot(buf);
 #endif
-               buf += mmc_boot(buf);
-       }
 
-       if (get_mem_type() == GPMC_ONENAND){
+       if (buf == (uchar *)CFG_LOADADDR) {
+               /* if no u-boot on mmc, try onenand and nand */
+               if (get_mem_type() == GPMC_ONENAND){
 #ifdef CFG_PRINTF
-                       printf("Booting from onenand . . .\n");
+                               printf("Booting from onenand . . .\n");
 #endif
-               for (i = ONENAND_START_BLOCK; i < ONENAND_END_BLOCK; i++){
-                       if (!onenand_read_block(buf, i))
-                               buf += ONENAND_BLOCK_SIZE;
-               }
-       }
+                       for (i = ONENAND_START_BLOCK; i < ONENAND_END_BLOCK; i++){
+                               if (!onenand_read_block(buf, i))
+                                       buf += ONENAND_BLOCK_SIZE;
+                       }
+               }
 
-       if (get_mem_type() == GPMC_NAND){
+               if (get_mem_type() == GPMC_NAND){
 #ifdef CFG_PRINTF
-                       printf("Booting from nand . . .\n");
+                               printf("Booting from nand . . .\n");
 #endif
-               for (i = NAND_UBOOT_START; i < NAND_UBOOT_END; i+= NAND_BLOCK_SIZE){
-                       if (!nand_read_block(buf, i))
-                               buf += NAND_BLOCK_SIZE; /* advance buf ptr */
-               }
+                       for (i = NAND_UBOOT_START; i < NAND_UBOOT_END; i+= NAND_BLOCK_SIZE){
+                               if (!nand_read_block(buf, i))
+                                       buf += NAND_BLOCK_SIZE; /* advance buf ptr */
+                       }
+               }
        }
 
 
-
        if (buf == (uchar *)CFG_LOADADDR)
                hang();