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-spear6xx | |
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-spear6xx')
-rw-r--r-- | arch/arm/mach-spear6xx/include/mach/generic.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-spear6xx/spear600_evb.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-spear6xx/spear6xx.c | 31 |
3 files changed, 34 insertions, 2 deletions
diff --git a/arch/arm/mach-spear6xx/include/mach/generic.h b/arch/arm/mach-spear6xx/include/mach/generic.h index 16205a538756..e5967ededdc3 100644 --- a/arch/arm/mach-spear6xx/include/mach/generic.h +++ b/arch/arm/mach-spear6xx/include/mach/generic.h | |||
@@ -31,9 +31,10 @@ | |||
31 | /* Add spear6xx family device structure declarations here */ | 31 | /* Add spear6xx family device structure declarations here */ |
32 | extern struct amba_device gpio_device[]; | 32 | extern struct amba_device gpio_device[]; |
33 | extern struct amba_device uart_device[]; | 33 | extern struct amba_device uart_device[]; |
34 | extern struct sys_timer spear_sys_timer; | 34 | extern struct sys_timer spear6xx_timer; |
35 | 35 | ||
36 | /* Add spear6xx family function declarations here */ | 36 | /* Add spear6xx family function declarations here */ |
37 | void __init spear_setup_timer(void); | ||
37 | void __init spear6xx_map_io(void); | 38 | void __init spear6xx_map_io(void); |
38 | void __init spear6xx_init_irq(void); | 39 | void __init spear6xx_init_irq(void); |
39 | void __init spear6xx_init(void); | 40 | void __init spear6xx_init(void); |
diff --git a/arch/arm/mach-spear6xx/spear600_evb.c b/arch/arm/mach-spear6xx/spear600_evb.c index daff8d04f7b6..b0ed0dfe9b01 100644 --- a/arch/arm/mach-spear6xx/spear600_evb.c +++ b/arch/arm/mach-spear6xx/spear600_evb.c | |||
@@ -46,6 +46,6 @@ MACHINE_START(SPEAR600, "ST-SPEAR600-EVB") | |||
46 | .boot_params = 0x00000100, | 46 | .boot_params = 0x00000100, |
47 | .map_io = spear6xx_map_io, | 47 | .map_io = spear6xx_map_io, |
48 | .init_irq = spear6xx_init_irq, | 48 | .init_irq = spear6xx_init_irq, |
49 | .timer = &spear_sys_timer, | 49 | .timer = &spear6xx_timer, |
50 | .init_machine = spear600_evb_init, | 50 | .init_machine = spear600_evb_init, |
51 | MACHINE_END | 51 | MACHINE_END |
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c index f2fe14e8471d..9cd3a688f6dc 100644 --- a/arch/arm/mach-spear6xx/spear6xx.c +++ b/arch/arm/mach-spear6xx/spear6xx.c | |||
@@ -155,3 +155,34 @@ void __init spear6xx_map_io(void) | |||
155 | /* This will initialize clock framework */ | 155 | /* This will initialize clock framework */ |
156 | clk_init(); | 156 | clk_init(); |
157 | } | 157 | } |
158 | |||
159 | static void __init spear6xx_timer_init(void) | ||
160 | { | ||
161 | char pclk_name[] = "pll3_48m_clk"; | ||
162 | struct clk *gpt_clk, *pclk; | ||
163 | |||
164 | /* get the system timer clock */ | ||
165 | gpt_clk = clk_get_sys("gpt0", NULL); | ||
166 | if (IS_ERR(gpt_clk)) { | ||
167 | pr_err("%s:couldn't get clk for gpt\n", __func__); | ||
168 | BUG(); | ||
169 | } | ||
170 | |||
171 | /* get the suitable parent clock for timer*/ | ||
172 | pclk = clk_get(NULL, pclk_name); | ||
173 | if (IS_ERR(pclk)) { | ||
174 | pr_err("%s:couldn't get %s as parent for gpt\n", | ||
175 | __func__, pclk_name); | ||
176 | BUG(); | ||
177 | } | ||
178 | |||
179 | clk_set_parent(gpt_clk, pclk); | ||
180 | clk_put(gpt_clk); | ||
181 | clk_put(pclk); | ||
182 | |||
183 | spear_setup_timer(); | ||
184 | } | ||
185 | |||
186 | struct sys_timer spear6xx_timer = { | ||
187 | .init = spear6xx_timer_init, | ||
188 | }; | ||