From mboxrd@z Thu Jan 1 00:00:00 1970 From: vijay.kilari@gmail.com Subject: [PATCH v5 17/22] xen/arm: ITS: Initialize physical ITS Date: Mon, 27 Jul 2015 16:41:59 +0530 Message-ID: <1437995524-19772-18-git-send-email-vijay.kilari@gmail.com> References: <1437995524-19772-1-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1437995524-19772-1-git-send-email-vijay.kilari@gmail.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: Ian.Campbell@citrix.com, julien.grall@citrix.com, stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com, tim@xen.org, xen-devel@lists.xen.org Cc: Prasun.Kapoor@caviumnetworks.com, manish.jaggi@caviumnetworks.com, Vijaya Kumar K , vijay.kilari@gmail.com List-Id: xen-devel@lists.xenproject.org From: Vijaya Kumar K Initialize physical ITS driver from GIC v3 driver if LPIs are supported by hardware Signed-off-by: Vijaya Kumar K --- v5: Made check of its dt node availability before setting lpi_supported flag --- xen/arch/arm/gic-v3.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 8c7c5cf..23eb47c 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -714,6 +714,10 @@ static int __cpuinit gicv3_cpu_init(void) if ( gicv3_enable_redist() ) return -ENODEV; + /* Give LPIs a spin */ + if ( gicv3_info.lpi_supported ) + its_cpu_init(); + /* Set priority on PPI and SGI interrupts */ priority = (GIC_PRI_IPI << 24 | GIC_PRI_IPI << 16 | GIC_PRI_IPI << 8 | GIC_PRI_IPI); @@ -1323,11 +1327,18 @@ static int __init gicv3_init(void) if ( gicv3_dist_supports_lpis() ) { - gicv3_info.lpi_supported = 1; - gicv3_info.nr_event_ids = its_get_nr_event_ids(); + /* + * LPI support is enabled only if HW supports it and + * ITS dt node is available + */ + if ( !its_init(&gicv3.rdist_data) ) + { + gicv3_info.lpi_supported = 1; + gicv3_info.nr_event_ids = its_get_nr_event_ids(); + } + else + gicv3_info.lpi_supported = 0; } - else - gicv3_info.lpi_supported = 0; gicv3_dist_init(); res = gicv3_cpu_init(); -- 1.7.9.5