Hung-Te Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32353
Change subject: board/kukui: Print ADC values on failure in getting board IDs ......................................................................
board/kukui: Print ADC values on failure in getting board IDs
WIP: Need a better way to report ADC failures.
BUG=None TEST=None BRANCH=None
Change-Id: I8d00956e0e3b48ddbcaa505dd3ade24720c3b4ad Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/boardid.c 1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/32353/1
diff --git a/src/mainboard/google/kukui/boardid.c b/src/mainboard/google/kukui/boardid.c index b9f1ba2..953ae33 100644 --- a/src/mainboard/google/kukui/boardid.c +++ b/src/mainboard/google/kukui/boardid.c @@ -15,6 +15,7 @@
#include <assert.h> #include <boardid.h> +#include <console/console.h> #include <soc/auxadc.h> #include <ec/google/chromeec/ec.h> #include <stddef.h> @@ -83,7 +84,11 @@ break;
const int tolerance = 10000; /* 10,000 uV */ - assert(ABS(value - voltages[id]) < tolerance); + if (ABS(value - voltages[id]) < tolerance) { + printk(BIOS_ERR, "ADC channel %u value out of range: %d\n" + channel, value); + die("Invalid ADC value"); + }
return id; }