From 68b447c2f8ed9b064ff3c915ae98ec8612d0ba3d Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 27 Jan 2021 23:32:27 +0100 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/50013 Reviewed-by: Matt DeVillier Reviewed-by: Paul Menzel Reviewed-by: Benjamin Doron Tested-by: build bot (Jenkins) --- src/mainboard/purism/librem_cnl/Makefile.inc | 2 ++ .../librem_cnl/variants/librem_mini/Makefile.inc | 4 ++++ .../purism/librem_cnl/variants/librem_mini/die.c | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc create mode 100644 src/mainboard/purism/librem_cnl/variants/librem_mini/die.c (limited to 'src/mainboard/purism') 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 +#include +#include +#include + +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); + } +} -- cgit v1.2.3