Received: from eggs.gnu.org ([208.118.235.92]:52776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP8Ys-0007tZ-4n for qemu-devel@nongnu.org; Fri, 19 Oct 2012 05:08:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TP8Yq-0004aJ-Hn for qemu-devel@nongnu.org; Fri, 19 Oct 2012 05:08:10 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:48623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP8Yq-0004aB-BJ for qemu-devel@nongnu.org; Fri, 19 Oct 2012 05:08:08 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp2so290929pbb.4 for ; Fri, 19 Oct 2012 02:08:07 -0700 (PDT) Sender: Peter Crosthwaite From: Peter Crosthwaite Date: Fri, 19 Oct 2012 19:08:04 +1000 Message-Id: <1350637684-32300-1-git-send-email-peter.crosthwaite@xilinx.com> Subject: [Qemu-devel] [PATCH] cadence_uart: More debug information List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Cc: Peter Crosthwaite Add more helpful debug information to the cadence UART. Signed-off-by: Peter Crosthwaite --- hw/cadence_uart.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/cadence_uart.c b/hw/cadence_uart.c index f8afc4e..483a316 100644 --- a/hw/cadence_uart.c +++ b/hw/cadence_uart.c @@ -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 = { -- 1.7.0.4