ARM: imx: use dynamic mapping for CCM
authorShawn Guo <shawn.guo@linaro.org>
Sat, 25 Apr 2015 08:02:53 +0000 (16:02 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Wed, 3 Jun 2015 06:44:30 +0000 (14:44 +0800)
Replace the static mapping of CCM block in clock drivers with dynamic
mapping.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
arch/arm/mach-imx/clk-imx1.c
arch/arm/mach-imx/clk-imx31.c
arch/arm/mach-imx/clk-imx35.c

index f4a76e84196686295b060f99378d48966a7b0666..5301d2ebb234063510deff8f5bdc2cbee5fa6381 100644 (file)
@@ -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);
 
index 8a103a2c8b6847963113e9915ebd654012e82fc1..2aaccadb9e136ed342ae952ffbe657f5cf0f076c 100644 (file)
@@ -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);
index 4ef1e8bdac5b0a9fce524524096e211cb026fc70..5818521a8766c98564e5be6202d8a34388a1eebb 100644 (file)
@@ -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];
This page took 0.025993 seconds and 5 git commands to generate.