* [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-29 6:11 ` [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap " Santosh Shilimkar
` (4 more replies)
2011-03-28 22:21 ` [PATCH 02/10] omap: Set separate timer init functions to avoid cpu_is_omap tests Tony Lindgren
` (10 subsequent siblings)
11 siblings, 5 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
This allows us to remove cpu_is_omap calls from init_irq functions
and the irq handler. There should not be any need for cpu_is_omap
as at this point we only care about SoC generation, and not about
subcategories.
The main reason for the patch is that we want to initialize only
minimal omap specific code from the init_early call, and this and
the following patches get us closer to that goal.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap1/board-ams-delta.c | 2 -
arch/arm/mach-omap1/board-fsample.c | 2 -
arch/arm/mach-omap1/board-generic.c | 2 -
arch/arm/mach-omap1/board-h2.c | 2 -
arch/arm/mach-omap1/board-h3.c | 2 -
arch/arm/mach-omap1/board-htcherald.c | 2 -
arch/arm/mach-omap1/board-innovator.c | 2 -
arch/arm/mach-omap1/board-nokia770.c | 2 -
arch/arm/mach-omap1/board-osk.c | 2 -
arch/arm/mach-omap1/board-palmte.c | 2 -
arch/arm/mach-omap1/board-palmtt.c | 2 -
arch/arm/mach-omap1/board-palmz71.c | 2 -
arch/arm/mach-omap1/board-perseus2.c | 2 -
arch/arm/mach-omap1/board-sx1.c | 2 -
arch/arm/mach-omap1/board-voiceblue.c | 2 -
arch/arm/mach-omap1/irq.c | 2 -
arch/arm/mach-omap2/board-2430sdp.c | 2 -
arch/arm/mach-omap2/board-3430sdp.c | 2 -
arch/arm/mach-omap2/board-3630sdp.c | 2 -
arch/arm/mach-omap2/board-am3517crane.c | 2 -
arch/arm/mach-omap2/board-am3517evm.c | 2 -
arch/arm/mach-omap2/board-apollon.c | 2 -
arch/arm/mach-omap2/board-cm-t35.c | 2 -
arch/arm/mach-omap2/board-cm-t3517.c | 2 -
arch/arm/mach-omap2/board-devkit8000.c | 2 -
arch/arm/mach-omap2/board-generic.c | 2 -
arch/arm/mach-omap2/board-h4.c | 2 -
arch/arm/mach-omap2/board-igep0020.c | 2 -
arch/arm/mach-omap2/board-igep0030.c | 2 -
arch/arm/mach-omap2/board-ldp.c | 2 -
arch/arm/mach-omap2/board-n8x0.c | 6 +-
arch/arm/mach-omap2/board-omap3beagle.c | 2 -
arch/arm/mach-omap2/board-omap3evm.c | 2 -
arch/arm/mach-omap2/board-omap3logic.c | 4 +
arch/arm/mach-omap2/board-omap3pandora.c | 2 -
arch/arm/mach-omap2/board-omap3stalker.c | 2 -
arch/arm/mach-omap2/board-omap3touchbook.c | 2 -
arch/arm/mach-omap2/board-overo.c | 2 -
arch/arm/mach-omap2/board-rm680.c | 2 -
arch/arm/mach-omap2/board-rx51.c | 2 -
arch/arm/mach-omap2/board-ti8168evm.c | 7 --
arch/arm/mach-omap2/board-zoom.c | 4 +
arch/arm/mach-omap2/io.c | 17 ------
arch/arm/mach-omap2/irq.c | 84 ++++++++++++++++++++--------
arch/arm/mach-omap2/omap4-common.c | 6 ++
arch/arm/plat-omap/include/plat/irqs.h | 6 ++
46 files changed, 117 insertions(+), 93 deletions(-)
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index de88c92..17ed757 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -138,7 +138,7 @@ void ams_delta_latch2_write(u16 mask, u16 value)
static void __init ams_delta_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct map_desc ams_delta_io_desc[] __initdata = {
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 87f173d..eaff305 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -329,7 +329,7 @@ static void __init omap_fsample_init(void)
static void __init omap_fsample_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/* Only FPGA needs to be mapped here. All others are done with ioremap */
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 23f4ab9..3fd6b40 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -31,7 +31,7 @@
static void __init omap_generic_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/* assume no Mini-AB port */
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index ba3bd09..8147b04 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -376,7 +376,7 @@ static struct i2c_board_info __initdata h2_i2c_board_info[] = {
static void __init h2_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct omap_usb_config h2_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index ac48677..1b448f6 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -439,7 +439,7 @@ static void __init h3_init(void)
static void __init h3_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static void __init h3_map_io(void)
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index ba05a51..1bd4d8e 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -605,7 +605,7 @@ static void __init htcherald_init_irq(void)
{
printk(KERN_INFO "htcherald_init_irq.\n");
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
MACHINE_START(HERALD, "HTC Herald")
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 2d9b8cb..5926b0c 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -292,7 +292,7 @@ static void __init innovator_init_smc91x(void)
static void __init innovator_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
#ifdef CONFIG_ARCH_OMAP15XX
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index cfd0849..e3cf21d 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -51,7 +51,7 @@ static void __init omap_nokia770_init_irq(void)
omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static const unsigned int nokia770_keymap[] = {
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 7c5e211..aed8202 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -282,7 +282,7 @@ static void __init osk_init_cf(void)
static void __init osk_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct omap_usb_config osk_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index c9d38f4..8b6a881 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -62,7 +62,7 @@
static void __init omap_palmte_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static const unsigned int palmte_keymap[] = {
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index f04f2d3..f2de43d 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -266,7 +266,7 @@ static struct spi_board_info __initdata palmtt_boardinfo[] = {
static void __init omap_palmtt_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct omap_usb_config palmtt_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index d7bbbe7..7904018 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -61,7 +61,7 @@ static void __init
omap_palmz71_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static const unsigned int palmz71_keymap[] = {
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 3c8ee84..7f019e5 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -297,7 +297,7 @@ static void __init omap_perseus2_init(void)
static void __init omap_perseus2_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/* Only FPGA needs to be mapped here. All others are done with ioremap */
static struct map_desc omap_perseus2_io_desc[] __initdata = {
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index d41fe2d..027520f 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -411,7 +411,7 @@ static void __init omap_sx1_init(void)
static void __init omap_sx1_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/*----------------------------------------*/
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index bdc0ac8..a843f4c 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -162,7 +162,7 @@ static struct omap_board_config_kernel voiceblue_config[] = {
static void __init voiceblue_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static void __init voiceblue_map_io(void)
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index 731dd33..7d49359 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -175,7 +175,7 @@ static struct irq_chip omap_irq_chip = {
.irq_set_wake = omap_wake_irq,
};
-void __init omap_init_irq(void)
+void __init omap1_init_irq(void)
{
int i, j;
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 1fa6bb8..3d5a1de 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -277,7 +277,7 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
.reserve = omap_reserve,
.map_io = omap_2430sdp_map_io,
.init_early = omap_2430sdp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = omap_2430sdp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 9afd087..8859a74 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -909,7 +909,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_3430sdp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_3430sdp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index a5933cc..2ec2d76 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -219,7 +219,7 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_sdp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_sdp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index a890d24..bbd9c14 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -110,7 +110,7 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = am3517_crane_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = am3517_crane_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index ce7d5e6..6fc0479 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -516,7 +516,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = am3517_evm_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = am3517_evm_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index f4f8374..e764c9c 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -357,7 +357,7 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
.reserve = omap_reserve,
.map_io = omap_apollon_map_io,
.init_early = omap_apollon_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = omap_apollon_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 02a12b4..bc37d72 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -806,7 +806,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = cm_t35_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = cm_t35_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index a27e3ee..b5618a6 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -306,7 +306,7 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = cm_t3517_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = cm_t3517_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 65f9fde..9fedcd6 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -457,7 +457,7 @@ static void __init devkit8000_init_early(void)
static void __init devkit8000_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 73e3c31..ccd503a 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -70,7 +70,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
.reserve = omap_reserve,
.map_io = omap_generic_map_io,
.init_early = omap_generic_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = omap_generic_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index bac7933..2e16d6c 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -298,7 +298,7 @@ static void __init omap_h4_init_early(void)
static void __init omap_h4_init_irq(void)
{
- omap_init_irq();
+ omap2_init_irq();
}
static struct at24_platform_data m24c01 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 5f8a2fd..8bf2650 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -708,7 +708,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = igep2_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = igep2_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index b10db0e..f83a0fe 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -452,7 +452,7 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = igep3_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = igep3_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e2ba779..5036e7d 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -466,7 +466,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_ldp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_ldp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index e710cd9..cf9e980 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -705,7 +705,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
.reserve = omap_reserve,
.map_io = n8x0_map_io,
.init_early = n8x0_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
.timer = &omap_timer,
MACHINE_END
@@ -715,7 +715,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
.reserve = omap_reserve,
.map_io = n8x0_map_io,
.init_early = n8x0_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
.timer = &omap_timer,
MACHINE_END
@@ -725,7 +725,7 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
.reserve = omap_reserve,
.map_io = n8x0_map_io,
.init_early = n8x0_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 33007fd..8db46ec 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -540,7 +540,7 @@ static void __init omap3_beagle_init_early(void)
static void __init omap3_beagle_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 5a1a916..ddddd3c 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -894,7 +894,7 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap3_evm_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3_evm_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index b726943..2183199 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -225,7 +225,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
.boot_params = 0x80000100,
.map_io = omap3_map_io,
.init_early = omap3logic_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3logic_init,
.timer = &omap_timer,
MACHINE_END
@@ -234,7 +234,7 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
.boot_params = 0x80000100,
.map_io = omap3_map_io,
.init_early = omap3logic_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3logic_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 07dba88..06d532c 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -720,7 +720,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap3pandora_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3pandora_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index a6e0b91..e5e37cb 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -587,7 +587,7 @@ static void __init omap3_stalker_init_early(void)
static void __init omap3_stalker_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 127cb17..c9261d4 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -422,7 +422,7 @@ static void __init omap3_touchbook_init_early(void)
static void __init omap3_touchbook_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 59ca333..826df4b 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -790,7 +790,7 @@ MACHINE_START(OVERO, "Gumstix Overo")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = overo_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = overo_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 2af8b05..c5e382d 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -178,7 +178,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
.reserve = omap_reserve,
.map_io = rm680_map_io,
.init_early = rm680_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = rm680_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index e964895..ceb17c5 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -151,7 +151,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
.reserve = omap_reserve,
.map_io = rx51_map_io,
.init_early = rx51_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = rx51_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index 09fa7bf..713c20f 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -33,11 +33,6 @@ static void __init ti8168_init_early(void)
omap2_init_common_devices(NULL, NULL);
}
-static void __init ti8168_evm_init_irq(void)
-{
- omap_init_irq();
-}
-
static void __init ti8168_evm_init(void)
{
omap_serial_init();
@@ -56,7 +51,7 @@ MACHINE_START(TI8168EVM, "ti8168evm")
.boot_params = 0x80000100,
.map_io = ti8168_evm_map_io,
.init_early = ti8168_init_early,
- .init_irq = ti8168_evm_init_irq,
+ .init_irq = ti816x_init_irq,
.timer = &omap_timer,
.init_machine = ti8168_evm_init,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 4b133d7..97a3f0b 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -137,7 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_zoom_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_zoom_init,
.timer = &omap_timer,
MACHINE_END
@@ -147,7 +147,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_zoom_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_zoom_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 441e79d..2ce1ce6 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -333,23 +333,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
}
+/* See irq.c, omap4-common.c and entry-macro.S */
void __iomem *omap_irq_base;
-/*
- * Initialize asm_irq_base for entry-macro.S
- */
-static inline void omap_irq_base_init(void)
-{
- if (cpu_is_omap24xx())
- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE);
- else if (cpu_is_omap34xx())
- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE);
- else if (cpu_is_omap44xx())
- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE);
- else
- pr_err("Could not initialize omap_irq_base\n");
-}
-
void __init omap2_init_common_infrastructure(void)
{
u8 postsetup_state;
@@ -422,7 +408,6 @@ void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
_omap2_init_reprogram_sdrc();
}
- omap_irq_base_init();
}
/*
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index bc524b9..33a5c0d 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -103,28 +103,36 @@ static void omap_ack_irq(struct irq_data *d)
intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL);
}
+static inline void _omap_mask_irq(int irq)
+{
+ int offset = irq & (~(IRQ_BITS_PER_REG - 1));
+ irq &= (IRQ_BITS_PER_REG - 1);
+ intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);
+}
+
static void omap_mask_irq(struct irq_data *d)
{
unsigned int irq = d->irq;
- int offset = irq & (~(IRQ_BITS_PER_REG - 1));
- if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
- int spurious = 0;
+ _omap_mask_irq(irq);
+}
- /*
- * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because
- * it is the highest irq number?
- */
- if (irq == INT_34XX_GPT12_IRQ)
- spurious = omap_check_spurious(irq);
+static void omap_mask_irq_omap3(struct irq_data *d)
+{
+ unsigned int irq = d->irq;
+ int spurious = 0;
- if (!spurious)
- previous_irq = irq;
- }
+ /*
+ * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because
+ * it is the highest irq number?
+ */
+ if (irq == INT_34XX_GPT12_IRQ)
+ spurious = omap_check_spurious(irq);
- irq &= (IRQ_BITS_PER_REG - 1);
+ if (!spurious)
+ previous_irq = irq;
- intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);
+ _omap_mask_irq(irq);
}
static void omap_unmask_irq(struct irq_data *d)
@@ -143,6 +151,12 @@ static void omap_mask_ack_irq(struct irq_data *d)
omap_ack_irq(d);
}
+static void omap_mask_ack_irq_omap3(struct irq_data *d)
+{
+ omap_mask_irq_omap3(d);
+ omap_ack_irq(d);
+}
+
static struct irq_chip omap_irq_chip = {
.name = "INTC",
.irq_ack = omap_mask_ack_irq,
@@ -186,25 +200,16 @@ int omap_irq_pending(void)
return 0;
}
-void __init omap_init_irq(void)
+static inline void omap_init_irq(u32 base, int nr_irqs)
{
unsigned long nr_of_irqs = 0;
unsigned int nr_banks = 0;
int i;
for (i = 0; i < ARRAY_SIZE(irq_banks); i++) {
- unsigned long base = 0;
struct omap_irq_bank *bank = irq_banks + i;
- if (cpu_is_omap24xx())
- base = OMAP24XX_IC_BASE;
- else if (cpu_is_omap34xx())
- base = OMAP34XX_IC_BASE;
-
- BUG_ON(!base);
-
- if (cpu_is_ti816x())
- bank->nr_irqs = 128;
+ bank->nr_irqs = nr_irqs;
/* Static mapping, never released */
bank->base_reg = ioremap(base, SZ_4K);
@@ -229,6 +234,35 @@ void __init omap_init_irq(void)
}
}
+void __init omap2_init_irq(void)
+{
+ omap_irq_base = ioremap(OMAP24XX_IC_BASE, SZ_4K);
+ if (WARN_ON(!omap_irq_base))
+ return;
+
+ omap_init_irq(OMAP24XX_IC_BASE, 96);
+}
+
+void __init omap3_init_irq(void)
+{
+ omap_irq_base = ioremap(OMAP34XX_IC_BASE, SZ_4K);
+ if (WARN_ON(!omap_irq_base))
+ return;
+
+ omap_irq_chip.irq_ack = omap_mask_ack_irq_omap3;
+ omap_irq_chip.irq_mask = omap_mask_irq_omap3;
+ omap_init_irq(OMAP34XX_IC_BASE, 96);
+}
+
+void __init ti816x_init_irq(void)
+{
+ omap_irq_base = ioremap(OMAP34XX_IC_BASE, SZ_4K);
+ if (WARN_ON(!omap_irq_base))
+ return;
+
+ omap_init_irq(OMAP34XX_IC_BASE, 128);
+}
+
#ifdef CONFIG_ARCH_OMAP3
static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 9ef8c29..1c3bcf1 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -19,6 +19,8 @@
#include <asm/hardware/gic.h>
#include <asm/hardware/cache-l2x0.h>
+#include <plat/irqs.h>
+
#include <mach/hardware.h>
#include <mach/omap4-common.h>
@@ -34,6 +36,10 @@ void __init gic_init_irq(void)
void __iomem *gic_cpu_base;
/* Static mapping, never released */
+ omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_4K);
+ BUG_ON(!omap_irq_base);
+
+ /* Static mapping, never released */
gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
BUG_ON(!gic_dist_base_addr);
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 5a25098..c884320 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -428,7 +428,11 @@
#define INTCPS_NR_IRQS 96
#ifndef __ASSEMBLY__
-extern void omap_init_irq(void);
+extern void __iomem *omap_irq_base;
+void omap1_init_irq(void);
+void omap2_init_irq(void);
+void omap3_init_irq(void);
+void ti816x_init_irq(void);
extern int omap_irq_pending(void);
void omap_intc_save_context(void);
void omap_intc_restore_context(void);
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap tests early
2011-03-28 22:21 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early Tony Lindgren
@ 2011-03-29 6:11 ` Santosh Shilimkar
2011-03-29 15:30 ` Tony Lindgren
2011-03-29 6:11 ` Santosh Shilimkar
` (3 subsequent siblings)
4 siblings, 1 reply; 38+ messages in thread
From: Santosh Shilimkar @ 2011-03-29 6:11 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
> owner at vger.kernel.org] On Behalf Of Tony Lindgren
> Sent: Tuesday, March 29, 2011 3:51 AM
> To: linux-arm-kernel at lists.infradead.org
> Cc: linux-omap at vger.kernel.org
> Subject: [PATCH 01/10] omap: Use separate init_irq functions to
> avoidcpu_is_omap tests early
>
> This allows us to remove cpu_is_omap calls from init_irq functions
> and the irq handler. There should not be any need for cpu_is_omap
> as at this point we only care about SoC generation, and not about
> subcategories.
>
> The main reason for the patch is that we want to initialize only
> minimal omap specific code from the init_early call, and this and
> the following patches get us closer to that goal.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
[....]
> diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-
> omap2/omap4-common.c
> index 9ef8c29..1c3bcf1 100644
> --- a/arch/arm/mach-omap2/omap4-common.c
> +++ b/arch/arm/mach-omap2/omap4-common.c
> @@ -19,6 +19,8 @@
> #include <asm/hardware/gic.h>
> #include <asm/hardware/cache-l2x0.h>
>
> +#include <plat/irqs.h>
> +
> #include <mach/hardware.h>
> #include <mach/omap4-common.h>
>
> @@ -34,6 +36,10 @@ void __init gic_init_irq(void)
> void __iomem *gic_cpu_base;
>
> /* Static mapping, never released */
> + omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_4K);
> + BUG_ON(!omap_irq_base);
> +
Above mapping is incorrect. The address space is of just
512 bytes. Infact you don't need to ioremap it again.
Below should be enough.
diff --git a/arch/arm/mach-omap2/omap4-common.c
b/arch/arm/mach-omap2/omap4-common.c
index 9ef8c29..9bddc9e 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -41,6 +41,8 @@ void __init gic_init_irq(void)
gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
BUG_ON(!gic_cpu_base);
+ omap_irq_base = gic_cpu_base;
+
gic_init(0, 29, gic_dist_base_addr, gic_cpu_base);
}
Regards,
Santosh
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap tests early
2011-03-29 6:11 ` [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap " Santosh Shilimkar
@ 2011-03-29 15:30 ` Tony Lindgren
2011-03-29 22:27 ` Tony Lindgren
0 siblings, 1 reply; 38+ messages in thread
From: Tony Lindgren @ 2011-03-29 15:30 UTC (permalink / raw)
To: linux-arm-kernel
* Santosh Shilimkar <santosh.shilimkar@ti.com> [110328 23:09]:
>
> Above mapping is incorrect. The address space is of just
> 512 bytes. Infact you don't need to ioremap it again.
> Below should be enough.
>
> diff --git a/arch/arm/mach-omap2/omap4-common.c
> b/arch/arm/mach-omap2/omap4-common.c
> index 9ef8c29..9bddc9e 100644
> --- a/arch/arm/mach-omap2/omap4-common.c
> +++ b/arch/arm/mach-omap2/omap4-common.c
> @@ -41,6 +41,8 @@ void __init gic_init_irq(void)
> gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
> BUG_ON(!gic_cpu_base);
>
> + omap_irq_base = gic_cpu_base;
> +
> gic_init(0, 29, gic_dist_base_addr, gic_cpu_base);
> }
Thanks for cathing this.
Tony
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap tests early
2011-03-29 15:30 ` Tony Lindgren
@ 2011-03-29 22:27 ` Tony Lindgren
0 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-29 22:27 UTC (permalink / raw)
To: linux-arm-kernel
* Tony Lindgren <tony@atomide.com> [110329 08:28]:
> * Santosh Shilimkar <santosh.shilimkar@ti.com> [110328 23:09]:
> >
> > Above mapping is incorrect. The address space is of just
> > 512 bytes. Infact you don't need to ioremap it again.
> > Below should be enough.
> >
> > diff --git a/arch/arm/mach-omap2/omap4-common.c
> > b/arch/arm/mach-omap2/omap4-common.c
> > index 9ef8c29..9bddc9e 100644
> > --- a/arch/arm/mach-omap2/omap4-common.c
> > +++ b/arch/arm/mach-omap2/omap4-common.c
> > @@ -41,6 +41,8 @@ void __init gic_init_irq(void)
> > gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
> > BUG_ON(!gic_cpu_base);
> >
> > + omap_irq_base = gic_cpu_base;
> > +
> > gic_init(0, 29, gic_dist_base_addr, gic_cpu_base);
> > }
>
> Thanks for cathing this.
Actually we can get rid of the local gic_cpu_base as we already
have omap_irq_base that we need anyways. Updated patch below.
Regards,
Tony
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 29 Mar 2011 15:17:12 -0700
Subject: [PATCH] omap: Use separate init_irq functions to avoid cpu_is_omap tests early
This allows us to remove cpu_is_omap calls from init_irq functions
and the irq handler. There should not be any need for cpu_is_omap
as at this point we only care about SoC generation, and not about
subcategories.
The main reason for the patch is that we want to initialize only
minimal omap specific code from the init_early call, and this and
the following patches get us closer to that goal.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index de88c92..17ed757 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -138,7 +138,7 @@ void ams_delta_latch2_write(u16 mask, u16 value)
static void __init ams_delta_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct map_desc ams_delta_io_desc[] __initdata = {
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 87f173d..eaff305 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -329,7 +329,7 @@ static void __init omap_fsample_init(void)
static void __init omap_fsample_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/* Only FPGA needs to be mapped here. All others are done with ioremap */
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 23f4ab9..3fd6b40 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -31,7 +31,7 @@
static void __init omap_generic_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/* assume no Mini-AB port */
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index ba3bd09..8147b04 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -376,7 +376,7 @@ static struct i2c_board_info __initdata h2_i2c_board_info[] = {
static void __init h2_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct omap_usb_config h2_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index ac48677..1b448f6 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -439,7 +439,7 @@ static void __init h3_init(void)
static void __init h3_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static void __init h3_map_io(void)
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index ba05a51..1bd4d8e 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -605,7 +605,7 @@ static void __init htcherald_init_irq(void)
{
printk(KERN_INFO "htcherald_init_irq.\n");
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
MACHINE_START(HERALD, "HTC Herald")
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 2d9b8cb..5926b0c 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -292,7 +292,7 @@ static void __init innovator_init_smc91x(void)
static void __init innovator_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
#ifdef CONFIG_ARCH_OMAP15XX
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index cfd0849..e3cf21d 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -51,7 +51,7 @@ static void __init omap_nokia770_init_irq(void)
omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static const unsigned int nokia770_keymap[] = {
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 7c5e211..aed8202 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -282,7 +282,7 @@ static void __init osk_init_cf(void)
static void __init osk_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct omap_usb_config osk_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index c9d38f4..8b6a881 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -62,7 +62,7 @@
static void __init omap_palmte_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static const unsigned int palmte_keymap[] = {
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index f04f2d3..f2de43d 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -266,7 +266,7 @@ static struct spi_board_info __initdata palmtt_boardinfo[] = {
static void __init omap_palmtt_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct omap_usb_config palmtt_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index d7bbbe7..7904018 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -61,7 +61,7 @@ static void __init
omap_palmz71_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static const unsigned int palmz71_keymap[] = {
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 3c8ee84..7f019e5 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -297,7 +297,7 @@ static void __init omap_perseus2_init(void)
static void __init omap_perseus2_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/* Only FPGA needs to be mapped here. All others are done with ioremap */
static struct map_desc omap_perseus2_io_desc[] __initdata = {
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index d41fe2d..027520f 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -411,7 +411,7 @@ static void __init omap_sx1_init(void)
static void __init omap_sx1_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/*----------------------------------------*/
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index bdc0ac8..a843f4c 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -162,7 +162,7 @@ static struct omap_board_config_kernel voiceblue_config[] = {
static void __init voiceblue_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static void __init voiceblue_map_io(void)
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index 731dd33..7d49359 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -175,7 +175,7 @@ static struct irq_chip omap_irq_chip = {
.irq_set_wake = omap_wake_irq,
};
-void __init omap_init_irq(void)
+void __init omap1_init_irq(void)
{
int i, j;
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 1fa6bb8..3d5a1de 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -277,7 +277,7 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
.reserve = omap_reserve,
.map_io = omap_2430sdp_map_io,
.init_early = omap_2430sdp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = omap_2430sdp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 9afd087..8859a74 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -909,7 +909,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_3430sdp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_3430sdp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index a5933cc..2ec2d76 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -219,7 +219,7 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_sdp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_sdp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index a890d24..bbd9c14 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -110,7 +110,7 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = am3517_crane_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = am3517_crane_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index ce7d5e6..6fc0479 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -516,7 +516,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = am3517_evm_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = am3517_evm_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index f4f8374..e764c9c 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -357,7 +357,7 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
.reserve = omap_reserve,
.map_io = omap_apollon_map_io,
.init_early = omap_apollon_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = omap_apollon_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 02a12b4..bc37d72 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -806,7 +806,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = cm_t35_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = cm_t35_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index a27e3ee..b5618a6 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -306,7 +306,7 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = cm_t3517_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = cm_t3517_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 65f9fde..9fedcd6 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -457,7 +457,7 @@ static void __init devkit8000_init_early(void)
static void __init devkit8000_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 73e3c31..ccd503a 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -70,7 +70,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
.reserve = omap_reserve,
.map_io = omap_generic_map_io,
.init_early = omap_generic_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = omap_generic_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index bac7933..2e16d6c 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -298,7 +298,7 @@ static void __init omap_h4_init_early(void)
static void __init omap_h4_init_irq(void)
{
- omap_init_irq();
+ omap2_init_irq();
}
static struct at24_platform_data m24c01 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 5f8a2fd..8bf2650 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -708,7 +708,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = igep2_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = igep2_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index b10db0e..f83a0fe 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -452,7 +452,7 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = igep3_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = igep3_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e2ba779..5036e7d 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -466,7 +466,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_ldp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_ldp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index e710cd9..cf9e980 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -705,7 +705,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
.reserve = omap_reserve,
.map_io = n8x0_map_io,
.init_early = n8x0_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
.timer = &omap_timer,
MACHINE_END
@@ -715,7 +715,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
.reserve = omap_reserve,
.map_io = n8x0_map_io,
.init_early = n8x0_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
.timer = &omap_timer,
MACHINE_END
@@ -725,7 +725,7 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
.reserve = omap_reserve,
.map_io = n8x0_map_io,
.init_early = n8x0_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 33007fd..8db46ec 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -540,7 +540,7 @@ static void __init omap3_beagle_init_early(void)
static void __init omap3_beagle_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 5a1a916..ddddd3c 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -894,7 +894,7 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap3_evm_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3_evm_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index b726943..2183199 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -225,7 +225,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
.boot_params = 0x80000100,
.map_io = omap3_map_io,
.init_early = omap3logic_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3logic_init,
.timer = &omap_timer,
MACHINE_END
@@ -234,7 +234,7 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
.boot_params = 0x80000100,
.map_io = omap3_map_io,
.init_early = omap3logic_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3logic_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 07dba88..06d532c 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -720,7 +720,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap3pandora_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3pandora_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index a6e0b91..e5e37cb 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -587,7 +587,7 @@ static void __init omap3_stalker_init_early(void)
static void __init omap3_stalker_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 127cb17..c9261d4 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -422,7 +422,7 @@ static void __init omap3_touchbook_init_early(void)
static void __init omap3_touchbook_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 59ca333..826df4b 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -790,7 +790,7 @@ MACHINE_START(OVERO, "Gumstix Overo")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = overo_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = overo_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 2af8b05..c5e382d 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -178,7 +178,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
.reserve = omap_reserve,
.map_io = rm680_map_io,
.init_early = rm680_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = rm680_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index e964895..ceb17c5 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -151,7 +151,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
.reserve = omap_reserve,
.map_io = rx51_map_io,
.init_early = rx51_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = rx51_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index 09fa7bf..713c20f 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -33,11 +33,6 @@ static void __init ti8168_init_early(void)
omap2_init_common_devices(NULL, NULL);
}
-static void __init ti8168_evm_init_irq(void)
-{
- omap_init_irq();
-}
-
static void __init ti8168_evm_init(void)
{
omap_serial_init();
@@ -56,7 +51,7 @@ MACHINE_START(TI8168EVM, "ti8168evm")
.boot_params = 0x80000100,
.map_io = ti8168_evm_map_io,
.init_early = ti8168_init_early,
- .init_irq = ti8168_evm_init_irq,
+ .init_irq = ti816x_init_irq,
.timer = &omap_timer,
.init_machine = ti8168_evm_init,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 4b133d7..97a3f0b 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -137,7 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_zoom_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_zoom_init,
.timer = &omap_timer,
MACHINE_END
@@ -147,7 +147,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_zoom_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_zoom_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 441e79d..2ce1ce6 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -333,23 +333,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
}
+/* See irq.c, omap4-common.c and entry-macro.S */
void __iomem *omap_irq_base;
-/*
- * Initialize asm_irq_base for entry-macro.S
- */
-static inline void omap_irq_base_init(void)
-{
- if (cpu_is_omap24xx())
- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE);
- else if (cpu_is_omap34xx())
- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE);
- else if (cpu_is_omap44xx())
- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE);
- else
- pr_err("Could not initialize omap_irq_base\n");
-}
-
void __init omap2_init_common_infrastructure(void)
{
u8 postsetup_state;
@@ -422,7 +408,6 @@ void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
_omap2_init_reprogram_sdrc();
}
- omap_irq_base_init();
}
/*
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index bc524b9..3254f0b 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -103,28 +103,36 @@ static void omap_ack_irq(struct irq_data *d)
intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL);
}
+static inline void _omap_mask_irq(int irq)
+{
+ int offset = irq & (~(IRQ_BITS_PER_REG - 1));
+ irq &= (IRQ_BITS_PER_REG - 1);
+ intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);
+}
+
static void omap_mask_irq(struct irq_data *d)
{
unsigned int irq = d->irq;
- int offset = irq & (~(IRQ_BITS_PER_REG - 1));
- if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
- int spurious = 0;
+ _omap_mask_irq(irq);
+}
- /*
- * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because
- * it is the highest irq number?
- */
- if (irq == INT_34XX_GPT12_IRQ)
- spurious = omap_check_spurious(irq);
+static void omap3_mask_irq(struct irq_data *d)
+{
+ unsigned int irq = d->irq;
+ int spurious = 0;
- if (!spurious)
- previous_irq = irq;
- }
+ /*
+ * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because
+ * it is the highest irq number?
+ */
+ if (irq == INT_34XX_GPT12_IRQ)
+ spurious = omap_check_spurious(irq);
- irq &= (IRQ_BITS_PER_REG - 1);
+ if (!spurious)
+ previous_irq = irq;
- intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);
+ _omap_mask_irq(irq);
}
static void omap_unmask_irq(struct irq_data *d)
@@ -143,6 +151,12 @@ static void omap_mask_ack_irq(struct irq_data *d)
omap_ack_irq(d);
}
+static void omap3_mask_ack_irq(struct irq_data *d)
+{
+ omap3_mask_irq(d);
+ omap_ack_irq(d);
+}
+
static struct irq_chip omap_irq_chip = {
.name = "INTC",
.irq_ack = omap_mask_ack_irq,
@@ -186,25 +200,16 @@ int omap_irq_pending(void)
return 0;
}
-void __init omap_init_irq(void)
+static inline void omap_init_irq(u32 base, int nr_irqs)
{
unsigned long nr_of_irqs = 0;
unsigned int nr_banks = 0;
int i;
for (i = 0; i < ARRAY_SIZE(irq_banks); i++) {
- unsigned long base = 0;
struct omap_irq_bank *bank = irq_banks + i;
- if (cpu_is_omap24xx())
- base = OMAP24XX_IC_BASE;
- else if (cpu_is_omap34xx())
- base = OMAP34XX_IC_BASE;
-
- BUG_ON(!base);
-
- if (cpu_is_ti816x())
- bank->nr_irqs = 128;
+ bank->nr_irqs = nr_irqs;
/* Static mapping, never released */
bank->base_reg = ioremap(base, SZ_4K);
@@ -229,6 +234,35 @@ void __init omap_init_irq(void)
}
}
+void __init omap2_init_irq(void)
+{
+ omap_irq_base = ioremap(OMAP24XX_IC_BASE, SZ_4K);
+ if (WARN_ON(!omap_irq_base))
+ return;
+
+ omap_init_irq(OMAP24XX_IC_BASE, 96);
+}
+
+void __init omap3_init_irq(void)
+{
+ omap_irq_base = ioremap(OMAP34XX_IC_BASE, SZ_4K);
+ if (WARN_ON(!omap_irq_base))
+ return;
+
+ omap_irq_chip.irq_ack = omap3_mask_ack_irq;
+ omap_irq_chip.irq_mask = omap3_mask_irq;
+ omap_init_irq(OMAP34XX_IC_BASE, 96);
+}
+
+void __init ti816x_init_irq(void)
+{
+ omap_irq_base = ioremap(OMAP34XX_IC_BASE, SZ_4K);
+ if (WARN_ON(!omap_irq_base))
+ return;
+
+ omap_init_irq(OMAP34XX_IC_BASE, 128);
+}
+
#ifdef CONFIG_ARCH_OMAP3
static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 9ef8c29..35ac3e5 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -19,6 +19,8 @@
#include <asm/hardware/gic.h>
#include <asm/hardware/cache-l2x0.h>
+#include <plat/irqs.h>
+
#include <mach/hardware.h>
#include <mach/omap4-common.h>
@@ -31,17 +33,15 @@ void __iomem *gic_dist_base_addr;
void __init gic_init_irq(void)
{
- void __iomem *gic_cpu_base;
-
/* Static mapping, never released */
gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
BUG_ON(!gic_dist_base_addr);
/* Static mapping, never released */
- gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
- BUG_ON(!gic_cpu_base);
+ omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
+ BUG_ON(!omap_irq_base);
- gic_init(0, 29, gic_dist_base_addr, gic_cpu_base);
+ gic_init(0, 29, gic_dist_base_addr, omap_irq_base);
}
#ifdef CONFIG_CACHE_L2X0
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 5a25098..c884320 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -428,7 +428,11 @@
#define INTCPS_NR_IRQS 96
#ifndef __ASSEMBLY__
-extern void omap_init_irq(void);
+extern void __iomem *omap_irq_base;
+void omap1_init_irq(void);
+void omap2_init_irq(void);
+void omap3_init_irq(void);
+void ti816x_init_irq(void);
extern int omap_irq_pending(void);
void omap_intc_save_context(void);
void omap_intc_restore_context(void);
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap tests early
2011-03-28 22:21 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early Tony Lindgren
2011-03-29 6:11 ` [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap " Santosh Shilimkar
@ 2011-03-29 6:11 ` Santosh Shilimkar
2011-03-29 6:11 ` Santosh Shilimkar
` (2 subsequent siblings)
4 siblings, 0 replies; 38+ messages in thread
From: Santosh Shilimkar @ 2011-03-29 6:11 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
> owner at vger.kernel.org] On Behalf Of Tony Lindgren
> Sent: Tuesday, March 29, 2011 3:51 AM
> To: linux-arm-kernel at lists.infradead.org
> Cc: linux-omap at vger.kernel.org
> Subject: [PATCH 01/10] omap: Use separate init_irq functions to
> avoidcpu_is_omap tests early
>
> This allows us to remove cpu_is_omap calls from init_irq functions
> and the irq handler. There should not be any need for cpu_is_omap
> as at this point we only care about SoC generation, and not about
> subcategories.
>
> The main reason for the patch is that we want to initialize only
> minimal omap specific code from the init_early call, and this and
> the following patches get us closer to that goal.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
[....]
> diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-
> omap2/omap4-common.c
> index 9ef8c29..1c3bcf1 100644
> --- a/arch/arm/mach-omap2/omap4-common.c
> +++ b/arch/arm/mach-omap2/omap4-common.c
> @@ -19,6 +19,8 @@
> #include <asm/hardware/gic.h>
> #include <asm/hardware/cache-l2x0.h>
>
> +#include <plat/irqs.h>
> +
> #include <mach/hardware.h>
> #include <mach/omap4-common.h>
>
> @@ -34,6 +36,10 @@ void __init gic_init_irq(void)
> void __iomem *gic_cpu_base;
>
> /* Static mapping, never released */
> + omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_4K);
> + BUG_ON(!omap_irq_base);
> +
Above mapping is incorrect. The address space is of just
512 bytes. Infact you don't need to ioremap it again.
Below should be enough.
diff --git a/arch/arm/mach-omap2/omap4-common.c
b/arch/arm/mach-omap2/omap4-common.c
index 9ef8c29..9bddc9e 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -41,6 +41,8 @@ void __init gic_init_irq(void)
gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
BUG_ON(!gic_cpu_base);
+ omap_irq_base = gic_cpu_base;
+
gic_init(0, 29, gic_dist_base_addr, gic_cpu_base);
}
Regards,
Santosh
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap tests early
2011-03-28 22:21 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early Tony Lindgren
2011-03-29 6:11 ` [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap " Santosh Shilimkar
2011-03-29 6:11 ` Santosh Shilimkar
@ 2011-03-29 6:11 ` Santosh Shilimkar
2011-03-29 6:11 ` Santosh Shilimkar
2011-03-29 17:11 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap " Kevin Hilman
4 siblings, 0 replies; 38+ messages in thread
From: Santosh Shilimkar @ 2011-03-29 6:11 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
> owner at vger.kernel.org] On Behalf Of Tony Lindgren
> Sent: Tuesday, March 29, 2011 3:51 AM
> To: linux-arm-kernel at lists.infradead.org
> Cc: linux-omap at vger.kernel.org
> Subject: [PATCH 01/10] omap: Use separate init_irq functions to
> avoidcpu_is_omap tests early
>
> This allows us to remove cpu_is_omap calls from init_irq functions
> and the irq handler. There should not be any need for cpu_is_omap
> as at this point we only care about SoC generation, and not about
> subcategories.
>
> The main reason for the patch is that we want to initialize only
> minimal omap specific code from the init_early call, and this and
> the following patches get us closer to that goal.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
[....]
> diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-
> omap2/omap4-common.c
> index 9ef8c29..1c3bcf1 100644
> --- a/arch/arm/mach-omap2/omap4-common.c
> +++ b/arch/arm/mach-omap2/omap4-common.c
> @@ -19,6 +19,8 @@
> #include <asm/hardware/gic.h>
> #include <asm/hardware/cache-l2x0.h>
>
> +#include <plat/irqs.h>
> +
> #include <mach/hardware.h>
> #include <mach/omap4-common.h>
>
> @@ -34,6 +36,10 @@ void __init gic_init_irq(void)
> void __iomem *gic_cpu_base;
>
> /* Static mapping, never released */
> + omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_4K);
> + BUG_ON(!omap_irq_base);
> +
Above mapping is incorrect. The address space is of just
512 bytes. Infact you don't need to ioremap it again.
Below should be enough.
diff --git a/arch/arm/mach-omap2/omap4-common.c
b/arch/arm/mach-omap2/omap4-common.c
index 9ef8c29..9bddc9e 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -41,6 +41,8 @@ void __init gic_init_irq(void)
gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
BUG_ON(!gic_cpu_base);
+ omap_irq_base = gic_cpu_base;
+
gic_init(0, 29, gic_dist_base_addr, gic_cpu_base);
}
Regards,
Santosh
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap tests early
2011-03-28 22:21 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early Tony Lindgren
` (2 preceding siblings ...)
2011-03-29 6:11 ` Santosh Shilimkar
@ 2011-03-29 6:11 ` Santosh Shilimkar
2011-03-29 17:11 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap " Kevin Hilman
4 siblings, 0 replies; 38+ messages in thread
From: Santosh Shilimkar @ 2011-03-29 6:11 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
> owner at vger.kernel.org] On Behalf Of Tony Lindgren
> Sent: Tuesday, March 29, 2011 3:51 AM
> To: linux-arm-kernel at lists.infradead.org
> Cc: linux-omap at vger.kernel.org
> Subject: [PATCH 01/10] omap: Use separate init_irq functions to
> avoidcpu_is_omap tests early
>
> This allows us to remove cpu_is_omap calls from init_irq functions
> and the irq handler. There should not be any need for cpu_is_omap
> as at this point we only care about SoC generation, and not about
> subcategories.
>
> The main reason for the patch is that we want to initialize only
> minimal omap specific code from the init_early call, and this and
> the following patches get us closer to that goal.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
[....]
> diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-
> omap2/omap4-common.c
> index 9ef8c29..1c3bcf1 100644
> --- a/arch/arm/mach-omap2/omap4-common.c
> +++ b/arch/arm/mach-omap2/omap4-common.c
> @@ -19,6 +19,8 @@
> #include <asm/hardware/gic.h>
> #include <asm/hardware/cache-l2x0.h>
>
> +#include <plat/irqs.h>
> +
> #include <mach/hardware.h>
> #include <mach/omap4-common.h>
>
> @@ -34,6 +36,10 @@ void __init gic_init_irq(void)
> void __iomem *gic_cpu_base;
>
> /* Static mapping, never released */
> + omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_4K);
> + BUG_ON(!omap_irq_base);
> +
Above mapping is incorrect. The address space is of just
512 bytes. Infact you don't need to ioremap it again.
Below should be enough.
diff --git a/arch/arm/mach-omap2/omap4-common.c
b/arch/arm/mach-omap2/omap4-common.c
index 9ef8c29..9bddc9e 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -41,6 +41,8 @@ void __init gic_init_irq(void)
gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
BUG_ON(!gic_cpu_base);
+ omap_irq_base = gic_cpu_base;
+
gic_init(0, 29, gic_dist_base_addr, gic_cpu_base);
}
Regards,
Santosh
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early
2011-03-28 22:21 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early Tony Lindgren
` (3 preceding siblings ...)
2011-03-29 6:11 ` Santosh Shilimkar
@ 2011-03-29 17:11 ` Kevin Hilman
2011-03-29 17:14 ` Tony Lindgren
4 siblings, 1 reply; 38+ messages in thread
From: Kevin Hilman @ 2011-03-29 17:11 UTC (permalink / raw)
To: linux-arm-kernel
Hi Tony,
Tony Lindgren <tony@atomide.com> writes:
> This allows us to remove cpu_is_omap calls from init_irq functions
> and the irq handler. There should not be any need for cpu_is_omap
> as at this point we only care about SoC generation, and not about
> subcategories.
>
> The main reason for the patch is that we want to initialize only
> minimal omap specific code from the init_early call, and this and
> the following patches get us closer to that goal.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
[...]
A couple of minor comments on naming below...
> diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
> index bc524b9..33a5c0d 100644
> --- a/arch/arm/mach-omap2/irq.c
> +++ b/arch/arm/mach-omap2/irq.c
> @@ -103,28 +103,36 @@ static void omap_ack_irq(struct irq_data *d)
> intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL);
> }
>
> +static inline void _omap_mask_irq(int irq)
> +{
> + int offset = irq & (~(IRQ_BITS_PER_REG - 1));
> + irq &= (IRQ_BITS_PER_REG - 1);
> + intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);
> +}
> +
> static void omap_mask_irq(struct irq_data *d)
> {
> unsigned int irq = d->irq;
> - int offset = irq & (~(IRQ_BITS_PER_REG - 1));
>
> - if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
> - int spurious = 0;
> + _omap_mask_irq(irq);
> +}
>
> - /*
> - * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because
> - * it is the highest irq number?
> - */
> - if (irq == INT_34XX_GPT12_IRQ)
> - spurious = omap_check_spurious(irq);
> +static void omap_mask_irq_omap3(struct irq_data *d)
how about omap3_mask_irq().
In most other code we're using the SoC name as a prefix instead of
suffix.
> +{
> + unsigned int irq = d->irq;
> + int spurious = 0;
>
> - if (!spurious)
> - previous_irq = irq;
> - }
> + /*
> + * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because
> + * it is the highest irq number?
> + */
> + if (irq == INT_34XX_GPT12_IRQ)
> + spurious = omap_check_spurious(irq);
>
> - irq &= (IRQ_BITS_PER_REG - 1);
> + if (!spurious)
> + previous_irq = irq;
>
> - intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);
> + _omap_mask_irq(irq);
> }
>
> static void omap_unmask_irq(struct irq_data *d)
> @@ -143,6 +151,12 @@ static void omap_mask_ack_irq(struct irq_data *d)
> omap_ack_irq(d);
> }
>
> +static void omap_mask_ack_irq_omap3(struct irq_data *d)
Also here: omap3_mask_ack_irq()
Kevin
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early
2011-03-29 17:11 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap " Kevin Hilman
@ 2011-03-29 17:14 ` Tony Lindgren
2011-05-17 11:28 ` Tony Lindgren
0 siblings, 1 reply; 38+ messages in thread
From: Tony Lindgren @ 2011-03-29 17:14 UTC (permalink / raw)
To: linux-arm-kernel
* Kevin Hilman <khilman@ti.com> [110329 10:08]:
> Hi Tony,
>
> Tony Lindgren <tony@atomide.com> writes:
>
> > This allows us to remove cpu_is_omap calls from init_irq functions
> > and the irq handler. There should not be any need for cpu_is_omap
> > as at this point we only care about SoC generation, and not about
> > subcategories.
> >
> > The main reason for the patch is that we want to initialize only
> > minimal omap specific code from the init_early call, and this and
> > the following patches get us closer to that goal.
> >
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
>
> [...]
>
> A couple of minor comments on naming below...
>
> > diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
> > index bc524b9..33a5c0d 100644
> > --- a/arch/arm/mach-omap2/irq.c
> > +++ b/arch/arm/mach-omap2/irq.c
> > @@ -103,28 +103,36 @@ static void omap_ack_irq(struct irq_data *d)
> > intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL);
> > }
> >
> > +static inline void _omap_mask_irq(int irq)
> > +{
> > + int offset = irq & (~(IRQ_BITS_PER_REG - 1));
> > + irq &= (IRQ_BITS_PER_REG - 1);
> > + intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);
> > +}
> > +
> > static void omap_mask_irq(struct irq_data *d)
> > {
> > unsigned int irq = d->irq;
> > - int offset = irq & (~(IRQ_BITS_PER_REG - 1));
> >
> > - if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
> > - int spurious = 0;
> > + _omap_mask_irq(irq);
> > +}
> >
> > - /*
> > - * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because
> > - * it is the highest irq number?
> > - */
> > - if (irq == INT_34XX_GPT12_IRQ)
> > - spurious = omap_check_spurious(irq);
> > +static void omap_mask_irq_omap3(struct irq_data *d)
>
> how about omap3_mask_irq().
>
> In most other code we're using the SoC name as a prefix instead of
> suffix.
>
> > +{
> > + unsigned int irq = d->irq;
> > + int spurious = 0;
> >
> > - if (!spurious)
> > - previous_irq = irq;
> > - }
> > + /*
> > + * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because
> > + * it is the highest irq number?
> > + */
> > + if (irq == INT_34XX_GPT12_IRQ)
> > + spurious = omap_check_spurious(irq);
> >
> > - irq &= (IRQ_BITS_PER_REG - 1);
> > + if (!spurious)
> > + previous_irq = irq;
> >
> > - intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);
> > + _omap_mask_irq(irq);
> > }
> >
> > static void omap_unmask_irq(struct irq_data *d)
> > @@ -143,6 +151,12 @@ static void omap_mask_ack_irq(struct irq_data *d)
> > omap_ack_irq(d);
> > }
> >
> > +static void omap_mask_ack_irq_omap3(struct irq_data *d)
>
> Also here: omap3_mask_ack_irq()
Sounds good to me.
Tony
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early
2011-03-29 17:14 ` Tony Lindgren
@ 2011-05-17 11:28 ` Tony Lindgren
0 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-05-17 11:28 UTC (permalink / raw)
To: linux-arm-kernel
* Tony Lindgren <tony@atomide.com> [110329 10:12]:
> * Kevin Hilman <khilman@ti.com> [110329 10:08]:
> >
> > Also here: omap3_mask_ack_irq()
>
> Sounds good to me.
Here's this one rebased on the genirq + omap2/3 genirq patch.
Now we've already removed the spurious handling with the genirq
patches, so now we actually produce a slightly negative diffstat
with this one too:
46 files changed, 78 insertions(+), 84 deletions(-)
Regards,
Tony
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 17 May 2011 03:51:26 -0700
Subject: [PATCH] omap: Use separate init_irq functions to avoid cpu_is_omap tests early
This allows us to remove cpu_is_omap calls from init_irq functions
and the irq handler. There should not be any need for cpu_is_omap
as at this point we only care about SoC generation, and not about
subcategories.
The main reason for the patch is that we want to initialize only
minimal omap specific code from the init_early call, and this and
the following patches get us closer to that goal.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index de88c92..17ed757 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -138,7 +138,7 @@ void ams_delta_latch2_write(u16 mask, u16 value)
static void __init ams_delta_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct map_desc ams_delta_io_desc[] __initdata = {
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 87f173d..eaff305 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -329,7 +329,7 @@ static void __init omap_fsample_init(void)
static void __init omap_fsample_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/* Only FPGA needs to be mapped here. All others are done with ioremap */
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 23f4ab9..3fd6b40 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -31,7 +31,7 @@
static void __init omap_generic_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/* assume no Mini-AB port */
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index ba3bd09..8147b04 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -376,7 +376,7 @@ static struct i2c_board_info __initdata h2_i2c_board_info[] = {
static void __init h2_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct omap_usb_config h2_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index ac48677..1b448f6 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -439,7 +439,7 @@ static void __init h3_init(void)
static void __init h3_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static void __init h3_map_io(void)
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index ba05a51..1bd4d8e 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -605,7 +605,7 @@ static void __init htcherald_init_irq(void)
{
printk(KERN_INFO "htcherald_init_irq.\n");
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
MACHINE_START(HERALD, "HTC Herald")
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 2d9b8cb..5926b0c 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -292,7 +292,7 @@ static void __init innovator_init_smc91x(void)
static void __init innovator_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
#ifdef CONFIG_ARCH_OMAP15XX
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index cfd0849..e3cf21d 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -51,7 +51,7 @@ static void __init omap_nokia770_init_irq(void)
omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static const unsigned int nokia770_keymap[] = {
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index e68dfde..1e7823d 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -282,7 +282,7 @@ static void __init osk_init_cf(void)
static void __init osk_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct omap_usb_config osk_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index c9d38f4..8b6a881 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -62,7 +62,7 @@
static void __init omap_palmte_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static const unsigned int palmte_keymap[] = {
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index f04f2d3..f2de43d 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -266,7 +266,7 @@ static struct spi_board_info __initdata palmtt_boardinfo[] = {
static void __init omap_palmtt_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static struct omap_usb_config palmtt_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 45f01d2..6665d2d 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -61,7 +61,7 @@ static void __init
omap_palmz71_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static const unsigned int palmz71_keymap[] = {
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 3c8ee84..7f019e5 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -297,7 +297,7 @@ static void __init omap_perseus2_init(void)
static void __init omap_perseus2_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/* Only FPGA needs to be mapped here. All others are done with ioremap */
static struct map_desc omap_perseus2_io_desc[] __initdata = {
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 0ad781d..24f0f7b 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -411,7 +411,7 @@ static void __init omap_sx1_init(void)
static void __init omap_sx1_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
/*----------------------------------------*/
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 65d2420..98826e2 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -162,7 +162,7 @@ static struct omap_board_config_kernel voiceblue_config[] = {
static void __init voiceblue_init_irq(void)
{
omap1_init_common_hw();
- omap_init_irq();
+ omap1_init_irq();
}
static void __init voiceblue_map_io(void)
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index 5d3da7a..e2b9c90 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -175,7 +175,7 @@ static struct irq_chip omap_irq_chip = {
.irq_set_wake = omap_wake_irq,
};
-void __init omap_init_irq(void)
+void __init omap1_init_irq(void)
{
int i, j;
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 1fa6bb8..3d5a1de 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -277,7 +277,7 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
.reserve = omap_reserve,
.map_io = omap_2430sdp_map_io,
.init_early = omap_2430sdp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = omap_2430sdp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 9afd087..8859a74 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -909,7 +909,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_3430sdp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_3430sdp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index a5933cc..2ec2d76 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -219,7 +219,7 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_sdp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_sdp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index a890d24..bbd9c14 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -110,7 +110,7 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = am3517_crane_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = am3517_crane_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index ce7d5e6..6fc0479 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -516,7 +516,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = am3517_evm_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = am3517_evm_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index f4f8374..e764c9c 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -357,7 +357,7 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
.reserve = omap_reserve,
.map_io = omap_apollon_map_io,
.init_early = omap_apollon_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = omap_apollon_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 02a12b4..bc37d72 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -806,7 +806,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = cm_t35_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = cm_t35_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index a27e3ee..b5618a6 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -306,7 +306,7 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = cm_t3517_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = cm_t3517_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 65f9fde..9fedcd6 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -457,7 +457,7 @@ static void __init devkit8000_init_early(void)
static void __init devkit8000_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 73e3c31..ccd503a 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -70,7 +70,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
.reserve = omap_reserve,
.map_io = omap_generic_map_io,
.init_early = omap_generic_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = omap_generic_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index bac7933..2e16d6c 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -298,7 +298,7 @@ static void __init omap_h4_init_early(void)
static void __init omap_h4_init_irq(void)
{
- omap_init_irq();
+ omap2_init_irq();
}
static struct at24_platform_data m24c01 = {
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 34cf982..2f8e1b8 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -708,7 +708,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = igep2_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = igep2_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index 2cf86c3..51c782e 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -452,7 +452,7 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = igep3_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = igep3_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e2ba779..5036e7d 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -466,7 +466,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_ldp_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_ldp_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index e710cd9..cf9e980 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -705,7 +705,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
.reserve = omap_reserve,
.map_io = n8x0_map_io,
.init_early = n8x0_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
.timer = &omap_timer,
MACHINE_END
@@ -715,7 +715,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
.reserve = omap_reserve,
.map_io = n8x0_map_io,
.init_early = n8x0_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
.timer = &omap_timer,
MACHINE_END
@@ -725,7 +725,7 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
.reserve = omap_reserve,
.map_io = n8x0_map_io,
.init_early = n8x0_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 33007fd..8db46ec 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -540,7 +540,7 @@ static void __init omap3_beagle_init_early(void)
static void __init omap3_beagle_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 5a1a916..ddddd3c 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -894,7 +894,7 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap3_evm_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3_evm_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index b726943..2183199 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -225,7 +225,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
.boot_params = 0x80000100,
.map_io = omap3_map_io,
.init_early = omap3logic_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3logic_init,
.timer = &omap_timer,
MACHINE_END
@@ -234,7 +234,7 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
.boot_params = 0x80000100,
.map_io = omap3_map_io,
.init_early = omap3logic_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3logic_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 07dba88..06d532c 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -720,7 +720,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap3pandora_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap3pandora_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index a6e0b91..e5e37cb 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -587,7 +587,7 @@ static void __init omap3_stalker_init_early(void)
static void __init omap3_stalker_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 127cb17..c9261d4 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -422,7 +422,7 @@ static void __init omap3_touchbook_init_early(void)
static void __init omap3_touchbook_init_irq(void)
{
- omap_init_irq();
+ omap3_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
#endif
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 59ca333..826df4b 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -790,7 +790,7 @@ MACHINE_START(OVERO, "Gumstix Overo")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = overo_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = overo_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 2af8b05..c5e382d 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -178,7 +178,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
.reserve = omap_reserve,
.map_io = rm680_map_io,
.init_early = rm680_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = rm680_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index e964895..ceb17c5 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -151,7 +151,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
.reserve = omap_reserve,
.map_io = rx51_map_io,
.init_early = rx51_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = rx51_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index 09fa7bf..713c20f 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -33,11 +33,6 @@ static void __init ti8168_init_early(void)
omap2_init_common_devices(NULL, NULL);
}
-static void __init ti8168_evm_init_irq(void)
-{
- omap_init_irq();
-}
-
static void __init ti8168_evm_init(void)
{
omap_serial_init();
@@ -56,7 +51,7 @@ MACHINE_START(TI8168EVM, "ti8168evm")
.boot_params = 0x80000100,
.map_io = ti8168_evm_map_io,
.init_early = ti8168_init_early,
- .init_irq = ti8168_evm_init_irq,
+ .init_irq = ti816x_init_irq,
.timer = &omap_timer,
.init_machine = ti8168_evm_init,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 4b133d7..97a3f0b 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -137,7 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_zoom_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_zoom_init,
.timer = &omap_timer,
MACHINE_END
@@ -147,7 +147,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap_zoom_init_early,
- .init_irq = omap_init_irq,
+ .init_irq = omap3_init_irq,
.init_machine = omap_zoom_init,
.timer = &omap_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 441e79d..2ce1ce6 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -333,23 +333,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
}
+/* See irq.c, omap4-common.c and entry-macro.S */
void __iomem *omap_irq_base;
-/*
- * Initialize asm_irq_base for entry-macro.S
- */
-static inline void omap_irq_base_init(void)
-{
- if (cpu_is_omap24xx())
- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE);
- else if (cpu_is_omap34xx())
- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE);
- else if (cpu_is_omap44xx())
- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE);
- else
- pr_err("Could not initialize omap_irq_base\n");
-}
-
void __init omap2_init_common_infrastructure(void)
{
u8 postsetup_state;
@@ -422,7 +408,6 @@ void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
_omap2_init_reprogram_sdrc();
}
- omap_irq_base_init();
}
/*
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 3af2b7a..dc288d7 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -141,25 +141,20 @@ omap_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
IRQ_NOREQUEST | IRQ_NOPROBE, 0);
}
-void __init omap_init_irq(void)
+void __init omap_init_irq(u32 base, int nr_irqs)
{
unsigned long nr_of_irqs = 0;
unsigned int nr_banks = 0;
int i, j;
+ omap_irq_base = ioremap(base, SZ_4K);
+ if (WARN_ON(!omap_irq_base))
+ return;
+
for (i = 0; i < ARRAY_SIZE(irq_banks); i++) {
- unsigned long base = 0;
struct omap_irq_bank *bank = irq_banks + i;
- if (cpu_is_omap24xx())
- base = OMAP24XX_IC_BASE;
- else if (cpu_is_omap34xx())
- base = OMAP34XX_IC_BASE;
-
- BUG_ON(!base);
-
- if (cpu_is_ti816x())
- bank->nr_irqs = 128;
+ bank->nr_irqs = nr_irqs;
/* Static mapping, never released */
bank->base_reg = ioremap(base, SZ_4K);
@@ -181,6 +176,21 @@ void __init omap_init_irq(void)
nr_of_irqs, nr_banks, nr_banks > 1 ? "s" : "");
}
+void __init omap2_init_irq(void)
+{
+ omap_init_irq(OMAP24XX_IC_BASE, 96);
+}
+
+void __init omap3_init_irq(void)
+{
+ omap_init_irq(OMAP34XX_IC_BASE, 96);
+}
+
+void __init ti816x_init_irq(void)
+{
+ omap_init_irq(OMAP34XX_IC_BASE, 128);
+}
+
#ifdef CONFIG_ARCH_OMAP3
static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 9ef8c29..35ac3e5 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -19,6 +19,8 @@
#include <asm/hardware/gic.h>
#include <asm/hardware/cache-l2x0.h>
+#include <plat/irqs.h>
+
#include <mach/hardware.h>
#include <mach/omap4-common.h>
@@ -31,17 +33,15 @@ void __iomem *gic_dist_base_addr;
void __init gic_init_irq(void)
{
- void __iomem *gic_cpu_base;
-
/* Static mapping, never released */
gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
BUG_ON(!gic_dist_base_addr);
/* Static mapping, never released */
- gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
- BUG_ON(!gic_cpu_base);
+ omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
+ BUG_ON(!omap_irq_base);
- gic_init(0, 29, gic_dist_base_addr, gic_cpu_base);
+ gic_init(0, 29, gic_dist_base_addr, omap_irq_base);
}
#ifdef CONFIG_CACHE_L2X0
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 5a25098..c884320 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -428,7 +428,11 @@
#define INTCPS_NR_IRQS 96
#ifndef __ASSEMBLY__
-extern void omap_init_irq(void);
+extern void __iomem *omap_irq_base;
+void omap1_init_irq(void);
+void omap2_init_irq(void);
+void omap3_init_irq(void);
+void ti816x_init_irq(void);
extern int omap_irq_pending(void);
void omap_intc_save_context(void);
void omap_intc_restore_context(void);
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 02/10] omap: Set separate timer init functions to avoid cpu_is_omap tests
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
2011-03-28 22:21 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 03/10] omap: Move dmtimer defines to dmtimer.h Tony Lindgren
` (9 subsequent siblings)
11 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
This is needed for the following patches to initialize non-sys_timer
hardware later on. Again, there's no need to do cpu_is_omap calls
as we only care about the major omap generation. We can do this with
the .timer entry alone.
Note that for now we just set stubs for the various sys_timer
entries that will get populated in a later patch. Also the following
patches will remove the omap_dm_timer_init calls and make it an
arch_initcall.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap1/board-ams-delta.c | 2 -
arch/arm/mach-omap1/board-fsample.c | 2 -
arch/arm/mach-omap1/board-generic.c | 2 -
arch/arm/mach-omap1/board-h2.c | 2 -
arch/arm/mach-omap1/board-h3.c | 2 -
arch/arm/mach-omap1/board-htcherald.c | 2 -
arch/arm/mach-omap1/board-innovator.c | 2 -
arch/arm/mach-omap1/board-nokia770.c | 2 -
arch/arm/mach-omap1/board-osk.c | 2 -
arch/arm/mach-omap1/board-palmte.c | 2 -
arch/arm/mach-omap1/board-palmtt.c | 2 -
arch/arm/mach-omap1/board-palmz71.c | 2 -
arch/arm/mach-omap1/board-perseus2.c | 2 -
arch/arm/mach-omap1/board-sx1.c | 2 -
arch/arm/mach-omap1/board-voiceblue.c | 2 -
arch/arm/mach-omap1/time.c | 6 +--
arch/arm/mach-omap2/board-2430sdp.c | 2 -
arch/arm/mach-omap2/board-3430sdp.c | 2 -
arch/arm/mach-omap2/board-3630sdp.c | 2 -
arch/arm/mach-omap2/board-4430sdp.c | 2 -
arch/arm/mach-omap2/board-am3517crane.c | 2 -
arch/arm/mach-omap2/board-am3517evm.c | 2 -
arch/arm/mach-omap2/board-apollon.c | 2 -
arch/arm/mach-omap2/board-cm-t35.c | 2 -
arch/arm/mach-omap2/board-cm-t3517.c | 2 -
arch/arm/mach-omap2/board-devkit8000.c | 2 -
arch/arm/mach-omap2/board-generic.c | 2 -
arch/arm/mach-omap2/board-h4.c | 2 -
arch/arm/mach-omap2/board-igep0020.c | 2 -
arch/arm/mach-omap2/board-igep0030.c | 2 -
arch/arm/mach-omap2/board-ldp.c | 2 -
arch/arm/mach-omap2/board-n8x0.c | 6 +--
arch/arm/mach-omap2/board-omap3beagle.c | 2 -
arch/arm/mach-omap2/board-omap3evm.c | 2 -
arch/arm/mach-omap2/board-omap3logic.c | 4 +-
arch/arm/mach-omap2/board-omap3pandora.c | 2 -
arch/arm/mach-omap2/board-omap3stalker.c | 2 -
arch/arm/mach-omap2/board-omap3touchbook.c | 2 -
arch/arm/mach-omap2/board-omap4panda.c | 2 -
arch/arm/mach-omap2/board-overo.c | 2 -
arch/arm/mach-omap2/board-rm680.c | 2 -
arch/arm/mach-omap2/board-rx51.c | 2 -
arch/arm/mach-omap2/board-ti8168evm.c | 2 -
arch/arm/mach-omap2/board-zoom.c | 4 +-
arch/arm/mach-omap2/timer-gp.c | 63 ++++++++++++++++++++++++----
arch/arm/plat-omap/include/plat/common.h | 7 +++
arch/arm/plat-omap/include/plat/dmtimer.h | 1
47 files changed, 111 insertions(+), 60 deletions(-)
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 17ed757..f1ac7fb 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -391,7 +391,7 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
.reserve = omap_reserve,
.init_irq = ams_delta_init_irq,
.init_machine = ams_delta_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
EXPORT_SYMBOL(ams_delta_latch1_write);
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index eaff305..a6b1bea 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -394,5 +394,5 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
.reserve = omap_reserve,
.init_irq = omap_fsample_init_irq,
.init_machine = omap_fsample_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 3fd6b40..04fc356 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -99,5 +99,5 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
.reserve = omap_reserve,
.init_irq = omap_generic_init_irq,
.init_machine = omap_generic_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 8147b04..cb7fb1a 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -466,5 +466,5 @@ MACHINE_START(OMAP_H2, "TI-H2")
.reserve = omap_reserve,
.init_irq = h2_init_irq,
.init_machine = h2_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 1b448f6..31f3487 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -454,5 +454,5 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
.reserve = omap_reserve,
.init_irq = h3_init_irq,
.init_machine = h3_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 1bd4d8e..36e06ea 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -616,5 +616,5 @@ MACHINE_START(HERALD, "HTC Herald")
.reserve = omap_reserve,
.init_irq = htcherald_init_irq,
.init_machine = htcherald_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 5926b0c..0b1ba46 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -464,5 +464,5 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
.reserve = omap_reserve,
.init_irq = innovator_init_irq,
.init_machine = innovator_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index e3cf21d..5469ce2 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -269,5 +269,5 @@ MACHINE_START(NOKIA770, "Nokia 770")
.reserve = omap_reserve,
.init_irq = omap_nokia770_init_irq,
.init_machine = omap_nokia770_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index aed8202..2de8791 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -588,5 +588,5 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
.reserve = omap_reserve,
.init_irq = osk_init_irq,
.init_machine = osk_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 8b6a881..459cb6b 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -280,5 +280,5 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
.reserve = omap_reserve,
.init_irq = omap_palmte_init_irq,
.init_machine = omap_palmte_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index f2de43d..b214f45 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -326,5 +326,5 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
.reserve = omap_reserve,
.init_irq = omap_palmtt_init_irq,
.init_machine = omap_palmtt_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 7904018..be8f5c6 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -346,5 +346,5 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
.reserve = omap_reserve,
.init_irq = omap_palmz71_init_irq,
.init_machine = omap_palmz71_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 7f019e5..67acd41 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -355,5 +355,5 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
.reserve = omap_reserve,
.init_irq = omap_perseus2_init_irq,
.init_machine = omap_perseus2_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 027520f..9e43cd9 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -426,5 +426,5 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
.reserve = omap_reserve,
.init_irq = omap_sx1_init_irq,
.init_machine = omap_sx1_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index a843f4c..6e67ae1 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -306,5 +306,5 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
.reserve = omap_reserve,
.init_irq = voiceblue_init_irq,
.init_machine = voiceblue_init,
- .timer = &omap_timer,
+ .timer = &omap1_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 6885d2f..df9c9a6 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -322,7 +322,7 @@ static inline int omap_32k_timer_usable(void)
* Timer initialization
* ---------------------------------------------------------------------------
*/
-static void __init omap_timer_init(void)
+static void __init omap1_timer_init(void)
{
if (omap_32k_timer_usable()) {
preferred_sched_clock_init(1);
@@ -332,6 +332,6 @@ static void __init omap_timer_init(void)
}
}
-struct sys_timer omap_timer = {
- .init = omap_timer_init,
+struct sys_timer omap1_timer = {
+ .init = omap1_timer_init,
};
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 3d5a1de..aa61aef 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -279,5 +279,5 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
.init_early = omap_2430sdp_init_early,
.init_irq = omap2_init_irq,
.init_machine = omap_2430sdp_init,
- .timer = &omap_timer,
+ .timer = &omap243x_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 8859a74..7194546 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -911,5 +911,5 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
.init_early = omap_3430sdp_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap_3430sdp_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 2ec2d76..e4f37b5 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -221,5 +221,5 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
.init_early = omap_sdp_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap_sdp_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 56702c5..f740c40 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -827,5 +827,5 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
.init_early = omap_4430sdp_init_early,
.init_irq = gic_init_irq,
.init_machine = omap_4430sdp_init,
- .timer = &omap_timer,
+ .timer = &omap4_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index bbd9c14..d70007c 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -112,5 +112,5 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
.init_early = am3517_crane_init_early,
.init_irq = omap3_init_irq,
.init_machine = am3517_crane_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 6fc0479..7195b1a 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -518,5 +518,5 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
.init_early = am3517_evm_init_early,
.init_irq = omap3_init_irq,
.init_machine = am3517_evm_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index e764c9c..2507b07 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -359,5 +359,5 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
.init_early = omap_apollon_init_early,
.init_irq = omap2_init_irq,
.init_machine = omap_apollon_init,
- .timer = &omap_timer,
+ .timer = &omap242x_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index bc37d72..b85f34e 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -808,5 +808,5 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
.init_early = cm_t35_init_early,
.init_irq = omap3_init_irq,
.init_machine = cm_t35_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index b5618a6..6c4d08c 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -308,5 +308,5 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
.init_early = cm_t3517_init_early,
.init_irq = omap3_init_irq,
.init_machine = cm_t3517_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 9fedcd6..cd465fa 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -816,5 +816,5 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
.init_early = devkit8000_init_early,
.init_irq = devkit8000_init_irq,
.init_machine = devkit8000_init,
- .timer = &omap_timer,
+ .timer = &omap3_beagle_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index ccd503a..c6ecf60 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -72,5 +72,5 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
.init_early = omap_generic_init_early,
.init_irq = omap2_init_irq,
.init_machine = omap_generic_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 2e16d6c..1a22962 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -388,5 +388,5 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
.init_early = omap_h4_init_early,
.init_irq = omap_h4_init_irq,
.init_machine = omap_h4_init,
- .timer = &omap_timer,
+ .timer = &omap242x_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 8bf2650..aee8861 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -710,5 +710,5 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
.init_early = igep2_init_early,
.init_irq = omap3_init_irq,
.init_machine = igep2_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index f83a0fe..6077113 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -454,5 +454,5 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
.init_early = igep3_init_early,
.init_irq = omap3_init_irq,
.init_machine = igep3_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 5036e7d..e96d51f 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -468,5 +468,5 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
.init_early = omap_ldp_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap_ldp_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index cf9e980..4906e32 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -707,7 +707,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
.init_early = n8x0_init_early,
.init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
- .timer = &omap_timer,
+ .timer = &omap242x_timer,
MACHINE_END
MACHINE_START(NOKIA_N810, "Nokia N810")
@@ -717,7 +717,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
.init_early = n8x0_init_early,
.init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
- .timer = &omap_timer,
+ .timer = &omap242x_timer,
MACHINE_END
MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
@@ -727,5 +727,5 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
.init_early = n8x0_init_early,
.init_irq = omap2_init_irq,
.init_machine = n8x0_init_machine,
- .timer = &omap_timer,
+ .timer = &omap242x_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 8db46ec..a4206be 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -689,5 +689,5 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
.init_early = omap3_beagle_init_early,
.init_irq = omap3_beagle_init_irq,
.init_machine = omap3_beagle_init,
- .timer = &omap_timer,
+ .timer = &omap3_beagle_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index ddddd3c..4e08569 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -896,5 +896,5 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
.init_early = omap3_evm_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap3_evm_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 2183199..7e8ce0a 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -227,7 +227,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
.init_early = omap3logic_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap3logic_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
@@ -236,5 +236,5 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
.init_early = omap3logic_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap3logic_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 06d532c..aea233c 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -722,5 +722,5 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
.init_early = omap3pandora_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap3pandora_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index e5e37cb..fd863cf 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -661,5 +661,5 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
.init_early = omap3_stalker_init_early,
.init_irq = omap3_stalker_init_irq,
.init_machine = omap3_stalker_init,
- .timer = &omap_timer,
+ .timer = &omap3_beagle_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index c9261d4..84f4be0 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -546,5 +546,5 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
.init_early = omap3_touchbook_init_early,
.init_irq = omap3_touchbook_init_irq,
.init_machine = omap3_touchbook_init,
- .timer = &omap_timer,
+ .timer = &omap3_beagle_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index f3a7b10..e7ce10d 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -749,5 +749,5 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
.init_early = omap4_panda_init_early,
.init_irq = gic_init_irq,
.init_machine = omap4_panda_init,
- .timer = &omap_timer,
+ .timer = &omap4_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 826df4b..f221463 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -792,5 +792,5 @@ MACHINE_START(OVERO, "Gumstix Overo")
.init_early = overo_init_early,
.init_irq = omap3_init_irq,
.init_machine = overo_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index c5e382d..7a355e7 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -180,5 +180,5 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
.init_early = rm680_init_early,
.init_irq = omap3_init_irq,
.init_machine = rm680_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index ceb17c5..3506597 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -153,5 +153,5 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
.init_early = rx51_init_early,
.init_irq = omap3_init_irq,
.init_machine = rx51_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index 713c20f..a85d5b0 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -52,6 +52,6 @@ MACHINE_START(TI8168EVM, "ti8168evm")
.map_io = ti8168_evm_map_io,
.init_early = ti8168_init_early,
.init_irq = ti816x_init_irq,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
.init_machine = ti8168_evm_init,
MACHINE_END
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 97a3f0b..8a98c3c 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -139,7 +139,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
.init_early = omap_zoom_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap_zoom_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
@@ -149,5 +149,5 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
.init_early = omap_zoom_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap_zoom_init,
- .timer = &omap_timer,
+ .timer = &omap3_timer,
MACHINE_END
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 3b9cf85..b7ea047 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -247,20 +247,67 @@ static void __init omap2_gp_clocksource_init(void)
}
#endif
-static void __init omap2_gp_timer_init(void)
+#ifdef CONFIG_ARCH_OMAP2
+static void __init omap242x_timer_init(void)
{
-#ifdef CONFIG_LOCAL_TIMERS
- if (cpu_is_omap44xx()) {
- twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256);
- BUG_ON(!twd_base);
- }
+ omap_dm_timer_init();
+ omap2_gp_clockevent_init();
+ omap2_gp_clocksource_init();
+}
+
+struct sys_timer omap242x_timer = {
+ .init = omap242x_timer_init,
+};
+
+static void __init omap243x_timer_init(void)
+{
+ omap_dm_timer_init();
+ omap2_gp_clockevent_init();
+ omap2_gp_clocksource_init();
+}
+
+struct sys_timer omap243x_timer = {
+ .init = omap243x_timer_init,
+};
#endif
+
+#ifdef CONFIG_ARCH_OMAP3
+static void __init omap3_timer_init(void)
+{
omap_dm_timer_init();
+ omap2_gp_clockevent_init();
+ omap2_gp_clocksource_init();
+}
+
+struct sys_timer omap3_timer = {
+ .init = omap3_timer_init,
+};
+
+static void __init omap3_beagle_timer_init(void)
+{
+ omap_dm_timer_init();
+ omap2_gp_clockevent_init();
+ omap2_gp_clocksource_init();
+}
+struct sys_timer omap3_beagle_timer = {
+ .init = omap3_beagle_timer_init,
+};
+#endif
+
+#ifdef CONFIG_ARCH_OMAP4
+static void __init omap4_timer_init(void)
+{
+#ifdef CONFIG_LOCAL_TIMERS
+ twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256);
+ BUG_ON(!twd_base);
+#endif
+ omap_dm_timer_init();
omap2_gp_clockevent_init();
omap2_gp_clocksource_init();
}
-struct sys_timer omap_timer = {
- .init = omap2_gp_timer_init,
+struct sys_timer omap4_timer = {
+ .init = omap4_timer_init,
};
+#endif
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 5288130..619f9b3 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -34,7 +34,12 @@
struct sys_timer;
extern void omap_map_common_io(void);
-extern struct sys_timer omap_timer;
+extern struct sys_timer omap1_timer;
+extern struct sys_timer omap242x_timer;
+extern struct sys_timer omap243x_timer;
+extern struct sys_timer omap3_timer;
+extern struct sys_timer omap3_beagle_timer;
+extern struct sys_timer omap4_timer;
extern bool omap_32k_timer_init(void);
extern int __init omap_init_clocksource_32k(void);
extern unsigned long long notrace omap_32k_sched_clock(void);
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index d6c70d2..330bd17 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -57,7 +57,6 @@
#define OMAP_TIMER_IP_VERSION_1 0x1
struct omap_dm_timer;
extern struct omap_dm_timer *gptimer_wakeup;
-extern struct sys_timer omap_timer;
struct clk;
int omap_dm_timer_init(void);
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 03/10] omap: Move dmtimer defines to dmtimer.h
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
2011-03-28 22:21 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early Tony Lindgren
2011-03-28 22:21 ` [PATCH 02/10] omap: Set separate timer init functions to avoid cpu_is_omap tests Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-29 17:41 ` Kevin Hilman
2011-03-28 22:21 ` [PATCH 04/10] omap: Make a subset of dmtimer functions into inline functions Tony Lindgren
` (8 subsequent siblings)
11 siblings, 1 reply; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
These will be needed when dmtimer platform init code gets split
for omap1 and omap2+. These will also be needed for inline macros
for sys_timer in the following patches. No functional changes.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/plat-omap/dmtimer.c | 121 ----------------------------
arch/arm/plat-omap/include/plat/dmtimer.h | 125 +++++++++++++++++++++++++++++
2 files changed, 125 insertions(+), 121 deletions(-)
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index ee9f6eb..dfdc3b2 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -41,127 +41,6 @@
#include <plat/dmtimer.h>
#include <mach/irqs.h>
-/* register offsets */
-#define _OMAP_TIMER_ID_OFFSET 0x00
-#define _OMAP_TIMER_OCP_CFG_OFFSET 0x10
-#define _OMAP_TIMER_SYS_STAT_OFFSET 0x14
-#define _OMAP_TIMER_STAT_OFFSET 0x18
-#define _OMAP_TIMER_INT_EN_OFFSET 0x1c
-#define _OMAP_TIMER_WAKEUP_EN_OFFSET 0x20
-#define _OMAP_TIMER_CTRL_OFFSET 0x24
-#define OMAP_TIMER_CTRL_GPOCFG (1 << 14)
-#define OMAP_TIMER_CTRL_CAPTMODE (1 << 13)
-#define OMAP_TIMER_CTRL_PT (1 << 12)
-#define OMAP_TIMER_CTRL_TCM_LOWTOHIGH (0x1 << 8)
-#define OMAP_TIMER_CTRL_TCM_HIGHTOLOW (0x2 << 8)
-#define OMAP_TIMER_CTRL_TCM_BOTHEDGES (0x3 << 8)
-#define OMAP_TIMER_CTRL_SCPWM (1 << 7)
-#define OMAP_TIMER_CTRL_CE (1 << 6) /* compare enable */
-#define OMAP_TIMER_CTRL_PRE (1 << 5) /* prescaler enable */
-#define OMAP_TIMER_CTRL_PTV_SHIFT 2 /* prescaler value shift */
-#define OMAP_TIMER_CTRL_POSTED (1 << 2)
-#define OMAP_TIMER_CTRL_AR (1 << 1) /* auto-reload enable */
-#define OMAP_TIMER_CTRL_ST (1 << 0) /* start timer */
-#define _OMAP_TIMER_COUNTER_OFFSET 0x28
-#define _OMAP_TIMER_LOAD_OFFSET 0x2c
-#define _OMAP_TIMER_TRIGGER_OFFSET 0x30
-#define _OMAP_TIMER_WRITE_PEND_OFFSET 0x34
-#define WP_NONE 0 /* no write pending bit */
-#define WP_TCLR (1 << 0)
-#define WP_TCRR (1 << 1)
-#define WP_TLDR (1 << 2)
-#define WP_TTGR (1 << 3)
-#define WP_TMAR (1 << 4)
-#define WP_TPIR (1 << 5)
-#define WP_TNIR (1 << 6)
-#define WP_TCVR (1 << 7)
-#define WP_TOCR (1 << 8)
-#define WP_TOWR (1 << 9)
-#define _OMAP_TIMER_MATCH_OFFSET 0x38
-#define _OMAP_TIMER_CAPTURE_OFFSET 0x3c
-#define _OMAP_TIMER_IF_CTRL_OFFSET 0x40
-#define _OMAP_TIMER_CAPTURE2_OFFSET 0x44 /* TCAR2, 34xx only */
-#define _OMAP_TIMER_TICK_POS_OFFSET 0x48 /* TPIR, 34xx only */
-#define _OMAP_TIMER_TICK_NEG_OFFSET 0x4c /* TNIR, 34xx only */
-#define _OMAP_TIMER_TICK_COUNT_OFFSET 0x50 /* TCVR, 34xx only */
-#define _OMAP_TIMER_TICK_INT_MASK_SET_OFFSET 0x54 /* TOCR, 34xx only */
-#define _OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET 0x58 /* TOWR, 34xx only */
-
-/* register offsets with the write pending bit encoded */
-#define WPSHIFT 16
-
-#define OMAP_TIMER_ID_REG (_OMAP_TIMER_ID_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_OCP_CFG_REG (_OMAP_TIMER_OCP_CFG_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_SYS_STAT_REG (_OMAP_TIMER_SYS_STAT_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_STAT_REG (_OMAP_TIMER_STAT_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_INT_EN_REG (_OMAP_TIMER_INT_EN_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_WAKEUP_EN_REG (_OMAP_TIMER_WAKEUP_EN_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_CTRL_REG (_OMAP_TIMER_CTRL_OFFSET \
- | (WP_TCLR << WPSHIFT))
-
-#define OMAP_TIMER_COUNTER_REG (_OMAP_TIMER_COUNTER_OFFSET \
- | (WP_TCRR << WPSHIFT))
-
-#define OMAP_TIMER_LOAD_REG (_OMAP_TIMER_LOAD_OFFSET \
- | (WP_TLDR << WPSHIFT))
-
-#define OMAP_TIMER_TRIGGER_REG (_OMAP_TIMER_TRIGGER_OFFSET \
- | (WP_TTGR << WPSHIFT))
-
-#define OMAP_TIMER_WRITE_PEND_REG (_OMAP_TIMER_WRITE_PEND_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_MATCH_REG (_OMAP_TIMER_MATCH_OFFSET \
- | (WP_TMAR << WPSHIFT))
-
-#define OMAP_TIMER_CAPTURE_REG (_OMAP_TIMER_CAPTURE_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_IF_CTRL_REG (_OMAP_TIMER_IF_CTRL_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_CAPTURE2_REG (_OMAP_TIMER_CAPTURE2_OFFSET \
- | (WP_NONE << WPSHIFT))
-
-#define OMAP_TIMER_TICK_POS_REG (_OMAP_TIMER_TICK_POS_OFFSET \
- | (WP_TPIR << WPSHIFT))
-
-#define OMAP_TIMER_TICK_NEG_REG (_OMAP_TIMER_TICK_NEG_OFFSET \
- | (WP_TNIR << WPSHIFT))
-
-#define OMAP_TIMER_TICK_COUNT_REG (_OMAP_TIMER_TICK_COUNT_OFFSET \
- | (WP_TCVR << WPSHIFT))
-
-#define OMAP_TIMER_TICK_INT_MASK_SET_REG \
- (_OMAP_TIMER_TICK_INT_MASK_SET_OFFSET | (WP_TOCR << WPSHIFT))
-
-#define OMAP_TIMER_TICK_INT_MASK_COUNT_REG \
- (_OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET | (WP_TOWR << WPSHIFT))
-
-struct omap_dm_timer {
- unsigned long phys_base;
- int irq;
-#ifdef CONFIG_ARCH_OMAP2PLUS
- struct clk *iclk, *fclk;
-#endif
- void __iomem *io_base;
- unsigned reserved:1;
- unsigned enabled:1;
- unsigned posted:1;
-};
-
static int dm_timer_count;
#ifdef CONFIG_ARCH_OMAP1
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 330bd17..66c4b34 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -92,5 +92,130 @@ void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value
int omap_dm_timers_active(void);
+/*
+ * Do not the defines below, they are not needed. They should be only
+ * used by dmtimer.c and sys_timer related code.
+ */
+
+/* register offsets */
+#define _OMAP_TIMER_ID_OFFSET 0x00
+#define _OMAP_TIMER_OCP_CFG_OFFSET 0x10
+#define _OMAP_TIMER_SYS_STAT_OFFSET 0x14
+#define _OMAP_TIMER_STAT_OFFSET 0x18
+#define _OMAP_TIMER_INT_EN_OFFSET 0x1c
+#define _OMAP_TIMER_WAKEUP_EN_OFFSET 0x20
+#define _OMAP_TIMER_CTRL_OFFSET 0x24
+#define OMAP_TIMER_CTRL_GPOCFG (1 << 14)
+#define OMAP_TIMER_CTRL_CAPTMODE (1 << 13)
+#define OMAP_TIMER_CTRL_PT (1 << 12)
+#define OMAP_TIMER_CTRL_TCM_LOWTOHIGH (0x1 << 8)
+#define OMAP_TIMER_CTRL_TCM_HIGHTOLOW (0x2 << 8)
+#define OMAP_TIMER_CTRL_TCM_BOTHEDGES (0x3 << 8)
+#define OMAP_TIMER_CTRL_SCPWM (1 << 7)
+#define OMAP_TIMER_CTRL_CE (1 << 6) /* compare enable */
+#define OMAP_TIMER_CTRL_PRE (1 << 5) /* prescaler enable */
+#define OMAP_TIMER_CTRL_PTV_SHIFT 2 /* prescaler value shift */
+#define OMAP_TIMER_CTRL_POSTED (1 << 2)
+#define OMAP_TIMER_CTRL_AR (1 << 1) /* auto-reload enable */
+#define OMAP_TIMER_CTRL_ST (1 << 0) /* start timer */
+#define _OMAP_TIMER_COUNTER_OFFSET 0x28
+#define _OMAP_TIMER_LOAD_OFFSET 0x2c
+#define _OMAP_TIMER_TRIGGER_OFFSET 0x30
+#define _OMAP_TIMER_WRITE_PEND_OFFSET 0x34
+#define WP_NONE 0 /* no write pending bit */
+#define WP_TCLR (1 << 0)
+#define WP_TCRR (1 << 1)
+#define WP_TLDR (1 << 2)
+#define WP_TTGR (1 << 3)
+#define WP_TMAR (1 << 4)
+#define WP_TPIR (1 << 5)
+#define WP_TNIR (1 << 6)
+#define WP_TCVR (1 << 7)
+#define WP_TOCR (1 << 8)
+#define WP_TOWR (1 << 9)
+#define _OMAP_TIMER_MATCH_OFFSET 0x38
+#define _OMAP_TIMER_CAPTURE_OFFSET 0x3c
+#define _OMAP_TIMER_IF_CTRL_OFFSET 0x40
+#define _OMAP_TIMER_CAPTURE2_OFFSET 0x44 /* TCAR2, 34xx only */
+#define _OMAP_TIMER_TICK_POS_OFFSET 0x48 /* TPIR, 34xx only */
+#define _OMAP_TIMER_TICK_NEG_OFFSET 0x4c /* TNIR, 34xx only */
+#define _OMAP_TIMER_TICK_COUNT_OFFSET 0x50 /* TCVR, 34xx only */
+#define _OMAP_TIMER_TICK_INT_MASK_SET_OFFSET 0x54 /* TOCR, 34xx only */
+#define _OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET 0x58 /* TOWR, 34xx only */
+
+/* register offsets with the write pending bit encoded */
+#define WPSHIFT 16
+
+#define OMAP_TIMER_ID_REG (_OMAP_TIMER_ID_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_OCP_CFG_REG (_OMAP_TIMER_OCP_CFG_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_SYS_STAT_REG (_OMAP_TIMER_SYS_STAT_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_STAT_REG (_OMAP_TIMER_STAT_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_INT_EN_REG (_OMAP_TIMER_INT_EN_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_WAKEUP_EN_REG (_OMAP_TIMER_WAKEUP_EN_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_CTRL_REG (_OMAP_TIMER_CTRL_OFFSET \
+ | (WP_TCLR << WPSHIFT))
+
+#define OMAP_TIMER_COUNTER_REG (_OMAP_TIMER_COUNTER_OFFSET \
+ | (WP_TCRR << WPSHIFT))
+
+#define OMAP_TIMER_LOAD_REG (_OMAP_TIMER_LOAD_OFFSET \
+ | (WP_TLDR << WPSHIFT))
+
+#define OMAP_TIMER_TRIGGER_REG (_OMAP_TIMER_TRIGGER_OFFSET \
+ | (WP_TTGR << WPSHIFT))
+
+#define OMAP_TIMER_WRITE_PEND_REG (_OMAP_TIMER_WRITE_PEND_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_MATCH_REG (_OMAP_TIMER_MATCH_OFFSET \
+ | (WP_TMAR << WPSHIFT))
+
+#define OMAP_TIMER_CAPTURE_REG (_OMAP_TIMER_CAPTURE_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_IF_CTRL_REG (_OMAP_TIMER_IF_CTRL_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_CAPTURE2_REG (_OMAP_TIMER_CAPTURE2_OFFSET \
+ | (WP_NONE << WPSHIFT))
+
+#define OMAP_TIMER_TICK_POS_REG (_OMAP_TIMER_TICK_POS_OFFSET \
+ | (WP_TPIR << WPSHIFT))
+
+#define OMAP_TIMER_TICK_NEG_REG (_OMAP_TIMER_TICK_NEG_OFFSET \
+ | (WP_TNIR << WPSHIFT))
+
+#define OMAP_TIMER_TICK_COUNT_REG (_OMAP_TIMER_TICK_COUNT_OFFSET \
+ | (WP_TCVR << WPSHIFT))
+
+#define OMAP_TIMER_TICK_INT_MASK_SET_REG \
+ (_OMAP_TIMER_TICK_INT_MASK_SET_OFFSET | (WP_TOCR << WPSHIFT))
+
+#define OMAP_TIMER_TICK_INT_MASK_COUNT_REG \
+ (_OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET | (WP_TOWR << WPSHIFT))
+
+struct omap_dm_timer {
+ unsigned long phys_base;
+ int irq;
+#ifdef CONFIG_ARCH_OMAP2PLUS
+ struct clk *iclk, *fclk;
+#endif
+ void __iomem *io_base;
+ unsigned reserved:1;
+ unsigned enabled:1;
+ unsigned posted:1;
+};
#endif /* __ASM_ARCH_DMTIMER_H */
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 03/10] omap: Move dmtimer defines to dmtimer.h
2011-03-28 22:21 ` [PATCH 03/10] omap: Move dmtimer defines to dmtimer.h Tony Lindgren
@ 2011-03-29 17:41 ` Kevin Hilman
2011-03-29 17:44 ` Tony Lindgren
0 siblings, 1 reply; 38+ messages in thread
From: Kevin Hilman @ 2011-03-29 17:41 UTC (permalink / raw)
To: linux-arm-kernel
Tony Lindgren <tony@atomide.com> writes:
[...]
> diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
> index 330bd17..66c4b34 100644
> --- a/arch/arm/plat-omap/include/plat/dmtimer.h
> +++ b/arch/arm/plat-omap/include/plat/dmtimer.h
> @@ -92,5 +92,130 @@ void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value
>
> int omap_dm_timers_active(void);
>
> +/*
> + * Do not the defines below, they are not needed. They should be only
Do not what? ;)
Kevin
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 03/10] omap: Move dmtimer defines to dmtimer.h
2011-03-29 17:41 ` Kevin Hilman
@ 2011-03-29 17:44 ` Tony Lindgren
0 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-29 17:44 UTC (permalink / raw)
To: linux-arm-kernel
* Kevin Hilman <khilman@ti.com> [110329 10:39]:
> Tony Lindgren <tony@atomide.com> writes:
>
> [...]
>
> > diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
> > index 330bd17..66c4b34 100644
> > --- a/arch/arm/plat-omap/include/plat/dmtimer.h
> > +++ b/arch/arm/plat-omap/include/plat/dmtimer.h
> > @@ -92,5 +92,130 @@ void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value
> >
> > int omap_dm_timers_active(void);
> >
> > +/*
> > + * Do not the defines below, they are not needed. They should be only
>
> Do not what? ;)
Looks like the nasty parts got censored ;) Should say "Do not use".
Tony
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 04/10] omap: Make a subset of dmtimer functions into inline functions
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
` (2 preceding siblings ...)
2011-03-28 22:21 ` [PATCH 03/10] omap: Move dmtimer defines to dmtimer.h Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-29 17:51 ` Kevin Hilman
2011-03-28 22:21 ` [PATCH 05/10] omap2+: Use dmtimer macros for clockevent Tony Lindgren
` (7 subsequent siblings)
11 siblings, 1 reply; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
This will allow us to share the code between system timer and
dmtimer device driver code without having to initialize all
dmtimers early. It will also make the timer_set_next_event
more efficient as the inline functions will optimize the code
better in this case.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/plat-omap/dmtimer.c | 90 ++++++++++++++++-------------
arch/arm/plat-omap/include/plat/dmtimer.h | 53 +++++++++++++++++
2 files changed, 102 insertions(+), 41 deletions(-)
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index dfdc3b2..ff9b732 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -170,11 +170,7 @@ static spinlock_t dm_timer_lock;
*/
static inline u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, u32 reg)
{
- if (timer->posted)
- while (readl(timer->io_base + (OMAP_TIMER_WRITE_PEND_REG & 0xff))
- & (reg >> WPSHIFT))
- cpu_relax();
- return readl(timer->io_base + (reg & 0xff));
+ return __omap_dm_timer_read(timer->io_base, reg, timer->posted);
}
/*
@@ -186,11 +182,7 @@ static inline u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, u32 reg)
static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg,
u32 value)
{
- if (timer->posted)
- while (readl(timer->io_base + (OMAP_TIMER_WRITE_PEND_REG & 0xff))
- & (reg >> WPSHIFT))
- cpu_relax();
- writel(value, timer->io_base + (reg & 0xff));
+ __omap_dm_timer_write(timer->io_base, reg, value, timer->posted);
}
static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer)
@@ -207,38 +199,54 @@ static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer)
}
}
-static void omap_dm_timer_reset(struct omap_dm_timer *timer)
+/* Assumes the source clock has been set by caller */
+void __omap_dm_timer_reset(struct omap_dm_timer *timer, int autoidle,
+ int wakeup)
{
u32 l;
+ l = omap_dm_timer_read_reg(timer, OMAP_TIMER_OCP_CFG_REG);
+ l |= 0x02 << 3; /* Set to smart-idle mode */
+ l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */
+
+ if (autoidle)
+ l |= 0x1 << 0;
+
+ if (wakeup)
+ l |= 1 << 2;
+
+ omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l);
+
+ /* Match hardware reset default of posted mode */
+ omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG,
+ OMAP_TIMER_CTRL_POSTED);
+ timer->posted = 1;
+}
+
+static void omap_dm_timer_reset(struct omap_dm_timer *timer)
+{
+ int autoidle = 0, wakeup = 0;
+
if (!cpu_class_is_omap2() || timer != &dm_timers[0]) {
omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06);
omap_dm_timer_wait_for_reset(timer);
}
omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
- l = omap_dm_timer_read_reg(timer, OMAP_TIMER_OCP_CFG_REG);
- l |= 0x02 << 3; /* Set to smart-idle mode */
- l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */
-
/* Enable autoidle on OMAP2 / OMAP3 */
if (cpu_is_omap24xx() || cpu_is_omap34xx())
- l |= 0x1 << 0;
+ autoidle = 1;
/*
* Enable wake-up on OMAP2 CPUs.
*/
if (cpu_class_is_omap2())
- l |= 1 << 2;
- omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l);
+ wakeup = 1;
- /* Match hardware reset default of posted mode */
- omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG,
- OMAP_TIMER_CTRL_POSTED);
- timer->posted = 1;
+ __omap_dm_timer_reset(timer, autoidle, wakeup);
}
-static void omap_dm_timer_prepare(struct omap_dm_timer *timer)
+void omap_dm_timer_prepare(struct omap_dm_timer *timer)
{
omap_dm_timer_enable(timer);
omap_dm_timer_reset(timer);
@@ -449,16 +457,13 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
#else
-int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
+int __omap_dm_timer_set_source(struct clk *timer_fck, struct clk *parent)
{
- int ret = -EINVAL;
-
- if (source < 0 || source >= 3)
- return -EINVAL;
+ int ret;
- clk_disable(timer->fclk);
- ret = clk_set_parent(timer->fclk, dm_source_clocks[source]);
- clk_enable(timer->fclk);
+ clk_disable(timer_fck);
+ ret = clk_set_parent(timer_fck, parent);
+ clk_enable(timer_fck);
/*
* When the functional clock disappears, too quick writes seem
@@ -468,6 +473,15 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
return ret;
}
+
+int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
+{
+ if (source < 0 || source >= 3)
+ return -EINVAL;
+
+ return __omap_dm_timer_set_source(timer->fclk,
+ dm_source_clocks[source]);
+}
EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
#endif
@@ -504,8 +518,7 @@ void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
}
l |= OMAP_TIMER_CTRL_ST;
- omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, load);
- omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+ __omap_dm_timer_load_start(timer->io_base, l, load, timer->posted);
}
EXPORT_SYMBOL_GPL(omap_dm_timer_set_load_start);
@@ -558,8 +571,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_set_prescaler);
void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer,
unsigned int value)
{
- omap_dm_timer_write_reg(timer, OMAP_TIMER_INT_EN_REG, value);
- omap_dm_timer_write_reg(timer, OMAP_TIMER_WAKEUP_EN_REG, value);
+ __omap_dm_timer_int_enable(timer->io_base, value);
}
EXPORT_SYMBOL_GPL(omap_dm_timer_set_int_enable);
@@ -575,17 +587,13 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_read_status);
void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value)
{
- omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, value);
+ __omap_dm_timer_write_status(timer->io_base, value);
}
EXPORT_SYMBOL_GPL(omap_dm_timer_write_status);
unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer)
{
- unsigned int l;
-
- l = omap_dm_timer_read_reg(timer, OMAP_TIMER_COUNTER_REG);
-
- return l;
+ return __omap_dm_timer_read_counter(timer->io_base, timer->posted);
}
EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter);
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 66c4b34..21ad28c 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -218,4 +218,57 @@ struct omap_dm_timer {
unsigned posted:1;
};
+void __omap_dm_timer_reset(struct omap_dm_timer *timer, int autoidle,
+ int wakeup);
+void omap_dm_timer_prepare(struct omap_dm_timer *timer);
+int __omap_dm_timer_set_source(struct clk *timer_fck, struct clk *parent);
+void __omap_dm_timer_stop(void __iomem *base, int posted, unsigned long rate);
+
+static inline u32 __omap_dm_timer_read(void __iomem *base, u32 reg, int posted)
+{
+ if (posted)
+ while (__raw_readl(base + (OMAP_TIMER_WRITE_PEND_REG & 0xff))
+ & (reg >> WPSHIFT))
+ cpu_relax();
+
+ return __raw_readl(base + (reg & 0xff));
+}
+
+static inline void __omap_dm_timer_write(void __iomem *base, u32 reg, u32 val,
+ int posted)
+{
+ if (posted)
+ while (__raw_readl(base + (OMAP_TIMER_WRITE_PEND_REG & 0xff))
+ & (reg >> WPSHIFT))
+ cpu_relax();
+
+ __raw_writel(val, base + (reg & 0xff));
+}
+
+static inline void __omap_dm_timer_load_start(void __iomem *base, u32 ctrl,
+ unsigned int load, int posted)
+{
+ __omap_dm_timer_write(base, OMAP_TIMER_COUNTER_REG, load, posted);
+ __omap_dm_timer_write(base, OMAP_TIMER_CTRL_REG, ctrl, posted);
+}
+
+static inline void __omap_dm_timer_int_enable(void __iomem *base,
+ unsigned int value)
+{
+ __omap_dm_timer_write(base, OMAP_TIMER_INT_EN_REG, value, 0);
+ __omap_dm_timer_write(base, OMAP_TIMER_WAKEUP_EN_REG, value, 0);
+}
+
+static inline unsigned int __omap_dm_timer_read_counter(void __iomem *base,
+ int posted)
+{
+ return __omap_dm_timer_read(base, OMAP_TIMER_COUNTER_REG, posted);
+}
+
+static inline void __omap_dm_timer_write_status(void __iomem *base,
+ unsigned int value)
+{
+ __omap_dm_timer_write(base, OMAP_TIMER_STAT_REG, value, 0);
+}
+
#endif /* __ASM_ARCH_DMTIMER_H */
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 04/10] omap: Make a subset of dmtimer functions into inline functions
2011-03-28 22:21 ` [PATCH 04/10] omap: Make a subset of dmtimer functions into inline functions Tony Lindgren
@ 2011-03-29 17:51 ` Kevin Hilman
2011-03-29 17:58 ` Tony Lindgren
0 siblings, 1 reply; 38+ messages in thread
From: Kevin Hilman @ 2011-03-29 17:51 UTC (permalink / raw)
To: linux-arm-kernel
Tony Lindgren <tony@atomide.com> writes:
> This will allow us to share the code between system timer and
> dmtimer device driver code without having to initialize all
> dmtimers early. It will also make the timer_set_next_event
> more efficient as the inline functions will optimize the code
> better in this case.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
[...]
> -static void omap_dm_timer_reset(struct omap_dm_timer *timer)
> +/* Assumes the source clock has been set by caller */
> +void __omap_dm_timer_reset(struct omap_dm_timer *timer, int autoidle,
> + int wakeup)
> {
> u32 l;
>
> + l = omap_dm_timer_read_reg(timer, OMAP_TIMER_OCP_CFG_REG);
> + l |= 0x02 << 3; /* Set to smart-idle mode */
> + l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */
> +
> + if (autoidle)
> + l |= 0x1 << 0;
> +
> + if (wakeup)
> + l |= 1 << 2;
> +
> + omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l);
> +
> + /* Match hardware reset default of posted mode */
> + omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG,
> + OMAP_TIMER_CTRL_POSTED);
> + timer->posted = 1;
> +}
The reset code is an example of something that will not be able to be
shared between a system timer driver and a real device driver. In the
real driver, the reset (as well as smart-idle, autoidle, wakeup
capability, etc.) will all be handled by the hwmod.
With a hwmod conversion, the system timer will have to have
duplicate/alternate compared to the real timer.
Ideally, what we need is a way for the system timer to be early_init
only. When the real driver is available, it switches to that. This
could probably be done pretty easily by using the 'rating' field of the
clockevent so when the "real" timer driver becomes available with a
higher rating, the clockevent code would switch to it.
Kevin
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 04/10] omap: Make a subset of dmtimer functions into inline functions
2011-03-29 17:51 ` Kevin Hilman
@ 2011-03-29 17:58 ` Tony Lindgren
2011-03-29 18:01 ` Kevin Hilman
0 siblings, 1 reply; 38+ messages in thread
From: Tony Lindgren @ 2011-03-29 17:58 UTC (permalink / raw)
To: linux-arm-kernel
* Kevin Hilman <khilman@ti.com> [110329 10:48]:
>
> The reset code is an example of something that will not be able to be
> shared between a system timer driver and a real device driver. In the
> real driver, the reset (as well as smart-idle, autoidle, wakeup
> capability, etc.) will all be handled by the hwmod.
>
> With a hwmod conversion, the system timer will have to have
> duplicate/alternate compared to the real timer.
Well the hwmod is already there also for system timer, so that should
not be a problem. See the init_one function in the next patch in the
series.
> Ideally, what we need is a way for the system timer to be early_init
> only. When the real driver is available, it switches to that. This
> could probably be done pretty easily by using the 'rating' field of the
> clockevent so when the "real" timer driver becomes available with a
> higher rating, the clockevent code would switch to it.
I don't think this is needed. When the dmtimer driver code initializes
it just picks up the already initialized struct omap_dm_timer entries
but does not reset them. At that point the struct dev entry can be
created, but from system timer point of view nothing changes.
Regards,
Tony
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 04/10] omap: Make a subset of dmtimer functions into inline functions
2011-03-29 17:58 ` Tony Lindgren
@ 2011-03-29 18:01 ` Kevin Hilman
2011-03-29 18:02 ` Tony Lindgren
0 siblings, 1 reply; 38+ messages in thread
From: Kevin Hilman @ 2011-03-29 18:01 UTC (permalink / raw)
To: linux-arm-kernel
Tony Lindgren <tony@atomide.com> writes:
> * Kevin Hilman <khilman@ti.com> [110329 10:48]:
>>
>> The reset code is an example of something that will not be able to be
>> shared between a system timer driver and a real device driver. In the
>> real driver, the reset (as well as smart-idle, autoidle, wakeup
>> capability, etc.) will all be handled by the hwmod.
>>
>> With a hwmod conversion, the system timer will have to have
>> duplicate/alternate compared to the real timer.
>
> Well the hwmod is already there also for system timer, so that should
> not be a problem. See the init_one function in the next patch in the
> series.
OK, I see that now. Guess I should get through the whole series before
responding.
So Tarun's series should convert then convert the reset to using the
equivalent hwmod functions.
Kevin
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 04/10] omap: Make a subset of dmtimer functions into inline functions
2011-03-29 18:01 ` Kevin Hilman
@ 2011-03-29 18:02 ` Tony Lindgren
0 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-29 18:02 UTC (permalink / raw)
To: linux-arm-kernel
* Kevin Hilman <khilman@ti.com> [110329 10:58]:
> Tony Lindgren <tony@atomide.com> writes:
>
> > * Kevin Hilman <khilman@ti.com> [110329 10:48]:
> >>
> >> The reset code is an example of something that will not be able to be
> >> shared between a system timer driver and a real device driver. In the
> >> real driver, the reset (as well as smart-idle, autoidle, wakeup
> >> capability, etc.) will all be handled by the hwmod.
> >>
> >> With a hwmod conversion, the system timer will have to have
> >> duplicate/alternate compared to the real timer.
> >
> > Well the hwmod is already there also for system timer, so that should
> > not be a problem. See the init_one function in the next patch in the
> > series.
>
> OK, I see that now. Guess I should get through the whole series before
> responding.
>
> So Tarun's series should convert then convert the reset to using the
> equivalent hwmod functions.
Yeh, that should also get rid of the clock names in the init_one function.
Regards,
Tony
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 05/10] omap2+: Use dmtimer macros for clockevent
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
` (3 preceding siblings ...)
2011-03-28 22:21 ` [PATCH 04/10] omap: Make a subset of dmtimer functions into inline functions Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-29 17:16 ` Tony Lindgren
2011-03-31 21:35 ` Kevin Hilman
2011-03-28 22:21 ` [PATCH 06/10] omap2+: Remove gptimer_wakekup for now Tony Lindgren
` (6 subsequent siblings)
11 siblings, 2 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
This patch makes timer-gp.c to use only a subset of dmtimer
functions without the need to initialize dmtimer code early.
Note that omap_dmtimer_init_one can eventually be moved to
omap2+ specific dmtimer.c.
Also note that now with the inline functions, timer_set_next_event
becomes more efficient in the lines of assembly code.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/timer-gp.c | 145 ++++++++++++++++++++++-------
arch/arm/plat-omap/include/plat/dmtimer.h | 1
2 files changed, 111 insertions(+), 35 deletions(-)
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index b7ea047..c21e99f 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -45,10 +45,33 @@
#include "timer-gp.h"
+/* Parent clocks, eventually these will come from the clock framework */
+
+#define OMAP2_MPU_SOURCE "sys_ck"
+#define OMAP3_MPU_SOURCE OMAP2_MPU_SOURCE
+#define OMAP4_MPU_SOURCE "sys_clkin_ck"
+#define OMAP2_32K_SOURCE "func_32k_ck"
+#define OMAP3_32K_SOURCE "omap_32k_fck"
+#define OMAP4_32K_SOURCE "sys_32k_ck"
+
+#ifdef CONFIG_OMAP_32K_TIMER
+#define OMAP2_CLKEV_SOURCE OMAP2_32K_SOURCE
+#define OMAP3_CLKEV_SOURCE OMAP3_32K_SOURCE
+#define OMAP4_CLKEV_SOURCE OMAP4_32K_SOURCE
+#define OMAP3_BEAGLE_TIMER 12
+#else
+#define OMAP2_CLKEV_SOURCE OMAP2_MPU_SOURCE
+#define OMAP3_CLKEV_SOURCE OMAP3_MPU_SOURCE
+#define OMAP4_CLKEV_SOURCE OMAP4_MPU_SOURCE
+#define OMAP3_BEAGLE_TIMER 1
+#endif
/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
#define MAX_GPTIMER_ID 12
+/* Clockevent code */
+
+static struct omap_dm_timer clkev;
static struct omap_dm_timer *gptimer;
static struct clock_event_device clockevent_gpt;
static u8 __initdata gptimer_id = 1;
@@ -57,10 +80,9 @@ struct omap_dm_timer *gptimer_wakeup;
static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
{
- struct omap_dm_timer *gpt = (struct omap_dm_timer *)dev_id;
struct clock_event_device *evt = &clockevent_gpt;
- omap_dm_timer_write_status(gpt, OMAP_TIMER_INT_OVERFLOW);
+ __omap_dm_timer_write_status(clkev.io_base, OMAP_TIMER_INT_OVERFLOW);
evt->event_handler(evt);
return IRQ_HANDLED;
@@ -75,7 +97,8 @@ static struct irqaction omap2_gp_timer_irq = {
static int omap2_gp_timer_set_next_event(unsigned long cycles,
struct clock_event_device *evt)
{
- omap_dm_timer_set_load_start(gptimer, 0, 0xffffffff - cycles);
+ __omap_dm_timer_load_start(clkev.io_base, OMAP_TIMER_CTRL_ST,
+ 0xffffffff - cycles, 1);
return 0;
}
@@ -85,13 +108,13 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
{
u32 period;
- omap_dm_timer_stop(gptimer);
+ omap_dm_timer_stop(&clkev);
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
- period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ;
+ period = clkev.rate / HZ;
period -= 1;
- omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period);
+ omap_dm_timer_set_load_start(&clkev, 1, 0xffffffff - period);
break;
case CLOCK_EVT_MODE_ONESHOT:
break;
@@ -130,43 +153,88 @@ int __init omap2_gp_clockevent_set_gptimer(u8 id)
return 0;
}
-static void __init omap2_gp_clockevent_init(void)
+static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
+ int gptimer_id,
+ const char *fck_source)
{
- u32 tick_rate;
- int src;
- char clockevent_hwmod_name[8]; /* 8 = sizeof("timerXX0") */
-
- inited = 1;
+ char name[10]; /* 10 = sizeof("gptXX_Xck0") */
+ struct omap_hwmod *oh;
+ size_t size;
+ int res = 0;
+
+ sprintf(name, "timer%d", gptimer_id);
+ omap_hwmod_setup_one(name);
+ oh = omap_hwmod_lookup(name);
+ if (!oh)
+ return -ENODEV;
+
+ timer->irq = oh->mpu_irqs[0].irq;
+ timer->phys_base = oh->slaves[0]->addr->pa_start;
+ size = oh->slaves[0]->addr->pa_end - timer->phys_base;
+
+ /* Static mapping, never released */
+ timer->io_base = ioremap(timer->phys_base, size);
+ if (!timer->io_base)
+ return -ENXIO;
+
+ /* After the dmtimer is using hwmod these clocks won't be needed */
+ sprintf(name, "gpt%d_fck", gptimer_id);
+ timer->fclk = clk_get(NULL, name);
+ if (IS_ERR(timer->fclk))
+ return -ENODEV;
+
+ sprintf(name, "gpt%d_ick", gptimer_id);
+ timer->iclk = clk_get(NULL, name);
+ if (IS_ERR(timer->iclk)) {
+ clk_put(timer->fclk);
+ return -ENODEV;
+ }
- sprintf(clockevent_hwmod_name, "timer%d", gptimer_id);
- omap_hwmod_setup_one(clockevent_hwmod_name);
+ omap_hwmod_enable(oh);
gptimer = omap_dm_timer_request_specific(gptimer_id);
BUG_ON(gptimer == NULL);
gptimer_wakeup = gptimer;
-#if defined(CONFIG_OMAP_32K_TIMER)
- src = OMAP_TIMER_SRC_32_KHZ;
-#else
- src = OMAP_TIMER_SRC_SYS_CLK;
- WARN(gptimer_id == 12, "WARNING: GPTIMER12 can only use the "
- "secure 32KiHz clock source\n");
-#endif
+ if (gptimer_id != 12) {
+ struct clk *src;
+
+ src = clk_get(NULL, fck_source);
+ if (IS_ERR(src)) {
+ res = -EINVAL;
+ } else {
+ res = __omap_dm_timer_set_source(timer->fclk, src);
+ if (IS_ERR_VALUE(res))
+ pr_warning("%s: timer%i cannot set source\n",
+ __func__, gptimer_id);
+ clk_put(src);
+ }
+ }
+ __omap_dm_timer_reset(timer, 1, 1);
+
+ timer->rate = clk_get_rate(timer->fclk);
+
+ timer->reserved = 1;
- if (gptimer_id != 12)
- WARN(IS_ERR_VALUE(omap_dm_timer_set_source(gptimer, src)),
- "timer-gp: omap_dm_timer_set_source() failed\n");
+ return res;
+}
- tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer));
+static void __init omap2_gp_clockevent_init(int gptimer_id,
+ const char *fck_source)
+{
+ int res;
- pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n",
- gptimer_id, tick_rate);
+ inited = 1;
+
+ res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source);
+ BUG_ON(res);
omap2_gp_timer_irq.dev_id = (void *)gptimer;
- setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq);
- omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW);
+ setup_irq(clkev.irq, &omap2_gp_timer_irq);
+
+ __omap_dm_timer_int_enable(clkev.io_base, OMAP_TIMER_INT_OVERFLOW);
- clockevent_gpt.mult = div_sc(tick_rate, NSEC_PER_SEC,
+ clockevent_gpt.mult = div_sc(clkev.rate, NSEC_PER_SEC,
clockevent_gpt.shift);
clockevent_gpt.max_delta_ns =
clockevent_delta2ns(0xffffffff, &clockevent_gpt);
@@ -176,6 +244,9 @@ static void __init omap2_gp_clockevent_init(void)
clockevent_gpt.cpumask = cpumask_of(0);
clockevents_register_device(&clockevent_gpt);
+
+ pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n",
+ gptimer_id, clkev.rate);
}
/* Clocksource code */
@@ -251,7 +322,7 @@ static void __init omap2_gp_clocksource_init(void)
static void __init omap242x_timer_init(void)
{
omap_dm_timer_init();
- omap2_gp_clockevent_init();
+ omap2_gp_clockevent_init(1, OMAP2_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
@@ -262,7 +333,7 @@ struct sys_timer omap242x_timer = {
static void __init omap243x_timer_init(void)
{
omap_dm_timer_init();
- omap2_gp_clockevent_init();
+ omap2_gp_clockevent_init(1, OMAP2_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
@@ -275,7 +346,7 @@ struct sys_timer omap243x_timer = {
static void __init omap3_timer_init(void)
{
omap_dm_timer_init();
- omap2_gp_clockevent_init();
+ omap2_gp_clockevent_init(1, OMAP3_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
@@ -283,10 +354,14 @@ struct sys_timer omap3_timer = {
.init = omap3_timer_init,
};
+/*
+ * Beagle based designs typically have an issue with gptimer1. Also note
+ * that GPTIMER12 can only use the secure 32KiHz clock source.
+ */
static void __init omap3_beagle_timer_init(void)
{
omap_dm_timer_init();
- omap2_gp_clockevent_init();
+ omap2_gp_clockevent_init(OMAP3_BEAGLE_TIMER, OMAP3_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
@@ -303,7 +378,7 @@ static void __init omap4_timer_init(void)
BUG_ON(!twd_base);
#endif
omap_dm_timer_init();
- omap2_gp_clockevent_init();
+ omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 21ad28c..5e68974 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -213,6 +213,7 @@ struct omap_dm_timer {
struct clk *iclk, *fclk;
#endif
void __iomem *io_base;
+ unsigned long rate;
unsigned reserved:1;
unsigned enabled:1;
unsigned posted:1;
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 05/10] omap2+: Use dmtimer macros for clockevent
2011-03-28 22:21 ` [PATCH 05/10] omap2+: Use dmtimer macros for clockevent Tony Lindgren
@ 2011-03-29 17:16 ` Tony Lindgren
2011-03-31 21:35 ` Kevin Hilman
1 sibling, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-29 17:16 UTC (permalink / raw)
To: linux-arm-kernel
* Tony Lindgren <tony@atomide.com> [110328 15:19]:
>
> Note that omap_dmtimer_init_one can eventually be moved to
> omap2+ specific dmtimer.c.
Actually after this series we'll have just timer.c, will
remove this comment.
Tony
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 05/10] omap2+: Use dmtimer macros for clockevent
2011-03-28 22:21 ` [PATCH 05/10] omap2+: Use dmtimer macros for clockevent Tony Lindgren
2011-03-29 17:16 ` Tony Lindgren
@ 2011-03-31 21:35 ` Kevin Hilman
2011-03-31 22:04 ` Tony Lindgren
1 sibling, 1 reply; 38+ messages in thread
From: Kevin Hilman @ 2011-03-31 21:35 UTC (permalink / raw)
To: linux-arm-kernel
Tony Lindgren <tony@atomide.com> writes:
> This patch makes timer-gp.c to use only a subset of dmtimer
> functions without the need to initialize dmtimer code early.
>
> Note that omap_dmtimer_init_one can eventually be moved to
> omap2+ specific dmtimer.c.
>
> Also note that now with the inline functions, timer_set_next_event
> becomes more efficient in the lines of assembly code.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
In looking closer at this patch, I have a few questions.
[...]
> @@ -75,7 +97,8 @@ static struct irqaction omap2_gp_timer_irq = {
> static int omap2_gp_timer_set_next_event(unsigned long cycles,
> struct clock_event_device *evt)
> {
> - omap_dm_timer_set_load_start(gptimer, 0, 0xffffffff - cycles);
> + __omap_dm_timer_load_start(clkev.io_base, OMAP_TIMER_CTRL_ST,
> + 0xffffffff - cycles, 1);
>
> return 0;
The creation of macros is causing some readability concern, at least for
me...
In creating the macro versions of some of the functions, the macro
version actually has different behavior which makes reading the code a
little confusing.
I just noticed that the macro version of _load_start() doesn't actually
do the "start", so you added the OMAP_TIMER_CTRL_ST when calling it.
To do this, the macro version takes a 'ctrl' argument where as the
"real" version only takes the autoreload argument.
If you're going to keep the same function name (but just add the __
prefix, I would expect that the functionality of the function doesn't
change.
If the functionality of the macro is different from the "real" function,
it should probably just be given a different name. In this case,
probably dropping the _start suffix is probably enough.
> }
> @@ -85,13 +108,13 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
> {
> u32 period;
>
> - omap_dm_timer_stop(gptimer);
> + omap_dm_timer_stop(&clkev);
>
> switch (mode) {
> case CLOCK_EVT_MODE_PERIODIC:
> - period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ;
> + period = clkev.rate / HZ;
> period -= 1;
> - omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period);
> + omap_dm_timer_set_load_start(&clkev, 1, 0xffffffff - period);
Hmm, you're using the driver function here not the macro. Is that
intended?
Why not use the macro version here with OMAP_TIMER_CTRL_AR |
OMAP_TIMER_CTRL_ST.
Kevin
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 05/10] omap2+: Use dmtimer macros for clockevent
2011-03-31 21:35 ` Kevin Hilman
@ 2011-03-31 22:04 ` Tony Lindgren
0 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-31 22:04 UTC (permalink / raw)
To: linux-arm-kernel
* Kevin Hilman <khilman@ti.com> [110331 14:32]:
> Tony Lindgren <tony@atomide.com> writes:
>
> > This patch makes timer-gp.c to use only a subset of dmtimer
> > functions without the need to initialize dmtimer code early.
> >
> > Note that omap_dmtimer_init_one can eventually be moved to
> > omap2+ specific dmtimer.c.
> >
> > Also note that now with the inline functions, timer_set_next_event
> > becomes more efficient in the lines of assembly code.
> >
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
>
> In looking closer at this patch, I have a few questions.
>
> [...]
>
> > @@ -75,7 +97,8 @@ static struct irqaction omap2_gp_timer_irq = {
> > static int omap2_gp_timer_set_next_event(unsigned long cycles,
> > struct clock_event_device *evt)
> > {
> > - omap_dm_timer_set_load_start(gptimer, 0, 0xffffffff - cycles);
> > + __omap_dm_timer_load_start(clkev.io_base, OMAP_TIMER_CTRL_ST,
> > + 0xffffffff - cycles, 1);
> >
> > return 0;
>
> The creation of macros is causing some readability concern, at least for
> me...
>
> In creating the macro versions of some of the functions, the macro
> version actually has different behavior which makes reading the code a
> little confusing.
>
> I just noticed that the macro version of _load_start() doesn't actually
> do the "start", so you added the OMAP_TIMER_CTRL_ST when calling it.
> To do this, the macro version takes a 'ctrl' argument where as the
> "real" version only takes the autoreload argument.
>
> If you're going to keep the same function name (but just add the __
> prefix, I would expect that the functionality of the function doesn't
> change.
>
> If the functionality of the macro is different from the "real" function,
> it should probably just be given a different name. In this case,
> probably dropping the _start suffix is probably enough.
OK good point.
> > }
> > @@ -85,13 +108,13 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
> > {
> > u32 period;
> >
> > - omap_dm_timer_stop(gptimer);
> > + omap_dm_timer_stop(&clkev);
> >
> > switch (mode) {
> > case CLOCK_EVT_MODE_PERIODIC:
> > - period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ;
> > + period = clkev.rate / HZ;
> > period -= 1;
> > - omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period);
> > + omap_dm_timer_set_load_start(&clkev, 1, 0xffffffff - period);
>
> Hmm, you're using the driver function here not the macro. Is that
> intended?
>
> Why not use the macro version here with OMAP_TIMER_CTRL_AR |
> OMAP_TIMER_CTRL_ST.
Hmm I guess I tried to change as little as possible here when I noticed
that there's some weirdness with the autoreload mode in the original
omap_dm_timer_set_load_start function that requires writing twice in
the autoreload case. Looks like that's not needed for the one-shot case.
Anyways, you're right, this should not be using the driver function to move
the rest of the timers to be under drivers/ eventually. Will post an
updated version after taking another look at the dmtimer hwmod series.
Regards,
Tony
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 06/10] omap2+: Remove gptimer_wakekup for now
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
` (4 preceding siblings ...)
2011-03-28 22:21 ` [PATCH 05/10] omap2+: Use dmtimer macros for clockevent Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-31 22:09 ` Kevin Hilman
2011-03-28 22:21 ` [PATCH 07/10] omap2+: Reserve clocksource and timesource and initialize dmtimer later Tony Lindgren
` (5 subsequent siblings)
11 siblings, 1 reply; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
This removes the support for setting the wake-up timer for debugging.
Later on we can reserve gptimer1 for PM code only and have similar
functionality.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/pm-debug.c | 27 ---------------------------
arch/arm/mach-omap2/pm.h | 6 ------
arch/arm/mach-omap2/pm34xx.c | 4 ----
arch/arm/mach-omap2/timer-gp.c | 8 +-------
4 files changed, 1 insertions(+), 44 deletions(-)
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index a5a83b3..6e19f10 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -41,8 +41,6 @@
int omap2_pm_debug;
u32 enable_off_mode;
u32 sleep_while_idle;
-u32 wakeup_timer_seconds;
-u32 wakeup_timer_milliseconds;
#define DUMP_PRM_MOD_REG(mod, reg) \
regs[reg_count].name = #mod "." #reg; \
@@ -162,23 +160,6 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
printk(KERN_INFO "%-20s: 0x%08x\n", regs[i].name, regs[i].val);
}
-void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds)
-{
- u32 tick_rate, cycles;
-
- if (!seconds && !milliseconds)
- return;
-
- tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup));
- cycles = tick_rate * seconds + tick_rate * milliseconds / 1000;
- omap_dm_timer_stop(gptimer_wakeup);
- omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0xffffffff - cycles);
-
- pr_info("PM: Resume timer in %u.%03u secs"
- " (%d ticks at %d ticks/sec.)\n",
- seconds, milliseconds, cycles, tick_rate);
-}
-
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
#include <linux/seq_file.h>
@@ -576,9 +557,6 @@ static int option_set(void *data, u64 val)
{
u32 *option = data;
- if (option == &wakeup_timer_milliseconds && val >= 1000)
- return -EINVAL;
-
*option = val;
if (option == &enable_off_mode) {
@@ -641,11 +619,6 @@ static int __init pm_dbg_init(void)
&enable_off_mode, &pm_dbg_option_fops);
(void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUSR, d,
&sleep_while_idle, &pm_dbg_option_fops);
- (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d,
- &wakeup_timer_seconds, &pm_dbg_option_fops);
- (void) debugfs_create_file("wakeup_timer_milliseconds",
- S_IRUGO | S_IWUSR, d, &wakeup_timer_milliseconds,
- &pm_dbg_option_fops);
pm_dbg_init_done = 1;
return 0;
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 797bfd1..fb26e71 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -55,19 +55,13 @@ inline void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params)
extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
-extern u32 wakeup_timer_seconds;
-extern u32 wakeup_timer_milliseconds;
-extern struct omap_dm_timer *gptimer_wakeup;
-
#ifdef CONFIG_PM_DEBUG
extern void omap2_pm_dump(int mode, int resume, unsigned int us);
-extern void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds);
extern int omap2_pm_debug;
extern u32 enable_off_mode;
extern u32 sleep_while_idle;
#else
#define omap2_pm_dump(mode, resume, us) do {} while (0);
-#define omap2_pm_wakeup_on_timer(seconds, milliseconds) do {} while (0);
#define omap2_pm_debug 0
#define enable_off_mode 0
#define sleep_while_idle 0
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 0c5e3a4..ff2fb0e 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -534,10 +534,6 @@ static int omap3_pm_suspend(void)
struct power_state *pwrst;
int state, ret = 0;
- if (wakeup_timer_seconds || wakeup_timer_milliseconds)
- omap2_pm_wakeup_on_timer(wakeup_timer_seconds,
- wakeup_timer_milliseconds);
-
/* Read current next_pwrsts */
list_for_each_entry(pwrst, &pwrst_list, node)
pwrst->saved_state = pwrdm_read_next_pwrst(pwrst->pwrdm);
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index c21e99f..4b071fb 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -72,11 +72,9 @@
/* Clockevent code */
static struct omap_dm_timer clkev;
-static struct omap_dm_timer *gptimer;
static struct clock_event_device clockevent_gpt;
static u8 __initdata gptimer_id = 1;
static u8 __initdata inited;
-struct omap_dm_timer *gptimer_wakeup;
static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
{
@@ -192,10 +190,6 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
omap_hwmod_enable(oh);
- gptimer = omap_dm_timer_request_specific(gptimer_id);
- BUG_ON(gptimer == NULL);
- gptimer_wakeup = gptimer;
-
if (gptimer_id != 12) {
struct clk *src;
@@ -229,7 +223,7 @@ static void __init omap2_gp_clockevent_init(int gptimer_id,
res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source);
BUG_ON(res);
- omap2_gp_timer_irq.dev_id = (void *)gptimer;
+ omap2_gp_timer_irq.dev_id = (void *)&clkev;
setup_irq(clkev.irq, &omap2_gp_timer_irq);
__omap_dm_timer_int_enable(clkev.io_base, OMAP_TIMER_INT_OVERFLOW);
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 06/10] omap2+: Remove gptimer_wakekup for now
2011-03-28 22:21 ` [PATCH 06/10] omap2+: Remove gptimer_wakekup for now Tony Lindgren
@ 2011-03-31 22:09 ` Kevin Hilman
2011-04-01 16:26 ` Santosh Shilimkar
0 siblings, 1 reply; 38+ messages in thread
From: Kevin Hilman @ 2011-03-31 22:09 UTC (permalink / raw)
To: linux-arm-kernel
Tony Lindgren <tony@atomide.com> writes:
> This removes the support for setting the wake-up timer for debugging.
>
> Later on we can reserve gptimer1 for PM code only and have similar
> functionality.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
While we work on an alternative, rather than completely remove this
functionality, below is a very small patch (replaces $SUBJECT patch)
that will keep the current wakeup-from-suspend timer for PM debug
working.
Note that GPT1 fs not just used for wakeups from suspend. GPT1 needs to
also be the clockevent (at least during idle) so that next-timer
interrupts during idle are also programmed for GPT1.
Here is what I see as a possible "real" solution. Let's see if we're on
the same page.
- GPT1 reserved for "special" PM wakeup
- GPT2 used as high-resolution clockevent (using sys_clk, but stops during idle)
- GPT3 (or counter_32k) used as clocksource depending on Kconfig
Whenever we're going idle (or suspend), we have to effectively switch
the clockevent from GPT2 to GPT1. I assume this is what you have in
mind as well.
We'll need to dig into the clockevent (and tick broadcast) code to get
this to work on UP. On SMP, the C3STOP flag is used to signify that at
clockevent will stop during specific power states, so an alternate
clockevent is used, but IIUC, this doesn't currently work the same on
UP. I think Santosh has looked into this more recently than I have.
Santosh, if you have any recent status on this, could you share? I'll
gladly work on the clockevent layer if necessary for this.
Tony, in the mean time, can you use something like the patch below
instead of $SUBJECT patch? At least we won't loose functionality while
working on this feature.
Kevin
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 06/10] omap2+: Remove gptimer_wakekup for now
2011-03-31 22:09 ` Kevin Hilman
@ 2011-04-01 16:26 ` Santosh Shilimkar
0 siblings, 0 replies; 38+ messages in thread
From: Santosh Shilimkar @ 2011-04-01 16:26 UTC (permalink / raw)
To: linux-arm-kernel
Kevin,
On 4/1/2011 3:39 AM, Kevin Hilman wrote:
> Tony Lindgren<tony@atomide.com> writes:
>
>> This removes the support for setting the wake-up timer for debugging.
>>
>> Later on we can reserve gptimer1 for PM code only and have similar
>> functionality.
>>
>> Signed-off-by: Tony Lindgren<tony@atomide.com>
>
> While we work on an alternative, rather than completely remove this
> functionality, below is a very small patch (replaces $SUBJECT patch)
> that will keep the current wakeup-from-suspend timer for PM debug
> working.
>
> Note that GPT1 fs not just used for wakeups from suspend. GPT1 needs to
> also be the clockevent (at least during idle) so that next-timer
> interrupts during idle are also programmed for GPT1.
>
> Here is what I see as a possible "real" solution. Let's see if we're on
> the same page.
>
> - GPT1 reserved for "special" PM wakeup
> - GPT2 used as high-resolution clockevent (using sys_clk, but stops during idle)
> - GPT3 (or counter_32k) used as clocksource depending on Kconfig
>
> Whenever we're going idle (or suspend), we have to effectively switch
> the clockevent from GPT2 to GPT1. I assume this is what you have in
> mind as well.
>
> We'll need to dig into the clockevent (and tick broadcast) code to get
> this to work on UP. On SMP, the C3STOP flag is used to signify that at
> clockevent will stop during specific power states, so an alternate
> clockevent is used, but IIUC, this doesn't currently work the same on
> UP. I think Santosh has looked into this more recently than I have.
> Santosh, if you have any recent status on this, could you share? I'll
> gladly work on the clockevent layer if necessary for this.
>
For OMAP4, it's already part of OMAP4 PM series as you know.
For OMAP3 as well I had cooked up couple of patches some time
back to get clock event switching working.
Will find and post them soon.
Regards
Santosh
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 07/10] omap2+: Reserve clocksource and timesource and initialize dmtimer later
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
` (5 preceding siblings ...)
2011-03-28 22:21 ` [PATCH 06/10] omap2+: Remove gptimer_wakekup for now Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 08/10] omap2+: Use dmtimer macros for clocksource Tony Lindgren
` (4 subsequent siblings)
11 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
There's no need to initialize the dmtimer framework early.
Just mark the clocksource and timesource as reserved, and
initialize dmtimer with an arch_initcall.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap1/timer32k.c | 4 ----
arch/arm/mach-omap2/timer-gp.c | 9 ++++-----
arch/arm/plat-omap/dmtimer.c | 8 ++++++++
arch/arm/plat-omap/include/plat/dmtimer.h | 1 +
4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 13d7b8f..96604a5 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -183,10 +183,6 @@ static __init void omap_init_32k_timer(void)
bool __init omap_32k_timer_init(void)
{
omap_init_clocksource_32k();
-
-#ifdef CONFIG_OMAP_DM_TIMER
- omap_dm_timer_init();
-#endif
omap_init_32k_timer();
return true;
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 4b071fb..5e8fa1e 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -69,6 +69,8 @@
/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
#define MAX_GPTIMER_ID 12
+u32 sys_timer_reserved;
+
/* Clockevent code */
static struct omap_dm_timer clkev;
@@ -190,6 +192,8 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
omap_hwmod_enable(oh);
+ sys_timer_reserved |= (1 << (gptimer_id - 1));
+
if (gptimer_id != 12) {
struct clk *src;
@@ -315,7 +319,6 @@ static void __init omap2_gp_clocksource_init(void)
#ifdef CONFIG_ARCH_OMAP2
static void __init omap242x_timer_init(void)
{
- omap_dm_timer_init();
omap2_gp_clockevent_init(1, OMAP2_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
@@ -326,7 +329,6 @@ struct sys_timer omap242x_timer = {
static void __init omap243x_timer_init(void)
{
- omap_dm_timer_init();
omap2_gp_clockevent_init(1, OMAP2_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
@@ -339,7 +341,6 @@ struct sys_timer omap243x_timer = {
#ifdef CONFIG_ARCH_OMAP3
static void __init omap3_timer_init(void)
{
- omap_dm_timer_init();
omap2_gp_clockevent_init(1, OMAP3_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
@@ -354,7 +355,6 @@ struct sys_timer omap3_timer = {
*/
static void __init omap3_beagle_timer_init(void)
{
- omap_dm_timer_init();
omap2_gp_clockevent_init(OMAP3_BEAGLE_TIMER, OMAP3_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
@@ -371,7 +371,6 @@ static void __init omap4_timer_init(void)
twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256);
BUG_ON(!twd_base);
#endif
- omap_dm_timer_init();
omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index ff9b732..5163cf4 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -677,8 +677,16 @@ int __init omap_dm_timer_init(void)
sprintf(clk_name, "gpt%d_fck", i + 1);
timer->fclk = clk_get(NULL, clk_name);
}
+
+ /* One or two timers may be set up early for sys_timer */
+ if (sys_timer_reserved & (1 << i)) {
+ timer->reserved = 1;
+ timer->posted = 1;
+ }
#endif
}
return 0;
}
+
+arch_initcall(omap_dm_timer_init);
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 5e68974..97bc306 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -219,6 +219,7 @@ struct omap_dm_timer {
unsigned posted:1;
};
+extern u32 sys_timer_reserved;
void __omap_dm_timer_reset(struct omap_dm_timer *timer, int autoidle,
int wakeup);
void omap_dm_timer_prepare(struct omap_dm_timer *timer);
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 08/10] omap2+: Use dmtimer macros for clocksource
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
` (6 preceding siblings ...)
2011-03-28 22:21 ` [PATCH 07/10] omap2+: Reserve clocksource and timesource and initialize dmtimer later Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 09/10] omap2+: Remove omap2_gp_clockevent_set_gptimer Tony Lindgren
` (3 subsequent siblings)
11 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
Use dmtimer macros for clocksource. As with the clockevent,
this allows us to initialize the rest of dmtimer code later on.
Note that eventually we will be initializing the timesource
from init_early so sched_clock will work properly for
CONFIG_PRINTK_TIME.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/timer-gp.c | 60 +++++++++++++++++++++-----------------
arch/arm/plat-omap/counter_32k.c | 2 +
2 files changed, 34 insertions(+), 28 deletions(-)
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 5e8fa1e..afb9041 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -256,20 +256,22 @@ static void __init omap2_gp_clockevent_init(int gptimer_id,
* sync counter. See clocksource setup in plat-omap/counter_32k.c
*/
-static void __init omap2_gp_clocksource_init(void)
+static void __init omap2_gp_clocksource_init(int unused, const char *dummy)
{
omap_init_clocksource_32k();
}
#else
+
+static struct omap_dm_timer clksrc;
+
/*
* clocksource
*/
static DEFINE_CLOCK_DATA(cd);
-static struct omap_dm_timer *gpt_clocksource;
static cycle_t clocksource_read_cycles(struct clocksource *cs)
{
- return (cycle_t)omap_dm_timer_read_counter(gpt_clocksource);
+ return (cycle_t)__omap_dm_timer_read_counter(clksrc.io_base, 1);
}
static struct clocksource clocksource_gpt = {
@@ -284,35 +286,39 @@ static void notrace dmtimer_update_sched_clock(void)
{
u32 cyc;
- cyc = omap_dm_timer_read_counter(gpt_clocksource);
+ cyc = __omap_dm_timer_read_counter(clksrc.io_base, 1);
update_sched_clock(&cd, cyc, (u32)~0);
}
-/* Setup free-running counter for clocksource */
-static void __init omap2_gp_clocksource_init(void)
+unsigned long long notrace sched_clock(void)
{
- static struct omap_dm_timer *gpt;
- u32 tick_rate;
- static char err1[] __initdata = KERN_ERR
- "%s: failed to request dm-timer\n";
- static char err2[] __initdata = KERN_ERR
- "%s: can't register clocksource!\n";
+ u32 cyc = 0;
- gpt = omap_dm_timer_request();
- if (!gpt)
- printk(err1, clocksource_gpt.name);
- gpt_clocksource = gpt;
+ if (clksrc.reserved)
+ cyc = __omap_dm_timer_read_counter(clksrc.io_base, 1);
- omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK);
- tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt));
+ return cyc_to_sched_clock(&cd, cyc, (u32)~0);
+}
+
+/* Setup free-running counter for clocksource */
+static void __init omap2_gp_clocksource_init(int gptimer_id,
+ const char *fck_source)
+{
+ int res;
+
+ res = omap_dm_timer_init_one(&clksrc, gptimer_id, fck_source);
+ BUG_ON(res);
- omap_dm_timer_set_load_start(gpt, 1, 0);
+ pr_info("OMAP clocksource: GPTIMER%d at %lu Hz\n",
+ gptimer_id, clksrc.rate);
- init_sched_clock(&cd, dmtimer_update_sched_clock, 32, tick_rate);
+ omap_dm_timer_set_load_start(&clksrc, 1, 0);
+ init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate);
- if (clocksource_register_hz(&clocksource_gpt, tick_rate))
- printk(err2, clocksource_gpt.name);
+ if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
+ pr_err("Could not register clocksource %s\n",
+ clocksource_gpt.name);
}
#endif
@@ -320,7 +326,7 @@ static void __init omap2_gp_clocksource_init(void)
static void __init omap242x_timer_init(void)
{
omap2_gp_clockevent_init(1, OMAP2_CLKEV_SOURCE);
- omap2_gp_clocksource_init();
+ omap2_gp_clocksource_init(2, OMAP2_MPU_SOURCE);
}
struct sys_timer omap242x_timer = {
@@ -330,7 +336,7 @@ struct sys_timer omap242x_timer = {
static void __init omap243x_timer_init(void)
{
omap2_gp_clockevent_init(1, OMAP2_CLKEV_SOURCE);
- omap2_gp_clocksource_init();
+ omap2_gp_clocksource_init(2, OMAP2_MPU_SOURCE);
}
struct sys_timer omap243x_timer = {
@@ -342,7 +348,7 @@ struct sys_timer omap243x_timer = {
static void __init omap3_timer_init(void)
{
omap2_gp_clockevent_init(1, OMAP3_CLKEV_SOURCE);
- omap2_gp_clocksource_init();
+ omap2_gp_clocksource_init(2, OMAP3_MPU_SOURCE);
}
struct sys_timer omap3_timer = {
@@ -356,7 +362,7 @@ struct sys_timer omap3_timer = {
static void __init omap3_beagle_timer_init(void)
{
omap2_gp_clockevent_init(OMAP3_BEAGLE_TIMER, OMAP3_CLKEV_SOURCE);
- omap2_gp_clocksource_init();
+ omap2_gp_clocksource_init(2, OMAP3_MPU_SOURCE);
}
struct sys_timer omap3_beagle_timer = {
@@ -372,7 +378,7 @@ static void __init omap4_timer_init(void)
BUG_ON(!twd_base);
#endif
omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE);
- omap2_gp_clocksource_init();
+ omap2_gp_clocksource_init(2, OMAP4_MPU_SOURCE);
}
struct sys_timer omap4_timer = {
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index f7fed60..c13bc3d 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -126,7 +126,7 @@ static inline unsigned long long notrace _omap_32k_sched_clock(void)
return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);
}
-#ifndef CONFIG_OMAP_MPU_TIMER
+#if defined(CONFIG_OMAP_32K_TIMER) && !defined(CONFIG_OMAP_MPU_TIMER)
unsigned long long notrace sched_clock(void)
{
return _omap_32k_sched_clock();
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 09/10] omap2+: Remove omap2_gp_clockevent_set_gptimer
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
` (7 preceding siblings ...)
2011-03-28 22:21 ` [PATCH 08/10] omap2+: Use dmtimer macros for clocksource Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 10/10] omap2+: Rename timer-gp.c into timer.c to combine timer init functions Tony Lindgren
` (2 subsequent siblings)
11 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
This is no longer needed as we now just set the desired
.timer in MACHINE_START. We can now also remove timer-gp.h.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-4430sdp.c | 4 ----
arch/arm/mach-omap2/board-devkit8000.c | 4 ----
arch/arm/mach-omap2/board-omap3beagle.c | 4 ----
arch/arm/mach-omap2/board-omap3logic.c | 1 -
arch/arm/mach-omap2/board-omap3stalker.c | 4 ----
arch/arm/mach-omap2/board-omap3touchbook.c | 4 ----
arch/arm/mach-omap2/board-omap4panda.c | 1 -
arch/arm/mach-omap2/timer-gp.c | 26 --------------------------
arch/arm/mach-omap2/timer-gp.h | 16 ----------------
9 files changed, 0 insertions(+), 64 deletions(-)
delete mode 100644 arch/arm/mach-omap2/timer-gp.h
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index f740c40..142efaa 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -40,7 +40,6 @@
#include "mux.h"
#include "hsmmc.h"
-#include "timer-gp.h"
#include "control.h"
#define ETH_KS8851_IRQ 34
@@ -330,9 +329,6 @@ static void __init omap_4430sdp_init_early(void)
{
omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL);
-#ifdef CONFIG_OMAP_32K_TIMER
- omap2_gp_clockevent_set_gptimer(1);
-#endif
}
static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index cd465fa..18f7a0f 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -59,7 +59,6 @@
#include "mux.h"
#include "hsmmc.h"
-#include "timer-gp.h"
#define NAND_BLOCK_SIZE SZ_128K
@@ -458,9 +457,6 @@ static void __init devkit8000_init_early(void)
static void __init devkit8000_init_irq(void)
{
omap3_init_irq();
-#ifdef CONFIG_OMAP_32K_TIMER
- omap2_gp_clockevent_set_gptimer(12);
-#endif
}
static void __init devkit8000_ads7846_init(void)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index a4206be..8af2433 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -50,7 +50,6 @@
#include "mux.h"
#include "hsmmc.h"
-#include "timer-gp.h"
#include "pm.h"
#define NAND_BLOCK_SIZE SZ_128K
@@ -541,9 +540,6 @@ static void __init omap3_beagle_init_early(void)
static void __init omap3_beagle_init_irq(void)
{
omap3_init_irq();
-#ifdef CONFIG_OMAP_32K_TIMER
- omap2_gp_clockevent_set_gptimer(12);
-#endif
}
static struct platform_device *omap3_beagle_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 7e8ce0a..57ac9d1 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -35,7 +35,6 @@
#include "mux.h"
#include "hsmmc.h"
-#include "timer-gp.h"
#include "control.h"
#include <plat/mux.h>
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index fd863cf..2f08603 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -53,7 +53,6 @@
#include "sdram-micron-mt46h32m32lf-6.h"
#include "mux.h"
#include "hsmmc.h"
-#include "timer-gp.h"
#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
#define OMAP3STALKER_ETHR_START 0x2c000000
@@ -588,9 +587,6 @@ static void __init omap3_stalker_init_early(void)
static void __init omap3_stalker_init_irq(void)
{
omap3_init_irq();
-#ifdef CONFIG_OMAP_32K_TIMER
- omap2_gp_clockevent_set_gptimer(12);
-#endif
}
static struct platform_device *omap3_stalker_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 84f4be0..a40f640 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -51,7 +51,6 @@
#include "mux.h"
#include "hsmmc.h"
-#include "timer-gp.h"
#include <asm/setup.h>
@@ -423,9 +422,6 @@ static void __init omap3_touchbook_init_early(void)
static void __init omap3_touchbook_init_irq(void)
{
omap3_init_irq();
-#ifdef CONFIG_OMAP_32K_TIMER
- omap2_gp_clockevent_set_gptimer(12);
-#endif
}
static struct platform_device *omap3_touchbook_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index e7ce10d..731efd3 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -41,7 +41,6 @@
#include <plat/usb.h>
#include <plat/mmc.h>
#include <plat/panel-generic-dpi.h>
-#include "timer-gp.h"
#include "hsmmc.h"
#include "control.h"
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index afb9041..2edeb1a 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -43,8 +43,6 @@
#include <plat/common.h>
#include <plat/omap_hwmod.h>
-#include "timer-gp.h"
-
/* Parent clocks, eventually these will come from the clock framework */
#define OMAP2_MPU_SOURCE "sys_ck"
@@ -75,8 +73,6 @@ u32 sys_timer_reserved;
static struct omap_dm_timer clkev;
static struct clock_event_device clockevent_gpt;
-static u8 __initdata gptimer_id = 1;
-static u8 __initdata inited;
static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
{
@@ -133,26 +129,6 @@ static struct clock_event_device clockevent_gpt = {
.set_mode = omap2_gp_timer_set_mode,
};
-/**
- * omap2_gp_clockevent_set_gptimer - set which GPTIMER is used for clockevents
- * @id: GPTIMER to use (1..MAX_GPTIMER_ID)
- *
- * Define the GPTIMER that the system should use for the tick timer.
- * Meant to be called from board-*.c files in the event that GPTIMER1, the
- * default, is unsuitable. Returns -EINVAL on error or 0 on success.
- */
-int __init omap2_gp_clockevent_set_gptimer(u8 id)
-{
- if (id < 1 || id > MAX_GPTIMER_ID)
- return -EINVAL;
-
- BUG_ON(inited);
-
- gptimer_id = id;
-
- return 0;
-}
-
static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
int gptimer_id,
const char *fck_source)
@@ -222,8 +198,6 @@ static void __init omap2_gp_clockevent_init(int gptimer_id,
{
int res;
- inited = 1;
-
res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source);
BUG_ON(res);
diff --git a/arch/arm/mach-omap2/timer-gp.h b/arch/arm/mach-omap2/timer-gp.h
deleted file mode 100644
index 5c1072c..0000000
--- a/arch/arm/mach-omap2/timer-gp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * OMAP2/3 GPTIMER support.headers
- *
- * Copyright (C) 2009 Nokia Corporation
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_TIMER_GP_H
-#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_TIMER_GP_H
-
-extern int __init omap2_gp_clockevent_set_gptimer(u8 id);
-
-#endif
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 10/10] omap2+: Rename timer-gp.c into timer.c to combine timer init functions
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
` (8 preceding siblings ...)
2011-03-28 22:21 ` [PATCH 09/10] omap2+: Remove omap2_gp_clockevent_set_gptimer Tony Lindgren
@ 2011-03-28 22:21 ` Tony Lindgren
2011-03-29 18:16 ` [PATCH 00/10] omap init_early changes for irq and timer init Kevin Hilman
2011-03-30 7:56 ` Santosh Shilimkar
11 siblings, 0 replies; 38+ messages in thread
From: Tony Lindgren @ 2011-03-28 22:21 UTC (permalink / raw)
To: linux-arm-kernel
We can keep everything sys_timer and gptimer.c related code in
timer.c as the code will be very minimal.
Later on we can also remove timer-mpu.c, as it can be called from
omap4_timer_init function.
This allows us to get rid of confusing existing files. We currently
have timer-gp.c, timer-mpu.c, and patches have been posted to add
dmtimer.c. There's no need to have these multiple files, we can
put everything into timer.c.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/Makefile | 2 +-
arch/arm/mach-omap2/timer.c | 0
2 files changed, 1 insertions(+), 1 deletions(-)
rename arch/arm/mach-omap2/{timer-gp.c => timer.c} (100%)
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index a45cd64..04d04bb 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -3,7 +3,7 @@
#
# Common support
-obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \
+obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \
common.o gpio.o dma.o wd_timer.o
omap-2-3-common = irq.o sdrc.o
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer.c
similarity index 100%
rename from arch/arm/mach-omap2/timer-gp.c
rename to arch/arm/mach-omap2/timer.c
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 00/10] omap init_early changes for irq and timer init
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
` (9 preceding siblings ...)
2011-03-28 22:21 ` [PATCH 10/10] omap2+: Rename timer-gp.c into timer.c to combine timer init functions Tony Lindgren
@ 2011-03-29 18:16 ` Kevin Hilman
2011-03-30 7:56 ` Santosh Shilimkar
11 siblings, 0 replies; 38+ messages in thread
From: Kevin Hilman @ 2011-03-29 18:16 UTC (permalink / raw)
To: linux-arm-kernel
Tony Lindgren <tony@atomide.com> writes:
> This series continues the work to only initialize minimal omap code
> in init_early and to cut down dependencies to code that should be
> initialized later. It also cleans up the omap2+ timer init code to prepare
> things for the later patches.
>
> After this series further patches can make the dmtimer code a regular
> device driver. Later on we can also move the clockource init happen
> earlier to make sched_clock work properly with CONFIG_PRINTK_TIME.
This series looks OK to me.
My primary concerns were around the duplication of code between
early/system timers and the "real" device driver. But it now looks like
those early timers will also be doing individual init using hwmod and
clock framework, so any duplication can be avoided.
Reviewed-by: Kevin Hilman <khilman@ti.com>
Kevin
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 00/10] omap init_early changes for irq and timer init
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
` (10 preceding siblings ...)
2011-03-29 18:16 ` [PATCH 00/10] omap init_early changes for irq and timer init Kevin Hilman
@ 2011-03-30 7:56 ` Santosh Shilimkar
2011-03-30 18:22 ` Tony Lindgren
11 siblings, 1 reply; 38+ messages in thread
From: Santosh Shilimkar @ 2011-03-30 7:56 UTC (permalink / raw)
To: linux-arm-kernel
Tony,
On 3/29/2011 3:51 AM, Tony Lindgren wrote:
> Hi all,
>
> This series continues the work to only initialize minimal omap code
> in init_early and to cut down dependencies to code that should be
> initialized later. It also cleans up the omap2+ timer init code to prepare
> things for the later patches.
>
> After this series further patches can make the dmtimer code a regular
> device driver. Later on we can also move the clockource init happen
> earlier to make sched_clock work properly with CONFIG_PRINTK_TIME.
>
Yesterday I started looking at this series but later because of my
mailer horror show, I gave up.
After going through entire series again, it looks very
good clean-up and right step towards moving rest of
the timer to drivers/ directory.
I also realized that the discussion we had before this series was
because of miss-understating about the 'wakeu_up' timer
terminology. After this series I see that you were mentioning
about the pm debug timer where as I was taling about
clock-event wakeups from CPUidle point of view.
I still have few concerns about this series.
1)We have removed the flexibility if choosing the timer from
from board files and hard-coded them in platform timer
header.
Below board related hard-coding in platform files looks more
hacky and the interface done by Pual still has a merits of
its own.
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -34,7 +34,12 @@
struct sys_timer;
extern void omap_map_common_io(void);
-extern struct sys_timer omap_timer;
+extern struct sys_timer omap1_timer;
+extern struct sys_timer omap242x_timer;
+extern struct sys_timer omap243x_timer;
+extern struct sys_timer omap3_timer;
+extern struct sys_timer omap3_beagle_timer;
+extern struct sys_timer omap4_timer;
extern bool omap_32k_timer_init(void);
extern int __init omap_init_clocksource_32k(void);
extern unsigned long long notrace omap_32k_sched_clock(void);
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -45,10 +45,33 @@
#include "timer-gp.h"
+/* Parent clocks, eventually these will come from the clock framework */
+
+#define OMAP2_MPU_SOURCE "sys_ck"
+#define OMAP3_MPU_SOURCE OMAP2_MPU_SOURCE
+#define OMAP4_MPU_SOURCE "sys_clkin_ck"
+#define OMAP2_32K_SOURCE "func_32k_ck"
+#define OMAP3_32K_SOURCE "omap_32k_fck"
+#define OMAP4_32K_SOURCE "sys_32k_ck"
+
+#ifdef CONFIG_OMAP_32K_TIMER
+#define OMAP2_CLKEV_SOURCE OMAP2_32K_SOURCE
+#define OMAP3_CLKEV_SOURCE OMAP3_32K_SOURCE
+#define OMAP4_CLKEV_SOURCE OMAP4_32K_SOURCE
+#define OMAP3_BEAGLE_TIMER 12
+#else
+#define OMAP2_CLKEV_SOURCE OMAP2_MPU_SOURCE
+#define OMAP3_CLKEV_SOURCE OMAP3_MPU_SOURCE
+#define OMAP4_CLKEV_SOURCE OMAP4_MPU_SOURCE
+#define OMAP3_BEAGLE_TIMER 1
+#endif
[.....]
+/*
+ * Beagle based designs typically have an issue with gptimer1. Also note
+ * that GPTIMER12 can only use the secure 32KiHz clock source.
+ */
static void __init omap3_beagle_timer_init(void)
{
omap_dm_timer_init();
- omap2_gp_clockevent_init();
+ omap2_gp_clockevent_init(OMAP3_BEAGLE_TIMER, OMAP3_CLKEV_SOURCE);
omap2_gp_clocksource_init();
}
2) In patch [6/10], you have removed wakeup timer debug
capability with comment "Later on we can reserve gptimer1
for PM code only and have similar functionality".
I don't know how this will work on OMAP. GPTIMER1 is the
only timer which is in always on power domain and wakeup
OMAP from deeper power states like CORE OSWR, CORE OFF,
DEVICE OFF.
We do implement these C-state in CPUidle as well and hence
the clock-event is expected to be of wakeup-capable.
Hence GPTIMER1 is already reserved for clock-event.
The wakeup timer used was only in suspend scenario's
and that point of time the timer system is already
suspended. So during that even if TIMER1 is re-used
for wakeup (which is the case), I don't see any issue.
At least I don't see other solution than using GPT1
for wakeup.
3) You have created few functions so that they can
be used between system timer and dmtimer driver code.
When we move the dmtimer driver to say some drivers/
directory. Is it allowed to share such functions from
device drivers
Apart from above comments, I really liked this series.
If you like you can add my,
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Regards
Santosh
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 00/10] omap init_early changes for irq and timer init
2011-03-30 7:56 ` Santosh Shilimkar
@ 2011-03-30 18:22 ` Tony Lindgren
2011-03-31 8:16 ` Santosh Shilimkar
0 siblings, 1 reply; 38+ messages in thread
From: Tony Lindgren @ 2011-03-30 18:22 UTC (permalink / raw)
To: linux-arm-kernel
* Santosh Shilimkar <santosh.shilimkar@ti.com> [110330 00:53]:
>
> After going through entire series again, it looks very
> good clean-up and right step towards moving rest of
> the timer to drivers/ directory.
>
> I also realized that the discussion we had before this series was
> because of miss-understating about the 'wakeu_up' timer
> terminology. After this series I see that you were mentioning
> about the pm debug timer where as I was taling about
> clock-event wakeups from CPUidle point of view.
Well this patcheset keeps the current behaviour, except for
the PM debug hack to program gpt1.
What it does not have is the code to dedicate gpt1 for PM
code, which can be done later once all the other dmtimer
changes are done.
So the earlier discussion is still a separate issue from the
PM debug hack removed in this series. I'll post some patches
later on for that.
> I still have few concerns about this series.
>
> 1)We have removed the flexibility if choosing the timer from
> from board files and hard-coded them in platform timer
> header.
Well it's not removed, you can still select the timer setup
by setting .timer entry in the board-*.c file.
So for example, we have omap3_timer and omap3_beagle_timer
for the beagle rev a & b based boards.
> Below board related hard-coding in platform files looks more
> hacky and the interface done by Pual still has a merits of
> its own.
>
> --- a/arch/arm/plat-omap/include/plat/common.h
> +++ b/arch/arm/plat-omap/include/plat/common.h
> @@ -34,7 +34,12 @@
> struct sys_timer;
>
> extern void omap_map_common_io(void);
> -extern struct sys_timer omap_timer;
> +extern struct sys_timer omap1_timer;
> +extern struct sys_timer omap242x_timer;
> +extern struct sys_timer omap243x_timer;
> +extern struct sys_timer omap3_timer;
> +extern struct sys_timer omap3_beagle_timer;
> +extern struct sys_timer omap4_timer;
> extern bool omap_32k_timer_init(void);
> extern int __init omap_init_clocksource_32k(void);
> extern unsigned long long notrace omap_32k_sched_clock(void);
Hmm the only reason for omap3_beagle_timer naming is the
hardware bug in rev a & b beagle boards.
> +/*
> + * Beagle based designs typically have an issue with gptimer1. Also note
> + * that GPTIMER12 can only use the secure 32KiHz clock source.
> + */
> static void __init omap3_beagle_timer_init(void)
> {
> omap_dm_timer_init();
> - omap2_gp_clockevent_init();
> + omap2_gp_clockevent_init(OMAP3_BEAGLE_TIMER, OMAP3_CLKEV_SOURCE);
> omap2_gp_clocksource_init();
> }
Got any better name in mind for that timer?
For removing the old interface, I don't see any reason to
select timer combinations on omap3 other than omap3_timer
and omap3_beagle_timer.
If there's need, any new valid sane combinations can be esily
added, although I seriously doubt that we'll need more for
omap3.
> 2) In patch [6/10], you have removed wakeup timer debug
> capability with comment "Later on we can reserve gptimer1
> for PM code only and have similar functionality".
>
> I don't know how this will work on OMAP. GPTIMER1 is the
> only timer which is in always on power domain and wakeup
> OMAP from deeper power states like CORE OSWR, CORE OFF,
> DEVICE OFF.
Right, that's why the PM code should manage it for the wake-up
events. For the clockevent and clocksource we just want to
use something fast for the runtime.
Then when we hit idle, we can just let PM code program gpt1
for the wake-up event.
> We do implement these C-state in CPUidle as well and hence
> the clock-event is expected to be of wakeup-capable.
> Hence GPTIMER1 is already reserved for clock-event.
The PM code can easily deal with gpt1 by either calling
next_timer_interrupt, or just by cloning the clockevent
timer value. But again, that's a separate patch series
to come..
> The wakeup timer used was only in suspend scenario's
> and that point of time the timer system is already
> suspended. So during that even if TIMER1 is re-used
> for wakeup (which is the case), I don't see any issue.
The reason is that for performance and latency reasons
we want to use localtimers for runtime on omap4+, and
need only gpt1 for PM wake-up.
The gpt1 using 32KiHz source clock is a very slow clock
to reprogram as it's on the external bus.
> At least I don't see other solution than using GPT1
> for wakeup.
Right, there's no other way to wake except gpt1 or wake-up
enabled gpio lines. But we don't need to use gpt1 during
runtime at all.
> 3) You have created few functions so that they can
> be used between system timer and dmtimer driver code.
> When we move the dmtimer driver to say some drivers/
> directory. Is it allowed to share such functions from
> device drivers
The only function we for clockevent and clocksource is
the init_one function, which will be implemented in in
arch/arm/mach-omap2/timer.c anyways. The function to
reprogram the timer is an inline function so dmtimer
can then be a loadable driver module :)
> Apart from above comments, I really liked this series.
> If you like you can add my,
> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Thanks for looking, will add.
Regards,
Tony
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 00/10] omap init_early changes for irq and timer init
2011-03-30 18:22 ` Tony Lindgren
@ 2011-03-31 8:16 ` Santosh Shilimkar
2011-03-31 17:32 ` Tony Lindgren
0 siblings, 1 reply; 38+ messages in thread
From: Santosh Shilimkar @ 2011-03-31 8:16 UTC (permalink / raw)
To: linux-arm-kernel
On 3/30/2011 11:52 PM, Tony Lindgren wrote:
> * Santosh Shilimkar<santosh.shilimkar@ti.com> [110330 00:53]:
>>
>> After going through entire series again, it looks very
>> good clean-up and right step towards moving rest of
>> the timer to drivers/ directory.
>>
>> I also realized that the discussion we had before this series was
>> because of miss-understating about the 'wakeu_up' timer
>> terminology. After this series I see that you were mentioning
>> about the pm debug timer where as I was taling about
>> clock-event wakeups from CPUidle point of view.
>
> Well this patcheset keeps the current behaviour, except for
> the PM debug hack to program gpt1.
>
This is the problem what I see.
> What it does not have is the code to dedicate gpt1 for PM
> code, which can be done later once all the other dmtimer
> changes are done.
>
Which not possible to do unless you plan to hack generic
timer framework or waste additional timer hardware for
this.
> So the earlier discussion is still a separate issue from the
> PM debug hack removed in this series. I'll post some patches
> later on for that.
>
No that discussion become relevant with this series now.
>> I still have few concerns about this series.
>>
>> 1)We have removed the flexibility if choosing the timer from
>> from board files and hard-coded them in platform timer
>> header.
>
> Well it's not removed, you can still select the timer setup
> by setting .timer entry in the board-*.c file.
>
> So for example, we have omap3_timer and omap3_beagle_timer
> for the beagle rev a& b based boards.
>
This is exactly my point. This is the board specific data which
is now getting moved to generic headers.
>> Below board related hard-coding in platform files looks more
>> hacky and the interface done by Pual still has a merits of
>> its own.
>>
>> --- a/arch/arm/plat-omap/include/plat/common.h
>> +++ b/arch/arm/plat-omap/include/plat/common.h
>> @@ -34,7 +34,12 @@
>> struct sys_timer;
>>
>> extern void omap_map_common_io(void);
>> -extern struct sys_timer omap_timer;
>> +extern struct sys_timer omap1_timer;
>> +extern struct sys_timer omap242x_timer;
>> +extern struct sys_timer omap243x_timer;
>> +extern struct sys_timer omap3_timer;
>> +extern struct sys_timer omap3_beagle_timer;
>> +extern struct sys_timer omap4_timer;
>> extern bool omap_32k_timer_init(void);
>> extern int __init omap_init_clocksource_32k(void);
>> extern unsigned long long notrace omap_32k_sched_clock(void);
>
> Hmm the only reason for omap3_beagle_timer naming is the
> hardware bug in rev a& b beagle boards.
>
>> +/*
>> + * Beagle based designs typically have an issue with gptimer1. Also note
>> + * that GPTIMER12 can only use the secure 32KiHz clock source.
>> + */
>> static void __init omap3_beagle_timer_init(void)
>> {
>> omap_dm_timer_init();
>> - omap2_gp_clockevent_init();
>> + omap2_gp_clockevent_init(OMAP3_BEAGLE_TIMER, OMAP3_CLKEV_SOURCE);
>> omap2_gp_clocksource_init();
>> }
>
> Got any better name in mind for that timer?
>
> For removing the old interface, I don't see any reason to
> select timer combinations on omap3 other than omap3_timer
> and omap3_beagle_timer.
>
> If there's need, any new valid sane combinations can be esily
> added, although I seriously doubt that we'll need more for
> omap3.
>
May be I am wrong but the point is about the merit of the
solution even if there are only couple of board files where
we use that interface.
It much cleaner and simpler to say timerid=X, from board
file rather than creating a "struct sys_timer" instance
and putting that in timer code.
>> 2) In patch [6/10], you have removed wakeup timer debug
>> capability with comment "Later on we can reserve gptimer1
>> for PM code only and have similar functionality".
>>
>> I don't know how this will work on OMAP. GPTIMER1 is the
>> only timer which is in always on power domain and wakeup
>> OMAP from deeper power states like CORE OSWR, CORE OFF,
>> DEVICE OFF.
>
> Right, that's why the PM code should manage it for the wake-up
> events. For the clockevent and clocksource we just want to
> use something fast for the runtime.
>
> Then when we hit idle, we can just let PM code program gpt1
> for the wake-up event.
>
>> We do implement these C-state in CPUidle as well and hence
>> the clock-event is expected to be of wakeup-capable.
>> Hence GPTIMER1 is already reserved for clock-event.
>
> The PM code can easily deal with gpt1 by either calling
> next_timer_interrupt, or just by cloning the clockevent
> timer value. But again, that's a separate patch series
> to come..
>
>> The wakeup timer used was only in suspend scenario's
>> and that point of time the timer system is already
>> suspended. So during that even if TIMER1 is re-used
>> for wakeup (which is the case), I don't see any issue.
>
> The reason is that for performance and latency reasons
> we want to use localtimers for runtime on omap4+, and
> need only gpt1 for PM wake-up.
>
This is already the case with or without this series.
> The gpt1 using 32KiHz source clock is a very slow clock
> to reprogram as it's on the external bus.
>
Even its slow, to make CPUIDLE work in low power modes and
you need this clock-event as well. This is where the
generic timer framework with C3STOP helps.
>> At least I don't see other solution than using GPT1
>> for wakeup.
>
> Right, there's no other way to wake except gpt1 or wake-up
> enabled gpio lines. But we don't need to use gpt1 during
> runtime at all.
>
This is not entirely correct and I think this is the point
where we are not on same page. During runtime, gpt1 clock
event is not used for tick generation but it's kept
programmed because low power state switch via
get triggered any time and on any CPU.
This is the same problem as X86 APIC timer + HPET
switching and I worked with Thomas G and Russell
to get this working on ARM platforms using generic
timer framework. No hacking is needed in PM code
for this.
>> 3) You have created few functions so that they can
>> be used between system timer and dmtimer driver code.
>> When we move the dmtimer driver to say some drivers/
>> directory. Is it allowed to share such functions from
>> device drivers
>
> The only function we for clockevent and clocksource is
> the init_one function, which will be implemented in in
> arch/arm/mach-omap2/timer.c anyways. The function to
> reprogram the timer is an inline function so dmtimer
> can then be a loadable driver module :)
>
Great. This was more of question for my undertanding.
For me, with current set of patches, suspend wakeup using
GPT1 is not possible.
It's not a big problem because it's just debug aid and
production kernel doesn't use this as such.
Regards
Santosh
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 00/10] omap init_early changes for irq and timer init
2011-03-31 8:16 ` Santosh Shilimkar
@ 2011-03-31 17:32 ` Tony Lindgren
2011-04-01 8:39 ` Santosh Shilimkar
0 siblings, 1 reply; 38+ messages in thread
From: Tony Lindgren @ 2011-03-31 17:32 UTC (permalink / raw)
To: linux-arm-kernel
* Santosh Shilimkar <santosh.shilimkar@ti.com> [110331 01:14]:
> On 3/30/2011 11:52 PM, Tony Lindgren wrote:
>
> >What it does not have is the code to dedicate gpt1 for PM
> >code, which can be done later once all the other dmtimer
> >changes are done.
> >
> Which not possible to do unless you plan to hack generic
> timer framework or waste additional timer hardware for
> this.
Well an extra timer hardware would only be needed on omap2 & 3.
But hey, if it makes sense to do or not to do is a different
set of patches. At least we now have an option to play with it.
> >For removing the old interface, I don't see any reason to
> >select timer combinations on omap3 other than omap3_timer
> >and omap3_beagle_timer.
> >
> >If there's need, any new valid sane combinations can be esily
> >added, although I seriously doubt that we'll need more for
> >omap3.
> >
> May be I am wrong but the point is about the merit of the
> solution even if there are only couple of board files where
> we use that interface.
>
> It much cleaner and simpler to say timerid=X, from board
> file rather than creating a "struct sys_timer" instance
> and putting that in timer code.
Well the timerid=X adds yet another interface and more calls from
board-*.c to the common code. And it requires more changes if beagle
boards want to use the system clock as the source clock instead
of the 32KiHZ source.
Maybe let's call the omap3_beagle_timer omap3_secure_timer instead?
That should solve your issue of having the board name show up
in the generic code, no?
> >>At least I don't see other solution than using GPT1
> >>for wakeup.
> >
> >Right, there's no other way to wake except gpt1 or wake-up
> >enabled gpio lines. But we don't need to use gpt1 during
> >runtime at all.
> >
> This is not entirely correct and I think this is the point
> where we are not on same page. During runtime, gpt1 clock
> event is not used for tick generation but it's kept
> programmed because low power state switch via
> get triggered any time and on any CPU.
Well ideally we would not program it during runtime at all
because it's slow to program. I don't think that can be
currently done with the sys_timer.
> This is the same problem as X86 APIC timer + HPET
> switching and I worked with Thomas G and Russell
> to get this working on ARM platforms using generic
> timer framework. No hacking is needed in PM code
> for this.
Except we should improve things eventually where we don't
need to program the slow external timer during runtime
if we have local timers.
Hmm maybe I'm wrong and you got that working already?
Regards,
Tony
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 00/10] omap init_early changes for irq and timer init
2011-03-31 17:32 ` Tony Lindgren
@ 2011-04-01 8:39 ` Santosh Shilimkar
0 siblings, 0 replies; 38+ messages in thread
From: Santosh Shilimkar @ 2011-04-01 8:39 UTC (permalink / raw)
To: linux-arm-kernel
On 3/31/2011 11:02 PM, Tony Lindgren wrote:
> * Santosh Shilimkar<santosh.shilimkar@ti.com> [110331 01:14]:
>> On 3/30/2011 11:52 PM, Tony Lindgren wrote:
>>
>>> What it does not have is the code to dedicate gpt1 for PM
>>> code, which can be done later once all the other dmtimer
>>> changes are done.
>>>
>> Which not possible to do unless you plan to hack generic
>> timer framework or waste additional timer hardware for
>> this.
>
> Well an extra timer hardware would only be needed on omap2& 3.
>
> But hey, if it makes sense to do or not to do is a different
> set of patches. At least we now have an option to play with it.
>
>>> For removing the old interface, I don't see any reason to
>>> select timer combinations on omap3 other than omap3_timer
>>> and omap3_beagle_timer.
>>>
>>> If there's need, any new valid sane combinations can be esily
>>> added, although I seriously doubt that we'll need more for
>>> omap3.
>>>
>> May be I am wrong but the point is about the merit of the
>> solution even if there are only couple of board files where
>> we use that interface.
>>
>> It much cleaner and simpler to say timerid=X, from board
>> file rather than creating a "struct sys_timer" instance
>> and putting that in timer code.
>
> Well the timerid=X adds yet another interface and more calls from
> board-*.c to the common code. And it requires more changes if beagle
> boards want to use the system clock as the source clock instead
> of the 32KiHZ source.
>
> Maybe let's call the omap3_beagle_timer omap3_secure_timer instead?
>
> That should solve your issue of having the board name show up
> in the generic code, no?
>
Sorry about picking up on names but that was not
my point. I agree with you on reducing interfaces so
I step back on this point.
>>>> At least I don't see other solution than using GPT1
>>>> for wakeup.
>>>
>>> Right, there's no other way to wake except gpt1 or wake-up
>>> enabled gpio lines. But we don't need to use gpt1 during
>>> runtime at all.
>>>
>> This is not entirely correct and I think this is the point
>> where we are not on same page. During runtime, gpt1 clock
>> event is not used for tick generation but it's kept
>> programmed because low power state switch via
>> get triggered any time and on any CPU.
>
> Well ideally we would not program it during runtime at all
> because it's slow to program. I don't think that can be
> currently done with the sys_timer.
>
>> This is the same problem as X86 APIC timer + HPET
>> switching and I worked with Thomas G and Russell
>> to get this working on ARM platforms using generic
>> timer framework. No hacking is needed in PM code
>> for this.
>
> Except we should improve things eventually where we don't
> need to program the slow external timer during runtime
> if we have local timers.
>
This is already the case now. On OMAP4 running system,
CPU use their own local timers and rq's. There is no
broadcasting. Whenever there is a need of it like
the situations where local-timers die (low power
states), timer system switches to broad-cast timer
which is wakeup capable. GPT1 in our case. This
is all managed by timer framework and works seamlessly.
> Hmm maybe I'm wrong and you got that working already?
>
I don't think you are wrong. All your points are
correct. The only missing point was the necessity
of GPT1 registered as clock-event to allow
dynamic switching between clock-events.
That's where I was saying that we are not
left with GPT1 for PM debug feature.
Regards
Santosh
^ permalink raw reply [flat|nested] 38+ messages in thread