From: Julien Grall Subject: [RFC 15/22] xen/arm: gic-hip04: Remove hbase from the global state Date: Fri, 8 May 2015 14:29:36 +0100 Message-ID: <1431091783-29090-16-git-send-email-julien.grall@citrix.com> References: <1431091783-29090-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YqidL-0007re-Pl for xen-devel@lists.xenproject.org; Fri, 08 May 2015 13:48:07 +0000 In-Reply-To: <1431091783-29090-1-git-send-email-julien.grall@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.xenproject.org Cc: Julien Grall , stefano.stabellini@citrix.com, tim@xen.org, ian.campbell@citrix.com, Zoltan Kiss List-Id: xen-devel@lists.xenproject.org The driver only needs to know the base address of the hypervisor register during the GIC initialization (see gicv2_init). Signed-off-by: Julien Grall Cc: Zoltan Kiss --- Note that all the other base addresses (dbase, cbase, vbase) will be move to a common GIC structure in a subsequent patch. This patch has also only been build-tested. --- xen/arch/arm/gic-hip04.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c index ef86019..15e096b 100644 --- a/xen/arch/arm/gic-hip04.c +++ b/xen/arch/arm/gic-hip04.c @@ -69,7 +69,6 @@ static struct { void __iomem * map_dbase; /* IO mapped Address of distributor registers */ paddr_t cbase; /* Address of CPU interface registers */ void __iomem * map_cbase[2]; /* IO mapped Address of CPU interface registers */ - paddr_t hbase; /* Address of virtual interface registers */ void __iomem * map_hbase; /* IO Address of virtual interface registers */ paddr_t vbase; /* Address of virtual cpu interface registers */ spinlock_t lock; @@ -697,6 +696,7 @@ static hw_irq_controller hip04gic_guest_irq_type = { static int __init hip04gic_init(void) { int res; + paddr_t hbase; const struct dt_device_node *node = gicv2_info.node; res = dt_device_get_address(node, 0, &gicv2.dbase, NULL); @@ -707,7 +707,7 @@ static int __init hip04gic_init(void) if ( res ) panic("GIC-HIP04: Cannot find a valid address for the CPU"); - res = dt_device_get_address(node, 2, &gicv2.hbase, NULL); + res = dt_device_get_address(node, 2, &hbase, NULL); if ( res ) panic("GIC-HIP04: Cannot find a valid address for the hypervisor"); @@ -728,11 +728,11 @@ static int __init hip04gic_init(void) " gic_hyp_addr=%"PRIpaddr"\n" " gic_vcpu_addr=%"PRIpaddr"\n" " gic_maintenance_irq=%u\n", - gicv2.dbase, gicv2.cbase, gicv2.hbase, gicv2.vbase, + gicv2.dbase, gicv2.cbase, hbase, gicv2.vbase, gicv2_info.maintenance_irq); if ( (gicv2.dbase & ~PAGE_MASK) || (gicv2.cbase & ~PAGE_MASK) || - (gicv2.hbase & ~PAGE_MASK) || (gicv2.vbase & ~PAGE_MASK) ) + (hbase & ~PAGE_MASK) || (gicv2.vbase & ~PAGE_MASK) ) panic("GIC-HIP04 interfaces not page aligned"); gicv2.map_dbase = ioremap_nocache(gicv2.dbase, SZ_4K); @@ -749,7 +749,7 @@ static int __init hip04gic_init(void) if ( !gicv2.map_cbase[0] || !gicv2.map_cbase[1] ) panic("GIC-HIP04: Failed to ioremap for GIC CPU interface\n"); - gicv2.map_hbase = ioremap_nocache(gicv2.hbase, SZ_4K); + gicv2.map_hbase = ioremap_nocache(hbase, SZ_4K); if ( !gicv2.map_hbase ) panic("GIC-HIP04: Failed to ioremap for GIC Virtual interface\n"); -- 2.1.4