Skip to content

Commit

Permalink
ARM: imx: use dynamic mapping for CCM
Browse files Browse the repository at this point in the history
Replace the static mapping of CCM block in clock drivers with dynamic
mapping.

Signed-off-by: Shawn Guo <[email protected]>
  • Loading branch information
shawnguo2 committed Jun 3, 2015
1 parent 6c529c4 commit 5ab96a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion arch/arm/mach-imx/clk-imx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 4 additions & 1 deletion arch/arm/mach-imx/clk-imx31.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/mach-imx/clk-imx35.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 5ab96a8

Please sign in to comment.