public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: linux-kernel@vger.kernel.org
Cc: linux-ia64@vger.kernel.org, Russell King <rmk@arm.linux.org.uk>
Subject: Re: [PATCH] early serial console support
Date: Thu, 01 Apr 2004 22:24:43 +0000	[thread overview]
Message-ID: <200404011524.43700.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <200404011458.04264.bjorn.helgaas@hp.com>

This updates ia64 to use the early serial console in the previous
patch.  It depends on that patch, so please don't apply it unless/
until that is applied.

The benefits to ia64 are:
    - /dev/ttyS<N> naming is now independent of any EFI console
      configuration or "console=" arguments.
    - Serial console can work a little earlier because it no longer
      depends on ACPI for interrupt registration.
    - It probably works early enough to obsolete the EARLY_PRINTK
      stuff.

"console=serial" means use the first device described in the HCDP (or
COM1 at I/O port 0x3f8 if no HCDP) as the early and normal console.
The baud rate is obtained from the HCDP or probed from the UART if
not specified.

"console=ttyS<N>" means use ttyS<N> as the console.  There will be no
early console.  The baud rate must be specified unless it is 9600.

Gotchas:
    - Old kernels don't understand "console=serial", so elilo.conf
      changes are needed if you want an early console.
    - Old kernels named ttyS devices in different orders, depending on
      which one was selected as the EFI console device, so you may
      need to add or change a getty entry in /etc/inittab.

For example, a machine with a built-in serial port plus an MP might
have these ports:

			        old, EFI	old, EFI	new, EFI
		   MMIO		console		console		console
		  address	on builtin	on MP		anywhere
		----------	---------	--------	--------
    builtin	0xff5e0000	ttyS0		ttyS1		ttyS0
    MP UPS	0xf8031000	ttyS1		ttyS2		ttyS1
    MP Console	0xf8030000	ttyS2		ttyS0		ttyS2
    MP 2	0xf8030010	ttyS3		ttyS3		ttyS3
    MP 3	0xf8030038	ttyS4		ttyS4		ttyS4

If you're using the MP console port (the port labelled "console" on
the 3-headed cable), it used to be /dev/ttyS0, but is now /dev/ttyS2.

Troubleshooting:
    - No kernel output after "Uncompressing Linux... done":
	-> You're using an MP port as the console and specified
	   "console=ttyS0".  This port is now named something else.
	   Use "console=serial" instead.
	-> Multiple UARTs selected as EFI console devices, and you're
	   looking at the wrong one.  Make sure only one UART is
	   selected (use the Boot Manager "Boot option maintenance"
	   menu).

    - Long pause (60+ seconds) between "Uncompressing Linux... done"
      and start of kernel output:
	-> No early console, probably because you used "console=ttyS0".
	   Replace it with "console=serial".

    - Kernel and init script output is fine, but no "login:" prompt:
	-> Missing getty entry in /etc/inittab.  Add the appropriate
	   entry based on the kernel "Starting serial console on
	   ttyS<N>" message.

    - "login:" prompt, but can't login as root:
	-> Add entry to /etc/securetty for console tty.


=== arch/ia64/kernel/setup.c 1.70 vs edited ==--- 1.70/arch/ia64/kernel/setup.c	Wed Mar 17 05:46:59 2004
+++ edited/arch/ia64/kernel/setup.c	Thu Apr  1 12:39:14 2004
@@ -263,20 +263,34 @@
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
 static void __init
-setup_serial_legacy (void)
+setup_serial_legacy (char *cmdline)
 {
+	static char buf[32];
+	char *options, *space;
 	struct uart_port port;
-	unsigned int i, iobase[] = {0x3f8, 0x2f8};
 
-	printk(KERN_INFO "Registering legacy COM ports for serial console\n");
+	if (!strstr(cmdline, "console=serial"))
+		return;
+
+	/*
+	 * We have no idea where the console UART is, but the
+	 * user explicitly requested it, so assume it's COM1.
+	 */
 	memset(&port, 0, sizeof(port));
 	port.iotype = SERIAL_IO_PORT;
-	port.uartclk = BASE_BAUD * 16;
-	for (i = 0; i < ARRAY_SIZE(iobase); i++) {
-		port.line = i;
-		port.iobase = iobase[i];
-		early_serial_setup(&port);
+	port.iobase = 0x3f8;
+
+	options = strstr(cmdline, "console=serial,");
+	if (options) {
+		options += 15;	// strlen("console=serial,")
+		strlcpy(buf, options, sizeof(buf));
+		space = strchr(buf, ' ');
+		if (space)
+			*space = 0;
+		options = buf;
 	}
+
+	serial8250_early_console_setup(&port, options);
 }
 #endif
 
@@ -297,6 +311,17 @@
 	machvec_init(acpi_get_sysname());
 #endif
 
+#ifdef CONFIG_SERIAL_8250_CONSOLE
+#ifdef CONFIG_SERIAL_8250_HCDP
+	if (efi.hcdp) {
+		extern void setup_hcdp_console(void *, char *);
+		setup_hcdp_console(efi.hcdp, *cmdline_p);
+	}
+#endif
+	if (!efi.hcdp)
+		setup_serial_legacy(*cmdline_p);
+#endif
+
 #ifdef CONFIG_ACPI_BOOT
 	/* Initialize the ACPI boot-time table parser */
 	acpi_table_init();
@@ -322,26 +347,6 @@
 
 #ifdef CONFIG_ACPI_BOOT
 	acpi_boot_init();
-#endif
-#ifdef CONFIG_SERIAL_8250_CONSOLE
-#ifdef CONFIG_SERIAL_8250_HCDP
-	if (efi.hcdp) {
-		void setup_serial_hcdp(void *);
-		setup_serial_hcdp(efi.hcdp);
-	}
-#endif
-	/*
-	 * Without HCDP, we won't discover any serial ports until the serial driver looks
-	 * in the ACPI namespace.  If ACPI claims there are some legacy devices, register
-	 * the legacy COM ports so serial console works earlier.  This is slightly dangerous
-	 * because we don't *really* know whether there's anything there, but we hope that
-	 * all new boxes will implement HCDP.
-	 */
-	{
-		extern unsigned char acpi_legacy_devices;
-		if (!efi.hcdp && acpi_legacy_devices)
-			setup_serial_legacy();
-	}
 #endif
 
 #ifdef CONFIG_VT

       reply	other threads:[~2004-04-01 22:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200404011458.04264.bjorn.helgaas@hp.com>
2004-04-01 22:24 ` Bjorn Helgaas [this message]
2004-04-02 17:18   ` [PATCH] early serial console support (updated ia64 part) Bjorn Helgaas
2004-04-01 22:21 [PATCH] early serial console support Bjorn Helgaas
2004-04-01 22:34 ` Matthew Wilcox
2004-04-02  1:40 ` David Mosberger
2004-04-10  8:28 ` Russell King
2004-04-22 23:25 ` Bjorn Helgaas

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=200404011524.43700.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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