diff options
author | Shiraz Hashim <shiraz.hashim@st.com> | 2011-02-16 01:40:32 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-03-09 04:49:44 -0500 |
commit | 5c881d9ae9480171f01921585e1893863d7ab421 (patch) | |
tree | 1f25afe829901e5cfc79d21d4b99b005b1e8b69c /arch/arm/mach-spear3xx | |
parent | 53688c51e412b7fd642e5c8eb8ba8ee19744c4ea (diff) |
ARM: 6737/1: SPEAr: formalized timer support
Move platform specific timer initialization code is moved into platform
specific files.
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Stanley Miao <stanley.miao@windriver.com>
Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-spear3xx')
-rw-r--r-- | arch/arm/mach-spear3xx/include/mach/generic.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-spear3xx/spear300_evb.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-spear3xx/spear310_evb.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-spear3xx/spear320_evb.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-spear3xx/spear3xx.c | 32 |
5 files changed, 36 insertions, 5 deletions
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h index c16d2f8025e9..e7d2de84e9a5 100644 --- a/arch/arm/mach-spear3xx/include/mach/generic.h +++ b/arch/arm/mach-spear3xx/include/mach/generic.h | |||
@@ -33,10 +33,11 @@ | |||
33 | /* Add spear3xx family device structure declarations here */ | 33 | /* Add spear3xx family device structure declarations here */ |
34 | extern struct amba_device gpio_device; | 34 | extern struct amba_device gpio_device; |
35 | extern struct amba_device uart_device; | 35 | extern struct amba_device uart_device; |
36 | extern struct sys_timer spear_sys_timer; | 36 | extern struct sys_timer spear3xx_timer; |
37 | 37 | ||
38 | /* Add spear3xx family function declarations here */ | 38 | /* Add spear3xx family function declarations here */ |
39 | void __init clk_init(void); | 39 | void __init clk_init(void); |
40 | void __init spear_setup_timer(void); | ||
40 | void __init spear3xx_map_io(void); | 41 | void __init spear3xx_map_io(void); |
41 | void __init spear3xx_init_irq(void); | 42 | void __init spear3xx_init_irq(void); |
42 | void __init spear3xx_init(void); | 43 | void __init spear3xx_init(void); |
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c index 2c90663e5c71..cd23c98b2ffd 100644 --- a/arch/arm/mach-spear3xx/spear300_evb.c +++ b/arch/arm/mach-spear3xx/spear300_evb.c | |||
@@ -71,6 +71,6 @@ MACHINE_START(SPEAR300, "ST-SPEAR300-EVB") | |||
71 | .boot_params = 0x00000100, | 71 | .boot_params = 0x00000100, |
72 | .map_io = spear3xx_map_io, | 72 | .map_io = spear3xx_map_io, |
73 | .init_irq = spear3xx_init_irq, | 73 | .init_irq = spear3xx_init_irq, |
74 | .timer = &spear_sys_timer, | 74 | .timer = &spear3xx_timer, |
75 | .init_machine = spear300_evb_init, | 75 | .init_machine = spear300_evb_init, |
76 | MACHINE_END | 76 | MACHINE_END |
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c index 4e55e553a2cf..385543108262 100644 --- a/arch/arm/mach-spear3xx/spear310_evb.c +++ b/arch/arm/mach-spear3xx/spear310_evb.c | |||
@@ -78,6 +78,6 @@ MACHINE_START(SPEAR310, "ST-SPEAR310-EVB") | |||
78 | .boot_params = 0x00000100, | 78 | .boot_params = 0x00000100, |
79 | .map_io = spear3xx_map_io, | 79 | .map_io = spear3xx_map_io, |
80 | .init_irq = spear3xx_init_irq, | 80 | .init_irq = spear3xx_init_irq, |
81 | .timer = &spear_sys_timer, | 81 | .timer = &spear3xx_timer, |
82 | .init_machine = spear310_evb_init, | 82 | .init_machine = spear310_evb_init, |
83 | MACHINE_END | 83 | MACHINE_END |
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c index 7083a06df9b6..4a7ce35fdf8c 100644 --- a/arch/arm/mach-spear3xx/spear320_evb.c +++ b/arch/arm/mach-spear3xx/spear320_evb.c | |||
@@ -75,6 +75,6 @@ MACHINE_START(SPEAR320, "ST-SPEAR320-EVB") | |||
75 | .boot_params = 0x00000100, | 75 | .boot_params = 0x00000100, |
76 | .map_io = spear3xx_map_io, | 76 | .map_io = spear3xx_map_io, |
77 | .init_irq = spear3xx_init_irq, | 77 | .init_irq = spear3xx_init_irq, |
78 | .timer = &spear_sys_timer, | 78 | .timer = &spear3xx_timer, |
79 | .init_machine = spear320_evb_init, | 79 | .init_machine = spear320_evb_init, |
80 | MACHINE_END | 80 | MACHINE_END |
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c index faf87097767d..e12a06c3b85b 100644 --- a/arch/arm/mach-spear3xx/spear3xx.c +++ b/arch/arm/mach-spear3xx/spear3xx.c | |||
@@ -523,5 +523,35 @@ struct pmx_dev pmx_plgpio_45_46_49_50 = { | |||
523 | .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes), | 523 | .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes), |
524 | .enb_on_reset = 1, | 524 | .enb_on_reset = 1, |
525 | }; | 525 | }; |
526 | #endif /* CONFIG_MACH_SPEAR310 || CONFIG_MACH_SPEAR320 */ | ||
526 | 527 | ||
527 | #endif | 528 | static void __init spear3xx_timer_init(void) |
529 | { | ||
530 | char pclk_name[] = "pll3_48m_clk"; | ||
531 | struct clk *gpt_clk, *pclk; | ||
532 | |||
533 | /* get the system timer clock */ | ||
534 | gpt_clk = clk_get_sys("gpt0", NULL); | ||
535 | if (IS_ERR(gpt_clk)) { | ||
536 | pr_err("%s:couldn't get clk for gpt\n", __func__); | ||
537 | BUG(); | ||
538 | } | ||
539 | |||
540 | /* get the suitable parent clock for timer*/ | ||
541 | pclk = clk_get(NULL, pclk_name); | ||
542 | if (IS_ERR(pclk)) { | ||
543 | pr_err("%s:couldn't get %s as parent for gpt\n", | ||
544 | __func__, pclk_name); | ||
545 | BUG(); | ||
546 | } | ||
547 | |||
548 | clk_set_parent(gpt_clk, pclk); | ||
549 | clk_put(gpt_clk); | ||
550 | clk_put(pclk); | ||
551 | |||
552 | spear_setup_timer(); | ||
553 | } | ||
554 | |||
555 | struct sys_timer spear3xx_timer = { | ||
556 | .init = spear3xx_timer_init, | ||
557 | }; | ||