From patchwork Sat Jan 16 05:01:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 59901 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp932041lbb; Fri, 15 Jan 2016 21:07:58 -0800 (PST) X-Received: by 10.140.42.20 with SMTP id b20mr17965736qga.16.1452920878673; Fri, 15 Jan 2016 21:07:58 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id a141si17591858qkb.16.2016.01.15.21.07.58 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Jan 2016 21:07:58 -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 1aKJ3l-0007BI-Jf; Sat, 16 Jan 2016 05:05:57 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aKJ3k-0007BC-NP for xen-devel@lists.xen.org; Sat, 16 Jan 2016 05:05:56 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id E2/2B-14900-3BFC9965; Sat, 16 Jan 2016 05:05:55 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1452920753!16135662!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 43923 invoked from network); 16 Jan 2016 05:05:54 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-12.tower-31.messagelabs.com with SMTP; 16 Jan 2016 05:05:54 -0000 Received: from 172.24.1.49 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.49]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CZY66085; Sat, 16 Jan 2016 13:02:28 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.235.1; Sat, 16 Jan 2016 13:02:19 +0800 From: Shannon Zhao To: Date: Sat, 16 Jan 2016 13:01:14 +0800 Message-ID: <1452920477-13916-8-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1452920477-13916-1-git-send-email-zhaoshenglong@huawei.com> References: <1452920477-13916-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.0A020202.5699CEE4.016E, 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: e7ca551cb32263b2a0036293c73663f5 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 v4 07/10] 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 /*