Skip to content

Commit

Permalink
ARM: OMAP2+: io: use new clock init API
Browse files Browse the repository at this point in the history
clk_init is now separated to a common function which gets called for all
SoC:s, which initializes the DT clocks and calls the SoC specific clock init.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
  • Loading branch information
Tero Kristo authored and Mike Turquette committed Jan 17, 2014
1 parent 943a63a commit cfa9667
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ struct omap_hwmod;
extern int omap_dss_reset(struct omap_hwmod *);

/* SoC specific clock initializer */
extern int (*omap_clk_init)(void);
int omap_clk_init(void);

#endif /* __ASSEMBLER__ */
#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
32 changes: 23 additions & 9 deletions arch/arm/mach-omap2/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
#include "prm44xx.h"

/*
* omap_clk_init: points to a function that does the SoC-specific
* omap_clk_soc_init: points to a function that does the SoC-specific
* clock initializations
*/
int (*omap_clk_init)(void);
static int (*omap_clk_soc_init)(void);

/*
* The machine specific code may provide the extra mapping besides the
Expand Down Expand Up @@ -419,7 +419,7 @@ void __init omap2420_init_early(void)
omap242x_clockdomains_init();
omap2420_hwmod_init();
omap_hwmod_init_postsetup();
omap_clk_init = omap2420_clk_init;
omap_clk_soc_init = omap2420_clk_init;
}

void __init omap2420_init_late(void)
Expand Down Expand Up @@ -448,7 +448,7 @@ void __init omap2430_init_early(void)
omap243x_clockdomains_init();
omap2430_hwmod_init();
omap_hwmod_init_postsetup();
omap_clk_init = omap2430_clk_init;
omap_clk_soc_init = omap2430_clk_init;
}

void __init omap2430_init_late(void)
Expand Down Expand Up @@ -482,7 +482,7 @@ void __init omap3_init_early(void)
omap3xxx_clockdomains_init();
omap3xxx_hwmod_init();
omap_hwmod_init_postsetup();
omap_clk_init = omap3xxx_clk_init;
omap_clk_soc_init = omap3xxx_clk_init;
}

void __init omap3430_init_early(void)
Expand Down Expand Up @@ -520,7 +520,7 @@ void __init ti81xx_init_early(void)
omap3xxx_clockdomains_init();
omap3xxx_hwmod_init();
omap_hwmod_init_postsetup();
omap_clk_init = omap3xxx_clk_init;
omap_clk_soc_init = omap3xxx_clk_init;
}

void __init omap3_init_late(void)
Expand Down Expand Up @@ -581,7 +581,7 @@ void __init am33xx_init_early(void)
am33xx_clockdomains_init();
am33xx_hwmod_init();
omap_hwmod_init_postsetup();
omap_clk_init = am33xx_clk_init;
omap_clk_soc_init = am33xx_clk_init;
}

void __init am33xx_init_late(void)
Expand Down Expand Up @@ -635,7 +635,7 @@ void __init omap4430_init_early(void)
omap44xx_clockdomains_init();
omap44xx_hwmod_init();
omap_hwmod_init_postsetup();
omap_clk_init = omap4xxx_clk_init;
omap_clk_soc_init = omap4xxx_clk_init;
}

void __init omap4430_init_late(void)
Expand Down Expand Up @@ -666,7 +666,7 @@ void __init omap5_init_early(void)
omap54xx_clockdomains_init();
omap54xx_hwmod_init();
omap_hwmod_init_postsetup();
omap_clk_init = omap5xxx_dt_clk_init;
omap_clk_soc_init = omap5xxx_dt_clk_init;
}

void __init omap5_init_late(void)
Expand Down Expand Up @@ -711,3 +711,17 @@ void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
_omap2_init_reprogram_sdrc();
}
}

int __init omap_clk_init(void)
{
int ret = 0;

if (!omap_clk_soc_init)
return 0;

ret = of_prcm_init();
if (!ret)
ret = omap_clk_soc_init();

return ret;
}
6 changes: 2 additions & 4 deletions arch/arm/mach-omap2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,7 @@ static inline void __init realtime_counter_init(void)
clksrc_nr, clksrc_src, clksrc_prop) \
void __init omap##name##_gptimer_timer_init(void) \
{ \
if (omap_clk_init) \
omap_clk_init(); \
omap_clk_init(); \
omap_dmtimer_init(); \
omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src, \
Expand All @@ -582,8 +581,7 @@ void __init omap##name##_gptimer_timer_init(void) \
clksrc_nr, clksrc_src, clksrc_prop) \
void __init omap##name##_sync32k_timer_init(void) \
{ \
if (omap_clk_init) \
omap_clk_init(); \
omap_clk_init(); \
omap_dmtimer_init(); \
omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
/* Enable the use of clocksource="gp_timer" kernel parameter */ \
Expand Down

0 comments on commit cfa9667

Please sign in to comment.