Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1251726
| From | Peter Hurley <peter@hurleysoftware.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter |
| Date | 2015-10-20 16:10 +0200 |
| Message-ID | <qlFLZ-5WV-35@gated-at.bofh.it> (permalink) |
| References | <qlvWi-8nk-5@gated-at.bofh.it> <qlvWi-8nk-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 10/19/2015 11:36 PM, Masahiro Yamada wrote:
> The input clock frequency varies from device to device, but the
> earlycon uses the fixed frequency (BASE_BAUD * 16). It makes
> impossible to set the correct divisor to the register.
So the bootloader hasn't setup the serial port?
> This commit allows to specify the input clock frequency from the
> kernel-parameter.
>
> [Example]
>
> earlycon=uart8250,mmio32,0x43fb0000,115200,12288000
>
> The input clock frequency (12288000, in this case) should be specified
> after the baudrate. If not specified, the default (BASE_BAUD * 16) is
> used.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> Changes in v2: None
>
> drivers/tty/serial/earlycon.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> index 07f7393..8030765 100644
> --- a/drivers/tty/serial/earlycon.c
> +++ b/drivers/tty/serial/earlycon.c
> @@ -95,6 +95,13 @@ static int __init parse_options(struct earlycon_device *device, char *options)
> length = min(strcspn(options, " ") + 1,
> (size_t)(sizeof(device->options)));
> strlcpy(device->options, options, length);
> + options = strchr(options, ',');
> + if (options) {
> + options++;
> + port->uartclk = simple_strtoul(options, NULL, 0);
> + }
> + if (!port->uartclk)
> + port->uartclk = BASE_BAUD * 16;
> }
>
> if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM16 ||
> @@ -122,7 +129,6 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match)
> if (buf && !parse_options(&early_console_dev, buf))
> buf = NULL;
>
> - port->uartclk = BASE_BAUD * 16;
> if (port->mapbase)
> port->membase = earlycon_map(port->mapbase, 64);
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/2] serial: console: add two features Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-10-20 05:40 +0200
[PATCH v2 1/2] serial: support register interface with 16-bit stride for console Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-10-20 05:40 +0200
Re: [PATCH v2 1/2] serial: support register interface with 16-bit stride for console Peter Hurley <peter@hurleysoftware.com> - 2015-10-20 15:50 +0200
[PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-10-20 05:40 +0200
Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter Peter Hurley <peter@hurleysoftware.com> - 2015-10-20 16:10 +0200
Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-10-21 03:30 +0200
Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter Peter Hurley <peter@hurleysoftware.com> - 2015-10-21 14:30 +0200
Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter Peter Hurley <peter@hurleysoftware.com> - 2015-10-21 17:40 +0200
Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-10-22 06:00 +0200
Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-10-21 17:40 +0200
Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter Rob Herring <robh@kernel.org> - 2015-10-22 17:40 +0200
Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter Masahiro Yamada <yamada.masahiro@socionext.com> - 2015-10-23 13:20 +0200
csiph-web