summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-01-27 23:32:27 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-03-03 09:01:32 +0000
commit68b447c2f8ed9b064ff3c915ae98ec8612d0ba3d (patch)
tree1016a1c9679e540b40cb3b25b42658ac1d7fbd18
parentbab7f18a434a56d152980ec0e50aabd09ee64bf8 (diff)
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>
-rw-r--r--src/mainboard/purism/librem_cnl/Makefile.inc2
-rw-r--r--src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc4
-rw-r--r--src/mainboard/purism/librem_cnl/variants/librem_mini/die.c22
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 8e3b5a6f36..c8cfa2212e 100644
--- a/src/mainboard/purism/librem_cnl/Makefile.inc
+++ b/src/mainboard/purism/librem_cnl/Makefile.inc
@@ -7,3 +7,5 @@ ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
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 0000000000..20ff43819f
--- /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 0000000000..8147abb170
--- /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);
+ }
+}