From patchwork Tue Nov 17 09:40:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 7634851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A8483BF90C for ; Tue, 17 Nov 2015 09:58:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C548C20489 for ; Tue, 17 Nov 2015 09:58:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7A9B20483 for ; Tue, 17 Nov 2015 09:58:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zycze-0004DR-0o; Tue, 17 Nov 2015 09:56:06 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZycoT-0006ws-2X for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 09:44:39 +0000 Received: by wmdw130 with SMTP id w130so146689721wmd.0 for ; Tue, 17 Nov 2015 01:44:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BeAB7Z7GVg8lVewJw8fJJTxlxIkkiUx4cKj3xqKbx+k=; b=vy2hCTCMFxf8EvS7CUsuunyljPtmeeyUNmfK2ve4s0QyOjcKOfUf0klBfigTuMAf0S tTzscYZG6eG9NEmLy0UrWQ0Maws4//i7iPRp2OKQyar0aiMQg7KHnJIV93GoltWJvqq9 18zxRbJolaPRD3Yb09kWgY9NHMpZncNRtBanmSzd9HqkVgOC18NCiAO8+9pWD/ZFPsIU t2f61HMvAoqiK2QQou1nsbvDdVI101XbIoV5TRi+ci+Cv4uppvZK55UJimqCQntRsteD KOU2uiqdQiprB+DVHr0HVr4N9vB40sVzOUg9SYUrPnM5LcMB9Mk6AWhvSHQ1htjynKNy TmSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BeAB7Z7GVg8lVewJw8fJJTxlxIkkiUx4cKj3xqKbx+k=; b=mJTuyPEuG88PhnYdVdY1BdMSVPSSlqHZKgzFixqfSKcf1UBozxiUFxMiyDhfrN/wqu JN3HwNSF7j0LQawDUd8Izx1zXtHYxzv8aXIoKL4hDN7FureswdhNK0BEjh0N3XmwQ+mO qR0GQCgCC9USF9t17T77rofVeUChiOYAwPIfj/JHyreY/1MC8tyvwpoyBG1hkoDjTNpw QBbkacolFR7BouWb4Ka7v5nuTZlqYgSKFfrzKGtCLyRdTr9pg4cPCOgVMA6q9P6heGQS qmty5DzykK4XZPRlZYchPnqkLQb80jkSXzWDcpIw2VeIVCwA0NAsrHuBwLtVlpvgyG4i IkKg== X-Gm-Message-State: ALoCoQmM25JnHzEoFc2frgKRyg6XUthRKFg8tDC2gTYz2AuHilC0NPXgCyzCiuuKJZxi4yTqAlzu X-Received: by 10.28.177.11 with SMTP id a11mr646926wmf.92.1447753451644; Tue, 17 Nov 2015 01:44:11 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id bk2sm39013947wjc.3.2015.11.17.01.44.09 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:44:11 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, julien.grall@citrix.com, xen-devel@lists.xen.org Subject: [PATCH v3 21/62] arm/gic-v2: Refactor gicv2_init into generic and dt specific parts Date: Tue, 17 Nov 2015 17:40:20 +0800 Message-Id: <1447753261-7552-22-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> References: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_014433_829317_8342D985 X-CRM114-Status: GOOD ( 11.65 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, hangaohuai@huawei.com, ard.biesheuvel@linaro.org, shannon.zhao@linaro.org, christoffer.dall@linaro.org, peter.huangpeng@huawei.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, linux-arm-kernel@lists.infradead.org, roger.pau@citrix.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 01e36b5..e31d38e 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 dt_gicv2_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; + + dt_gicv2_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 dt_gicv2_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 = dt_gicv2_preinit, DT_DEVICE_END /*