]> xenbits.xensource.com Git - people/pauldu/qemu.git/commitdiff
hw/char/pl011: fix baud rate calculation
authorBaruch Siach <baruch@tkos.co.il>
Thu, 6 Oct 2022 10:19:48 +0000 (13:19 +0300)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 20 Oct 2022 10:27:48 +0000 (11:27 +0100)
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>
hw/char/pl011.c

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