From patchwork Thu Jan 24 06:27:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 2029371 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 5B2673FD56 for ; Thu, 24 Jan 2013 06:36:43 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TyGOH-0000HO-Lt; Thu, 24 Jan 2013 06:34:25 +0000 Received: from relais.videotron.ca ([24.201.245.36]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TyGIg-0003pv-R3 for linux-arm-kernel@lists.infradead.org; Thu, 24 Jan 2013 06:28:40 +0000 Received: from yoda.home ([24.202.213.203]) by VL-VM-MR002.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0MH400JZX9YSTA80@VL-VM-MR002.ip.videotron.ca> for linux-arm-kernel@lists.infradead.org; Thu, 24 Jan 2013 01:28:05 -0500 (EST) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 4FCC82DA00F9 for ; Thu, 24 Jan 2013 01:28:05 -0500 (EST) From: Nicolas Pitre To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 16/16] ARM: vexpress/dcscb: probe via device tree Date: Thu, 24 Jan 2013 01:27:59 -0500 Message-id: <1359008879-9015-17-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.0 In-reply-to: <1359008879-9015-1-git-send-email-nicolas.pitre@linaro.org> References: <1359008879-9015-1-git-send-email-nicolas.pitre@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130124_012838_956452_823ECE5C X-CRM114-Status: GOOD ( 12.69 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [24.201.245.36 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This allows for the DCSCB support to be compiled in and selected at run time. Signed-off-by: Nicolas Pitre --- arch/arm/mach-vexpress/dcscb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c index 575c489a4c..17e410e4fe 100644 --- a/arch/arm/mach-vexpress/dcscb.c +++ b/arch/arm/mach-vexpress/dcscb.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -24,8 +25,6 @@ #include -#define DCSCB_PHYS_BASE 0x60000000 - #define RST_HOLD0 0x0 #define RST_HOLD1 0x4 #define SYS_SWRESET 0x8 @@ -215,12 +214,16 @@ extern void dcscb_power_up_setup(unsigned int affinity_level); static int __init dcscb_init(void) { + struct device_node *node; unsigned int cfg; int ret; - dcscb_base = ioremap(DCSCB_PHYS_BASE, 0x1000); + node = of_find_compatible_node(NULL, NULL, "arm,dcscb"); + if (!node) + return -ENODEV; + dcscb_base= of_iomap(node, 0); if (!dcscb_base) - return -ENOMEM; + return -EINVAL; cfg = readl_relaxed(dcscb_base + DCS_CFG_R); dcscb_cluster_cpu_mask[0] = (1 << (((cfg >> 16) >> (0 << 2)) & 0xf)) - 1; dcscb_cluster_cpu_mask[1] = (1 << (((cfg >> 16) >> (1 << 2)) & 0xf)) - 1;