From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott McNutt Date: Thu, 22 Apr 2010 22:22:21 -0400 Subject: [U-Boot] [PATCH 5/5 v3] nios2: fix no flash, add nand and mmc init in board.c In-Reply-To: <1271928436-6681-1-git-send-email-thomas@wytron.com.tw> References: <1269996650-20816-5-git-send-email-thomas@wytron.com.tw> <1271928436-6681-1-git-send-email-thomas@wytron.com.tw> Message-ID: <4BD1045D.7000908@psyent.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Applied. Thanks. --Scott Thomas Chou wrote: > This patch fixes error when CONFIG_SYS_NO_FLASH. And adds > nand flash and mmc initialization, which should go before > env initialization. > > Signed-off-by: Thomas Chou > --- > v3 include mmc.h and nand.h. > v2 arch dir reorganized. > > arch/nios2/lib/board.c | 18 ++++++++++++++++++ > 1 files changed, 18 insertions(+), 0 deletions(-) > > diff --git a/arch/nios2/lib/board.c b/arch/nios2/lib/board.c > index 8ec66a3..f83e691 100644 > --- a/arch/nios2/lib/board.c > +++ b/arch/nios2/lib/board.c > @@ -28,6 +28,7 @@ > #include > #include > #include > +#include > #include > #ifdef CONFIG_STATUS_LED > #include > @@ -35,6 +36,9 @@ > #if defined(CONFIG_SYS_NIOS_EPCSBASE) > #include > #endif > +#ifdef CONFIG_CMD_NAND > +#include /* cannot even include nand.h if it isnt configured */ > +#endif > > DECLARE_GLOBAL_DATA_PTR; > > @@ -100,7 +104,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 +125,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();