aboutsummaryrefslogtreecommitdiff
path: root/hw/char
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2022-10-06 13:19:48 +0300
committerPeter Maydell <peter.maydell@linaro.org>2022-10-20 11:27:48 +0100
commit31cb769c317e0623cbe2a3e8da437b6cd7ddef9b (patch)
tree7fb5e60c2219b369122f4cd6fbce7fb2d5b922a6 /hw/char
parent214a8da23651f2472b296b3293e619fd58d9e212 (diff)
downloadqemu-31cb769c317e0623cbe2a3e8da437b6cd7ddef9b.zip
qemu-31cb769c317e0623cbe2a3e8da437b6cd7ddef9b.tar.gz
qemu-31cb769c317e0623cbe2a3e8da437b6cd7ddef9b.tar.bz2
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>
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/pl011.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/char/pl011.c b/hw/char/pl011.c
index 6e2d7f7..c076813 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;
}