summaryrefslogtreecommitdiff
path: root/src/mainboard/msi/ms7d25
diff options
context:
space:
mode:
authorMichał Żygowski <michal.zygowski@3mdeb.com>2022-11-09 14:46:08 +0100
committerMichał Żygowski <michal.zygowski@3mdeb.com>2023-05-31 12:55:34 +0000
commit3289a3916b339f7cef7c5ac95940218fb957b43d (patch)
tree44567564c21f0abf71a629dc54cdf23cdb96aa6e /src/mainboard/msi/ms7d25
parent97c57fd079c2d097da632c9b5d3e0a5010e17cf5 (diff)
mb/msi/ms7d25: Add console die notification
Add beeps and blink SATA LED on critical errors. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Change-Id: I45b8b4fda00d58a1ab1d7dfab49d6f841bc0b000 Reviewed-on: https://review.coreboot.org/c/coreboot/+/69821 Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com> Reviewed-by: Himanshu Sahdev <himanshu.sahdev@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/msi/ms7d25')
-rw-r--r--src/mainboard/msi/ms7d25/Kconfig5
-rw-r--r--src/mainboard/msi/ms7d25/Makefile.inc3
-rw-r--r--src/mainboard/msi/ms7d25/die.c42
3 files changed, 46 insertions, 4 deletions
diff --git a/src/mainboard/msi/ms7d25/Kconfig b/src/mainboard/msi/ms7d25/Kconfig
index b5c1a46d19..653d915b1d 100644
--- a/src/mainboard/msi/ms7d25/Kconfig
+++ b/src/mainboard/msi/ms7d25/Kconfig
@@ -16,6 +16,7 @@ config BOARD_MSI_MS7D25
select INTEL_GMA_HAVE_VBT
select CRB_TPM
select HAVE_INTEL_PTT
+ select USE_LEGACY_8254_TIMER
if BOARD_MSI_MS7D25
@@ -49,10 +50,6 @@ config USE_PM_ACPI_TIMER
bool
default n
-config USE_LEGACY_8254_TIMER
- bool
- default n
-
config CBFS_SIZE
hex
default 0x1000000
diff --git a/src/mainboard/msi/ms7d25/Makefile.inc b/src/mainboard/msi/ms7d25/Makefile.inc
index 2e6759f093..deb5ff625a 100644
--- a/src/mainboard/msi/ms7d25/Makefile.inc
+++ b/src/mainboard/msi/ms7d25/Makefile.inc
@@ -5,3 +5,6 @@ bootblock-y += bootblock.c
romstage-y += romstage_fsp_params.c
ramstage-y += mainboard.c
+
+all-y += die.c
+smm-y += die.c
diff --git a/src/mainboard/msi/ms7d25/die.c b/src/mainboard/msi/ms7d25/die.c
new file mode 100644
index 0000000000..52b3338799
--- /dev/null
+++ b/src/mainboard/msi/ms7d25/die.c
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <console/console.h>
+#include <pc80/i8254.h>
+#include <soc/gpio.h>
+#include <delay.h>
+#include <gpio.h>
+
+static void beep_and_blink(void)
+{
+ static uint8_t blink = 0;
+ static uint8_t beep_count = 0;
+
+ gpio_set(GPP_E8, blink);
+ /* Beep 12 times at most, constant beeps may be annoying */
+ if (beep_count < 12) {
+ beep(800, 300);
+ mdelay(200);
+ beep_count++;
+ } else {
+ mdelay(500);
+ }
+
+ blink ^= 1;
+}
+
+void die_notify(void)
+{
+ if (ENV_POSTCAR)
+ return;
+
+ /* Make SATA LED blink and use PC SPKR */
+ gpio_output(GPP_E8, 0);
+
+ while (1) {
+ beep_and_blink();
+ beep_and_blink();
+ beep_and_blink();
+ beep_and_blink();
+ delay(2);
+ }
+}