From patchwork Wed Mar 11 12:43:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 448978 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 027F91400DD for ; Thu, 12 Mar 2015 00:06:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=p/sYBGJu; 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 1YVgHW-0000yJ-08; Wed, 11 Mar 2015 13:02:38 +0000 Received: from mail-qg0-x22e.google.com ([2607:f8b0:400d:c04::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVg06-0005xL-5w for linux-arm-kernel@lists.infradead.org; Wed, 11 Mar 2015 12:44:38 +0000 Received: by qgdz60 with SMTP id z60so9512679qgd.1 for ; Wed, 11 Mar 2015 05:44:16 -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=cMV6YdTqah7ODZwVRU9S+aPhacUO3knA+oWJk+lJUyI=; b=p/sYBGJucYNY4m1HB70Pq0gZHSkd4kXar/ZiWOd6QAd5rmhRQ8LCRN7kb9Ni2UCYjN FY5Vc3Vr0/A7x1/f+MsHLQbg2bzM6T/FesIrLVgkahxuaiAQE0EVSmMihUoiavPte3eB KkQKU1Ajg5Rq2QRnyqJhgSjFqz3auDKGELiF7AP1yd5ZjfvinZzJE4WIsjRvR3EzAIBr GDN0G8mfml+j7US5dAWWppPkLbH8NW69LnSebP6wv/PlsSXHrpLHa25p6DHfWoV2pDPC XgHAso9/AR5Cw2ZXyNOb+zzQarSlzPDWNF2BgTb57BsyWIycmVw6aHb10BZhcKnwO+N0 LNYA== X-Received: by 10.55.31.203 with SMTP id n72mr40448314qkh.30.1426077856595; Wed, 11 Mar 2015 05:44:16 -0700 (PDT) Received: from localhost.localdomain ([177.194.98.53]) by mx.google.com with ESMTPSA id i48sm2457865qge.34.2015.03.11.05.44.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Mar 2015 05:44:15 -0700 (PDT) From: Fabio Estevam To: shawn.guo@linaro.org Subject: [PATCH 4/7] ARM: mx25: Retrieve IIM base from dt Date: Wed, 11 Mar 2015 09:43:52 -0300 Message-Id: <1426077835-31081-4-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426077835-31081-1-git-send-email-festevam@gmail.com> References: <1426077835-31081-1-git-send-email-festevam@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150311_054438_352305_A590955E X-CRM114-Status: GOOD ( 11.19 ) 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:c04:0:0:0:22e 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-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 --- 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); + WARN_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;