Fix build breakage when CONFIG_MMC is disabled
authorSteve Sakoman <steve@sakoman.com>
Fri, 15 Aug 2008 04:21:03 +0000 (21:21 -0700)
committerSteve Sakoman <steve@sakoman.com>
Fri, 15 Aug 2008 04:21:03 +0000 (21:21 -0700)
board/overo/overo.c
lib/board.c

index f1fca25..2f29f82 100644 (file)
@@ -529,6 +529,7 @@ void s_init(void)
  ********************************************************/
 int misc_init_r(void)
 {
+#ifdef CONFIG_MMC
        /* REMOVE!! for proto boards only */
        /* set vaux2 to 2.8V */
        unsigned char byte = 0x20;
@@ -537,7 +538,7 @@ int misc_init_r(void)
        i2c_write(0x4B, 0x79, 1, &byte, 1);
 
        udelay(5000);
-
+#endif
        return 0;
 }
 
index dec550d..ef00bff 100644 (file)
@@ -48,7 +48,9 @@ int print_info(void)
 
 static int init_func_i2c (void)
 {
+#ifdef CONFIG_MMC
        i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
+#endif
        return 0;
 }
 
@@ -62,7 +64,9 @@ init_fnc_t *init_sequence[] = {
        print_info,
 #endif
        nand_init,              /* board specific nand init */
+#ifdef CONFIG_MMC
        init_func_i2c,
+#endif
        NULL,
 };
 
@@ -93,8 +97,8 @@ void start_armboot (void)
 #endif
                        buf += size;
                }
-#endif
        }
+#endif
 
        if (buf == (uchar *)CFG_LOADADDR) {
                /* if no u-boot on mmc, try onenand or nand, depending upon sysboot */
@@ -106,9 +110,7 @@ void start_armboot (void)
                                if (!onenand_read_block(buf, i))
                                        buf += ONENAND_BLOCK_SIZE;
                        }
-               }
-
-               if (get_mem_type() == GPMC_NAND){
+               } else if (get_mem_type() == GPMC_NAND){
 #ifdef CFG_PRINTF
                                printf("Booting from nand\n");
 #endif