Skip to contentSkip to conversation

cadence_uart: More debug information

PATCH Applied Peter Crosthwaite 3 participants 3 messages Oct 19, 2012 – Oct 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cadence_uart: More debug information

Add more helpful debug information to the cadence UART.

---
 hw/cadence_uart.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
hw/cadence_uart.c +7 -4
index f8afc4e..483a316 100644
@@ -359,7 +359,7 @@ static void uart_write(void *opaque, target_phys_addr_t offset,
 {
     UartState *s = (UartState *)opaque;
 
-    DB_PRINT(" offset:%x data:%08x\n", offset, (unsigned)value);
+    DB_PRINT(" offset:%x data:%08x\n", (unsigned)offset, (unsigned)value);
     offset >>= 2;
     switch (offset) {
     case R_IER: /* ier (wts imr) */
@@ -405,12 +405,15 @@ static uint64_t uart_read(void *opaque, target_phys_addr_t offset,
 
     offset >>= 2;
     if (offset >= R_MAX) {
-        return 0;
+        c = 0;
     } else if (offset == R_TX_RX) {
         uart_read_rx_fifo(s, &c);
-        return c;
+    } else {
+       c = s->r[offset];
     }
-    return s->r[offset];
+
+    DB_PRINT(" offset:%x data:%08x\n", (unsigned)(offset << 2), (unsigned)c);
+    return c;
 }
 
 static const MemoryRegionOps uart_ops = {
Signature · 1 line
1.7.0.4