From 0d0ba59ccd135addc345568e5678400d01d356db Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Oct 2014 21:11:20 -0600 Subject: x86: Rewrite bootm.c to make it similar to ARM The x86 bootm code is quite special, and geared to zimage. Adjust it to support device tree and make it more like the ARM code, with separate bootm stages and functions for each stage. Create a function announce_and_cleanup() to handle printing the "Starting kernel ..." message and put it in bootm so it is in one place and can be used by any loading code. Also move the board_final_cleanup() function into bootm. Signed-off-by: Simon Glass --- arch/x86/lib/zimage.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'arch/x86/lib/zimage.c') diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 1dab3cc..1f59bf2 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #ifdef CONFIG_SYS_COREBOOT #include @@ -257,26 +258,9 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, return 0; } -/* - * Implement a weak default function for boards that optionally - * need to clean up the system before jumping to the kernel. - */ -__weak void board_final_cleanup(void) -{ -} - void boot_zimage(void *setup_base, void *load_address) { - debug("## Transferring control to Linux (at address %08x) ...\n", - (u32)setup_base); - - bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel"); -#ifdef CONFIG_BOOTSTAGE_REPORT - bootstage_report(); -#endif - board_final_cleanup(); - - printf("\nStarting kernel ...\n\n"); + bootm_announce_and_cleanup(); #ifdef CONFIG_SYS_COREBOOT timestamp_add_now(TS_U_BOOT_START_KERNEL); -- cgit v1.1