]> xenbits.xensource.com Git - xen.git/commitdiff
xen: arm: slightly refactor gic DT node creation for domain 0.
authorIan Campbell <ian.campbell@citrix.com>
Fri, 8 May 2015 11:26:57 +0000 (12:26 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 8 May 2015 15:57:38 +0000 (16:57 +0100)
Although in principal #interrupt-cells can vary it must always be 3
for a GIC (and we only support GIC as a guest interrupt controller),
so putting it in common code is OK.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@citrix.com>
xen/arch/arm/domain_build.c
xen/arch/arm/gic-hip04.c
xen/arch/arm/gic-v2.c
xen/arch/arm/gic-v3.c

index 24a024261c761ec08514ea0af42d881e15aa5915..e9307f676c0e754898d6214f644f09ca09cf2a71 100644 (file)
@@ -847,6 +847,14 @@ static int make_gic_node(const struct domain *d, void *fdt,
             return res;
     }
 
+    res = fdt_property_cell(fdt, "#interrupt-cells", 3);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
+    if ( res )
+        return res;
+
     res = fdt_end_node(fdt);
 
     return res;
index 073ad337123e8b6345d91cf50a32c7ece9bb14f3..223c4149f1798fdef0dfb9170bdc68694ff0090d 100644 (file)
@@ -633,15 +633,6 @@ static int hip04gic_make_dt_node(const struct domain *d,
         return res;
 
     res = fdt_property(fdt, "compatible", compatible, len);
-    if ( res )
-        return res;
-
-    res = fdt_property_cell(fdt, "#interrupt-cells", 3);
-    if ( res )
-        return res;
-
-    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
-
     if ( res )
         return res;
 
index 1a639e0057b374ec64ab9d76f0a2ce502fbdc605..073fec2735fd83f4dbf4809488589adb95f9df44 100644 (file)
@@ -621,15 +621,6 @@ static int gicv2_make_dt_node(const struct domain *d,
         return res;
 
     res = fdt_property(fdt, "compatible", compatible, len);
-    if ( res )
-        return res;
-
-    res = fdt_property_cell(fdt, "#interrupt-cells", 3);
-    if ( res )
-        return res;
-
-    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
-
     if ( res )
         return res;
 
index b0f498e3a520c1b1fc96619ea7fdce25b6b411b8..e9a8edaa192945575a5562469509b546df35430e 100644 (file)
@@ -1106,14 +1106,6 @@ static int gicv3_make_dt_node(const struct domain *d,
     if ( res )
         return res;
 
-    res = fdt_property_cell(fdt, "#interrupt-cells", 3);
-    if ( res )
-        return res;
-
-    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
-    if ( res )
-        return res;
-
     res = dt_property_read_u32(gic, "redistributor-stride", &rd_stride);
     if ( !res )
         rd_stride = 0;