Patrick Georgi submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Matt DeVillier: Looks good to me, approved Benjamin Doron: Looks good to me, but someone else must approve
mb/purism/librem_mini: Implement `die_notify`

Make the SATA LED blink when coreboot dies. GPIO functions aren't
compiled in for postcar, so add a check to prevent linker failures.

TEST: Try to boot Librem Mini WHL without RAM, observe blinking (and
also blinding LED). Re-install RAM (and re-seat RAM a few times),
boot to OS, and observe SATA LED operating normally, as expected.

Change-Id: I0ffac0ab02e52e9fbba7990f401d87e50a1b5154
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50013
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Benjamin Doron <benjamin.doron00@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M src/mainboard/purism/librem_cnl/Makefile.inc
A src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc
A src/mainboard/purism/librem_cnl/variants/librem_mini/die.c
3 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/src/mainboard/purism/librem_cnl/Makefile.inc b/src/mainboard/purism/librem_cnl/Makefile.inc
index 8e3b5a6..c8cfa22 100644
--- a/src/mainboard/purism/librem_cnl/Makefile.inc
+++ b/src/mainboard/purism/librem_cnl/Makefile.inc
@@ -7,3 +7,5 @@
ramstage-y += ramstage.c

CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
+
+subdirs-y += variants/$(VARIANT_DIR)/
diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc b/src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc
new file mode 100644
index 0000000..20ff438
--- /dev/null
+++ b/src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc
@@ -0,0 +1,4 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+all-y += die.c
+smm-y += die.c
diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/die.c b/src/mainboard/purism/librem_cnl/variants/librem_mini/die.c
new file mode 100644
index 0000000..8147abb
--- /dev/null
+++ b/src/mainboard/purism/librem_cnl/variants/librem_mini/die.c
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <console/console.h>
+#include <delay.h>
+#include <gpio.h>
+#include <soc/gpio.h>
+
+void die_notify(void)
+{
+ if (ENV_POSTCAR)
+ return;
+
+ /* Make SATA LED blink */
+ gpio_output(GPP_E8, 1);
+
+ while (1) {
+ gpio_set(GPP_E8, 0);
+ mdelay(100);
+ gpio_set(GPP_E8, 1);
+ mdelay(100);
+ }
+}

To view, visit change 50013. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0ffac0ab02e52e9fbba7990f401d87e50a1b5154
Gerrit-Change-Number: 50013
Gerrit-PatchSet: 5
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Benjamin Doron <benjamin.doron00@gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier@gmail.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged