Re: [PATCH -next 07/12] serial: earlycon: Common log banner for command line and DT
Hi Geert, On 03/05/2015 07:02 AM, Geert Uytterhoeven wrote: > Hi Peter, > > On Wed, Mar 4, 2015 at 6:24 PM, Peter Hurley wrote: >> --- a/drivers/tty/serial/earlycon.c >> +++ b/drivers/tty/serial/earlycon.c >> @@ -69,6 +69,7 @@ static void __init earlycon_init(struct earlycon_device >> *device, >> const char *name) >> { >> struct console *earlycon = device->con; >> + struct uart_port *port = >port; >> const char *s; >> size_t len; >> >> @@ -82,6 +83,16 @@ static void __init earlycon_init(struct earlycon_device >> *device, >> len = s - name; >> strlcpy(earlycon->name, name, min(len + 1, sizeof(earlycon->name))); >> earlycon->data = _console_dev; >> + >> + if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM32) >> + pr_info("Early serial console at MMIO%s 0x%llx (options >> '%s')\n", >> + (port->iotype == UPIO_MEM32) ? "32" : "", >> + (unsigned long long)port->mapbase, > > I know you're just moving this piece of code around, but mapbase is a > resource_size_t (it should actually be phys_addr_t, which probably didn't > exist in 2007), so it should be printed using %pa and passing a reference, > instead of %llx and using a cast. Good point. I could add that fix to the 8/12 patch which adds the earlycon name to the banner. I have to respin anyway because of a rebase error that breaks x86 build. Regards, Peter Hurley -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -next 07/12] serial: earlycon: Common log banner for command line and DT
Hi Peter, On Wed, Mar 4, 2015 at 6:24 PM, Peter Hurley wrote: > --- a/drivers/tty/serial/earlycon.c > +++ b/drivers/tty/serial/earlycon.c > @@ -69,6 +69,7 @@ static void __init earlycon_init(struct earlycon_device > *device, > const char *name) > { > struct console *earlycon = device->con; > + struct uart_port *port = >port; > const char *s; > size_t len; > > @@ -82,6 +83,16 @@ static void __init earlycon_init(struct earlycon_device > *device, > len = s - name; > strlcpy(earlycon->name, name, min(len + 1, sizeof(earlycon->name))); > earlycon->data = _console_dev; > + > + if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM32) > + pr_info("Early serial console at MMIO%s 0x%llx (options > '%s')\n", > + (port->iotype == UPIO_MEM32) ? "32" : "", > + (unsigned long long)port->mapbase, I know you're just moving this piece of code around, but mapbase is a resource_size_t (it should actually be phys_addr_t, which probably didn't exist in 2007), so it should be printed using %pa and passing a reference, instead of %llx and using a cast. > + device->options); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -next 07/12] serial: earlycon: Common log banner for command line and DT
Hi Peter, On Wed, Mar 4, 2015 at 6:24 PM, Peter Hurley pe...@hurleysoftware.com wrote: --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -69,6 +69,7 @@ static void __init earlycon_init(struct earlycon_device *device, const char *name) { struct console *earlycon = device-con; + struct uart_port *port = device-port; const char *s; size_t len; @@ -82,6 +83,16 @@ static void __init earlycon_init(struct earlycon_device *device, len = s - name; strlcpy(earlycon-name, name, min(len + 1, sizeof(earlycon-name))); earlycon-data = early_console_dev; + + if (port-iotype == UPIO_MEM || port-iotype == UPIO_MEM32) + pr_info(Early serial console at MMIO%s 0x%llx (options '%s')\n, + (port-iotype == UPIO_MEM32) ? 32 : , + (unsigned long long)port-mapbase, I know you're just moving this piece of code around, but mapbase is a resource_size_t (it should actually be phys_addr_t, which probably didn't exist in 2007), so it should be printed using %pa and passing a reference, instead of %llx and using a cast. + device-options); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say programmer or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -next 07/12] serial: earlycon: Common log banner for command line and DT
Hi Geert, On 03/05/2015 07:02 AM, Geert Uytterhoeven wrote: Hi Peter, On Wed, Mar 4, 2015 at 6:24 PM, Peter Hurley pe...@hurleysoftware.com wrote: --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -69,6 +69,7 @@ static void __init earlycon_init(struct earlycon_device *device, const char *name) { struct console *earlycon = device-con; + struct uart_port *port = device-port; const char *s; size_t len; @@ -82,6 +83,16 @@ static void __init earlycon_init(struct earlycon_device *device, len = s - name; strlcpy(earlycon-name, name, min(len + 1, sizeof(earlycon-name))); earlycon-data = early_console_dev; + + if (port-iotype == UPIO_MEM || port-iotype == UPIO_MEM32) + pr_info(Early serial console at MMIO%s 0x%llx (options '%s')\n, + (port-iotype == UPIO_MEM32) ? 32 : , + (unsigned long long)port-mapbase, I know you're just moving this piece of code around, but mapbase is a resource_size_t (it should actually be phys_addr_t, which probably didn't exist in 2007), so it should be printed using %pa and passing a reference, instead of %llx and using a cast. Good point. I could add that fix to the 8/12 patch which adds the earlycon name to the banner. I have to respin anyway because of a rebase error that breaks x86 build. Regards, Peter Hurley -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH -next 07/12] serial: earlycon: Common log banner for command line and DT
Refactor the command line earlycon banner into earlycon_init() so both earlycon startup methods output an info banner. Signed-off-by: Peter Hurley --- drivers/tty/serial/earlycon.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index b1a4bd1..522ceb8 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -69,6 +69,7 @@ static void __init earlycon_init(struct earlycon_device *device, const char *name) { struct console *earlycon = device->con; + struct uart_port *port = >port; const char *s; size_t len; @@ -82,6 +83,16 @@ static void __init earlycon_init(struct earlycon_device *device, len = s - name; strlcpy(earlycon->name, name, min(len + 1, sizeof(earlycon->name))); earlycon->data = _console_dev; + + if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM32) + pr_info("Early serial console at MMIO%s 0x%llx (options '%s')\n", + (port->iotype == UPIO_MEM32) ? "32" : "", + (unsigned long long)port->mapbase, + device->options); + else + pr_info("Early serial console at I/O port 0x%lx (options '%s')\n", + port->iobase, + device->options); } static int __init parse_options(struct earlycon_device *device, char *options) @@ -113,16 +124,6 @@ static int __init parse_options(struct earlycon_device *device, char *options) strlcpy(device->options, options, length); } - if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM32) - pr_info("Early serial console at MMIO%s 0x%llx (options '%s')\n", - (port->iotype == UPIO_MEM32) ? "32" : "", - (unsigned long long)port->mapbase, - device->options); - else - pr_info("Early serial console at I/O port 0x%lx (options '%s')\n", - port->iobase, - device->options); - return 0; } -- 2.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH -next 07/12] serial: earlycon: Common log banner for command line and DT
Refactor the command line earlycon banner into earlycon_init() so both earlycon startup methods output an info banner. Signed-off-by: Peter Hurley pe...@hurleysoftware.com --- drivers/tty/serial/earlycon.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index b1a4bd1..522ceb8 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -69,6 +69,7 @@ static void __init earlycon_init(struct earlycon_device *device, const char *name) { struct console *earlycon = device-con; + struct uart_port *port = device-port; const char *s; size_t len; @@ -82,6 +83,16 @@ static void __init earlycon_init(struct earlycon_device *device, len = s - name; strlcpy(earlycon-name, name, min(len + 1, sizeof(earlycon-name))); earlycon-data = early_console_dev; + + if (port-iotype == UPIO_MEM || port-iotype == UPIO_MEM32) + pr_info(Early serial console at MMIO%s 0x%llx (options '%s')\n, + (port-iotype == UPIO_MEM32) ? 32 : , + (unsigned long long)port-mapbase, + device-options); + else + pr_info(Early serial console at I/O port 0x%lx (options '%s')\n, + port-iobase, + device-options); } static int __init parse_options(struct earlycon_device *device, char *options) @@ -113,16 +124,6 @@ static int __init parse_options(struct earlycon_device *device, char *options) strlcpy(device-options, options, length); } - if (port-iotype == UPIO_MEM || port-iotype == UPIO_MEM32) - pr_info(Early serial console at MMIO%s 0x%llx (options '%s')\n, - (port-iotype == UPIO_MEM32) ? 32 : , - (unsigned long long)port-mapbase, - device-options); - else - pr_info(Early serial console at I/O port 0x%lx (options '%s')\n, - port-iobase, - device-options); - return 0; } -- 2.3.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/