From patchwork Sun May 17 20:03:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 48638 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3324421411 for ; Sun, 17 May 2015 20:06:20 +0000 (UTC) Received: by wivs14 with SMTP id s14sf15381821wiv.1 for ; Sun, 17 May 2015 13:06:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=J9T8BOPiCKnyDYSZR2UeKJsp+cl9SMzXGmd7JysoMx8=; b=TKPtJOvinrqHrWHCqpruW39IKe2tkjqR25snY3Gr875aN5ZWrDwxWsduar1Q3izl3X sjp/f1Ml8fDa+LpiatMjj30PIL4WXpiZQJG1EiSNdqjU3I/Gc8le2jCjntN995DF0QI0 +4KSmiQOu1A6ZmJA2axAxWhjwVpZAo4DCW6dzj9nLUcomnNCD+TrV6TsURyaBRYHkg4k HEMVJi63v+tWlcKcKlJqjBmdIFTfScrgNCmECaAEI+6qJ+ppa8rUIfZZLoiggNrPoNwt Nf28s0WTnKV+b6FBgJ8YtX+vYFbq4yhWdq7w5rsL36jZ/2NQkiv8xPjpyb9NB2t5h69o TywQ== X-Gm-Message-State: ALoCoQkxboPiphJLh9SLh1mRzkCq/hxbjIbeyTDkSiGD/S6qwRdFWyM1rX0q9S7vz4/GCglnH552 X-Received: by 10.112.93.203 with SMTP id cw11mr15290855lbb.0.1431893179500; Sun, 17 May 2015 13:06:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.43 with SMTP id ll11ls724006lac.12.gmail; Sun, 17 May 2015 13:06:19 -0700 (PDT) X-Received: by 10.112.180.201 with SMTP id dq9mr15331008lbc.78.1431893179297; Sun, 17 May 2015 13:06:19 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id o4si5317089laj.143.2015.05.17.13.06.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 May 2015 13:06:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by laat2 with SMTP id t2so191054690laa.1 for ; Sun, 17 May 2015 13:06:19 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr15154545lab.35.1431893179198; Sun, 17 May 2015 13:06:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3507830lbb; Sun, 17 May 2015 13:06:17 -0700 (PDT) X-Received: by 10.55.21.221 with SMTP id 90mr40508233qkv.44.1431893177293; Sun, 17 May 2015 13:06:17 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id q15si8264944qha.77.2015.05.17.13.06.16 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 May 2015 13:06:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4oa-00029p-VL; Sun, 17 May 2015 20:05:36 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4oZ-00026o-0d for xen-devel@lists.xen.org; Sun, 17 May 2015 20:05:35 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id BD/AD-02789-D84F8555; Sun, 17 May 2015 20:05:33 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-13.tower-206.messagelabs.com!1431893131!11153466!1 X-Originating-IP: [209.85.220.44] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 6.13.15; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27903 invoked from network); 17 May 2015 20:05:32 -0000 Received: from mail-pa0-f44.google.com (HELO mail-pa0-f44.google.com) (209.85.220.44) by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 17 May 2015 20:05:32 -0000 Received: by pabru16 with SMTP id ru16so119858622pab.1 for ; Sun, 17 May 2015 13:05:31 -0700 (PDT) X-Received: by 10.66.163.38 with SMTP id yf6mr37890268pab.115.1431893131473; Sun, 17 May 2015 13:05:31 -0700 (PDT) Received: from localhost.localdomain ([117.247.24.139]) by mx.google.com with ESMTPSA id j9sm7838401pdm.53.2015.05.17.13.05.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 May 2015 13:05:30 -0700 (PDT) From: Parth Dixit To: xen-devel@lists.xen.org Date: Mon, 18 May 2015 01:33:44 +0530 Message-Id: <1431893048-5214-18-git-send-email-parth.dixit@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> References: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> Cc: keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, tim@xen.org, julien.grall@citrix.com, stefano.stabellini@citrix.com, jbeulich@suse.com, parth.dixit@linaro.org, christoffer.dall@linaro.org Subject: [Xen-devel] [PATCH v2 17/41] arm : refactor gic into generic and dt specific parts X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: parth.dixit@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: refactor gic related functions into dt and generic parts this will be helpful when adding acpi support for gic Signed-off-by: Parth Dixit --- xen/arch/arm/gic-v2.c | 13 ++++++++++--- xen/arch/arm/gic.c | 7 ++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index 80acc62..7276951 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c @@ -663,7 +663,7 @@ static hw_irq_controller gicv2_guest_irq_type = { .set_affinity = gicv2_irq_set_affinity, }; -static int __init gicv2_init(void) +static int __init dt_gicv2_init(void) { int res; const struct dt_device_node *node = gicv2_info.node; @@ -689,6 +689,13 @@ static int __init gicv2_init(void) panic("GICv2: Cannot find the maintenance IRQ"); gicv2_info.maintenance_irq = res; + return 0; +} + +static int gicv2_init(void) +{ + dt_gicv2_init(); + /* TODO: Add check on distributor, cpu size */ printk("GICv2 initialization:\n" @@ -763,7 +770,7 @@ const static struct gic_hw_operations gicv2_ops = { }; /* Set up the GIC */ -static int __init gicv2_preinit(struct dt_device_node *node, const void *data) +static int __init dt_gicv2_preinit(struct dt_device_node *node, const void *data) { gicv2_info.hw_version = GIC_V2; gicv2_info.node = node; @@ -781,7 +788,7 @@ static const struct dt_device_match gicv2_dt_match[] __initconst = DT_DEVICE_START(gicv2, "GICv2", DEVICE_GIC) .dt_match = gicv2_dt_match, - .init = gicv2_preinit, + .init = dt_gicv2_preinit, DT_DEVICE_END /* diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index f023e4f..701c306 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -231,7 +231,7 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize, /* Find the interrupt controller and set up the callback to translate * device tree IRQ. */ -void __init gic_preinit(void) +void __init dt_gic_preinit(void) { int rc; struct dt_device_node *node; @@ -261,6 +261,11 @@ void __init gic_preinit(void) dt_device_set_used_by(node, DOMID_XEN); } +void __init gic_preinit(void) +{ + dt_gic_preinit(); +} + /* Set up the GIC */ void __init gic_init(void) {