]> git.proxmox.com Git - mirror_qemu.git/commitdiff
cadence_uart: More debug information
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Fri, 19 Oct 2012 09:08:04 +0000 (19:08 +1000)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 1 Nov 2012 18:42:35 +0000 (19:42 +0100)
Add more helpful debug information to the cadence UART.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/cadence_uart.c

index a7d0504c586db7dcd12f8bd4209dcce78b493a3a..686e6172d01d74e5cd1be737cb8bfd05222c34b8 100644 (file)
@@ -359,7 +359,7 @@ static void uart_write(void *opaque, hwaddr 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, hwaddr 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 = {