[coreboot-gerrit] Change in coreboot[master]: [WIP]ec/lenovo/h8: Panic on die

Patrick Rudolph (Code Review) gerrit at coreboot.org
Mon May 15 18:17:20 CEST 2017


Patrick Rudolph has uploaded a new change for review. ( https://review.coreboot.org/19696 )

Change subject: [WIP]ec/lenovo/h8: Panic on die
......................................................................

[WIP]ec/lenovo/h8: Panic on die

Panic on die method.

Useful to signal something realy bad happend happend,
like failed raminit.

Change-Id: I71f8ddfc96047e8a0d39f084588db1fe2f251612
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M src/console/die.c
M src/ec/lenovo/h8/h8.c
M src/include/console/console.h
3 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/19696/1

diff --git a/src/console/die.c b/src/console/die.c
index ea46f51..5b15081 100644
--- a/src/console/die.c
+++ b/src/console/die.c
@@ -21,10 +21,15 @@
 #ifndef __ROMCC__
 #define NORETURN __attribute__((noreturn))
 
+void __attribute__ ((weak)) ec_panic(void)
+{
+}
+
 /* Report a fatal error */
 void NORETURN die(const char *msg)
 {
 	printk(BIOS_EMERG, "%s", msg);
+	ec_panic();
 	halt();
 }
 #endif
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index 272caf1..528f431 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -165,6 +165,12 @@
 		ec_write(H8_LED_CONTROL, H8_LED_CONTROL_BLINK | i);
 }
 
+/* called by die() */
+void ec_panic(void)
+{
+	h8_panic();
+}
+
 u8 h8_build_id_and_function_spec_version(char *buf, u8 buf_len)
 {
 	u8 i, c;
diff --git a/src/include/console/console.h b/src/include/console/console.h
index d89d747..b283fe4 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -41,6 +41,7 @@
 /* this function is weak and can be overridden by a mainboard function. */
 void mainboard_post(u8 value);
 void __attribute__ ((noreturn)) die(const char *msg);
+void __attribute__ ((weak)) ec_panic(void);
 
 #define __CONSOLE_ENABLE__ \
 	((ENV_BOOTBLOCK && IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) || \

-- 
To view, visit https://review.coreboot.org/19696
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71f8ddfc96047e8a0d39f084588db1fe2f251612
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>



More information about the coreboot-gerrit mailing list