From patchwork Wed Aug 3 23:04:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 108332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7226EB71F2 for ; Thu, 4 Aug 2011 09:04:41 +1000 (EST) Received: from localhost ([::1]:41868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QokUP-0003AU-VY for incoming@patchwork.ozlabs.org; Wed, 03 Aug 2011 19:04:37 -0400 Received: from eggs.gnu.org ([140.186.70.92]:47564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QokUK-00039W-29 for qemu-devel@nongnu.org; Wed, 03 Aug 2011 19:04:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QokUI-0006zk-TT for qemu-devel@nongnu.org; Wed, 03 Aug 2011 19:04:32 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:60699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QokUI-0006zg-Lf for qemu-devel@nongnu.org; Wed, 03 Aug 2011 19:04:30 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QokUG-0002RZ-FS; Thu, 04 Aug 2011 00:04:28 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 4 Aug 2011 00:04:28 +0100 Message-Id: <1312412668-9366-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1312412668-9366-1-git-send-email-peter.maydell@linaro.org> References: <1312412668-9366-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Engin AYDOGAN , patches@linaro.org Subject: [Qemu-devel] [PATCH 2/2] hw/pl061.c: Support GPIOAMSEL register 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 Support the GPIOAMSEL register found on some Stellaris boards. Signed-off-by: Peter Maydell --- hw/pl061.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/hw/pl061.c b/hw/pl061.c index 27de824..d13746c 100644 --- a/hw/pl061.c +++ b/hw/pl061.c @@ -50,6 +50,7 @@ typedef struct { uint32_t den; uint32_t cr; uint32_t float_high; + uint32_t amsel; qemu_irq irq; qemu_irq out[8]; const unsigned char *id; @@ -57,7 +58,7 @@ typedef struct { static const VMStateDescription vmstate_pl061 = { .name = "pl061", - .version_id = 1, + .version_id = 2, .minimum_version_id = 1, .fields = (VMStateField[]) { VMSTATE_UINT32(locked, pl061_state), @@ -80,6 +81,7 @@ static const VMStateDescription vmstate_pl061 = { VMSTATE_UINT32(den, pl061_state), VMSTATE_UINT32(cr, pl061_state), VMSTATE_UINT32(float_high, pl061_state), + VMSTATE_UINT32_V(amsel, pl061_state, 2), VMSTATE_END_OF_LIST() } }; @@ -157,6 +159,8 @@ static uint32_t pl061_read(void *opaque, target_phys_addr_t offset) return s->locked; case 0x524: /* Commit */ return s->cr; + case 0x528: /* Analog mode select */ + return s->amsel; default: hw_error("pl061_read: Bad offset %x\n", (int)offset); return 0; @@ -229,6 +233,9 @@ static void pl061_write(void *opaque, target_phys_addr_t offset, if (!s->locked) s->cr = value & 0xff; break; + case 0x528: + s->amsel = value & 0xff; + break; default: hw_error("pl061_write: Bad offset %x\n", (int)offset); }