From patchwork Sun Apr 26 14:31:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 6276811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6B4A09F389 for ; Sun, 26 Apr 2015 14:37:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 918532035E for ; Sun, 26 Apr 2015 14:37:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2F962034A for ; Sun, 26 Apr 2015 14:37:11 +0000 (UTC) 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 1YmNe3-0001Sk-C6; Sun, 26 Apr 2015 14:34:55 +0000 Received: from mail-pd0-f181.google.com ([209.85.192.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YmNdQ-00017p-RB for linux-arm-kernel@lists.infradead.org; Sun, 26 Apr 2015 14:34:18 +0000 Received: by pdea3 with SMTP id a3so100549553pde.3 for ; Sun, 26 Apr 2015 07:33:55 -0700 (PDT) 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=/HGOAkHqOMCVsyBNJszxc4Kps6T023o/BjDh/W6McW8=; b=TYUKfR205VVwOZBUIPUb2k48yy916TYaondx/VqIx4poxdu+2ejLwT0kXbzbMA+JTr UqPnaMjR8XA+Mm7GYmrFTYJbp5xXKT6ccxt1WngAx50+yrsRy1wrI2Xg3JtX7ideCbrM 6b/jROIiNRtXlN/ULrqknPy83r1tQ+zyKfgwaEIWOcy1B9P6hgf9+XPxLszLqVgE7GhG 5d6HYV4+hiLxjcVWB9h1Ipi/+N7dldhWJYERdjaPVhDZnCPtiOFnN6quyWygngtmZUzh M/45yh0AaOAypxW/GCRz3HoZo/d+qF5qY+APvT2O/6V91To7WheUEv7gjU19OaxjUx7m 5jnA== X-Gm-Message-State: ALoCoQnlRzKR4UUbVH+2Eyty2sihCwjGN2RY+2ofHY/l+5sDHja3vEf6LFmA9YV5njQBcvRFSN/n X-Received: by 10.68.68.232 with SMTP id z8mr14227382pbt.104.1430058835741; Sun, 26 Apr 2015 07:33:55 -0700 (PDT) Received: from localhost.localdomain ([104.207.83.1]) by mx.google.com with ESMTPSA id x2sm16622905pdm.40.2015.04.26.07.33.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 Apr 2015 07:33:55 -0700 (PDT) From: Shawn Guo To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 02/11] ARM: imx: use dynamic mapping for CCM Date: Sun, 26 Apr 2015 22:31:03 +0800 Message-Id: <1430058672-9267-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430058672-9267-1-git-send-email-shawn.guo@linaro.org> References: <1430058672-9267-1-git-send-email-shawn.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150426_073416_975298_FE5D31FF X-CRM114-Status: GOOD ( 11.57 ) X-Spam-Score: -0.9 (/) Cc: Frank Li , Stephen Boyd , Russell King , kernel@pengutronix.de, Mike Turquette , Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace the static mapping of CCM block in clock drivers with dynamic mapping. Signed-off-by: Shawn Guo --- arch/arm/mach-imx/clk-imx1.c | 3 ++- arch/arm/mach-imx/clk-imx31.c | 5 ++++- arch/arm/mach-imx/clk-imx35.c | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c index f4a76e841966..5301d2ebb234 100644 --- a/arch/arm/mach-imx/clk-imx1.c +++ b/arch/arm/mach-imx/clk-imx1.c @@ -75,7 +75,8 @@ static void __init _mx1_clocks_init(unsigned long fref) int __init mx1_clocks_init(unsigned long fref) { - ccm = MX1_IO_ADDRESS(MX1_CCM_BASE_ADDR); + ccm = ioremap(MX1_CCM_BASE_ADDR, SZ_4K); + BUG_ON(!ccm); _mx1_clocks_init(fref); diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c index 8a103a2c8b68..2aaccadb9e13 100644 --- a/arch/arm/mach-imx/clk-imx31.c +++ b/arch/arm/mach-imx/clk-imx31.c @@ -50,9 +50,12 @@ static struct clk_onecell_data clk_data; int __init mx31_clocks_init(unsigned long fref) { - void __iomem *base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR); + void __iomem *base; struct device_node *np; + base = ioremap(MX31_CCM_BASE_ADDR, SZ_4K); + BUG_ON(!base); + clk[dummy] = imx_clk_fixed("dummy", 0); clk[ckih] = imx_clk_fixed("ckih", fref); clk[ckil] = imx_clk_fixed("ckil", 32768); diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c index 4ef1e8bdac5b..14f33ec049bc 100644 --- a/arch/arm/mach-imx/clk-imx35.c +++ b/arch/arm/mach-imx/clk-imx35.c @@ -71,11 +71,14 @@ static struct clk *clk[clk_max]; int __init mx35_clocks_init(void) { - void __iomem *base = MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR); + void __iomem *base; u32 pdr0, consumer_sel, hsp_sel; struct arm_ahb_div *aad; unsigned char *hsp_div; + base = ioremap(MX35_CCM_BASE_ADDR, SZ_4K); + BUG_ON(base); + pdr0 = __raw_readl(base + MXC_CCM_PDR0); consumer_sel = (pdr0 >> 16) & 0xf; aad = &clk_consumer[consumer_sel];