From: Jesse Barnes <jbarnes@engr.sgi.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] early console registration
Date: Tue, 22 Jun 2004 17:54:27 +0000 [thread overview]
Message-ID: <200406221354.27322.jbarnes@engr.sgi.com> (raw)
In-Reply-To: <200405141425.59867.jbarnes@engr.sgi.com>
[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]
> > But AFAIK, there is no such code now, and I don't have any better ideas,
> > so maybe we should just go with your ia64-specific patch for now.
>
> Sounds good to me.
Bjorn is ok with it, so here it is again. Pat, can you fix up the #ifdef
check for your new driver when it gets in? You should be able to reuse the
function name...
Allow consoles to register early if they're capable of early output. If one
of them registers successfully, set CPU 0 online so that printk() will
actually call the console drivers.
Drivers that are capable of early output can add themselves to the
early_console_setup routine in the following form:
...
#ifdef CONFIG_SGI_L1_SERIAL_CONSOLE
{
extern int sn_serial_console_early_setup(void);
if (!sn_serial_console_early_setup())
return 0;
}
#endif
...
#ifdef CONFIG_FOO_CONSOLE
{
extern int foo_early_setup(void);
if (!foo_early_setup())
return 0;
}
#endif
...
Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
Thanks,
Jesse
[-- Attachment #2: early-console-setup.patch --]
[-- Type: text/x-diff, Size: 1146 bytes --]
===== arch/ia64/kernel/setup.c 1.74 vs edited =====
--- 1.74/arch/ia64/kernel/setup.c 2004-06-05 01:15:10 -04:00
+++ edited/arch/ia64/kernel/setup.c 2004-06-22 13:51:27 -04:00
@@ -280,6 +280,28 @@
}
#endif
+/**
+ * early_console_setup - setup debugging console
+ *
+ * Consoles started here require little enough setup that we can start using
+ * them very early in the boot process, either right after the machine
+ * vector initialization, or even before if the drivers can detect their hw.
+ *
+ * Returns non-zero if a console couldn't be setup.
+ */
+static int __init early_console_setup(void)
+{
+#ifdef CONFIG_SGI_L1_SERIAL_CONSOLE
+ {
+ extern int sn_serial_console_early_setup(void);
+ if(!sn_serial_console_early_setup())
+ return 0;
+ }
+#endif
+
+ return -1;
+}
+
void __init
setup_arch (char **cmdline_p)
{
@@ -296,6 +318,10 @@
#ifdef CONFIG_IA64_GENERIC
machvec_init(acpi_get_sysname());
#endif
+
+ /* If we register an early console, allow CPU 0 to printk */
+ if (!early_console_setup())
+ cpu_set(smp_processor_id(), cpu_online_map);
#ifdef CONFIG_ACPI_BOOT
/* Initialize the ACPI boot-time table parser */
prev parent reply other threads:[~2004-06-22 17:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-14 21:25 [PATCH] early console registration Jesse Barnes
2004-05-20 1:17 ` David Mosberger
2004-05-20 13:03 ` Jesse Barnes
2004-05-20 15:18 ` Bjorn Helgaas
2004-05-20 15:26 ` Jesse Barnes
2004-06-03 21:49 ` Jesse Barnes
2004-06-14 22:27 ` Bjorn Helgaas
2004-06-15 13:12 ` Jesse Barnes
2004-06-16 20:22 ` Bjorn Helgaas
2004-06-16 20:40 ` Jesse Barnes
2004-06-22 17:54 ` Jesse Barnes [this message]
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=200406221354.27322.jbarnes@engr.sgi.com \
--to=jbarnes@engr.sgi.com \
--cc=linux-ia64@vger.kernel.org \
/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