aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@linaro.org>2013-09-26 12:09:37 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-09-26 15:44:45 +0100
commitc9760939c0cea28c7cbaacd3f893fc6cefc09bef (patch)
treeca41d84908aeacde06ad39805ebd3b4f3ce4ba49
parentd4e681a59bf2b90acb44044c0f236bce26697e0c (diff)
downloadxen-c9760939c0cea28c7cbaacd3f893fc6cefc09bef.tar.gz
xen-c9760939c0cea28c7cbaacd3f893fc6cefc09bef.tar.bz2
xen-c9760939c0cea28c7cbaacd3f893fc6cefc09bef.zip
xen/arm: Initialize correctly IRQ routing
When Xen initialize the GIC distributor, we need to route all the IRQs to the boot CPU. The CPU ID can differ between Xen and the GIC. When ITARGETSR0 is read, each field will return a value that corresponds only to the processor reading the register. So Xen can use the PPI 0 to initialize correctly the routing. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r--xen/arch/arm/gic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 091eb36725..b969d236cc 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -258,9 +258,10 @@ void gic_route_dt_irq(const struct dt_irq *irq, const cpumask_t *cpu_mask,
static void __init gic_dist_init(void)
{
uint32_t type;
- uint32_t cpumask = 1 << smp_processor_id();
+ uint32_t cpumask;
int i;
+ cpumask = GICD[GICD_ITARGETSR] & 0xff;
cpumask |= cpumask << 8;
cpumask |= cpumask << 16;