From patchwork Sat Jan 23 08:00:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 60236 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp326923lbb; Sat, 23 Jan 2016 00:04:23 -0800 (PST) X-Received: by 10.28.136.148 with SMTP id k142mr7929199wmd.41.1453536263032; Sat, 23 Jan 2016 00:04:23 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id cf10si13564709wjc.167.2016.01.23.00.04.22 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 23 Jan 2016 00:04:23 -0800 (PST) Received-SPF: neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=50.57.142.19; Authentication-Results: mx.google.com; spf=neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aMt9z-0002Wo-Qr; Sat, 23 Jan 2016 08:03:03 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aMt9y-0002WV-I3 for xen-devel@lists.xen.org; Sat, 23 Jan 2016 08:03:02 +0000 Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id FC/C4-10115-5B333A65; Sat, 23 Jan 2016 08:03:01 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1453536172!18888998!1 X-Originating-IP: [58.251.152.64] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26894 invoked from network); 23 Jan 2016 08:03:00 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 23 Jan 2016 08:03:00 -0000 Received: from 172.24.1.49 (EHLO szxeml433-hub.china.huawei.com) ([172.24.1.49]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DDP78218; Sat, 23 Jan 2016 16:00:49 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml433-hub.china.huawei.com (10.82.67.210) with Microsoft SMTP Server id 14.3.235.1; Sat, 23 Jan 2016 16:00:40 +0800 From: Shannon Zhao To: Date: Sat, 23 Jan 2016 16:00:17 +0800 Message-ID: <1453536020-16196-6-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1453536020-16196-1-git-send-email-zhaoshenglong@huawei.com> References: <1453536020-16196-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.56A33331.00C7, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 84693f2caf7e57e798ff793dec620aa0 Cc: julien.grall@citrix.com, peter.huangpeng@huawei.com, stefano.stabellini@citrix.com, ian.campbell@citrix.com, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH v5 5/8] arm/gic-v2: Refactor gicv2_init into generic and dt specific parts X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org From: Shannon Zhao Refactor gic-v2 related functions into dt and generic parts. This will be helpful when adding acpi support for gic. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini --- xen/arch/arm/gic-v2.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) -- 2.0.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index 793dca7..3fb5823 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c @@ -628,13 +628,12 @@ static bool_t gicv2_is_aliased(paddr_t cbase, paddr_t csize) return ((val_low & 0xfff0fff) == 0x0202043B && val_low == val_high); } -static int __init gicv2_init(void) +static paddr_t __initdata hbase, dbase, cbase, csize, vbase; + +static void __init gicv2_dt_init(void) { int res; - paddr_t hbase, dbase; - paddr_t cbase, csize; - paddr_t vbase, vsize; - uint32_t aliased_offset = 0; + paddr_t vsize; const struct dt_device_node *node = gicv2_info.node; res = dt_device_get_address(node, 0, &dbase, NULL); @@ -680,6 +679,13 @@ static int __init gicv2_init(void) if ( csize != vsize ) panic("GICv2: Sizes of GICC (%#"PRIpaddr") and GICV (%#"PRIpaddr") don't match\n", csize, vsize); +} + +static int __init gicv2_init(void) +{ + uint32_t aliased_offset = 0; + + gicv2_dt_init(); printk("GICv2 initialization:\n" " gic_dist_addr=%"PRIpaddr"\n" @@ -765,7 +771,8 @@ 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 gicv2_dt_preinit(struct dt_device_node *node, + const void *data) { gicv2_info.hw_version = GIC_V2; gicv2_info.node = node; @@ -783,7 +790,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 = gicv2_dt_preinit, DT_DEVICE_END /*