From patchwork Wed Mar 11 14:21:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 449046 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DCD2114008F for ; Thu, 12 Mar 2015 01:28:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=ZVx9Mlwq; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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 1YVha9-0006OZ-Ig; Wed, 11 Mar 2015 14:25:57 +0000 Received: from mail-qc0-x236.google.com ([2607:f8b0:400d:c01::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVhWf-0002ds-4i for linux-arm-kernel@lists.infradead.org; Wed, 11 Mar 2015 14:22:21 +0000 Received: by qcyl6 with SMTP id l6so10454149qcy.13 for ; Wed, 11 Mar 2015 07:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fqmAOhC6MbvTNCWYpb43wSW2qwlQMsn6Xf8K6ON8zLQ=; b=ZVx9Mlwq21q/kqmih2sU39FePJAuSL4G1FUw8OFq894wwanqCIlkPLxOYkNF4Mra6q EnHmCjUMPS8DU4tUWuyS64LKOtZTRnIsFK3DUf5AobBrnm0T/vHWKWpjuCqqObhJkKXF 6XPu1vcxqgYVYgQZAFHAzl/ZWPZ/ZfN1nsAh6CmxuvvUpZ1j+oKOJ534B6oHoijpE+9N MXAP/Nvf9YHo0K9YUPEyR9tI1Nuu+B/Ssx5bNeynF1SBUojtSn8CbNGnJNNmxsGVgPWq siwSevxshdxrpW9bQipA0A+b6ZHuvL3DBVWTzLsUhFY7u06DhzoZlvGuVt6jMbOxIdon uadA== X-Received: by 10.140.85.137 with SMTP id n9mr46370331qgd.17.1426083718820; Wed, 11 Mar 2015 07:21:58 -0700 (PDT) Received: from localhost.localdomain ([177.194.98.53]) by mx.google.com with ESMTPSA id y10sm2643593qgd.14.2015.03.11.07.21.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Mar 2015 07:21:57 -0700 (PDT) From: Fabio Estevam To: shawn.guo@linaro.org Subject: [PATCH v2 4/7] ARM: mx25: Retrieve IIM base from dt Date: Wed, 11 Mar 2015 11:21:31 -0300 Message-Id: <1426083694-6624-4-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426083694-6624-1-git-send-email-festevam@gmail.com> References: <1426083694-6624-1-git-send-email-festevam@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150311_072221_287735_A17AF515 X-CRM114-Status: GOOD ( 11.39 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400d:c01:0:0:0:236 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Fabio Estevam , linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Fabio Estevam We should use dt to retrieve the IIM base address. Signed-off-by: Fabio Estevam --- Changes since v1: - Use BUG_ON as suggested by Russell arch/arm/mach-imx/cpu-imx25.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/cpu-imx25.c b/arch/arm/mach-imx/cpu-imx25.c index 96ec64b..0d2d860 100644 --- a/arch/arm/mach-imx/cpu-imx25.c +++ b/arch/arm/mach-imx/cpu-imx25.c @@ -11,6 +11,8 @@ */ #include #include +#include +#include #include "iim.h" #include "hardware.h" @@ -20,8 +22,15 @@ static int mx25_cpu_rev = -1; static int mx25_read_cpu_rev(void) { u32 rev; + void __iomem *iim_base; + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, "fsl,imx25-iim"); + iim_base = of_iomap(np, 0); + BUG_ON(!iim_base); + rev = readl(iim_base + MXC_IIMSREV); + iounmap(iim_base); - rev = __raw_readl(MX25_IO_ADDRESS(MX25_IIM_BASE_ADDR + MXC_IIMSREV)); switch (rev) { case 0x00: return IMX_CHIP_REVISION_1_0;