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>
This commit is contained in:
Angel Pons 2021-01-27 23:32:27 +01:00 committed by Patrick Georgi
parent bab7f18a43
commit 68b447c2f8
3 changed files with 28 additions and 0 deletions

View File

@ -7,3 +7,5 @@ ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
ramstage-y += ramstage.c ramstage-y += ramstage.c
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
subdirs-y += variants/$(VARIANT_DIR)/

View File

@ -0,0 +1,4 @@
## SPDX-License-Identifier: GPL-2.0-only
all-y += die.c
smm-y += die.c

View File

@ -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);
}
}