This patch fixes error when CONFIG_SYS_NO_FLASH. And adds
nand flash and mmc initialization,

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 lib_nios2/board.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/lib_nios2/board.c b/lib_nios2/board.c
index 311d66c..d5f6c14 100644
--- a/lib_nios2/board.c
+++ b/lib_nios2/board.c
@@ -100,7 +100,9 @@ void board_init (void)
        bd = gd->bd;
        bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
+#ifndef CONFIG_SYS_NO_FLASH
        bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
+#endif
 #if    defined(CONFIG_SYS_SRAM_BASE) && defined(CONFIG_SYS_SRAM_SIZE)
        bd->bi_sramstart= CONFIG_SYS_SRAM_BASE;
        bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE;
@@ -119,8 +121,20 @@ void board_init (void)
        /* The Malloc area is immediately below the monitor copy in RAM */
        mem_malloc_init(CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN);
 
+#ifndef CONFIG_SYS_NO_FLASH
        WATCHDOG_RESET ();
        bd->bi_flashsize = flash_init();
+#endif
+
+#ifdef CONFIG_CMD_NAND
+       puts("NAND:  ");
+       nand_init();
+#endif
+
+#ifdef CONFIG_GENERIC_MMC
+       puts("MMC:   ");
+       mmc_initialize(bd);
+#endif
 
        WATCHDOG_RESET ();
        env_relocate();
-- 
1.6.6.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to