render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame 0237-hw-armv7m_nvic-Correctly-register-GIC-region-when-se.patch

5544c1
From f4a5b8185d067430cd605a740af654cd1cd2e2aa Mon Sep 17 00:00:00 2001
5544c1
From: Meador Inge <meadori@codesourcery.com>
5544c1
Date: Wed, 26 Sep 2012 16:46:28 +0100
5544c1
Subject: [PATCH] hw/armv7m_nvic: Correctly register GIC region when setting
5544c1
 up NVIC
5544c1
5544c1
When setting up the NVIC memory regions the memory range
5544c1
0x100..0xcff is aliased to an IO memory region that belongs
5544c1
to the ARM GIC.  This aliased region should be added to the
5544c1
NVIC memory container, but the actual GIC IO memory region
5544c1
was being added instead.  This mixup was causing the wrong
5544c1
IO memory access functions to be called when accessing parts
5544c1
of the NVIC memory.
5544c1
5544c1
Signed-off-by: Meador Inge <meadori@codesourcery.com>
5544c1
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5544c1
(cherry picked from commit 9892cae39562d2e6c00ccc5966302c00f23be6d4)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1
---
5544c1
 hw/armv7m_nvic.c | 3 ++-
5544c1
 1 file changed, 2 insertions(+), 1 deletion(-)
5544c1
5544c1
diff --git a/hw/armv7m_nvic.c b/hw/armv7m_nvic.c
5544c1
index 6a0832e..5c09116 100644
5544c1
--- a/hw/armv7m_nvic.c
5544c1
+++ b/hw/armv7m_nvic.c
5544c1
@@ -489,7 +489,8 @@ static int armv7m_nvic_init(SysBusDevice *dev)
5544c1
      */
5544c1
     memory_region_init_alias(&s->gic_iomem_alias, "nvic-gic", &s->gic.iomem,
5544c1
                              0x100, 0xc00);
5544c1
-    memory_region_add_subregion_overlap(&s->container, 0x100, &s->gic.iomem, 1);
5544c1
+    memory_region_add_subregion_overlap(&s->container, 0x100,
5544c1
+                                        &s->gic_iomem_alias, 1);
5544c1
     /* Map the whole thing into system memory at the location required
5544c1
      * by the v7M architecture.
5544c1
      */
5544c1
-- 
5544c1
1.7.12.1
5544c1