From patchwork Thu Nov 1 19:05:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 196334 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3D2E42C0347 for ; Fri, 2 Nov 2012 06:06:15 +1100 (EST) Received: from localhost ([::1]:60905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TU05l-00067D-CM for incoming@patchwork.ozlabs.org; Thu, 01 Nov 2012 15:06:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TU05d-00065A-OC for qemu-devel@nongnu.org; Thu, 01 Nov 2012 15:06:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TU05c-0007PA-Ce for qemu-devel@nongnu.org; Thu, 01 Nov 2012 15:06:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TU05c-0007P2-4E for qemu-devel@nongnu.org; Thu, 01 Nov 2012 15:06:04 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA1J63Aw011721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Nov 2012 15:06:03 -0400 Received: from localhost (ovpn-112-23.ams2.redhat.com [10.36.112.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA1J60qg019369; Thu, 1 Nov 2012 15:06:02 -0400 From: Stefan Hajnoczi To: Anthony Liguori Date: Thu, 1 Nov 2012 20:05:40 +0100 Message-Id: <1351796754-21703-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1351796754-21703-1-git-send-email-stefanha@redhat.com> References: <1351796754-21703-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Crosthwaite , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 1/9] cadence_uart: More debug information X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Peter Crosthwaite Add more helpful debug information to the cadence UART. Signed-off-by: Peter Crosthwaite Reviewed-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- hw/cadence_uart.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/cadence_uart.c b/hw/cadence_uart.c index a7d0504..686e617 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 = {