Skip to content

Commit

Permalink
OMAP2+: io: split omap2_init_common_hw()
Browse files Browse the repository at this point in the history
Split omap2_init_common_hw() into two functions.  The first,
omap2_init_common_infrastructure(), initializes the hwmod code and
data, the OMAP PM code, and the clock code and data.  The second,
omap2_init_common_devices(), handles any other early device
initialization that, for whatever reason, has not been or cannot be
moved to initcalls or early platform devices.

This patch is required for the hwmod postsetup patch, which allows
board files to change the state that hwmods should be placed into at
the conclusion of the hwmod _setup() function.  For example, for a
board whose creators wish to ensure watchdog coverage across the
entire kernel boot process, code to change the watchdog's postsetup
state will be added in the board-*.c file between the
omap2_init_common_infrastructure() and omap2_init_common_devices() function
calls.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Paul Walmsley committed Dec 22, 2010
1 parent b9e7683 commit 4805734
Show file tree
Hide file tree
Showing 29 changed files with 80 additions and 43 deletions.
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-2430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ static void __init omap_2430sdp_init_irq(void)
{
omap_board_config = sdp2430_config;
omap_board_config_size = ARRAY_SIZE(sdp2430_config);
omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-3430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ static void __init omap_3430sdp_init_irq(void)
omap_board_config = sdp3430_config;
omap_board_config_size = ARRAY_SIZE(sdp3430_config);
omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
omap_init_irq();
}

Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-omap2/board-3630sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ static void __init omap_sdp_init_irq(void)
{
omap_board_config = sdp_config;
omap_board_config_size = ARRAY_SIZE(sdp_config);
omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
h8mbx00u0mer0em_sdrc_params);
omap2_init_common_infrastructure();
omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
h8mbx00u0mer0em_sdrc_params);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-4430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ static void __init omap_4430sdp_init_irq(void)
{
omap_board_config = sdp4430_config;
omap_board_config_size = ARRAY_SIZE(sdp4430_config);
omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(1);
#endif
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-am3517crane.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ static void __init am3517_crane_init_irq(void)
omap_board_config = am3517_crane_config;
omap_board_config_size = ARRAY_SIZE(am3517_crane_config);

omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
}

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/board-am3517evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ static void __init am3517_evm_init_irq(void)
{
omap_board_config = am3517_evm_config;
omap_board_config_size = ARRAY_SIZE(am3517_evm_config);

omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-apollon.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ static void __init omap_apollon_init_irq(void)
{
omap_board_config = apollon_config;
omap_board_config_size = ARRAY_SIZE(apollon_config);
omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-cm-t35.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ static void __init cm_t35_init_irq(void)
omap_board_config = cm_t35_config;
omap_board_config_size = ARRAY_SIZE(cm_t35_config);

omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
omap2_init_common_infrastructure();
omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
}
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-cm-t3517.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ static void __init cm_t3517_init_irq(void)
omap_board_config = cm_t3517_config;
omap_board_config_size = ARRAY_SIZE(cm_t3517_config);

omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
}

Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-omap2/board-devkit8000.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,9 @@ static struct platform_device keys_gpio = {

static void __init devkit8000_init_irq(void)
{
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap2_init_common_infrastructure();
omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ static void __init omap_generic_init_irq(void)
{
omap_board_config = generic_config;
omap_board_config_size = ARRAY_SIZE(generic_config);
omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-h4.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ static void __init omap_h4_init_irq(void)
{
omap_board_config = h4_config;
omap_board_config_size = ARRAY_SIZE(h4_config);
omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
h4_init_flash();
}
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-omap2/board-igep0020.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,9 @@ static struct platform_device *igep2_devices[] __initdata = {

static void __init igep2_init_irq(void)
{
omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params);
omap2_init_common_infrastructure();
omap2_init_common_devices(m65kxxxxam_sdrc_params,
m65kxxxxam_sdrc_params);
omap_init_irq();
}

Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-omap2/board-igep0030.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ static struct twl4030_usb_data igep3_twl4030_usb_data = {

static void __init igep3_init_irq(void)
{
omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params);
omap2_init_common_infrastructure();
omap2_init_common_devices(m65kxxxxam_sdrc_params,
m65kxxxxam_sdrc_params);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-ldp.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ static void __init omap_ldp_init_irq(void)
{
omap_board_config = ldp_config;
omap_board_config_size = ARRAY_SIZE(ldp_config);
omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-n8x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@ static void __init n8x0_map_io(void)

static void __init n8x0_init_irq(void)
{
omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
}

Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-omap2/board-omap3beagle.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,9 @@ static struct platform_device keys_gpio = {

static void __init omap3_beagle_init_irq(void)
{
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap2_init_common_infrastructure();
omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-omap3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ static void __init omap3_evm_init_irq(void)
{
omap_board_config = omap3_evm_config;
omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-omap3logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ static inline void __init board_smsc911x_init(void)

static void __init omap3logic_init_irq(void)
{
omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
omap_init_irq();
}

Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-omap2/board-omap3pandora.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,9 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {

static void __init omap3pandora_init_irq(void)
{
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap2_init_common_infrastructure();
omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-omap3stalker.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ static void __init omap3_stalker_init_irq(void)
{
omap_board_config = omap3_stalker_config;
omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
omap_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-omap2/board-omap3touchbook.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,9 @@ static void __init omap3_touchbook_init_irq(void)
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap_board_config = omap3_touchbook_config;
omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap2_init_common_infrastructure();
omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-omap4panda.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ static struct platform_device *panda_devices[] __initdata = {

static void __init omap4_panda_init_irq(void)
{
omap2_init_common_hw(NULL, NULL);
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
gic_init_irq();
}

Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-omap2/board-overo.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,9 @@ static void __init overo_init_irq(void)
{
omap_board_config = overo_config;
omap_board_config_size = ARRAY_SIZE(overo_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap2_init_common_infrastructure();
omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-rm680.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ static void __init rm680_init_irq(void)
{
struct omap_sdrc_params *sdrc_params;

omap2_init_common_infrastructure();
sdrc_params = nokia_get_sdram_timings();
omap2_init_common_hw(sdrc_params, sdrc_params);
omap2_init_common_devices(sdrc_params, sdrc_params);
omap_init_irq();
}

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-rx51.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ static void __init rx51_init_irq(void)
omap_board_config = rx51_config;
omap_board_config_size = ARRAY_SIZE(rx51_config);
omap3_pm_init_cpuidle(rx51_cpuidle_params);
omap2_init_common_infrastructure();
sdrc_params = nokia_get_sdram_timings();
omap2_init_common_hw(sdrc_params, sdrc_params);
omap2_init_common_devices(sdrc_params, sdrc_params);
omap_init_irq();
}

Expand Down
9 changes: 5 additions & 4 deletions arch/arm/mach-omap2/board-zoom.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@

static void __init omap_zoom_init_irq(void)
{
omap2_init_common_infrastructure();
if (machine_is_omap_zoom2())
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
else if (machine_is_omap_zoom3())
omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
h8mbx00u0mer0em_sdrc_params);
omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
h8mbx00u0mer0em_sdrc_params);

omap_init_irq();
}
Expand Down
16 changes: 12 additions & 4 deletions arch/arm/mach-omap2/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,8 @@ static inline void omap_irq_base_init(void)
#endif
}

void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
struct omap_sdrc_params *sdrc_cs1)
void __init omap2_init_common_infrastructure(void)
{
u8 skip_setup_idle = 0;

pwrdm_init(powerdomains_omap);
clkdm_init(clockdomains_omap, clkdm_autodeps);
if (cpu_is_omap242x())
Expand All @@ -359,6 +356,17 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
omap4xxx_clk_init();
else
pr_err("Could not init clock framework - unknown CPU\n");
}

/*
* XXX Ideally, this function will dwindle into nothingness over time;
* almost all device init code should be possible through initcalls
* and other generalized mechanisms
*/
void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
struct omap_sdrc_params *sdrc_cs1)
{
u8 skip_setup_idle = 0;

omap_serial_early_init();

Expand Down
5 changes: 3 additions & 2 deletions arch/arm/plat-omap/include/plat/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,9 @@ static inline void omap44xx_map_common_io(void)
}
#endif

extern void omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
struct omap_sdrc_params *sdrc_cs1);
extern void omap2_init_common_infrastructure(void);
extern void omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
struct omap_sdrc_params *sdrc_cs1);

#define __arch_ioremap omap_ioremap
#define __arch_iounmap omap_iounmap
Expand Down

0 comments on commit 4805734

Please sign in to comment.