OMAP2+: io: split omap2_init_common_hw()
authorPaul Walmsley <paul@pwsan.com>
Tue, 21 Dec 2010 22:25:10 +0000 (15:25 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 22 Dec 2010 02:55:11 +0000 (19:55 -0700)
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>
29 files changed:
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-3630sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-am3517crane.c
arch/arm/mach-omap2/board-am3517evm.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-cm-t3517.c
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-igep0030.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-n8x0.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3logic.c
arch/arm/mach-omap2/board-omap3pandora.c
arch/arm/mach-omap2/board-omap3stalker.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-omap4panda.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-rm680.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/board-zoom.c
arch/arm/mach-omap2/io.c
arch/arm/plat-omap/include/plat/io.h

index e9eee5f0e6d3fbab8a1fc79e4fd03acf797f2d61..e0661777f599cd735341440d0f7f4d58bddd33b1 100644 (file)
@@ -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();
 }
 
index 869fb133c207f690d759035c4c1e7215256d5d71..3b39ef1a680a54df7e930e282908f0c4b2656c79 100644 (file)
@@ -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();
 }
 
index a8d35ba7781e3fe83d8d1f9d1fc83a28e8bb7edf..5d41dbe059a3ffc2e7bb655e4cac7047f5b29052 100644 (file)
@@ -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();
 }
 
index 33b1f7319c17ac63a084efdb031bf9194d7dd0ad..1cb208b6e62623168da8a181c45516e374f4a34c 100644 (file)
@@ -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
index 8ba404770e75fe86584ecbc9db42b5970b770a5b..781ed2558e122e0e71ed0379d34b428b95eb792c 100644 (file)
@@ -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();
 }
 
index 86867138f1e43c823177ee17ac415abd73bad6ff..bc1562648020fc9f5748d870ea8164bd4f7199ce 100644 (file)
@@ -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();
 }
 
index 200cb386340b4d8b518871e722a43feddce81574..9f55b68687f7fa0bfc17ca5b950a1b8f58aacf14 100644 (file)
@@ -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();
 }
 
index 22c55d13a4e31afd6852dfe2d08a91067661d4f6..486a3de5f4018c9eb17aaf9c6f073d62e7dbb660 100644 (file)
@@ -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();
 }
index 7ee23dab84fe8156ecff7533fb7f4d7051fab0ad..5b0c77732dfc4435303b32b22b9fd5a24a541f17 100644 (file)
@@ -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();
 }
 
index a30a7fce8cbfb7841f1c0050b1c5103e757a6b92..924b7cf93a4bc5c93f6a1e3c14b6ea3af6b2fa1b 100644 (file)
@@ -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);
index b1c2c9a11c389f44e4e870f39ed8236f2b4ae649..0e3d81e09f89ceb0578bcd5b1a489b9958e1b8f9 100644 (file)
@@ -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();
 }
 
index 0a2d73cf036f2d979def6b9901d79e692de0311e..db5d323866f47f8b36d6d18090fbbd93c501b10c 100644 (file)
@@ -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();
 }
index c5bd537553c2ee52124d0b6c1d68e67b9dd348ee..0afa3011db0f138cdb4c2a7f91998fb9224e6ecd 100644 (file)
@@ -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();
 }
 
index 886f193a841503ca2073412fbbb37ad0ef926429..bcccd68f185685652a24e34718e2a8ca7b065dd1 100644 (file)
@@ -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();
 }
 
index 7455b0aadf86a3ab5612a59a12603f96039eb986..e5dc74875f9d8ecdfc14b32ebc316c19e1e20923 100644 (file)
@@ -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();
 }
 
index d4ce96316e3bc26621609497aae9d04572bc771f..43af70ec771edba29386f72b62a75d2e55f10fae 100644 (file)
@@ -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();
 }
 
index f1a8edefa42f41f7bc6fe18b2f8e60bf776b76b5..6c127605942ffd1fdfaec8dc1f013507dacb7f6d 100644 (file)
@@ -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);
index 21ffc5c587a13d79a24c2e03a16c6c290c3725d9..3de8d9b8ec76ee010aad26422fc7d7b950ccf9a2 100644 (file)
@@ -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();
 }
 
index cfd618d3bda81cfacf82310d76a9aa5bc55e209f..15e4b08e99ba179e8ddb24f7adc0dcc6fa84fb3b 100644 (file)
@@ -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();
 }
 
index e64bcb66d1ab97e776136fe7d60e4b905258428c..d457b5961f471fb9d3ffb36a5b396a7537f0406d 100644 (file)
@@ -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();
 }
 
index 1af344b872bcd9144cab3eb9c38b7d67f02edc7e..9df9d9367608cf5e669247b2d448253663b0e982 100644 (file)
@@ -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);
index baa72c507d4ce3383c1da2b768915a28e6a43be9..db1f74fe6c4f0b24288d8be092d95207cc2e0d43 100644 (file)
@@ -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);
index b82f2319a091490e9b2bf03353d0a1346e91c3fc..0d74f6cd5fae92a1e3f333e3f34640a1650eed14 100644 (file)
@@ -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();
 }
 
index b75bdcd47117cffca17dab3b58f3f981cdd51be8..cb26e5d8268d071f8ca2a2d52b50f27d5d4cb2c0 100644 (file)
@@ -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();
 }
 
index 8da65bd6ff8d50a569e72d68e34d4047895d67c8..cb77be7ac44fe98b8fb4b33cd6db7b839f5d99ab 100644 (file)
@@ -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();
 }
 
index 7362c91ddd760598fda2f93e8e9203fb44d05ac5..f53fc551c58fe85ffc5f24e18acffc597e7cca1c 100644 (file)
@@ -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();
 }
 
index 0dff9deaa8961cb1ff4714531bcfbe527b1c10e6..e041c537ea37d66fa3a84697ff124a5fda1b87e7 100644 (file)
 
 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();
 }
index 5577ab2faad23f251325ffafdb37787b0aab0f43..77bf0d1baeefe32738efeb76b47963e8a1d7b85d 100644 (file)
@@ -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())
@@ -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();
 
index 204865f91d93c469c609dcd15aafb6f1a7816334..ef4106c13183fd1f007b16dd208b2fc10b43652c 100644 (file)
@@ -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