From b55881ddb455af31b64038cf3b67f781909971cc Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 23 Oct 2021 03:06:03 +0200 Subject: [PATCH] bootstage: Add SPL support Allow usage of the bootstage facilities in SPL. Signed-off-by: Marek Vasut Cc: Simon Glass Reviewed-by: Simon Glass --- arch/x86/cpu/cpu.c | 2 +- board/siemens/iot2050/board.c | 2 +- common/Kconfig.boot | 9 +++++++++ common/init/board_init.c | 2 +- common/spl/spl.c | 2 +- include/bootstage.h | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 01dece5769..86f53e78d2 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -178,7 +178,7 @@ int default_print_cpuinfo(void) return 0; } -#if CONFIG_IS_ENABLED(BOOTSTAGE) +#if CONFIG_IS_ENABLED(SHOW_BOOT_PROGRESS) void show_boot_progress(int val) { outb(val, POST_PORT); diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c index b2110978ae..16ae2ffc17 100644 --- a/board/siemens/iot2050/board.c +++ b/board/siemens/iot2050/board.c @@ -250,7 +250,7 @@ void spl_board_init(void) { } -#if CONFIG_IS_ENABLED(LED) && CONFIG_IS_ENABLED(BOOTSTAGE) +#if CONFIG_IS_ENABLED(LED) && CONFIG_IS_ENABLED(SHOW_BOOT_PROGRESS) /* * Indicate any error or (accidental?) entering of CLI via the red status LED. */ diff --git a/common/Kconfig.boot b/common/Kconfig.boot index c948d58094..a8d4be23a9 100644 --- a/common/Kconfig.boot +++ b/common/Kconfig.boot @@ -703,6 +703,15 @@ config SHOW_BOOT_PROGRESS -150 common/cmd_nand.c Incorrect FIT image format 151 common/cmd_nand.c FIT image format OK +config SPL_SHOW_BOOT_PROGRESS + bool "Show boot progress in a board-specific manner" + depends on SPL + help + Defining this option allows to add some board-specific code (calling + a user-provided function show_boot_progress(int) that enables you to + show the system's boot progress on some display (for example, some + LEDs) on your board. For details see SHOW_BOOT_PROGRESS. + endmenu menu "Boot media" diff --git a/common/init/board_init.c b/common/init/board_init.c index 0965b96fa3..eab5ee1395 100644 --- a/common/init/board_init.c +++ b/common/init/board_init.c @@ -166,7 +166,7 @@ void board_init_f_init_reserve(ulong base) board_init_f_init_stack_protection(); } -#if CONFIG_IS_ENABLED(BOOTSTAGE) +#if CONFIG_IS_ENABLED(SHOW_BOOT_PROGRESS) /* * Board-specific Platform code can reimplement show_boot_progress () if needed */ diff --git a/common/spl/spl.c b/common/spl/spl.c index 0c08da06e8..99cde6609c 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -61,7 +61,7 @@ binman_sym_declare(ulong, spl, size); /* Define board data structure */ static struct bd_info bdata __attribute__ ((section(".data"))); -#if CONFIG_IS_ENABLED(BOOTSTAGE) +#if CONFIG_IS_ENABLED(SHOW_BOOT_PROGRESS) /* * Board-specific Platform code can reimplement show_boot_progress () if needed */ diff --git a/include/bootstage.h b/include/bootstage.h index f837a387c8..8d1989ac0e 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -220,7 +220,7 @@ enum bootstage_id { */ ulong timer_get_boot_us(void); -#if defined(USE_HOSTCC) || !CONFIG_IS_ENABLED(BOOTSTAGE) +#if defined(USE_HOSTCC) || !CONFIG_IS_ENABLED(SHOW_BOOT_PROGRESS) #define show_boot_progress(val) do {} while (0) #else /** -- 2.39.5