[PATCH 2/2] m68k: sun3: add an early boot console over the PROM
From: Daniel Palmer
Date: Thu Sep 24 2026 - 07:25:30 EST
Register a CON_BOOT console that writes through the resident PROM's
polled character output (prom_putchar()).
Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Daniel Palmer <daniel@xxxxxxxx>
---
arch/m68k/sun3/config.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index cb4e19b95a1b..49821c28a641 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -145,11 +145,33 @@ static void __init sun3_bootmem_alloc(unsigned long memory_start,
m68k_setup_node(0);
}
+/* Early boot console over the resident PROM's polled character output. */
+static void sun3_early_console_write(struct console *con, const char *s,
+ unsigned int n)
+{
+ while (n-- > 0) {
+ if (*s == '\n')
+ prom_putchar('\r');
+ prom_putchar(*s++);
+ }
+}
+
+static struct console sun3_early_console = {
+ .name = "sun3prom",
+ .write = sun3_early_console_write,
+ .flags = CON_PRINTBUFFER | CON_BOOT,
+ .index = -1,
+};
void __init config_sun3(void)
{
unsigned long memory_start, memory_end;
+ if (!sun3_early_console.data) {
+ sun3_early_console.data = &sun3_early_console;
+ register_console(&sun3_early_console);
+ }
+
pr_info("ARCH: SUN3\n");
idprom_init();
--
2.55.0