Re: Changes to UART ns8250

From: Zbigniew Bodek <zbb_at_freebsd.org>
Date: Sat, 26 Oct 2013 19:34:50 +0200
Hello again.

I've just committed the patch:
http://svnweb.freebsd.org/base?view=revision&revision=257170

Thanks and best regards
Zbigniew Bodek

2013/10/26 Zbigniew Bodek <zbb_at_freebsd.org>:
> Hello Everyone,
>
> I'm attaching the newest version of the ns8250 UART patch.
> After some discussions I decided to go with busy-wait + timeout solution.
> The applied delay should handle exotic corner cases (please notice
> that we can't use ns8250_delay()
> to get the actual single transmission time since we know that LCR is locked).
>
> If there are no objections then I would like to commit this soon.
>
> Best regards
> Zbigniew Bodek
>
> 2013/10/9 Zbigniew Bodek <zbb_at_freebsd.org>:
>> Hello Ganbold.
>>
>> Thank you for testing the patch and pointing those issue out.
>> My detection log from Armada XP:
>>
>> uart0: <16550 or compatible> mem 0xd0012000-0xd001201f irq 41 on simplebus0
>> uart0: console (115200,n,8,1)
>> uart1: <16550 or compatible> mem 0xd0012100-0xd001211f irq 42 on simplebus0
>> uart2: <16550 or compatible> mem 0xd0012200-0xd001221f irq 43 on simplebus0
>> uart3: <16550 or compatible> mem 0xd0012300-0xd001231f irq 44 on simplebus0
>>
>> Is there a possibility to download a datasheet for RK30xx so that I could
>> verify what is required for it's UART?
>> The patch is causing that we only wait until UART is not busy anymore. I
>> can't find why would that cause problems
>> if your UART requires busy detection anyway.
>>
>> Best regards
>> Zbigniew Bodek
>>
>>
>>
>> 2013/10/9 Ganbold Tsagaankhuu <ganbold_at_gmail.com>
>>>
>>>
>>>
>>>
>>> On Tue, Oct 8, 2013 at 9:58 AM, Ganbold Tsagaankhuu <ganbold_at_gmail.com>
>>> wrote:
>>>>
>>>> Zbigniew,
>>>>
>>>>
>>>> On Tue, Oct 8, 2013 at 3:54 AM, Zbigniew Bodek <zbb_at_freebsd.org> wrote:
>>>>>
>>>>> Hello.
>>>>>
>>>>> I would like to present a patch for ns8250 serial that I would like to
>>>>> commit in the near future (if there are no objections).
>>>>>
>>>>> The patch is fixing newest DesignWare UART with busy detection.
>>>>> During frequency divisors configuration when UART is busy transferring
>>>>> or
>>>>> receiving data, line control register manipulation will not take effect.
>>>>> Therefore, we will not set divisor latch access bit and we will corrupt
>>>>> LCR
>>>>> instead of configuring divisors.
>>>>> It is necessary to wait until UART finishes all transfers to proceed
>>>>> with
>>>>> the configuration.
>>>>>
>>>>> This was detected on Armada XP as UART fails on this issue 100/100
>>>>> attempts.
>>>>> The patch was tested by kevlo_at_ and me and it works on our Armada XP -
>>>>> based
>>>>> systems.
>>>>>
>>>>> Please send your comment or remarks if there are any.
>>>>
>>>>
>>>> I'm trying your patch on r254983.
>>>> Tried on 2 boards (Cubieboard2 (Allwinner A20 SoC - dual Cortex A7) and
>>>> Radxa Rock (Rockchip RK3188 - Quad Cortex A9)). Both seem to have some sort
>>>> of DesignWare uart.
>>>>
>>>> 1. It works fine on Cubieboard2. Uart dmesg is like:
>>>>
>>>> uart0: <16750 or compatible> mem 0x1c28000-0x1c283ff irq 33 on simplebus0
>>>> uart0: console (115200,n,8,1)
>>>>
>>>> 2. No any printing on screen in case of Radxa Rock. Without your patch
>>>> uart dmesg is like:
>>>>
>>>> uart0: <16650 or compatible> mem 0x20064000-0x200643ff irq 68 on
>>>> simplebus0
>>>> uart0: console (115200,n,8,1)
>>>>
>>>> In case of RK3188 SoC, it seems booting FreeBSD kernel seems very
>>>> fragile, not sure yet what is causing the problem.
>>>> Even with stock ns8250 some version later than r254983 didn't show/print
>>>> anything on serial console few days ago.
>>>> Only thing so far I know is this r254983 (with some patch) works in my
>>>> case on RK3188 SoC based board.
>>>
>>>
>>>
>>> Zbigniew,
>>>
>>> Just tried again your patch on RK30xx board. I was able to see boot
>>> messages on screen.
>>> This uart detected as:
>>> ...
>>> uart0: <16650 or compatible> mem 0x20064000-0x200643ff irq 68 on
>>> simplebus0
>>> uart0: console (115200,n,8,1)
>>> uart0: fast interrupt
>>> ...
>>> Can you show me your uart detection log?
>>> It seems this DW uart of RK30xx is different than DW uart of A10/A20.
>>> Boot simply stops printing "start_init: trying /sbin/init".
>>>
>>> thanks,
>>>
>>> Ganbold
>>>
>>>
>>>>
>>>>
>>>> thanks,
>>>>
>>>> Ganbold
>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>> Best regards
>>>>> Zbigniew Bodek
>>>>>
>>>>> _______________________________________________
>>>>> freebsd-current_at_freebsd.org mailing list
>>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-current
>>>>> To unsubscribe, send any mail to
>>>>> "freebsd-current-unsubscribe_at_freebsd.org"
>>>>
>>>>
>>>
>>
Received on Sat Oct 26 2013 - 15:34:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:43 UTC