From d82e0cf331b5f7f3122930808705030ed861b14e Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 17 Feb 2015 17:27:23 -0800 Subject: Fix non-x86 __PRE_RAM__ assertions and add FATAL_ASSERTS Kconfig option This patch fixes a bug that caused non-x86 boards to use the poor man's assert() version with a lot more instructions per invocation and hexadecimal line numbers in __PRE_RAM__ environments. This was really just an oversight in the ARM port... even x86 uses a proper printk() in most cases (those with CAR) and there's no reason not to do so on the generally even more flexible SRAM-based architectures. Additionally, it adds a new Kconfig option to make failed assertions and BUG() calls halt again. This seems to have been the original intention, but was commented out once out of fear that this might prevent production systems from booting. It is still a useful debugging feature though (since otherwise assertions can easily just scroll past and get overlooked), so the user should be able to decide the this based on his needs. (Also changed error messages for both to include the word "ERROR", since grepping for that is the most sophisticated way we currently have to detect firmware problems. Some automated Chromium OS suspend tests check for that.) BRANCH=veyron BUG=None TEST=Booted Jerry. Compared binary sizes before and after, new version's bootblock is some ~600 bytes smaller. Change-Id: I894da18d77e12bf104e443322e2d58e60564e4b7 Signed-off-by: Patrick Georgi Original-Commit-Id: 6a5343124719c18a1c969477e3d18bda13c0bf26 Original-Change-Id: I0268cfd67d8c894406b18bb3759a577944bcffb1 Original-Signed-off-by: Julius Werner Original-Reviewed-on: https://chromium-review.googlesource.com/250661 Original-Reviewed-by: Vadim Bendebury Original-Reviewed-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/9775 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan --- src/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Kconfig') diff --git a/src/Kconfig b/src/Kconfig index 6f7f459fc1..a6032c7d07 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -808,6 +808,12 @@ config GDB_WAIT help If enabled, coreboot will wait for a GDB connection. +config FATAL_ASSERTS + bool "Halt when hitting a BUG() or assertion error" + default n + help + If enabled, coreboot will call hlt() on a BUG() or failed ASSERT(). + config DEBUG_CBFS bool "Output verbose CBFS debug messages" default n -- cgit v1.2.3