diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Kconfig | 7 | ||||
-rw-r--r-- | src/lib/prog_loaders.c | 3 | ||||
-rw-r--r-- | src/lib/reset.c | 24 |
3 files changed, 32 insertions, 2 deletions
diff --git a/src/lib/Kconfig b/src/lib/Kconfig index eb4c16eb51..2f10c1ccdf 100644 --- a/src/lib/Kconfig +++ b/src/lib/Kconfig @@ -1,3 +1,10 @@ +config MISSING_BOARD_RESET + bool + help + Selected by boards that don't provide a do_board_reset() + implementation. This activates a stub that logs the missing + board reset and halts execution. + config NO_EDID_FILL_FB bool default y if !MAINBOARD_DO_NATIVE_VGA_INIT diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c index e3ddce0a5c..883dbdc7ec 100644 --- a/src/lib/prog_loaders.c +++ b/src/lib/prog_loaders.c @@ -84,8 +84,7 @@ static void ramstage_cache_invalid(void) { printk(BIOS_ERR, "ramstage cache invalid.\n"); if (IS_ENABLED(CONFIG_RESET_ON_INVALID_RAMSTAGE_CACHE)) { - hard_reset(); - halt(); + board_reset(); } } diff --git a/src/lib/reset.c b/src/lib/reset.c index d8284210c4..283f72c2bf 100644 --- a/src/lib/reset.c +++ b/src/lib/reset.c @@ -18,6 +18,30 @@ #include <halt.h> #include <reset.h> +__noreturn void board_reset(void) +{ + printk(BIOS_INFO, "%s() called!\n", __func__); + dcache_clean_all(); + do_board_reset(); + halt(); +} + +#if IS_ENABLED(CONFIG_MISSING_BOARD_RESET) +void do_board_reset(void) +{ + printk(BIOS_CRIT, "No board_reset implementation, hanging...\n"); +} +#else +/* + * Fall back to hard_reset() for a regression free transition. + * FIXME: Remove after everything is converted to board_reset(). + */ +__weak void do_board_reset(void) +{ + hard_reset(); +} +#endif + __noreturn static void __hard_reset(void) { if (IS_ENABLED(CONFIG_HAVE_HARD_RESET)) do_hard_reset(); |