Skip to contentSkip to conversation

char: cadence: correct reset value for baud rate registers

PATCH In review P J P 3 participants 4 messages Oct 25, 2016

lore
Share & tools
lore

P J P

author
#0 lore raw

PATCH 1/1 char: cadence: correct reset value for baud rate registers

From: Prasad J Pandit <[email protected]>

The Cadence UART device emulator stores 'baud rate generator' and 'baud rate divider' values, used in computing speed, in two registers. The device specification defines their range and their reset value. Use their correct value when resetting the device in cadence_uart_reset.

---
 hw/char/cadence_uart.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/char/cadence_uart.c +2 -1
index c176446..b8d4c28 100644
@@ -471,7 +471,8 @@ static void cadence_uart_reset(DeviceState *dev)
     s->r[R_IMR] = 0;
     s->r[R_CISR] = 0;
     s->r[R_RTRIG] = 0x00000020;
-    s->r[R_BRGR] = 0x0000000F;
+    s->r[R_BRGR] = 0x0000028B;
+    s->r[R_BDIV] = 0x0000000F;
     s->r[R_TTRIG] = 0x00000020;
 
     uart_rx_reset(s);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 28 lines · P J P

From: Prasad J Pandit <[email protected]>

The Cadence UART device emulator stores 'baud rate generator' and 'baud rate divider' values, used in computing speed, in two registers. The device specification defines their range and their reset value. Use their correct value when resetting the device in cadence_uart_reset.

---
 hw/char/cadence_uart.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/char/cadence_uart.c +2 -2
index c176446..b8d4c28 100644
@@ -471,7 +471,8 @@ static void cadence_uart_reset(DeviceState *dev)
     s->r[R_IMR] = 0;
     s->r[R_CISR] = 0;
     s->r[R_RTRIG] = 0x00000020;
-    s->r[R_BRGR] = 0x0000000F;
+    s->r[R_BRGR] = 0x0000028B;
+    s->r[R_BDIV] = 0x0000000F;
     s->r[R_TTRIG] = 0x00000020;
 
     uart_rx_reset(s);
--
Quoted 1 line

2.7.4

I'm going to wait for a review/ack from one of the Xilinx folk before putting this in target-arm.next.

thanks
-- PMM

Reviewed-by
#2 lore raw
Quoted 27 lines · Peter Maydell
Quoted 26 lines · P J P

From: Prasad J Pandit <[email protected]>

The Cadence UART device emulator stores 'baud rate generator' and 'baud rate divider' values, used in computing speed, in two registers. The device specification defines their range and their reset value. Use their correct value when resetting the device in cadence_uart_reset.

---
 hw/char/cadence_uart.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/char/cadence_uart.c +2 -1
index c176446..b8d4c28 100644
@@ -471,7 +471,8 @@ static void cadence_uart_reset(DeviceState *dev)
     s->r[R_IMR] = 0;
     s->r[R_CISR] = 0;
     s->r[R_RTRIG] = 0x00000020;
-    s->r[R_BRGR] = 0x0000000F;
+    s->r[R_BRGR] = 0x0000028B;
+    s->r[R_BDIV] = 0x0000000F;
     s->r[R_TTRIG] = 0x00000020;
 
Quoted 6 lines
Quoted 3 lines
hw/char/cadence_uart.c +0 -1
     uart_rx_reset(s);
--

2.7.4

I'm going to wait for a review/ack from one of the Xilinx folk before putting this in target-arm.next.

Best regards,
Edgar

#3 lore raw
Quoted 28 lines · Edgar E. Iglesias
Quoted 27 lines · Peter Maydell
Quoted 26 lines · P J P

From: Prasad J Pandit <[email protected]>

The Cadence UART device emulator stores 'baud rate generator' and 'baud rate divider' values, used in computing speed, in two registers. The device specification defines their range and their reset value. Use their correct value when resetting the device in cadence_uart_reset.

---
 hw/char/cadence_uart.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/char/cadence_uart.c +2 -1
index c176446..b8d4c28 100644
@@ -471,7 +471,8 @@ static void cadence_uart_reset(DeviceState *dev)
     s->r[R_IMR] = 0;
     s->r[R_CISR] = 0;
     s->r[R_RTRIG] = 0x00000020;
-    s->r[R_BRGR] = 0x0000000F;
+    s->r[R_BRGR] = 0x0000028B;
+    s->r[R_BDIV] = 0x0000000F;
     s->r[R_TTRIG] = 0x00000020;
 
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
hw/char/cadence_uart.c +0 -1
     uart_rx_reset(s);
--

2.7.4

I'm going to wait for a review/ack from one of the Xilinx folk before putting this in target-arm.next.

Thanks; now applied to target-arm.next.

-- PMM