qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/char/pl011: fix baud rate calculation


From: Baruch Siach
Subject: Re: [PATCH] hw/char/pl011: fix baud rate calculation
Date: Thu, 06 Oct 2022 14:12:43 +0300
User-agent: mu4e 1.8.7; emacs 27.1

Hi Peter,

On Thu, Oct 06 2022, Peter Maydell wrote:
> On Thu, 6 Oct 2022 at 11:20, Baruch Siach <baruch@tkos.co.il> wrote:
>>
>> The PL011 TRM says that "UARTIBRD = 0 is invalid and UARTFBRD is ignored
>> when this is the case". But the code looks at FBRD for the invalid case.
>> Fix this.
>>
>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>> ---
>>  hw/char/pl011.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Thanks for this patch (I'll review it in a bit). Did you find this
> because it caused problems for a guest, or just because you were
> looking at the QEMU source code? (If it's the former, we like to
> include some details of that in the commit message.)

Initially I only looked at the source code while trying to understand
how clock initialization and use is meant to work. Once I figured that
out I confirmed the issue with ATF code that first sets IBRD and then
FBRD.

Before patch:

pl011_baudrate_change new baudrate 0 (clk: 100000000hz, ibrd: 54, fbrd: 0)
pl011_baudrate_change new baudrate 115204 (clk: 100000000hz, ibrd: 54, fbrd: 16)

With patch:

pl011_baudrate_change new baudrate 115740 (clk: 100000000hz, ibrd: 54, fbrd: 0)
pl011_baudrate_change new baudrate 115204 (clk: 100000000hz, ibrd: 54, fbrd: 16)

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -



reply via email to

[Prev in Thread] Current Thread [Next in Thread]