Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1252971
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 2/2] serial: earlycon: allow to specify uartclk in earlycon kernel-parameter |
| Date | 2015-10-21 17:40 +0200 |
| Message-ID | <qm3EC-7ex-27@gated-at.bofh.it> (permalink) |
| References | <qlvWi-8nk-5@gated-at.bofh.it> <qlvWi-8nk-9@gated-at.bofh.it> <qlFLZ-5WV-35@gated-at.bofh.it> <qlQo1-4vM-3@gated-at.bofh.it> <qm0GK-2RY-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Peter.
2015-10-21 21:27 GMT+09:00 Peter Hurley <peter@hurleysoftware.com>:
> On 10/20/2015 09:20 PM, Masahiro Yamada wrote:
>> Hi Peter,
>> (+ Rob Herring, Stefan Agner)
>>
>> 2015-10-20 23:00 GMT+09:00 Peter Hurley <peter@hurleysoftware.com>:
>>> 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?
>>
>> It does.
>> I use U-boot and the serial port is already set up by U-boot.
>>
>>
>> But, earlycon setup functions update hardware registers.
>> See early_serial8250_setup(), ingenic_early_console_setup(), etc.
>>
>>
>> Without port->uartclk set to a valid value,
>> the init code in earlycon setup does not make sense.
>>
>>
>> What I want to clarify is,
>> what should we do in the earlycon setup function?
>>
>> Currently, I see
>> [1] set device->con->write callback
>> [2] initialize UART port registers
>>
>>
>> For [2], we need to know baudrate and input clock frequency.
>> (and the latter is missing, that's why my patch is here.)
>>
>>
>> In order to be independent of a boot loader, we also need
>> [3] pinctrl (pin-muxing)
>>
>> But, it is difficult to handle pinctrl in the earlycon framework.
>>
>>
>> If we depend on a boot loader, [2] is meaningless. [1] is enough.
>
> The 8250 earlycon doesn't try to initialize the hardware (other than
> masking interrupts) if the baud rate is uninitialized
> (!device->baud in early_serial8250_setup()).
>
Right.
If it is always correct to preserve the initialization done by boot-loader,
the following code in 8250_early.c does not make sense.
Delete?
divisor = DIV_ROUND_CLOSEST(port->uartclk, 16 * device->baud);
c = serial8250_early_in(port, UART_LCR);
serial8250_early_out(port, UART_LCR, c | UART_LCR_DLAB);
serial8250_early_out(port, UART_DLL, divisor & 0xff);
serial8250_early_out(port, UART_DLM, (divisor >> 8) & 0xff);
serial8250_early_out(port, UART_LCR, c & ~UART_LCR_DLAB);
--
Best Regards
Masahiro Yamada
--
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