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: 56730 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1825940lbb; Tue, 17 Nov 2015 01:45:24 -0800 (PST) X-Received: by 10.31.8.193 with SMTP id 184mr2639795vki.131.1447753524644; Tue, 17 Nov 2015 01:45:24 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id j131si2021237vka.205.2015.11.17.01.45.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Nov 2015 01:45:24 -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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZycoB-0003s3-00; Tue, 17 Nov 2015 09:44:15 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zyco8-0003qC-WD for xen-devel@lists.xen.org; Tue, 17 Nov 2015 09:44:13 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 6D/C3-31069-CE6FA465; Tue, 17 Nov 2015 09:44:12 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-9.tower-31.messagelabs.com!1447753451!1042634!1 X-Originating-IP: [74.125.82.45] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11986 invoked from network); 17 Nov 2015 09:44:11 -0000 Received: from mail-wm0-f45.google.com (HELO mail-wm0-f45.google.com) (74.125.82.45) by server-9.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Nov 2015 09:44:11 -0000 Received: by wmec201 with SMTP id c201so17194543wme.1 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=PoNaMTrCrmoGij/rx4UmBHyQSqsC4PEfiFvq75oTsIvYJBdv2OnDW9Mon7/j618eTV pGq+ggP2pG3opASUWkhZZrnz+mKNpaiCOlJUfTER8ZLc2X3XqnnDHdl1gilouudOGNJt vRA/ig8esgoI1bq4KIbsXvA00zmVA5f7TlETphkGNPPSrJP5daWtoCAlBzwi7Fzgn8QM w8hqXs8OtbOkZKxVKXjujdkvW16OPBgF4fybsIJrypJ+zxCA50dzHLmwAeIxa8s9ul31 acJjCT+oO3au5n/LOrFGCY9H6ZMurp5iBcPirGJL1Komn5xUBAFRzAlCl87AKO9LTMeD apEA== X-Gm-Message-State: ALoCoQmpdHmZO8TXaHoTOU0WSOuhDmDM8YLp9nOKlmGxlInRB9OR9nZ5x55DG9vcYa53cSxAA9k/ 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 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> 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 Subject: [Xen-devel] [PATCH v3 21/62] 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: , MIME-Version: 1.0 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 --- xen/arch/arm/gic-v2.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) -- 2.1.0 _______________________________________________ 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 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 /*