From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 1/5] xen: arm: propagate gic's #address-cells property to dom0. Date: Fri, 24 Oct 2014 10:58:33 +0100 Message-ID: <1414144717-32328-1-git-send-email-ian.campbell@citrix.com> References: <1414144694.15687.31.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1414144694.15687.31.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian Campbell , stefano.stabellini@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, Clark Laughlin , Pranavkumar Sawargaonkar List-Id: xen-devel@lists.xenproject.org The interrupt-map property requires that the interrupt-parent node must have both #address-cells and #interrupt-cells properties (see ePAPR 2.4.3.1). Therefore propagate the property if it is present. We must propagate (rather than invent our own value) since this value is used to size fields within other properties within the tree. ePAPR strictly speaking requires that the interrupt-parent node always has these properties. However reality has diverged from this and implementations will recursively search parents for #*-cells properties. Hence we only copy if it is present. Signed-off-by: Ian Campbell --- xen/arch/arm/domain_build.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 5aca925..de180d8 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -788,6 +788,8 @@ static int make_gic_node(const struct domain *d, void *fdt, { const struct dt_device_node *gic = dt_interrupt_controller; int res = 0; + const void *addrcells; + u32 addrcells_len; /* * Xen currently supports only a single GIC. Discard any secondary @@ -817,6 +819,14 @@ static int make_gic_node(const struct domain *d, void *fdt, return res; } + addrcells = dt_get_property(gic, "#address-cells", &addrcells_len); + if ( addrcells ) + { + res = fdt_property(fdt, "#address-cells", addrcells, addrcells_len); + if ( res ) + return res; + } + res = fdt_end_node(fdt); return res; -- 1.7.10.4