mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Palmer <daniel@0x0f.com>
To: sammy@sammy.net, geert@linux-m68k.org, linux-m68k@lists.linux-m68k.org
Cc: linux-kernel@vger.kernel.org, Daniel Palmer <daniel@0x0f.com>
Subject: [PATCH 2/2] m68k: sun3: add an early boot console over the PROM
Date: Thu, 24 Sep 2026 20:18:51 +0900	[thread overview]
Message-ID: <20260924111851.3501100-3-daniel@0x0f.com> (raw)
In-Reply-To: <20260924111851.3501100-1-daniel@0x0f.com>

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@0x0f.com>
---
 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


  parent reply	other threads:[~2026-09-24 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 11:18 [PATCH 0/2] Make sun3 work again Daniel Palmer
2026-09-24 11:18 ` [PATCH 1/2] m68k: sun3: register RAM with memblock and set the low pfn limits Daniel Palmer
2026-09-24 11:18 ` Daniel Palmer [this message]
2026-09-24 11:32 ` [PATCH 0/2] Make sun3 work again John Paul Adrian Glaubitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260924111851.3501100-3-daniel@0x0f.com \
    --to=daniel@0x0f.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=sammy@sammy.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®