From 9d23fc584c4b7b8bb9ecbee48920b1b04b08fa1b Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 12 Nov 2008 13:18:19 +0100 Subject: MIPS: Add onenand_init() to board.c and move nand_init() This patch adds a call to onenand_init() for OneNAND support and moves the nand_init() call to an earlier place, so that the environment can be used from NAND and OneNAND. Signed-off-by: Stefan Roese Signed-off-by: Shinya Kuribayashi --- lib_mips/board.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib_mips') diff --git a/lib_mips/board.c b/lib_mips/board.c index 9c997f190..5133b8a5d 100644 --- a/lib_mips/board.c +++ b/lib_mips/board.c @@ -30,6 +30,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -378,6 +379,15 @@ void board_init_r (gd_t *id, ulong dest_addr) mem_malloc_init(); malloc_bin_reloc(); +#ifdef CONFIG_CMD_NAND + puts ("NAND: "); + nand_init (); /* go init the NAND */ +#endif + +#if defined(CONFIG_CMD_ONENAND) + onenand_init(); +#endif + /* relocate environment function pointers etc. */ env_relocate(); @@ -419,11 +429,6 @@ void board_init_r (gd_t *id, ulong dest_addr) } #endif -#ifdef CONFIG_CMD_NAND - puts ("NAND: "); - nand_init (); /* go init the NAND */ -#endif - #ifdef CONFIG_CMD_SPI puts ("SPI: "); spi_init (); /* go init the SPI */ -- cgit v1.2.3 From db08ecaa6eb8176904b3bae103a85ee8f735dc40 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 12 Nov 2008 13:18:02 +0100 Subject: MIPS: Add board_early_init_f() to init_sequence This patch adds the board_early_init_f() call to the MIPS init sequence. A weak dummy implementation is also added which can be overridden by a board specific version. This will be used by the upcoming VCTH board support. Signed-off-by: Stefan Roese Signed-off-by: Shinya Kuribayashi --- lib_mips/board.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib_mips') diff --git a/lib_mips/board.c b/lib_mips/board.c index 5133b8a5d..dfe683161 100644 --- a/lib_mips/board.c +++ b/lib_mips/board.c @@ -72,6 +72,15 @@ static ulong mem_malloc_brk; */ unsigned long mips_io_port_base = -1; +int __board_early_init_f(void) +{ + /* + * Nothing to do in this dummy implementation + */ + return 0; +} +int board_early_init_f(void) __attribute__((weak, alias("__board_early_init_f"))); + /* * The Malloc area is immediately below the monitor copy in DRAM */ @@ -169,6 +178,7 @@ static int init_baudrate (void) typedef int (init_fnc_t) (void); init_fnc_t *init_sequence[] = { + board_early_init_f, timer_init, env_init, /* initialize environment */ #ifdef CONFIG_INCA_IP -- cgit v1.2.3