* [PATCH] serial : convert early_uart to earlycon for 8250 fix 3 alias [not found] ` <200706120955.44097.yinghai.lu@sun.com> @ 2007-06-21 17:42 ` Yinghai Lu 2007-06-22 11:58 ` Andy Whitcroft 0 siblings, 1 reply; 2+ messages in thread From: Yinghai Lu @ 2007-06-21 17:42 UTC (permalink / raw) To: Bjorn Helgaas, Alex Chiang, akpm, ak, Gerd Hoffmann, rmk, Andy Whitcroft Cc: Linux Kernel Mailing List [PATCH] serial : convert early_uart to earlycon for 8250 fix 3 alias make the console=uart,io,0x3f8,9600n8 like console=uart8250,io,0x3f8,9600 suggested by Andy Whitcroft. Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> --- a/Documentation/kernel-parameters.txt 2007-06-21 10:12:48.000000000 -0700 +++ b/Documentation/kernel-parameters.txt 2007-06-21 10:13:43.000000000 -0700 @@ -467,16 +467,16 @@ Documentation/networking/netconsole.txt for an alternative. - uart8250,io,<addr>[,options] - uart8250,mmio,<addr>[,options] + uart[8250],io,<addr>[,options] + uart[8250],mmio,<addr>[,options] Start an early, polled-mode console on the 8250/16550 UART at the specified I/O port or MMIO address, switching to the matching ttyS device later. The options are the same as for ttyS, above. earlycon= [KNL] Output early console device and options. - uart8250,io,<addr>[,options] - uart8250,mmio,<addr>[,options] + uart[8250],io,<addr>[,options] + uart[8250],mmio,<addr>[,options] Start an early, polled-mode console on the 8250/16550 UART at the specified I/O port or MMIO address. The options are the same as for ttyS, above. --- a/drivers/serial/8250_early.c 2007-06-21 10:04:25.000000000 -0700 +++ b/drivers/serial/8250_early.c 2007-06-21 10:12:08.000000000 -0700 @@ -210,8 +210,11 @@ int err; options = strstr(cmdline, "uart8250,"); - if (!options) - return 0; + if (!options) { + options = strstr(cmdline, "uart,"); + if (!options) + return 0; + } options = strchr(cmdline, ',') + 1; if ((err = early_serial8250_setup(options)) < 0) @@ -227,6 +230,7 @@ struct early_serial8250_device *device = &early_device; struct uart_port *port = &device->port; int line; + int ret; if (!device->port.membase && !device->port.iobase) return -ENODEV; @@ -235,8 +239,13 @@ if (line < 0) return -ENODEV; - return update_console_cmdline("uart", 8250, + ret = update_console_cmdline("uart", 8250, + "ttyS", line, device->options); + if (ret < 0) + ret = update_console_cmdline("uart", 0, "ttyS", line, device->options); + + return ret; } early_param("earlycon", setup_early_serial8250_console); ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] serial : convert early_uart to earlycon for 8250 fix 3 alias 2007-06-21 17:42 ` [PATCH] serial : convert early_uart to earlycon for 8250 fix 3 alias Yinghai Lu @ 2007-06-22 11:58 ` Andy Whitcroft 0 siblings, 0 replies; 2+ messages in thread From: Andy Whitcroft @ 2007-06-22 11:58 UTC (permalink / raw) To: Yinghai Lu Cc: Bjorn Helgaas, Alex Chiang, akpm, ak, Gerd Hoffmann, rmk, Linux Kernel Mailing List Yinghai Lu wrote: > [PATCH] serial : convert early_uart to earlycon for 8250 fix 3 alias > > make the console=uart,io,0x3f8,9600n8 like console=uart8250,io,0x3f8,9600 > suggested by Andy Whitcroft. > > Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> > > --- a/Documentation/kernel-parameters.txt 2007-06-21 10:12:48.000000000 -0700 > +++ b/Documentation/kernel-parameters.txt 2007-06-21 10:13:43.000000000 -0700 > @@ -467,16 +467,16 @@ > Documentation/networking/netconsole.txt for an > alternative. > > - uart8250,io,<addr>[,options] > - uart8250,mmio,<addr>[,options] > + uart[8250],io,<addr>[,options] > + uart[8250],mmio,<addr>[,options] > Start an early, polled-mode console on the 8250/16550 > UART at the specified I/O port or MMIO address, > switching to the matching ttyS device later. The > options are the same as for ttyS, above. > > earlycon= [KNL] Output early console device and options. > - uart8250,io,<addr>[,options] > - uart8250,mmio,<addr>[,options] > + uart[8250],io,<addr>[,options] > + uart[8250],mmio,<addr>[,options] > Start an early, polled-mode console on the 8250/16550 > UART at the specified I/O port or MMIO address. > The options are the same as for ttyS, above. > --- a/drivers/serial/8250_early.c 2007-06-21 10:04:25.000000000 -0700 > +++ b/drivers/serial/8250_early.c 2007-06-21 10:12:08.000000000 -0700 > @@ -210,8 +210,11 @@ > int err; > > options = strstr(cmdline, "uart8250,"); > - if (!options) > - return 0; > + if (!options) { > + options = strstr(cmdline, "uart,"); > + if (!options) > + return 0; > + } This could probabally be written as below and be a little clearer: options = strstr(cmdline, "uart8250,"); if (!options) options = strstr(cmdline, "uart,"); if (!options) return 0; > > options = strchr(cmdline, ',') + 1; > if ((err = early_serial8250_setup(options)) < 0) > @@ -227,6 +230,7 @@ > struct early_serial8250_device *device = &early_device; > struct uart_port *port = &device->port; > int line; > + int ret; > > if (!device->port.membase && !device->port.iobase) > return -ENODEV; > @@ -235,8 +239,13 @@ > if (line < 0) > return -ENODEV; > > - return update_console_cmdline("uart", 8250, > + ret = update_console_cmdline("uart", 8250, > + "ttyS", line, device->options); > + if (ret < 0) > + ret = update_console_cmdline("uart", 0, > "ttyS", line, device->options); > + > + return ret; > } > > early_param("earlycon", setup_early_serial8250_console); Other than the little nit above I have tested this on the machine which was all upset over the change and it works like a charm. Acked-by: Andy Whitcroft <apw@shadowen.org> -apw ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-22 11:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200706010002.l5102LN5031209@shell0.pdx.osdl.net>
[not found] ` <466EC86C.6000601@sun.com>
[not found] ` <200706120955.44097.yinghai.lu@sun.com>
2007-06-21 17:42 ` [PATCH] serial : convert early_uart to earlycon for 8250 fix 3 alias Yinghai Lu
2007-06-22 11:58 ` Andy Whitcroft
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox