summaryrefslogtreecommitdiff
path: root/hw/cadence_uart.c
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2012-10-19 19:08:04 +1000
committerStefan Hajnoczi <stefanha@redhat.com>2012-11-01 19:42:35 +0100
commit2ddef11bede823b068b59a66b4c5c62377e69b2f (patch)
tree0cafadb0d8eaf279161478cacb2535e09f797655 /hw/cadence_uart.c
parent286d52ebfc0d0d53c2a878e454292fea14bad41b (diff)
downloadqemu-2ddef11bede823b068b59a66b4c5c62377e69b2f.tar.gz
qemu-2ddef11bede823b068b59a66b4c5c62377e69b2f.tar.bz2
qemu-2ddef11bede823b068b59a66b4c5c62377e69b2f.zip
cadence_uart: More debug information
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>
Diffstat (limited to 'hw/cadence_uart.c')
-rw-r--r--hw/cadence_uart.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/cadence_uart.c b/hw/cadence_uart.c
index a7d0504c58..686e6172d0 100644
--- a/hw/cadence_uart.c
+++ b/hw/cadence_uart.c
@@ -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 = {