hw/char/pl011: fix baud rate calculation

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>
Message-id: 1408f62a2e45665816527d4845ffde650957d5ab.1665051588.git.baruchs-c@neureality.ai
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Baruch Siach 2022-10-06 13:19:48 +03:00 committed by Peter Maydell
parent 214a8da236
commit 31cb769c31

View File

@ -176,7 +176,7 @@ static unsigned int pl011_get_baudrate(const PL011State *s)
{ {
uint64_t clk; uint64_t clk;
if (s->fbrd == 0) { if (s->ibrd == 0) {
return 0; return 0;
} }