hw/char/imx_serial: Fix reset value of UFCR register
authorBernhard Beschow <shentey@gmail.com>
Sat, 11 Jan 2025 18:37:00 +0000 (19:37 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 27 Jan 2025 13:50:14 +0000 (13:50 +0000)
The value of the UCFR register is respected when echoing characters to the
terminal, but its reset value is reserved. Fix the reset value to the one
documented in the datasheet.

While at it move the related attribute out of the section of unimplemented
registers since its value is actually respected.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/char/imx_serial.c
include/hw/char/imx_serial.h

index 7c353fde509f2e5662cc46d02afa6809d90b6caf..cb6761d40e48916b18cf16b7599a28c1c693c18c 100644 (file)
@@ -160,6 +160,7 @@ static void imx_serial_reset(IMXSerialState *s)
     s->ucr3 = 0x700;
     s->ubmr = 0;
     s->ubrc = 4;
+    s->ufcr = BIT(11) | BIT(0);
 
     fifo32_reset(&s->rx_fifo);
     timer_del(&s->ageing_timer);
index 65f0e97c76b5327edffaf53bdd342f6637d38f38..90ba3ff18c209e3d1bf4dc91bf5509e832b1251c 100644 (file)
@@ -109,13 +109,13 @@ struct IMXSerialState {
     uint32_t ucr1;
     uint32_t ucr2;
     uint32_t uts1;
+    uint32_t ufcr;
 
     /*
      * The registers below are implemented just so that the
      * guest OS sees what it has written
      */
     uint32_t onems;
-    uint32_t ufcr;
     uint32_t ubmr;
     uint32_t ubrc;
     uint32_t ucr3;