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: 8048651 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EA6469F1CC for ; Sat, 16 Jan 2016 05:09:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A62E20383 for ; Sat, 16 Jan 2016 05:09:25 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B3E22037F for ; Sat, 16 Jan 2016 05:09:24 +0000 (UTC) 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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 /*