diff options
author | Nico Huber <nico.h@gmx.de> | 2018-10-05 23:40:21 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-10-22 08:34:00 +0000 |
commit | 4f32b64e4f88038347bec1d80ee2af41470d03ca (patch) | |
tree | 77765fa2cd40095b72403f1927a48b2656106b07 /src/lib/reset.c | |
parent | 076ce2f4d9082eb80a03f39111ad6e81fc2f8836 (diff) | |
download | coreboot-4f32b64e4f88038347bec1d80ee2af41470d03ca.tar.xz |
reset: Provide new single-function reset API
board_reset() replaces the existing common reset API. There is no common
distinction between reset types across platforms, hence, common code
could never decide which one to call.
Currently only hard_reset() is used by common code. We replace these
calls and provide a fall-back to the current hard_reset() implemen-
tation. The fall-back will be removed along with hard_reset() after the
transition of all boards.
Change-Id: I274a8cee9cb38226b5a0bdff6a847c74ef0b3128
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/29047
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/lib/reset.c')
-rw-r--r-- | src/lib/reset.c | 24 |
1 files changed, 24 insertions, 0 deletions
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(); |