[PATCH v2 52/53] MIPS: SGI-IP27: show the OS state on the Fuel and Tezro front panels
From: Imre Kaloz
Date: Tue Oct 13 2026 - 10:09:58 EST
Register the front-panel LED device on a Fuel and a deskside Tezro and
blink the red LED on panic. A Tezro also shows "Linux booting", "Linux
running" or "Linux panic" on line 2 of its L1 display.
Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
---
arch/mips/sgi-ip27/ip27-init.c | 52 ++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c
index e657155ef7c9..f7de09515c0c 100644
--- a/arch/mips/sgi-ip27/ip27-init.c
+++ b/arch/mips/sgi-ip27/ip27-init.c
@@ -13,6 +13,9 @@
#include <linux/smp.h>
#include <linux/mm.h>
#include <linux/export.h>
+#include <linux/notifier.h>
+#include <linux/panic_notifier.h>
+#include <linux/platform_device.h>
#include <linux/cpumask.h>
#include <linux/ctype.h>
#include <asm/bootinfo.h>
@@ -122,6 +125,8 @@ static const struct {
{ 'Q', "SGI Tezro Rackmount", NULL },
};
+static int ip27_brick_type;
+
static bool __init ip27_has_graphics(void)
{
nasid_t nasid;
@@ -145,6 +150,7 @@ static void __init ip27_set_machine_name(void)
brick_type = l1_read_brick_type();
if (brick_type < 0)
return;
+ ip27_brick_type = brick_type;
gfx = ip27_has_graphics();
@@ -165,6 +171,52 @@ static void __init ip27_set_machine_name(void)
gfx ? "with" : "without");
}
+/*
+ * A Fuel (brick type 'A') and a deskside Tezro ('9') have L1-driven
+ * front-panel LEDs, the Tezro also an L1 display. A blinking red LED,
+ * with the white one off, marks a panic.
+ */
+static int ip27_panel_panic(struct notifier_block *nb, unsigned long event,
+ void *ptr)
+{
+ l1_set_leds(L1_LED_RED, L1_LED_BLINK);
+ if (ip27_brick_type == '9')
+ l1_set_display("Linux panic");
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block ip27_panel_panic_nb = {
+ .notifier_call = ip27_panel_panic,
+};
+
+static int __init ip27_panel_init(void)
+{
+ struct platform_device *pdev;
+
+ if (ip27_brick_type != 'A' && ip27_brick_type != '9')
+ return 0;
+
+ atomic_notifier_chain_register(&panic_notifier_list,
+ &ip27_panel_panic_nb);
+ if (ip27_brick_type == '9')
+ l1_set_display("Linux booting");
+
+ pdev = platform_device_register_simple("ip35-leds", PLATFORM_DEVID_NONE,
+ NULL, 0);
+ return PTR_ERR_OR_ZERO(pdev);
+}
+arch_initcall(ip27_panel_init);
+
+static int __init ip27_panel_running(void)
+{
+ if (ip27_brick_type == '9')
+ l1_set_display("Linux running");
+
+ return 0;
+}
+late_initcall_sync(ip27_panel_running);
+
/*
* Prefer ttyS0 at the baud rate the IP35 PROM recorded for its console
* UART in the KLCONFIG header.
--
2.47.3