From patchwork Tue Jan 29 07:51:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 2060291 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 6AC8E3FCD5 for ; Tue, 29 Jan 2013 08:00:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U064y-0002K7-9c; Tue, 29 Jan 2013 07:58:04 +0000 Received: from relais.videotron.ca ([24.201.245.36]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U05yw-0005iU-5E for linux-arm-kernel@lists.infradead.org; Tue, 29 Jan 2013 07:51:51 +0000 Received: from yoda.home ([24.202.213.203]) by VL-VM-MR003.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0MHD000PGN5M8M90@VL-VM-MR003.ip.videotron.ca> for linux-arm-kernel@lists.infradead.org; Tue, 29 Jan 2013 02:51:23 -0500 (EST) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id DEA302DA00F9; Tue, 29 Jan 2013 02:51:22 -0500 (EST) From: Nicolas Pitre To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 15/15] ARM: vexpress/dcscb: probe via device tree Date: Tue, 29 Jan 2013 02:51:10 -0500 Message-id: <1359445870-18925-16-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-reply-to: <1359445870-18925-1-git-send-email-nicolas.pitre@linaro.org> References: <1359445870-18925-1-git-send-email-nicolas.pitre@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130129_025150_522303_50E60630 X-CRM114-Status: GOOD ( 11.58 ) 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] Cc: Dave Martin , Lorenzo Pieralisi , Pawel Moll , Catalin Marinas , Will Deacon , Santosh Shilimkar 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c index 58051ffafb..a724507cbc 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,10 +214,14 @@ 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 -EADDRNOTAVAIL; cfg = readl_relaxed(dcscb_base + DCS_CFG_R);