From: Ian Campbell Date: Fri, 8 May 2015 11:26:57 +0000 (+0100) Subject: xen: arm: slightly refactor gic DT node creation for domain 0. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3274 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ee18075f5a9d419093f56aa3c0f31e19b436cb59;p=xen.git xen: arm: slightly refactor gic DT node creation for domain 0. 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 Reviewed-by: Julien Grall --- diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 24a024261c..e9307f676c 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -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; diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c index 073ad33712..223c4149f1 100644 --- a/xen/arch/arm/gic-hip04.c +++ b/xen/arch/arm/gic-hip04.c @@ -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; diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index 1a639e0057..073fec2735 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c @@ -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; diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index b0f498e3a5..e9a8edaa19 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -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;