* [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set
@ 2010-11-16 10:18 Paul Walmsley
2010-11-16 10:18 ` [PATCH 1/8] OMAP2+: io: split omap2_init_common_hw() Paul Walmsley
` (8 more replies)
0 siblings, 9 replies; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 10:18 UTC (permalink / raw)
To: linux-arm-kernel
This patch series contains upgrades for the OMAP2+ hwmod core
code, intended for 2.6.38. Most of these patches were developed
in response to use-cases discovered while converting device
drivers to use the hwmod code.
Tested on an OMAP34xx BeagleBoard with omap2plus_defconfig.
- Paul
---
hwmod_a_2.6.38
text data bss dec hex filename
5708416 472960 5608992 11790368 b3e820 vmlinux.omap2plus_defconfig.orig
5709076 470560 5608992 11788628 b3e154 vmlinux.omap2plus_defconfig.patched
Paul Walmsley (7):
OMAP2+: io: split omap2_init_common_hw()
OMAP2+: hwmod: allow custom pre-shutdown functions
OMAP2+: hwmod: add postsetup state
OMAP2+: hwmod: add support for per-class custom device reset functions
OMAP2+: hwmod: rename omap_hwmod_mutex to _hwmod_list_mutex
OMAP2+: hwmod: upgrade per-hwmod mutex to a spinlock
OMAP2+: hwmod: fix a warning, add some docs, remove unused fields
Rajendra Nayak (1):
OMAP2+: hwmod: Update the sysc_cache in case module context is lost
arch/arm/mach-omap2/board-2430sdp.c | 3
arch/arm/mach-omap2/board-3430sdp.c | 3
arch/arm/mach-omap2/board-3630sdp.c | 5
arch/arm/mach-omap2/board-4430sdp.c | 3
arch/arm/mach-omap2/board-am3517evm.c | 4
arch/arm/mach-omap2/board-apollon.c | 3
arch/arm/mach-omap2/board-cm-t35.c | 3
arch/arm/mach-omap2/board-cm-t3517.c | 3
arch/arm/mach-omap2/board-devkit8000.c | 5
arch/arm/mach-omap2/board-generic.c | 3
arch/arm/mach-omap2/board-h4.c | 3
arch/arm/mach-omap2/board-igep0020.c | 4
arch/arm/mach-omap2/board-igep0030.c | 4
arch/arm/mach-omap2/board-ldp.c | 3
arch/arm/mach-omap2/board-n8x0.c | 3
arch/arm/mach-omap2/board-omap3beagle.c | 5
arch/arm/mach-omap2/board-omap3evm.c | 3
arch/arm/mach-omap2/board-omap3logic.c | 3
arch/arm/mach-omap2/board-omap3pandora.c | 5
arch/arm/mach-omap2/board-omap3stalker.c | 3
arch/arm/mach-omap2/board-omap3touchbook.c | 5
arch/arm/mach-omap2/board-omap4panda.c | 3
arch/arm/mach-omap2/board-overo.c | 5
arch/arm/mach-omap2/board-rx51.c | 3
arch/arm/mach-omap2/board-zoom.c | 9 -
arch/arm/mach-omap2/io.c | 32 ++-
arch/arm/mach-omap2/omap_hwmod.c | 264 ++++++++++++++++++--------
arch/arm/mach-omap2/omap_hwmod_2430_data.c | 2
arch/arm/mach-omap2/serial.c | 9 -
arch/arm/plat-omap/include/plat/io.h | 5
arch/arm/plat-omap/include/plat/omap_hwmod.h | 47 +++--
31 files changed, 302 insertions(+), 153 deletions(-)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/8] OMAP2+: io: split omap2_init_common_hw()
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
@ 2010-11-16 10:18 ` Paul Walmsley
2010-12-21 22:38 ` Paul Walmsley
2010-11-16 10:18 ` [PATCH 2/8] OMAP2+: hwmod: allow custom pre-shutdown functions Paul Walmsley
` (7 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 10:18 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
arch/arm/mach-omap2/board-2430sdp.c | 3 ++-
arch/arm/mach-omap2/board-3430sdp.c | 3 ++-
arch/arm/mach-omap2/board-3630sdp.c | 5 +++--
arch/arm/mach-omap2/board-4430sdp.c | 3 ++-
arch/arm/mach-omap2/board-am3517evm.c | 4 ++--
arch/arm/mach-omap2/board-apollon.c | 3 ++-
arch/arm/mach-omap2/board-cm-t35.c | 3 ++-
arch/arm/mach-omap2/board-cm-t3517.c | 3 ++-
arch/arm/mach-omap2/board-devkit8000.c | 5 +++--
arch/arm/mach-omap2/board-generic.c | 3 ++-
arch/arm/mach-omap2/board-h4.c | 3 ++-
arch/arm/mach-omap2/board-igep0020.c | 4 +++-
arch/arm/mach-omap2/board-igep0030.c | 4 +++-
arch/arm/mach-omap2/board-ldp.c | 3 ++-
arch/arm/mach-omap2/board-n8x0.c | 3 ++-
arch/arm/mach-omap2/board-omap3beagle.c | 5 +++--
arch/arm/mach-omap2/board-omap3evm.c | 3 ++-
arch/arm/mach-omap2/board-omap3logic.c | 3 ++-
arch/arm/mach-omap2/board-omap3pandora.c | 5 +++--
arch/arm/mach-omap2/board-omap3stalker.c | 3 ++-
arch/arm/mach-omap2/board-omap3touchbook.c | 5 +++--
arch/arm/mach-omap2/board-omap4panda.c | 3 ++-
arch/arm/mach-omap2/board-overo.c | 5 +++--
arch/arm/mach-omap2/board-rx51.c | 3 ++-
arch/arm/mach-omap2/board-zoom.c | 9 +++++----
arch/arm/mach-omap2/io.c | 16 ++++++++++++----
arch/arm/plat-omap/include/plat/io.h | 5 +++--
27 files changed, 76 insertions(+), 41 deletions(-)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index b527f8d..7de5e5a 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 4e3742c..2452dac8c 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index bbcf580..40e816a 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index df5a425..d6f4798 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -217,7 +217,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
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 0739950..14039f5 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 2c6db1a..294bfdf 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -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();
omap_gpio_init();
apollon_init_smc91x();
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 63f764e..583b2ca 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -683,7 +683,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();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 1dd303e..3820a3c 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 53ac762..39cc593 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -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);
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index b1c2c9a..0e3d81e 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 929993b..259a765 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -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();
omap_gpio_init();
h4_init_flash();
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index fe76b59..dc01b89 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -482,7 +482,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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index 22b0b25..a8907c5 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 001fd97..0e373f3 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -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();
omap_gpio_init();
ldp_init_smsc911x();
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index ebd460e..20dc4c1 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -741,7 +741,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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 14f4224..4b48e55 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -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);
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index b04365c..c82a80a 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 5f7d2c1..8ee2478 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 89ed1be..a9eb59d 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index f252721..a92d4ea 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -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);
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 41104bb..f9281de 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -422,8 +422,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);
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 1ecd0a6..53ea55e 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -76,7 +76,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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 7053bc0..03fa2fd 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -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();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 36f2cf4..74f1f92 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -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 = rx51_get_sdram_timings();
- omap2_init_common_hw(sdrc_params, sdrc_params);
+ omap2_init_common_devices(sdrc_params, sdrc_params);
omap_init_irq();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 3da69e4..057638f 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -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();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 40562dd..90ce77a 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -311,11 +311,8 @@ static int __init _omap2_init_reprogram_sdrc(void)
return v;
}
-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())
@@ -340,6 +337,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();
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index 128b549..f0ad64c 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -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(p,s,t) omap_ioremap(p,s,t)
#define __arch_iounmap(v) omap_iounmap(v)
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/8] OMAP2+: hwmod: allow custom pre-shutdown functions
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
2010-11-16 10:18 ` [PATCH 1/8] OMAP2+: io: split omap2_init_common_hw() Paul Walmsley
@ 2010-11-16 10:18 ` Paul Walmsley
2010-11-16 10:18 ` [PATCH 3/8] OMAP2+: hwmod: add postsetup state Paul Walmsley
` (6 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 10:18 UTC (permalink / raw)
To: linux-arm-kernel
Some OMAP IP blocks, such as the watchdog timers, cannot be completely
shut down via the standard hwmod shutdown mechanism. This patch
enables the hwmod data files to supply a pointer to a custom
pre-shutdown function via the struct omap_hwmod_class.pre_shutdown
function pointer. If the struct omap_hwmod_class.pre_shutdown
function pointer is non-null, the function will be executed before the
existing hwmod shutdown code runs.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 15 +++++++++++++++
arch/arm/plat-omap/include/plat/omap_hwmod.h | 10 ++++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 5a30658..c051fa4 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1261,6 +1261,9 @@ int _omap_hwmod_idle(struct omap_hwmod *oh)
*/
static int _shutdown(struct omap_hwmod *oh)
{
+ int ret;
+ u8 prev_state;
+
if (oh->_state != _HWMOD_STATE_IDLE &&
oh->_state != _HWMOD_STATE_ENABLED) {
WARN(1, "omap_hwmod: %s: disabled state can only be entered "
@@ -1270,6 +1273,18 @@ static int _shutdown(struct omap_hwmod *oh)
pr_debug("omap_hwmod: %s: disabling\n", oh->name);
+ if (oh->class->pre_shutdown) {
+ prev_state = oh->_state;
+ if (oh->_state == _HWMOD_STATE_IDLE)
+ _omap_hwmod_enable(oh);
+ ret = oh->class->pre_shutdown(oh);
+ if (ret) {
+ if (prev_state == _HWMOD_STATE_IDLE)
+ _omap_hwmod_idle(oh);
+ return ret;
+ }
+ }
+
if (oh->class->sysc)
_shutdown_sysc(oh);
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 7eaa8ed..d1f1265 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -415,14 +415,24 @@ struct omap_hwmod_omap4_prcm {
* @name: name of the hwmod_class
* @sysc: device SYSCONFIG/SYSSTATUS register data
* @rev: revision of the IP class
+ * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
*
* Represent the class of a OMAP hardware "modules" (e.g. timer,
* smartreflex, gpio, uart...)
+ *
+ * @pre_shutdown is a function that will be run immediately before
+ * hwmod clocks are disabled, etc. It is intended for use for hwmods
+ * like the MPU watchdog, which cannot be disabled with the standard
+ * omap_hwmod_shutdown(). The function should return 0 upon success,
+ * or some negative error upon failure. Returning an error will cause
+ * omap_hwmod_shutdown() to abort the device shutdown and return an
+ * error.
*/
struct omap_hwmod_class {
const char *name;
struct omap_hwmod_class_sysconfig *sysc;
u32 rev;
+ int (*pre_shutdown)(struct omap_hwmod *oh);
};
/**
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/8] OMAP2+: hwmod: add postsetup state
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
2010-11-16 10:18 ` [PATCH 1/8] OMAP2+: io: split omap2_init_common_hw() Paul Walmsley
2010-11-16 10:18 ` [PATCH 2/8] OMAP2+: hwmod: allow custom pre-shutdown functions Paul Walmsley
@ 2010-11-16 10:18 ` Paul Walmsley
2010-11-16 10:18 ` [PATCH 4/8] OMAP2+: hwmod: add support for per-class custom device reset functions Paul Walmsley
` (5 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 10:18 UTC (permalink / raw)
To: linux-arm-kernel
Allow board files and OMAP core code to control the state that some or
all of the hwmods end up in at the end of _setup() (called by
omap_hwmod_late_init() ). Reimplement the old skip_setup_idle code in
terms of this new postsetup state code.
There are two use-cases for this patch: the !CONFIG_PM_RUNTIME case,
in which all IP blocks should stay enabled after _setup() finishes;
and the MPU watchdog case, in which the watchdog IP block should enter
idle if watchdog coverage of kernel initialization is desired, and
should be disabled otherwise.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Charulatha Varadarajan <charu@ti.com>
---
arch/arm/mach-omap2/io.c | 32 ++++++----
arch/arm/mach-omap2/omap_hwmod.c | 82 ++++++++++++++++++++------
arch/arm/plat-omap/include/plat/omap_hwmod.h | 6 ++
3 files changed, 88 insertions(+), 32 deletions(-)
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 90ce77a..39ab1ec 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -311,8 +311,15 @@ static int __init _omap2_init_reprogram_sdrc(void)
return v;
}
+static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
+{
+ return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
+}
+
void __init omap2_init_common_infrastructure(void)
{
+ u8 postsetup_state;
+
pwrdm_init(powerdomains_omap);
clkdm_init(clockdomains_omap, clkdm_autodeps);
if (cpu_is_omap242x())
@@ -323,6 +330,16 @@ void __init omap2_init_common_infrastructure(void)
omap3xxx_hwmod_init();
else if (cpu_is_omap44xx())
omap44xx_hwmod_init();
+ else
+ pr_err("Could not init hwmod data - unknown SoC\n");
+
+ /* Set the default postsetup state for all hwmods */
+#ifdef CONFIG_PM_RUNTIME
+ postsetup_state = _HWMOD_STATE_IDLE;
+#else
+ postsetup_state = _HWMOD_STATE_ENABLED;
+#endif
+ omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
/* The OPP tables have to be registered before a clk init */
omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
@@ -336,25 +353,16 @@ void __init omap2_init_common_infrastructure(void)
else if (cpu_is_omap44xx())
omap4xxx_clk_init();
else
- pr_err("Could not init clock framework - unknown CPU\n");
+ pr_err("Could not init clock framework - unknown SoC\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();
-#ifndef CONFIG_PM_RUNTIME
- skip_setup_idle = 1;
-#endif
- omap_hwmod_late_init(skip_setup_idle);
+ omap_hwmod_late_init();
+
if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
_omap2_init_reprogram_sdrc();
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index c051fa4..683428f 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1313,23 +1313,15 @@ static int _shutdown(struct omap_hwmod *oh)
/**
* _setup - do initial configuration of omap_hwmod
* @oh: struct omap_hwmod *
- * @skip_setup_idle_p: do not idle hwmods at the end of the fn if 1
*
* Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh
- * OCP_SYSCONFIG register. @skip_setup_idle is intended to be used on
- * a system that will not call omap_hwmod_enable() to enable devices
- * (e.g., a system without PM runtime). Returns -EINVAL if the hwmod
- * is in the wrong state or returns 0.
+ * OCP_SYSCONFIG register. Returns -EINVAL if the hwmod is in the
+ * wrong state or returns 0.
*/
static int _setup(struct omap_hwmod *oh, void *data)
{
int i, r;
- u8 skip_setup_idle;
-
- if (!oh || !data)
- return -EINVAL;
-
- skip_setup_idle = *(u8 *)data;
+ u8 postsetup_state;
/* Set iclk autoidle mode */
if (oh->slaves_cnt > 0) {
@@ -1349,7 +1341,6 @@ static int _setup(struct omap_hwmod *oh, void *data)
}
}
- mutex_init(&oh->_mutex);
oh->_state = _HWMOD_STATE_INITIALIZED;
/*
@@ -1383,8 +1374,25 @@ static int _setup(struct omap_hwmod *oh, void *data)
}
}
- if (!(oh->flags & HWMOD_INIT_NO_IDLE) && !skip_setup_idle)
+ postsetup_state = oh->_postsetup_state;
+ if (postsetup_state == _HWMOD_STATE_UNKNOWN)
+ postsetup_state = _HWMOD_STATE_ENABLED;
+
+ /*
+ * XXX HWMOD_INIT_NO_IDLE does not belong in hwmod data -
+ * it should be set by the core code as a runtime flag during startup
+ */
+ if ((oh->flags & HWMOD_INIT_NO_IDLE) &&
+ (postsetup_state == _HWMOD_STATE_IDLE))
+ postsetup_state = _HWMOD_STATE_ENABLED;
+
+ if (postsetup_state == _HWMOD_STATE_IDLE)
_omap_hwmod_idle(oh);
+ else if (postsetup_state == _HWMOD_STATE_DISABLED)
+ _shutdown(oh);
+ else if (postsetup_state != _HWMOD_STATE_ENABLED)
+ WARN(1, "hwmod: %s: unknown postsetup state %d! defaulting to enabled\n",
+ oh->name, postsetup_state);
return 0;
}
@@ -1485,6 +1493,8 @@ int omap_hwmod_register(struct omap_hwmod *oh)
list_add_tail(&oh->node, &omap_hwmod_list);
+ mutex_init(&oh->_mutex);
+
oh->_state = _HWMOD_STATE_REGISTERED;
ret = 0;
@@ -1585,13 +1595,12 @@ int omap_hwmod_init(struct omap_hwmod **ohs)
/**
* omap_hwmod_late_init - do some post-clock framework initialization
- * @skip_setup_idle: if 1, do not idle hwmods in _setup()
*
* Must be called after omap2_clk_init(). Resolves the struct clk names
* to struct clk pointers for each registered omap_hwmod. Also calls
* _setup() on each hwmod. Returns 0.
*/
-int omap_hwmod_late_init(u8 skip_setup_idle)
+int omap_hwmod_late_init(void)
{
int r;
@@ -1603,10 +1612,7 @@ int omap_hwmod_late_init(u8 skip_setup_idle)
WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n",
MPU_INITIATOR_NAME);
- if (skip_setup_idle)
- pr_debug("omap_hwmod: will leave hwmods enabled during setup\n");
-
- omap_hwmod_for_each(_setup, &skip_setup_idle);
+ omap_hwmod_for_each(_setup, NULL);
return 0;
}
@@ -2132,3 +2138,41 @@ int omap_hwmod_for_each_by_class(const char *classname,
return ret;
}
+/**
+ * omap_hwmod_set_postsetup_state - set the post-_setup() state for this hwmod
+ * @oh: struct omap_hwmod *
+ * @state: state that _setup() should leave the hwmod in
+ *
+ * Sets the hwmod state that @oh will enter at the end of _setup() (called by
+ * omap_hwmod_late_init()). Only valid to call between calls to
+ * omap_hwmod_init() and omap_hwmod_late_init(). Returns 0 upon success or
+ * -EINVAL if there is a problem with the arguments or if the hwmod is
+ * in the wrong state.
+ */
+int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
+{
+ int ret;
+
+ if (!oh)
+ return -EINVAL;
+
+ if (state != _HWMOD_STATE_DISABLED &&
+ state != _HWMOD_STATE_ENABLED &&
+ state != _HWMOD_STATE_IDLE)
+ return -EINVAL;
+
+ mutex_lock(&oh->_mutex);
+
+ if (oh->_state != _HWMOD_STATE_REGISTERED) {
+ ret = -EINVAL;
+ goto ohsps_unlock;
+ }
+
+ oh->_postsetup_state = state;
+ ret = 0;
+
+ohsps_unlock:
+ mutex_unlock(&oh->_mutex);
+
+ return ret;
+}
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index d1f1265..b445ecd 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -462,6 +462,7 @@ struct omap_hwmod_class {
* @response_lat: device OCP response latency (in interface clock cycles)
* @_int_flags: internal-use hwmod flags
* @_state: internal-use hwmod state
+ * @_postsetup_state: internal-use state to leave the hwmod in after _setup()
* @flags: hwmod flags (documented below)
* @omap_chip: OMAP chips this hwmod is present on
* @_mutex: mutex serializing operations on this hwmod
@@ -510,6 +511,7 @@ struct omap_hwmod {
u8 hwmods_cnt;
u8 _int_flags;
u8 _state;
+ u8 _postsetup_state;
const struct omap_chip_id omap_chip;
};
@@ -519,7 +521,7 @@ int omap_hwmod_unregister(struct omap_hwmod *oh);
struct omap_hwmod *omap_hwmod_lookup(const char *name);
int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
void *data);
-int omap_hwmod_late_init(u8 skip_setup_idle);
+int omap_hwmod_late_init(void);
int omap_hwmod_enable(struct omap_hwmod *oh);
int _omap_hwmod_enable(struct omap_hwmod *oh);
@@ -566,6 +568,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
void *user),
void *user);
+int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
+
/*
* Chip variant-specific hwmod init routines - XXX should be converted
* to use initcalls once the initial boot ordering is straightened out
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 4/8] OMAP2+: hwmod: add support for per-class custom device reset functions
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
` (2 preceding siblings ...)
2010-11-16 10:18 ` [PATCH 3/8] OMAP2+: hwmod: add postsetup state Paul Walmsley
@ 2010-11-16 10:18 ` Paul Walmsley
2010-11-16 10:18 ` [PATCH 5/8] OMAP2+: hwmod: rename omap_hwmod_mutex to _hwmod_list_mutex Paul Walmsley
` (4 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 10:18 UTC (permalink / raw)
To: linux-arm-kernel
The standard omap_hwmod.c _reset() code relies on an IP block's
OCP_SYSCONFIG.SOFTRESET register bit to reset the IP block. This
works for most IP blocks on the chip, but unfortunately not all. For
example, initiator-only IP blocks often don't have any MPU-accessible
OCP-header registers, and therefore the MPU can't write to any
OCP_SYSCONFIG registers in that block. Other IP blocks, such as the
IVA, require a specialized reset sequence.
Since we need to be able to reset these IP blocks as well, allow
custom IP block reset functions to be passed into the hwmod code via a
per-hwmod-class reset function pointer, struct omap_hwmod_class.reset.
If .reset is non-null, then the hwmod _reset() code will call the custom
function instead of the standard OCP SOFTRESET-based code.
As part of this change, rename most of the existing _reset() function
code to _ocp_softreset(), to indicate more clearly that it does not work
for all cases.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
Cc: Paul Hunt <hunt@ti.com>
Cc: Stanley Liu <stanley_liu@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 38 +++++++++++++++++++++++---
arch/arm/plat-omap/include/plat/omap_hwmod.h | 9 +++++-
2 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 683428f..12a0b9a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1089,7 +1089,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
}
/**
- * _reset - reset an omap_hwmod
+ * _ocp_softreset - reset an omap_hwmod via the OCP_SYSCONFIG bit
* @oh: struct omap_hwmod *
*
* Resets an omap_hwmod @oh via the OCP_SYSCONFIG bit. hwmod must be
@@ -1098,12 +1098,13 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
* the module did not reset in time, or 0 upon success.
*
* In OMAP3 a specific SYSSTATUS register is used to get the reset status.
- * Starting in OMAP4, some IPs does not have SYSSTATUS register and instead
+ * Starting in OMAP4, some IPs do not have SYSSTATUS registers and instead
* use the SYSCONFIG softreset bit to provide the status.
*
- * Note that some IP like McBSP does have a reset control but no reset status.
+ * Note that some IP like McBSP do have reset control but don't have
+ * reset status.
*/
-static int _reset(struct omap_hwmod *oh)
+static int _ocp_softreset(struct omap_hwmod *oh)
{
u32 v;
int c = 0;
@@ -1124,7 +1125,7 @@ static int _reset(struct omap_hwmod *oh)
if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET)
_enable_optional_clocks(oh);
- pr_debug("omap_hwmod: %s: resetting\n", oh->name);
+ pr_debug("omap_hwmod: %s: resetting via OCP SOFTRESET\n", oh->name);
v = oh->_sysc_cache;
ret = _set_softreset(oh, &v);
@@ -1164,6 +1165,33 @@ dis_opt_clks:
}
/**
+ * _reset - reset an omap_hwmod
+ * @oh: struct omap_hwmod *
+ *
+ * Resets an omap_hwmod @oh. The default software reset mechanism for
+ * most OMAP IP blocks is triggered via the OCP_SYSCONFIG.SOFTRESET
+ * bit. However, some hwmods cannot be reset via this method: some
+ * are not targets and therefore have no OCP header registers to
+ * access; others (like the IVA) have idiosyncratic reset sequences.
+ * So for these relatively rare cases, custom reset code can be
+ * supplied in the struct omap_hwmod_class .reset function pointer.
+ * Passes along the return value from either _reset() or the custom
+ * reset function - these must return -EINVAL if the hwmod cannot be
+ * reset this way or if the hwmod is in the wrong state, -ETIMEDOUT if
+ * the module did not reset in time, or 0 upon success.
+ */
+static int _reset(struct omap_hwmod *oh)
+{
+ int ret;
+
+ pr_debug("omap_hwmod: %s: resetting\n", oh->name);
+
+ ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh);
+
+ return ret;
+}
+
+/**
* _omap_hwmod_enable - enable an omap_hwmod
* @oh: struct omap_hwmod *
*
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index b445ecd..e4c4fd4 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -364,7 +364,7 @@ struct omap_hwmod_omap4_prcm {
* when module is enabled, rather than the default, which is to
* enable autoidle
* HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
- * HWMOD_NO_IDLEST : this module does not have idle status - this is the case
+ * HWMOD_NO_IDLEST: this module does not have idle status - this is the case
* only for few initiator modules on OMAP2 & 3.
* HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset.
* This is needed for devices like DSS that require optional clocks enabled
@@ -416,6 +416,7 @@ struct omap_hwmod_omap4_prcm {
* @sysc: device SYSCONFIG/SYSSTATUS register data
* @rev: revision of the IP class
* @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
+ * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
*
* Represent the class of a OMAP hardware "modules" (e.g. timer,
* smartreflex, gpio, uart...)
@@ -427,12 +428,18 @@ struct omap_hwmod_omap4_prcm {
* or some negative error upon failure. Returning an error will cause
* omap_hwmod_shutdown() to abort the device shutdown and return an
* error.
+ *
+ * If @reset is defined, then the function it points to will be
+ * executed in place of the standard hwmod _reset() code in
+ * mach-omap2/omap_hwmod.c. This is needed for IP blocks which have
+ * unusual reset sequences - usually processor IP blocks like the IVA.
*/
struct omap_hwmod_class {
const char *name;
struct omap_hwmod_class_sysconfig *sysc;
u32 rev;
int (*pre_shutdown)(struct omap_hwmod *oh);
+ int (*reset)(struct omap_hwmod *oh);
};
/**
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/8] OMAP2+: hwmod: rename omap_hwmod_mutex to _hwmod_list_mutex
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
` (3 preceding siblings ...)
2010-11-16 10:18 ` [PATCH 4/8] OMAP2+: hwmod: add support for per-class custom device reset functions Paul Walmsley
@ 2010-11-16 10:18 ` Paul Walmsley
2010-11-16 17:32 ` Cousson, Benoit
2010-11-16 10:18 ` [PATCH 6/8] OMAP2+: hwmod: upgrade per-hwmod mutex to a spinlock Paul Walmsley
` (3 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 10:18 UTC (permalink / raw)
To: linux-arm-kernel
This trivial patch renames omap_hwmod_mutex to _hwmod_list_mutex to indicate
clearly that it is only used for hwmod list manipulation operations.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 12a0b9a..0e85278 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -156,7 +156,8 @@
/* omap_hwmod_list contains all registered struct omap_hwmods */
static LIST_HEAD(omap_hwmod_list);
-static DEFINE_MUTEX(omap_hwmod_mutex);
+/* _hwmod_list_mutex protects the list of registered hwmods */
+static DEFINE_MUTEX(_hwmod_list_mutex);
/* mpu_oh: used to add/remove MPU initiator from sleepdep list */
static struct omap_hwmod *mpu_oh;
@@ -874,7 +875,7 @@ static void _shutdown_sysc(struct omap_hwmod *oh)
* @name: find an omap_hwmod by name
*
* Return a pointer to an omap_hwmod by name, or NULL if not found.
- * Caller must hold omap_hwmod_mutex.
+ * Caller must hold _hwmod_list_mutex.
*/
static struct omap_hwmod *_lookup(const char *name)
{
@@ -1502,7 +1503,7 @@ int omap_hwmod_register(struct omap_hwmod *oh)
(oh->_state != _HWMOD_STATE_UNKNOWN))
return -EINVAL;
- mutex_lock(&omap_hwmod_mutex);
+ mutex_lock(&_hwmod_list_mutex);
pr_debug("omap_hwmod: %s: registering\n", oh->name);
@@ -1528,7 +1529,7 @@ int omap_hwmod_register(struct omap_hwmod *oh)
ret = 0;
ohr_unlock:
- mutex_unlock(&omap_hwmod_mutex);
+ mutex_unlock(&_hwmod_list_mutex);
return ret;
}
@@ -1546,9 +1547,9 @@ struct omap_hwmod *omap_hwmod_lookup(const char *name)
if (!name)
return NULL;
- mutex_lock(&omap_hwmod_mutex);
+ mutex_lock(&_hwmod_list_mutex);
oh = _lookup(name);
- mutex_unlock(&omap_hwmod_mutex);
+ mutex_unlock(&_hwmod_list_mutex);
return oh;
}
@@ -1574,13 +1575,13 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
if (!fn)
return -EINVAL;
- mutex_lock(&omap_hwmod_mutex);
+ mutex_lock(&_hwmod_list_mutex);
list_for_each_entry(temp_oh, &omap_hwmod_list, node) {
ret = (*fn)(temp_oh, data);
if (ret)
break;
}
- mutex_unlock(&omap_hwmod_mutex);
+ mutex_unlock(&_hwmod_list_mutex);
return ret;
}
@@ -1663,10 +1664,10 @@ int omap_hwmod_unregister(struct omap_hwmod *oh)
pr_debug("omap_hwmod: %s: unregistering\n", oh->name);
- mutex_lock(&omap_hwmod_mutex);
+ mutex_lock(&_hwmod_list_mutex);
iounmap(oh->_mpu_rt_va);
list_del(&oh->node);
- mutex_unlock(&omap_hwmod_mutex);
+ mutex_unlock(&_hwmod_list_mutex);
return 0;
}
@@ -2125,7 +2126,7 @@ int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name)
* @user: arbitrary context data to pass to the callback function
*
* For each omap_hwmod of class @classname, call @fn. Takes
- * omap_hwmod_mutex to prevent the hwmod list from changing during the
+ * _hwmod_list_mutex to prevent the hwmod list from changing during the
* iteration. If the callback function returns something other than
* zero, the iterator is terminated, and the callback function's return
* value is passed back to the caller. Returns 0 upon success, -EINVAL
@@ -2145,7 +2146,7 @@ int omap_hwmod_for_each_by_class(const char *classname,
pr_debug("omap_hwmod: %s: looking for modules of class %s\n",
__func__, classname);
- mutex_lock(&omap_hwmod_mutex);
+ mutex_lock(&_hwmod_list_mutex);
list_for_each_entry(temp_oh, &omap_hwmod_list, node) {
if (!strcmp(temp_oh->class->name, classname)) {
@@ -2157,7 +2158,7 @@ int omap_hwmod_for_each_by_class(const char *classname,
}
}
- mutex_unlock(&omap_hwmod_mutex);
+ mutex_unlock(&_hwmod_list_mutex);
if (ret)
pr_debug("omap_hwmod: %s: iterator terminated early: %d\n",
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 6/8] OMAP2+: hwmod: upgrade per-hwmod mutex to a spinlock
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
` (4 preceding siblings ...)
2010-11-16 10:18 ` [PATCH 5/8] OMAP2+: hwmod: rename omap_hwmod_mutex to _hwmod_list_mutex Paul Walmsley
@ 2010-11-16 10:18 ` Paul Walmsley
2010-12-15 4:03 ` Paul Walmsley
2010-11-16 10:18 ` [PATCH 7/8] OMAP2+: hwmod: fix a warning, add some docs, remove unused fields Paul Walmsley
` (2 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 10:18 UTC (permalink / raw)
To: linux-arm-kernel
Change the per-hwmod mutex to a spinlock. (The per-hwmod lock
serializes most post-initialization hwmod operations such as enable,
idle, and shutdown.) Spinlocks are needed, because in some cases,
hwmods must be enabled from timer interrupt disabled-context, such as
an ISR. The current use-case that is driving this is the OMAP GPIO
block ISR: it can trigger interrupts even with its clocks disabled,
but these clocks are needed for register accesses in the ISR to succeed.
This patch also effectively reverts commit
848240223c35fcc71c424ad51a8e8aef42d3879c - this patch makes
_omap_hwmod_enable() and _omap_hwmod_init() static, renames them back
to _enable() and _idle(), and changes their callers to call the
spinlocking versions. Previously, since omap_hwmod_{enable,init}()
attempted to take mutexes, these functions could not be called while
the timer interrupt was disabled; but now that the functions use
spinlocks and save and restore the IRQ state, it is appropriate to
call them directly.
Kevin Hilman <khilman@deeprootsystems.com> originally proposed this
patch - thanks Kevin.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 105 +++++++++++++++-----------
arch/arm/mach-omap2/serial.c | 9 --
arch/arm/plat-omap/include/plat/omap_hwmod.h | 6 +
3 files changed, 64 insertions(+), 56 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 0e85278..589c282 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -135,6 +135,7 @@
#include <linux/err.h>
#include <linux/list.h>
#include <linux/mutex.h>
+#include <linux/spinlock.h>
#include <plat/common.h>
#include <plat/cpu.h>
@@ -1193,17 +1194,14 @@ static int _reset(struct omap_hwmod *oh)
}
/**
- * _omap_hwmod_enable - enable an omap_hwmod
+ * _enable - enable an omap_hwmod
* @oh: struct omap_hwmod *
*
* Enables an omap_hwmod @oh such that the MPU can access the hwmod's
- * register target. (This function has a full name --
- * _omap_hwmod_enable() rather than simply _enable() -- because it is
- * currently required by the pm34xx.c idle loop.) Returns -EINVAL if
- * the hwmod is in the wrong state or passes along the return value of
- * _wait_target_ready().
+ * register target. Returns -EINVAL if the hwmod is in the wrong
+ * state or passes along the return value of _wait_target_ready().
*/
-int _omap_hwmod_enable(struct omap_hwmod *oh)
+static int _enable(struct omap_hwmod *oh)
{
int r;
@@ -1250,16 +1248,14 @@ int _omap_hwmod_enable(struct omap_hwmod *oh)
}
/**
- * _omap_hwmod_idle - idle an omap_hwmod
+ * _idle - idle an omap_hwmod
* @oh: struct omap_hwmod *
*
* Idles an omap_hwmod @oh. This should be called once the hwmod has
- * no further work. (This function has a full name --
- * _omap_hwmod_idle() rather than simply _idle() -- because it is
- * currently required by the pm34xx.c idle loop.) Returns -EINVAL if
- * the hwmod is in the wrong state or returns 0.
+ * no further work. Returns -EINVAL if the hwmod is in the wrong
+ * state or returns 0.
*/
-int _omap_hwmod_idle(struct omap_hwmod *oh)
+static int _idle(struct omap_hwmod *oh)
{
if (oh->_state != _HWMOD_STATE_ENABLED) {
WARN(1, "omap_hwmod: %s: idle state can only be entered from "
@@ -1305,11 +1301,11 @@ static int _shutdown(struct omap_hwmod *oh)
if (oh->class->pre_shutdown) {
prev_state = oh->_state;
if (oh->_state == _HWMOD_STATE_IDLE)
- _omap_hwmod_enable(oh);
+ _enable(oh);
ret = oh->class->pre_shutdown(oh);
if (ret) {
if (prev_state == _HWMOD_STATE_IDLE)
- _omap_hwmod_idle(oh);
+ _idle(oh);
return ret;
}
}
@@ -1382,7 +1378,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
if ((oh->flags & HWMOD_INIT_NO_RESET) && oh->rst_lines_cnt == 1)
return 0;
- r = _omap_hwmod_enable(oh);
+ r = _enable(oh);
if (r) {
pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n",
oh->name, oh->_state);
@@ -1394,7 +1390,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
/*
* OCP_SYSCONFIG bits need to be reprogrammed after a softreset.
- * The _omap_hwmod_enable() function should be split to
+ * The _enable() function should be split to
* avoid the rewrite of the OCP_SYSCONFIG register.
*/
if (oh->class->sysc) {
@@ -1416,7 +1412,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
postsetup_state = _HWMOD_STATE_ENABLED;
if (postsetup_state == _HWMOD_STATE_IDLE)
- _omap_hwmod_idle(oh);
+ _idle(oh);
else if (postsetup_state == _HWMOD_STATE_DISABLED)
_shutdown(oh);
else if (postsetup_state != _HWMOD_STATE_ENABLED)
@@ -1522,7 +1518,7 @@ int omap_hwmod_register(struct omap_hwmod *oh)
list_add_tail(&oh->node, &omap_hwmod_list);
- mutex_init(&oh->_mutex);
+ spin_lock_init(&oh->_lock);
oh->_state = _HWMOD_STATE_REGISTERED;
@@ -1682,18 +1678,18 @@ int omap_hwmod_unregister(struct omap_hwmod *oh)
int omap_hwmod_enable(struct omap_hwmod *oh)
{
int r;
+ unsigned long flags;
if (!oh)
return -EINVAL;
- mutex_lock(&oh->_mutex);
- r = _omap_hwmod_enable(oh);
- mutex_unlock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
+ r = _enable(oh);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return r;
}
-
/**
* omap_hwmod_idle - idle an omap_hwmod
* @oh: struct omap_hwmod *
@@ -1703,12 +1699,14 @@ int omap_hwmod_enable(struct omap_hwmod *oh)
*/
int omap_hwmod_idle(struct omap_hwmod *oh)
{
+ unsigned long flags;
+
if (!oh)
return -EINVAL;
- mutex_lock(&oh->_mutex);
- _omap_hwmod_idle(oh);
- mutex_unlock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
+ _idle(oh);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return 0;
}
@@ -1723,12 +1721,14 @@ int omap_hwmod_idle(struct omap_hwmod *oh)
*/
int omap_hwmod_shutdown(struct omap_hwmod *oh)
{
+ unsigned long flags;
+
if (!oh)
return -EINVAL;
- mutex_lock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
_shutdown(oh);
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return 0;
}
@@ -1741,9 +1741,11 @@ int omap_hwmod_shutdown(struct omap_hwmod *oh)
*/
int omap_hwmod_enable_clocks(struct omap_hwmod *oh)
{
- mutex_lock(&oh->_mutex);
+ unsigned long flags;
+
+ spin_lock_irqsave(&oh->_lock, flags);
_enable_clocks(oh);
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return 0;
}
@@ -1756,9 +1758,11 @@ int omap_hwmod_enable_clocks(struct omap_hwmod *oh)
*/
int omap_hwmod_disable_clocks(struct omap_hwmod *oh)
{
- mutex_lock(&oh->_mutex);
+ unsigned long flags;
+
+ spin_lock_irqsave(&oh->_lock, flags);
_disable_clocks(oh);
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return 0;
}
@@ -1802,13 +1806,14 @@ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh)
int omap_hwmod_reset(struct omap_hwmod *oh)
{
int r;
+ unsigned long flags;
if (!oh)
return -EINVAL;
- mutex_lock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
r = _reset(oh);
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return r;
}
@@ -2005,13 +2010,15 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
*/
int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
{
+ unsigned long flags;
+
if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
return -EINVAL;
- mutex_lock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
_enable_wakeup(oh);
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return 0;
}
@@ -2030,13 +2037,15 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
*/
int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
{
+ unsigned long flags;
+
if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
return -EINVAL;
- mutex_lock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
_disable_wakeup(oh);
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return 0;
}
@@ -2056,13 +2065,14 @@ int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name)
{
int ret;
+ unsigned long flags;
if (!oh)
return -EINVAL;
- mutex_lock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
ret = _assert_hardreset(oh, name);
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return ret;
}
@@ -2082,13 +2092,14 @@ int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name)
int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name)
{
int ret;
+ unsigned long flags;
if (!oh)
return -EINVAL;
- mutex_lock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
ret = _deassert_hardreset(oh, name);
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return ret;
}
@@ -2107,13 +2118,14 @@ int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name)
int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name)
{
int ret;
+ unsigned long flags;
if (!oh)
return -EINVAL;
- mutex_lock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
ret = _read_hardreset(oh, name);
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return ret;
}
@@ -2181,6 +2193,7 @@ int omap_hwmod_for_each_by_class(const char *classname,
int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
{
int ret;
+ unsigned long flags;
if (!oh)
return -EINVAL;
@@ -2190,7 +2203,7 @@ int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
state != _HWMOD_STATE_IDLE)
return -EINVAL;
- mutex_lock(&oh->_mutex);
+ spin_lock_irqsave(&oh->_lock, flags);
if (oh->_state != _HWMOD_STATE_REGISTERED) {
ret = -EINVAL;
@@ -2201,7 +2214,7 @@ int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
ret = 0;
ohsps_unlock:
- mutex_unlock(&oh->_mutex);
+ spin_unlock_irqrestore(&oh->_lock, flags);
return ret;
}
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index becf0e3..1be0031 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -105,21 +105,16 @@ struct omap_uart_state {
static LIST_HEAD(uart_list);
static u8 num_uarts;
-/*
- * Since these idle/enable hooks are used in the idle path itself
- * which has interrupts disabled, use the non-locking versions of
- * the hwmod enable/disable functions.
- */
static int uart_idle_hwmod(struct omap_device *od)
{
- _omap_hwmod_idle(od->hwmods[0]);
+ omap_hwmod_idle(od->hwmods[0]);
return 0;
}
static int uart_enable_hwmod(struct omap_device *od)
{
- _omap_hwmod_enable(od->hwmods[0]);
+ omap_hwmod_enable(od->hwmods[0]);
return 0;
}
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index e4c4fd4..b588f47 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -32,7 +32,7 @@
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/ioport.h>
-#include <linux/mutex.h>
+#include <linux/spinlock.h>
#include <plat/cpu.h>
struct omap_device;
@@ -472,7 +472,7 @@ struct omap_hwmod_class {
* @_postsetup_state: internal-use state to leave the hwmod in after _setup()
* @flags: hwmod flags (documented below)
* @omap_chip: OMAP chips this hwmod is present on
- * @_mutex: mutex serializing operations on this hwmod
+ * @_lock: spinlock serializing operations on this hwmod
* @node: list node for hwmod list (internal use)
*
* @main_clk refers to this module's "main clock," which for our
@@ -502,7 +502,7 @@ struct omap_hwmod {
void *dev_attr;
u32 _sysc_cache;
void __iomem *_mpu_rt_va;
- struct mutex _mutex;
+ spinlock_t _lock;
struct list_head node;
u16 flags;
u8 _mpu_port_index;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 7/8] OMAP2+: hwmod: fix a warning, add some docs, remove unused fields
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
` (5 preceding siblings ...)
2010-11-16 10:18 ` [PATCH 6/8] OMAP2+: hwmod: upgrade per-hwmod mutex to a spinlock Paul Walmsley
@ 2010-11-16 10:18 ` Paul Walmsley
2010-11-16 10:18 ` [PATCH 8/8] OMAP2+: hwmod: Update the sysc_cache in case module context is lost Paul Walmsley
2010-11-16 16:47 ` [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
8 siblings, 0 replies; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 10:18 UTC (permalink / raw)
To: linux-arm-kernel
Trivial cleanup and documentation changes on the hwmod code and data:
- resolve the OMAP2430 hwmod data i2c_dev_attr warning
- add some hwmod documentation to indicate flags that should be moved
outside the static hwmod data in a future patch
- remove some unused fields in the struct omap_hwmod_ocp_if and
struct omap_hwmod structures
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_2430_data.c | 2 --
arch/arm/plat-omap/include/plat/omap_hwmod.h | 16 ++++------------
2 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 7cf0d3a..e4b8d7d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -475,8 +475,6 @@ static struct omap_hwmod_class i2c_class = {
.sysc = &i2c_sysc,
};
-static struct omap_i2c_dev_attr i2c_dev_attr;
-
/* I2C1 */
static struct omap_i2c_dev_attr i2c1_dev_attr = {
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index b588f47..62bdb23 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -23,7 +23,7 @@
* - add pinmuxing
* - init_conn_id_bit (CONNID_BIT_VECTOR)
* - implement default hwmod SMS/SDRC flags?
- * - remove unused fields
+ * - move Linux-specific data ("non-ROM data") out
*
*/
#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
@@ -159,7 +159,7 @@ struct omap_hwmod_omap2_firewall {
* ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init.
* ADDR_TYPE_RT: Address space contains module register target data.
*/
-#define ADDR_MAP_ON_INIT (1 << 0)
+#define ADDR_MAP_ON_INIT (1 << 0) /* XXX does not belong */
#define ADDR_TYPE_RT (1 << 1)
/**
@@ -200,8 +200,6 @@ struct omap_hwmod_addr_space {
* @fw: interface firewall data
* @addr_cnt: ARRAY_SIZE(@addr)
* @width: OCP data width
- * @thread_cnt: number of threads
- * @max_burst_len: maximum burst length in @width sized words (0 if unlimited)
* @user: initiators using this interface (see OCP_USER_* macros above)
* @flags: OCP interface flags (see OCPIF_* macros above)
*
@@ -221,8 +219,6 @@ struct omap_hwmod_ocp_if {
} fw;
u8 addr_cnt;
u8 width;
- u8 thread_cnt;
- u8 max_burst_len;
u8 user;
u8 flags;
};
@@ -357,9 +353,9 @@ struct omap_hwmod_omap4_prcm {
* HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out
* of standby, rather than relying on module smart-standby
* HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
- * SDRAM controller, etc.
+ * SDRAM controller, etc. XXX probably belongs outside the main hwmod file
* HWMOD_INIT_NO_IDLE: don't idle this module@boot - important for SDRAM
- * controller, etc.
+ * controller, etc. XXX probably belongs outside the main hwmod file
* HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
* when module is enabled, rather than the default, which is to
* enable autoidle
@@ -459,8 +455,6 @@ struct omap_hwmod_class {
* @_sysc_cache: internal-use hwmod flags
* @_mpu_rt_va: cached register target start address (internal use)
* @_mpu_port_index: cached MPU register target slave ID (internal use)
- * @msuspendmux_reg_id: CONTROL_MSUSPENDMUX register ID (1-6)
- * @msuspendmux_shift: CONTROL_MSUSPENDMUX register bit shift
* @mpu_irqs_cnt: number of @mpu_irqs
* @sdma_reqs_cnt: number of @sdma_reqs
* @opt_clks_cnt: number of @opt_clks
@@ -506,8 +500,6 @@ struct omap_hwmod {
struct list_head node;
u16 flags;
u8 _mpu_port_index;
- u8 msuspendmux_reg_id;
- u8 msuspendmux_shift;
u8 response_lat;
u8 mpu_irqs_cnt;
u8 sdma_reqs_cnt;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 8/8] OMAP2+: hwmod: Update the sysc_cache in case module context is lost
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
` (6 preceding siblings ...)
2010-11-16 10:18 ` [PATCH 7/8] OMAP2+: hwmod: fix a warning, add some docs, remove unused fields Paul Walmsley
@ 2010-11-16 10:18 ` Paul Walmsley
2010-11-16 16:47 ` [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
8 siblings, 0 replies; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 10:18 UTC (permalink / raw)
To: linux-arm-kernel
From: Rajendra Nayak <rnayak@ti.com>
Do not skip the sysc programming in the hmwod framework based
on the cached value alone, since at times the module might have lost
context (due to the Powerdomain in which the module belongs
transitions to either Open Switch RET or OFF).
Identifying if a module has lost context requires atleast one
register read, and since a register read has more latency than
a write, it makes sense to do a blind write always.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 589c282..8a9847e 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -211,10 +211,9 @@ static void _write_sysconfig(u32 v, struct omap_hwmod *oh)
/* XXX ensure module interface clock is up */
- if (oh->_sysc_cache != v) {
- oh->_sysc_cache = v;
- omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
- }
+ /* Module might have lost context, always update cache and register */
+ oh->_sysc_cache = v;
+ omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
}
/**
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
` (7 preceding siblings ...)
2010-11-16 10:18 ` [PATCH 8/8] OMAP2+: hwmod: Update the sysc_cache in case module context is lost Paul Walmsley
@ 2010-11-16 16:47 ` Paul Walmsley
2010-11-22 21:56 ` Kevin Hilman
8 siblings, 1 reply; 17+ messages in thread
From: Paul Walmsley @ 2010-11-16 16:47 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 16 Nov 2010, Paul Walmsley wrote:
> This patch series contains upgrades for the OMAP2+ hwmod core
> code, intended for 2.6.38. Most of these patches were developed
> in response to use-cases discovered while converting device
> drivers to use the hwmod code.
>
> Tested on an OMAP34xx BeagleBoard with omap2plus_defconfig.
Just FYI, this branch 'hwmod_a_2.6.38' is available at
git://git.pwsan.com/linux-2.6
Warning: it's based on Tony's tree, not the mainline, due to the recent
board file changes.
- Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 5/8] OMAP2+: hwmod: rename omap_hwmod_mutex to _hwmod_list_mutex
2010-11-16 10:18 ` [PATCH 5/8] OMAP2+: hwmod: rename omap_hwmod_mutex to _hwmod_list_mutex Paul Walmsley
@ 2010-11-16 17:32 ` Cousson, Benoit
2010-11-19 5:29 ` Paul Walmsley
0 siblings, 1 reply; 17+ messages in thread
From: Cousson, Benoit @ 2010-11-16 17:32 UTC (permalink / raw)
To: linux-arm-kernel
Hi Paul,
Funny, I was about to send you a RFC to get rid of that mutex :-)
Today that mutex is preventing us to be re-entrant during hwmod lookup
and for_each_by_class iteration, and we'd like to in order to manage
link between 2 hwmods.
The context is the link between mcbsp and sidetone on OMAP3. Since this
module are tightly coupled, I was suggesting to Kishon to add the
sidetone reference directly in the mcbsp hwmod in order to create a
omap_device that will handle the 2 hwmods at the same time.
Since we are using the iteration to get all the hwmod that belongs to
the mcbsp class we cannot call the lookup function to get the sidetone
hwmod at that time.
For the moment we need to do 2 iteration and use intermediate storage to
workaround that.
After checking the purpose of the mutex, I was wondering if this is
useful. For the moment the creation of the hwmod list is done only at
init time, and nothing is supposed to change that at runtime except the
unregister function.
So I've started to get rid of this function, then of the mutex and I
added the __init to all these registration functions to avoid the usage
at runtime. It will save a little bit of memory as well.
Thanks to that we can now use the omap_hwmod_lookup inside the
omap_hwmod_for_each_by_class.
Does that make sense to you?
I can send you the patches if you want.
Regards,
Benoit
On 11/16/2010 11:18 AM, Paul Walmsley wrote:
> This trivial patch renames omap_hwmod_mutex to _hwmod_list_mutex to indicate
> clearly that it is only used for hwmod list manipulation operations.
>
> Signed-off-by: Paul Walmsley<paul@pwsan.com>
> Cc: Beno?t Cousson<b-cousson@ti.com>
> ---
> arch/arm/mach-omap2/omap_hwmod.c | 27 ++++++++++++++-------------
> 1 files changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
> index 12a0b9a..0e85278 100644
> --- a/arch/arm/mach-omap2/omap_hwmod.c
> +++ b/arch/arm/mach-omap2/omap_hwmod.c
> @@ -156,7 +156,8 @@
> /* omap_hwmod_list contains all registered struct omap_hwmods */
> static LIST_HEAD(omap_hwmod_list);
>
> -static DEFINE_MUTEX(omap_hwmod_mutex);
> +/* _hwmod_list_mutex protects the list of registered hwmods */
> +static DEFINE_MUTEX(_hwmod_list_mutex);
>
> /* mpu_oh: used to add/remove MPU initiator from sleepdep list */
> static struct omap_hwmod *mpu_oh;
> @@ -874,7 +875,7 @@ static void _shutdown_sysc(struct omap_hwmod *oh)
> * @name: find an omap_hwmod by name
> *
> * Return a pointer to an omap_hwmod by name, or NULL if not found.
> - * Caller must hold omap_hwmod_mutex.
> + * Caller must hold _hwmod_list_mutex.
> */
> static struct omap_hwmod *_lookup(const char *name)
> {
> @@ -1502,7 +1503,7 @@ int omap_hwmod_register(struct omap_hwmod *oh)
> (oh->_state != _HWMOD_STATE_UNKNOWN))
> return -EINVAL;
>
> - mutex_lock(&omap_hwmod_mutex);
> + mutex_lock(&_hwmod_list_mutex);
>
> pr_debug("omap_hwmod: %s: registering\n", oh->name);
>
> @@ -1528,7 +1529,7 @@ int omap_hwmod_register(struct omap_hwmod *oh)
> ret = 0;
>
> ohr_unlock:
> - mutex_unlock(&omap_hwmod_mutex);
> + mutex_unlock(&_hwmod_list_mutex);
> return ret;
> }
>
> @@ -1546,9 +1547,9 @@ struct omap_hwmod *omap_hwmod_lookup(const char *name)
> if (!name)
> return NULL;
>
> - mutex_lock(&omap_hwmod_mutex);
> + mutex_lock(&_hwmod_list_mutex);
> oh = _lookup(name);
> - mutex_unlock(&omap_hwmod_mutex);
> + mutex_unlock(&_hwmod_list_mutex);
>
> return oh;
> }
> @@ -1574,13 +1575,13 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
> if (!fn)
> return -EINVAL;
>
> - mutex_lock(&omap_hwmod_mutex);
> + mutex_lock(&_hwmod_list_mutex);
> list_for_each_entry(temp_oh,&omap_hwmod_list, node) {
> ret = (*fn)(temp_oh, data);
> if (ret)
> break;
> }
> - mutex_unlock(&omap_hwmod_mutex);
> + mutex_unlock(&_hwmod_list_mutex);
>
> return ret;
> }
> @@ -1663,10 +1664,10 @@ int omap_hwmod_unregister(struct omap_hwmod *oh)
>
> pr_debug("omap_hwmod: %s: unregistering\n", oh->name);
>
> - mutex_lock(&omap_hwmod_mutex);
> + mutex_lock(&_hwmod_list_mutex);
> iounmap(oh->_mpu_rt_va);
> list_del(&oh->node);
> - mutex_unlock(&omap_hwmod_mutex);
> + mutex_unlock(&_hwmod_list_mutex);
>
> return 0;
> }
> @@ -2125,7 +2126,7 @@ int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name)
> * @user: arbitrary context data to pass to the callback function
> *
> * For each omap_hwmod of class @classname, call @fn. Takes
> - * omap_hwmod_mutex to prevent the hwmod list from changing during the
> + * _hwmod_list_mutex to prevent the hwmod list from changing during the
> * iteration. If the callback function returns something other than
> * zero, the iterator is terminated, and the callback function's return
> * value is passed back to the caller. Returns 0 upon success, -EINVAL
> @@ -2145,7 +2146,7 @@ int omap_hwmod_for_each_by_class(const char *classname,
> pr_debug("omap_hwmod: %s: looking for modules of class %s\n",
> __func__, classname);
>
> - mutex_lock(&omap_hwmod_mutex);
> + mutex_lock(&_hwmod_list_mutex);
>
> list_for_each_entry(temp_oh,&omap_hwmod_list, node) {
> if (!strcmp(temp_oh->class->name, classname)) {
> @@ -2157,7 +2158,7 @@ int omap_hwmod_for_each_by_class(const char *classname,
> }
> }
>
> - mutex_unlock(&omap_hwmod_mutex);
> + mutex_unlock(&_hwmod_list_mutex);
>
> if (ret)
> pr_debug("omap_hwmod: %s: iterator terminated early: %d\n",
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 5/8] OMAP2+: hwmod: rename omap_hwmod_mutex to _hwmod_list_mutex
2010-11-16 17:32 ` Cousson, Benoit
@ 2010-11-19 5:29 ` Paul Walmsley
0 siblings, 0 replies; 17+ messages in thread
From: Paul Walmsley @ 2010-11-19 5:29 UTC (permalink / raw)
To: linux-arm-kernel
Hi Beno?t,
On Tue, 16 Nov 2010, Cousson, Benoit wrote:
> Funny, I was about to send you a RFC to get rid of that mutex :-)
>
> Today that mutex is preventing us to be re-entrant during hwmod lookup and
> for_each_by_class iteration, and we'd like to in order to manage link between
> 2 hwmods.
>
> The context is the link between mcbsp and sidetone on OMAP3. Since this module
> are tightly coupled, I was suggesting to Kishon to add the sidetone reference
> directly in the mcbsp hwmod in order to create a omap_device that will handle
> the 2 hwmods at the same time.
>
> Since we are using the iteration to get all the hwmod that belongs to the
> mcbsp class we cannot call the lookup function to get the sidetone hwmod at
> that time.
> For the moment we need to do 2 iteration and use intermediate storage to
> workaround that.
>
> After checking the purpose of the mutex, I was wondering if this is useful.
> For the moment the creation of the hwmod list is done only at init time, and
> nothing is supposed to change that at runtime except the unregister function.
>
> So I've started to get rid of this function, then of the mutex and I added the
> __init to all these registration functions to avoid the usage at runtime. It
> will save a little bit of memory as well.
>
> Thanks to that we can now use the omap_hwmod_lookup inside the
> omap_hwmod_for_each_by_class.
>
> Does that make sense to you?
> I can send you the patches if you want.
Yep, that sounds fine to me. I'll plan to drop the mutex rename patch
once you send your patch to avoid the noise. I guess that
omap_hwmod_register() can become static also, and can be renamed to
_register(), and we'll just use omap_hwmod_init() as the entry point to
register hwmods.
- Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set
2010-11-16 16:47 ` [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
@ 2010-11-22 21:56 ` Kevin Hilman
2010-11-23 0:15 ` Paul Walmsley
0 siblings, 1 reply; 17+ messages in thread
From: Kevin Hilman @ 2010-11-22 21:56 UTC (permalink / raw)
To: linux-arm-kernel
Paul Walmsley <paul@pwsan.com> writes:
> On Tue, 16 Nov 2010, Paul Walmsley wrote:
>
>> This patch series contains upgrades for the OMAP2+ hwmod core
>> code, intended for 2.6.38. Most of these patches were developed
>> in response to use-cases discovered while converting device
>> drivers to use the hwmod code.
>>
>> Tested on an OMAP34xx BeagleBoard with omap2plus_defconfig.
>
> Just FYI, this branch 'hwmod_a_2.6.38' is available at
> git://git.pwsan.com/linux-2.6
>
> Warning: it's based on Tony's tree, not the mainline, due to the recent
> board file changes.
Looks like Tony has collected the board file changes into his
devel-board branch. Can this rebased there?
That way, I can included it as part of the PM branch testing without
having to pull in master.
Thanks,
Kevin
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set
2010-11-22 21:56 ` Kevin Hilman
@ 2010-11-23 0:15 ` Paul Walmsley
2010-12-07 21:41 ` Kevin Hilman
0 siblings, 1 reply; 17+ messages in thread
From: Paul Walmsley @ 2010-11-23 0:15 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 22 Nov 2010, Kevin Hilman wrote:
> Paul Walmsley <paul@pwsan.com> writes:
>
> > On Tue, 16 Nov 2010, Paul Walmsley wrote:
> >
> >> This patch series contains upgrades for the OMAP2+ hwmod core
> >> code, intended for 2.6.38. Most of these patches were developed
> >> in response to use-cases discovered while converting device
> >> drivers to use the hwmod code.
> >>
> >> Tested on an OMAP34xx BeagleBoard with omap2plus_defconfig.
> >
> > Just FYI, this branch 'hwmod_a_2.6.38' is available at
> > git://git.pwsan.com/linux-2.6
> >
> > Warning: it's based on Tony's tree, not the mainline, due to the recent
> > board file changes.
>
> Looks like Tony has collected the board file changes into his
> devel-board branch. Can this rebased there?
>
> That way, I can included it as part of the PM branch testing without
> having to pull in master.
hwmod_a_2.6.38 is now based on devel-board and wdt_2.6.38 is now rebased
on the updated hwmod_a_2.6.38.
- Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set
2010-11-23 0:15 ` Paul Walmsley
@ 2010-12-07 21:41 ` Kevin Hilman
0 siblings, 0 replies; 17+ messages in thread
From: Kevin Hilman @ 2010-12-07 21:41 UTC (permalink / raw)
To: linux-arm-kernel
Paul Walmsley <paul@pwsan.com> writes:
> On Mon, 22 Nov 2010, Kevin Hilman wrote:
>
>> Paul Walmsley <paul@pwsan.com> writes:
>>
>> > On Tue, 16 Nov 2010, Paul Walmsley wrote:
>> >
>> >> This patch series contains upgrades for the OMAP2+ hwmod core
>> >> code, intended for 2.6.38. Most of these patches were developed
>> >> in response to use-cases discovered while converting device
>> >> drivers to use the hwmod code.
>> >>
>> >> Tested on an OMAP34xx BeagleBoard with omap2plus_defconfig.
>> >
>> > Just FYI, this branch 'hwmod_a_2.6.38' is available at
>> > git://git.pwsan.com/linux-2.6
>> >
>> > Warning: it's based on Tony's tree, not the mainline, due to the recent
>> > board file changes.
>>
>> Looks like Tony has collected the board file changes into his
>> devel-board branch. Can this rebased there?
>>
>> That way, I can included it as part of the PM branch testing without
>> having to pull in master.
>
> hwmod_a_2.6.38 is now based on devel-board and wdt_2.6.38 is now rebased
> on the updated hwmod_a_2.6.38.
Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
Tested on 35xx/omap3evm, 34xx/n900 and 35xx/beagle.
Kevin
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 6/8] OMAP2+: hwmod: upgrade per-hwmod mutex to a spinlock
2010-11-16 10:18 ` [PATCH 6/8] OMAP2+: hwmod: upgrade per-hwmod mutex to a spinlock Paul Walmsley
@ 2010-12-15 4:03 ` Paul Walmsley
0 siblings, 0 replies; 17+ messages in thread
From: Paul Walmsley @ 2010-12-15 4:03 UTC (permalink / raw)
To: linux-arm-kernel
Hi Kevin, Beno?t,
On Tue, 16 Nov 2010, Paul Walmsley wrote:
> Change the per-hwmod mutex to a spinlock. (The per-hwmod lock
> serializes most post-initialization hwmod operations such as enable,
> idle, and shutdown.) Spinlocks are needed, because in some cases,
> hwmods must be enabled from timer interrupt disabled-context, such as
> an ISR. The current use-case that is driving this is the OMAP GPIO
> block ISR: it can trigger interrupts even with its clocks disabled,
> but these clocks are needed for register accesses in the ISR to succeed.
The more I think about this patch, the less I like it. At some point it
would be good to try to convert the OMAP clock code to using mutexes in as
many places as possible, rather than spinlocks. When that happens, this
is going to be a liability. Nevertheless I will leave it this patch in
for now by request, but this is just a simultaneous request: as we review
these hwmod conversions, we need to be very careful with any code that
will attempt to call the hwmod functions from timer-interrupt-disabled
context ... we should try to discourage it if at all possible and if that
is not possible, to put a big fat XXX comment there to review the
situation...
- Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/8] OMAP2+: io: split omap2_init_common_hw()
2010-11-16 10:18 ` [PATCH 1/8] OMAP2+: io: split omap2_init_common_hw() Paul Walmsley
@ 2010-12-21 22:38 ` Paul Walmsley
0 siblings, 0 replies; 17+ messages in thread
From: Paul Walmsley @ 2010-12-21 22:38 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 16 Nov 2010, Paul Walmsley wrote:
> 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.
This patch has been updated to fix the two new board files in Tony's
omap-for-linus branch, board-rm680.c and board-am3517crane.c. The revised
patch follows.
- Paul
[PATCH] OMAP2+: io: split omap2_init_common_hw()
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>
---
arch/arm/mach-omap2/board-2430sdp.c | 3 ++-
arch/arm/mach-omap2/board-3430sdp.c | 3 ++-
arch/arm/mach-omap2/board-3630sdp.c | 5 +++--
arch/arm/mach-omap2/board-4430sdp.c | 3 ++-
arch/arm/mach-omap2/board-am3517crane.c | 3 ++-
arch/arm/mach-omap2/board-am3517evm.c | 4 ++--
arch/arm/mach-omap2/board-apollon.c | 3 ++-
arch/arm/mach-omap2/board-cm-t35.c | 3 ++-
arch/arm/mach-omap2/board-cm-t3517.c | 3 ++-
arch/arm/mach-omap2/board-devkit8000.c | 5 +++--
arch/arm/mach-omap2/board-generic.c | 3 ++-
arch/arm/mach-omap2/board-h4.c | 3 ++-
arch/arm/mach-omap2/board-igep0020.c | 4 +++-
arch/arm/mach-omap2/board-igep0030.c | 4 +++-
arch/arm/mach-omap2/board-ldp.c | 3 ++-
arch/arm/mach-omap2/board-n8x0.c | 3 ++-
arch/arm/mach-omap2/board-omap3beagle.c | 5 +++--
arch/arm/mach-omap2/board-omap3evm.c | 3 ++-
arch/arm/mach-omap2/board-omap3logic.c | 3 ++-
arch/arm/mach-omap2/board-omap3pandora.c | 5 +++--
arch/arm/mach-omap2/board-omap3stalker.c | 3 ++-
arch/arm/mach-omap2/board-omap3touchbook.c | 5 +++--
arch/arm/mach-omap2/board-omap4panda.c | 3 ++-
arch/arm/mach-omap2/board-overo.c | 5 +++--
arch/arm/mach-omap2/board-rm680.c | 3 ++-
arch/arm/mach-omap2/board-rx51.c | 3 ++-
arch/arm/mach-omap2/board-zoom.c | 9 +++++----
arch/arm/mach-omap2/io.c | 16 ++++++++++++----
arch/arm/plat-omap/include/plat/io.h | 5 +++--
29 files changed, 80 insertions(+), 43 deletions(-)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index e9eee5f..e066177 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 869fb13..3b39ef1 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index a8d35ba..5d41dbe 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 33b1f73..1cb208b 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -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
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 8ba4047..781ed25 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 8686713..bc15626 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 200cb38..9f55b68 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 22c55d1..486a3de 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 7ee23da..5b0c777 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index a30a7fc..924b7cf 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -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);
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index b1c2c9a..0e3d81e 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 0a2d73c..db5d323 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index c5bd537..0afa301 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index 886f193..bcccd68 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 7455b0a..e5dc748 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index d4ce963..43af70e 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index f1a8ede..6c12760 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -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);
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 21ffc5c..3de8d9b 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index cfd618d..15e4b08 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index e64bcb6..d457b59 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 1af344b..9df9d93 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -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);
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index baa72c5..db1f74f 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -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);
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index b82f231..0d74f6c 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index b75bdcd..cb26e5d 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 8da65bd..cb77be7 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 7362c91..f53fc55 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 0dff9de..e041c53 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -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();
}
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 4605d50..ddb5fff 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -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())
@@ -360,6 +357,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();
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index 204865f..ef4106c 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -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
--
1.7.2.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
end of thread, other threads:[~2010-12-21 22:38 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-16 10:18 [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
2010-11-16 10:18 ` [PATCH 1/8] OMAP2+: io: split omap2_init_common_hw() Paul Walmsley
2010-12-21 22:38 ` Paul Walmsley
2010-11-16 10:18 ` [PATCH 2/8] OMAP2+: hwmod: allow custom pre-shutdown functions Paul Walmsley
2010-11-16 10:18 ` [PATCH 3/8] OMAP2+: hwmod: add postsetup state Paul Walmsley
2010-11-16 10:18 ` [PATCH 4/8] OMAP2+: hwmod: add support for per-class custom device reset functions Paul Walmsley
2010-11-16 10:18 ` [PATCH 5/8] OMAP2+: hwmod: rename omap_hwmod_mutex to _hwmod_list_mutex Paul Walmsley
2010-11-16 17:32 ` Cousson, Benoit
2010-11-19 5:29 ` Paul Walmsley
2010-11-16 10:18 ` [PATCH 6/8] OMAP2+: hwmod: upgrade per-hwmod mutex to a spinlock Paul Walmsley
2010-12-15 4:03 ` Paul Walmsley
2010-11-16 10:18 ` [PATCH 7/8] OMAP2+: hwmod: fix a warning, add some docs, remove unused fields Paul Walmsley
2010-11-16 10:18 ` [PATCH 8/8] OMAP2+: hwmod: Update the sysc_cache in case module context is lost Paul Walmsley
2010-11-16 16:47 ` [PATCH 0/8] OMAP2+: hwmod core upgrades for 2.6.38: first set Paul Walmsley
2010-11-22 21:56 ` Kevin Hilman
2010-11-23 0:15 ` Paul Walmsley
2010-12-07 21:41 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).