From 07639839666f134834b060a63d6b172812092366 Mon Sep 17 00:00:00 2001 From: cmss_dx Date: Mon, 28 Nov 2022 02:50:07 +0000 Subject: [PATCH 28/29] hw/char/pl011: fix baud rate calculation mainline inclusion from mainline-v7.2.0-rc2 commit 31cb769c317e0623cbe2a3e8da437b6cd7ddef9b category: bugfix -------------------------------- 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 Message-id: 1408f62a2e45665816527d4845ffde650957d5ab.1665051588.git.baruchs-c@neureality.ai Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell Signed-off-by: cmss_dx --- hw/char/pl011.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/pl011.c b/hw/char/pl011.c index 8ca2a4ed68..b24ccfeac7 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -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; } -- 2.27.0