From patchwork Wed Sep 26 16:13:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 187121 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 4F8722C00A8 for ; Thu, 27 Sep 2012 02:14:24 +1000 (EST) Received: from localhost ([::1]:33079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGuFh-0004hF-N8 for incoming@patchwork.ozlabs.org; Wed, 26 Sep 2012 12:14:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGuFG-0004C6-JS for qemu-devel@nongnu.org; Wed, 26 Sep 2012 12:14:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGuF8-0003He-7H for qemu-devel@nongnu.org; Wed, 26 Sep 2012 12:13:54 -0400 Received: from 38.0.169.217.in-addr.arpa ([217.169.0.38]:53863 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGuF8-0003FA-1F for qemu-devel@nongnu.org; Wed, 26 Sep 2012 12:13:46 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1TGuEx-0004JO-8Z; Wed, 26 Sep 2012 17:13:35 +0100 From: Peter Maydell To: Anthony Liguori Date: Wed, 26 Sep 2012 17:13:33 +0100 Message-Id: <1348676015-16547-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1348676015-16547-1-git-send-email-peter.maydell@linaro.org> References: <1348676015-16547-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: 217.169.0.38 Cc: qemu-devel@nongnu.org, Paul Brook Subject: [Qemu-devel] [PATCH 2/4] hw/armv7m_nvic: Correctly register GIC region when setting up NVIC 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: Meador Inge When setting up the NVIC memory regions the memory range 0x100..0xcff is aliased to an IO memory region that belongs to the ARM GIC. This aliased region should be added to the NVIC memory container, but the actual GIC IO memory region was being added instead. This mixup was causing the wrong IO memory access functions to be called when accessing parts of the NVIC memory. Signed-off-by: Meador Inge Signed-off-by: Peter Maydell --- hw/armv7m_nvic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/armv7m_nvic.c b/hw/armv7m_nvic.c index 6a0832e..5c09116 100644 --- a/hw/armv7m_nvic.c +++ b/hw/armv7m_nvic.c @@ -489,7 +489,8 @@ static int armv7m_nvic_init(SysBusDevice *dev) */ memory_region_init_alias(&s->gic_iomem_alias, "nvic-gic", &s->gic.iomem, 0x100, 0xc00); - memory_region_add_subregion_overlap(&s->container, 0x100, &s->gic.iomem, 1); + memory_region_add_subregion_overlap(&s->container, 0x100, + &s->gic_iomem_alias, 1); /* Map the whole thing into system memory at the location required * by the v7M architecture. */