xen/arm: gic-v3: Allow Xen to run on hardware supporting GICv4
authorJulien Grall <julien.grall@citrix.com>
Mon, 14 Sep 2015 15:32:24 +0000 (16:32 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 24 Sep 2015 10:47:59 +0000 (11:47 +0100)
GICv4 is an extension of GICv3 (see 1.1 in ARM IHI 0069A) which means
that the GICv3 driver can run normally on GICv4 hardware.

The GICv4-only features currently won't be used.

Reported-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/gic-v3.c
xen/include/asm-arm/gic_v3_defs.h

index 4d623bfcf6fc4be431d14ba0143d2d5baf4c85dc..1e3c19b13b0bbacf03137c715d54a54eeee412b5 100644 (file)
@@ -640,7 +640,7 @@ static int __init gicv3_populate_rdist(void)
         void __iomem *ptr = gicv3.rdist_regions[i].map_base;
 
         reg = readl_relaxed(ptr + GICR_PIDR2) & GIC_PIDR2_ARCH_MASK;
-        if ( reg != GIC_PIDR2_ARCH_GICv3 )
+        if ( reg != GIC_PIDR2_ARCH_GICv3 && reg != GIC_PIDR2_ARCH_GICv4 )
         {
             dprintk(XENLOG_ERR,
                     "GICv3: No redistributor present @%"PRIpaddr"\n",
@@ -1194,7 +1194,7 @@ static int __init gicv3_init(void)
         panic("GICv3: Failed to ioremap for GIC distributor\n");
 
     reg = readl_relaxed(GICD + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK;
-    if ( reg != GIC_PIDR2_ARCH_GICv3 )
+    if ( reg != GIC_PIDR2_ARCH_GICv3 && reg != GIC_PIDR2_ARCH_GICv4 )
          panic("GICv3: no distributor detected\n");
 
     if ( !dt_property_read_u32(node, "#redistributor-regions",
index b0ac6ff55b7f1a15a0b504a3d4227b9e7e8a939a..c6d73df4a8af4c11a4deb81903939a555b3c255e 100644 (file)
@@ -43,6 +43,7 @@
 /* Common between GICD_PIDR2 and GICR_PIDR2 */
 #define GIC_PIDR2_ARCH_MASK         (0xf0)
 #define GIC_PIDR2_ARCH_GICv3        (0x30)
+#define GIC_PIDR2_ARCH_GICv4        (0x40)
 
 #define GICC_SRE_EL2_SRE             (1UL << 0)
 #define GICC_SRE_EL2_DFB             (1UL << 1)