mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-27 12:57:13 +00:00
x86: Call board_final_cleanup() in last_stage_init()
At present board_final_cleanup() is called before booting a Linux kernel. This actually needs to be done before booting anything, like SeaBIOS, VxWorks or Windows. Move the call to last_stage_init() instead. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
91fc5bf652
commit
1e2f7b9e8e
3 changed files with 21 additions and 18 deletions
|
@ -39,15 +39,7 @@ int print_cpuinfo(void)
|
||||||
return default_print_cpuinfo();
|
return default_print_cpuinfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
int last_stage_init(void)
|
static void board_final_cleanup(void)
|
||||||
{
|
|
||||||
if (gd->flags & GD_FLG_COLD_BOOT)
|
|
||||||
timestamp_add_to_bootstage();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void board_final_cleanup(void)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Un-cache the ROM so the kernel has one
|
* Un-cache the ROM so the kernel has one
|
||||||
|
@ -79,6 +71,16 @@ void board_final_cleanup(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int last_stage_init(void)
|
||||||
|
{
|
||||||
|
if (gd->flags & GD_FLG_COLD_BOOT)
|
||||||
|
timestamp_add_to_bootstage();
|
||||||
|
|
||||||
|
board_final_cleanup();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int misc_init_r(void)
|
int misc_init_r(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -661,10 +661,20 @@ void show_boot_progress(int val)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_SYS_COREBOOT
|
#ifndef CONFIG_SYS_COREBOOT
|
||||||
|
/*
|
||||||
|
* 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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
int last_stage_init(void)
|
int last_stage_init(void)
|
||||||
{
|
{
|
||||||
write_tables();
|
write_tables();
|
||||||
|
|
||||||
|
board_final_cleanup();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -26,14 +26,6 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
#define COMMAND_LINE_OFFSET 0x9000
|
#define COMMAND_LINE_OFFSET 0x9000
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 bootm_announce_and_cleanup(void)
|
void bootm_announce_and_cleanup(void)
|
||||||
{
|
{
|
||||||
printf("\nStarting kernel ...\n\n");
|
printf("\nStarting kernel ...\n\n");
|
||||||
|
@ -45,7 +37,6 @@ void bootm_announce_and_cleanup(void)
|
||||||
#ifdef CONFIG_BOOTSTAGE_REPORT
|
#ifdef CONFIG_BOOTSTAGE_REPORT
|
||||||
bootstage_report();
|
bootstage_report();
|
||||||
#endif
|
#endif
|
||||||
board_final_cleanup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_OF_LIBFDT) && !defined(CONFIG_OF_NO_KERNEL)
|
#if defined(CONFIG_OF_LIBFDT) && !defined(CONFIG_OF_NO_KERNEL)
|
||||||
|
|
Loading…
Add table
Reference in a new issue