From: Ian Campbell Subject: Re: [PATCH v3] xen: get GIC addresses from DT Date: Thu, 6 Dec 2012 09:45:14 +0000 Message-ID: <1354787114.17165.55.camel@zakaz.uk.xensource.com> References: <1354734105-7007-1-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1354734105-7007-1-git-send-email-stefano.stabellini@eu.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: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , "Tim (Xen.org)" List-Id: xen-devel@lists.xenproject.org On Wed, 2012-12-05 at 19:01 +0000, Stefano Stabellini wrote: > @@ -306,10 +306,28 @@ static void __cpuinit gic_hyp_disable(void) > /* Set up the GIC */ > void __init gic_init(void) > { > - /* XXX FIXME get this from devicetree */ > - gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET; > - gic.cbase = GIC_BASE_ADDRESS + GIC_CR_OFFSET; > - gic.hbase = GIC_BASE_ADDRESS + GIC_HR_OFFSET; > + printk("GIC initialization:\n" > + " gic_dist_addr=%"PRIpaddr"\n" > + " gic_cpu_addr=%"PRIpaddr"\n" > + " gic_hyp_addr=%"PRIpaddr"\n" > + " gic_vcpu_addr=%"PRIpaddr"\n", > + early_info.gic.gic_dist_addr, early_info.gic.gic_cpu_addr, > + early_info.gic.gic_hyp_addr, early_info.gic.gic_vcpu_addr); I think there's a hard tab in here somewhere. > +static void device_tree_nr_reg_ranges(const struct fdt_property *prop, > + u32 address_cells, u32 size_cells, int *ranges) > +{ > + u32 reg_cells = address_cells + size_cells; > + *ranges = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32)); Why not just return the value here? Ian.