diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2011-09-11 22:46:13 -0700 |
---|---|---|
committer | Vadim Bendebury <vbendeb@chromium.org> | 2011-09-12 15:54:58 -0700 |
commit | 53101b5bcd5f3e3133f80af45d7d0cf952455579 (patch) | |
tree | fa21ea124a2841ffd0499e6ec439847be3227f75 /arch/x86 | |
parent | fc1ad78beffc1043313b0ec08c961d93cbae0ee8 (diff) |
Rearrange initialization sequence to provide early access to environment.
When the environment is stored in the SPI flash, PCI needs to be
initialized before SPI can be accessed.
BUG=chromium-os:20105
TEST=manual
. this change was tested combined with other modifications; The
ability to read and save the u-boot environment in an SPI
flash was demonstrated.
Change-Id: I824e0b075349a71726fa098c1b683a1f840996a3
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/7534
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/lib/board.c | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index 6fd086a17f..1b9eba40e9 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -291,13 +291,11 @@ void board_init_f(ulong boot_flags) void board_init_r(gd_t *id, ulong dest_addr) { char *s; - ulong size; static bd_t bd_data; static gd_t gd_data; init_fnc_t **init_fnc_ptr; show_boot_progress(0x21); - /* Global data pointer is now writable */ gd = &gd_data; memcpy(gd, id, sizeof(gd_t)); @@ -318,42 +316,37 @@ void board_init_r(gd_t *id, ulong dest_addr) if ((*init_fnc_ptr)() != 0) hang (); } - show_boot_progress(0x23); -#ifdef CONFIG_SERIAL_MULTI - serial_initialize(); -#endif - /* configure available FLASH banks */ -#ifdef CONFIG_SYS_NO_FLASH - size = 0; -#else - size = flash_init(); - display_flash_config(size); +#if defined(CONFIG_PCI) + /* + * Do pci configuration + */ + show_boot_progress(0x23); + pci_init(); #endif - show_boot_progress(0x24); - - show_boot_progress(0x25); +#ifdef CONFIG_CMD_SPI + show_boot_progress(0x24); + spi_init(); +#endif /* initialize environment */ env_relocate (); - show_boot_progress(0x26); - #ifdef CONFIG_CMD_NET /* IP Address */ bd_data.bi_ip_addr = getenv_IPaddr ("ipaddr"); #endif -#if defined(CONFIG_PCI) - /* - * Do pci configuration - */ - pci_init(); +#ifdef CONFIG_SERIAL_MULTI + show_boot_progress(0x25); + serial_initialize(); +#endif + /* configure available FLASH banks */ +#ifndef CONFIG_SYS_NO_FLASH + display_flash_config(flash_init()); #endif - show_boot_progress(0x27); - - + show_boot_progress(0x26); stdio_init (); jumptable_init (); @@ -361,10 +354,6 @@ void board_init_r(gd_t *id, ulong dest_addr) /* Initialize the console (after the relocation and devices init) */ console_init_r(); -#ifdef CONFIG_CMD_SPI - spi_init(); -#endif - #ifdef CONFIG_MISC_INIT_R /* miscellaneous platform dependent initialisations */ misc_init_r(); |