diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-11 08:07:52 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-19 06:11:10 -0500 |
commit | 493a451bb559476d2f7f189670be2172ca3010b4 (patch) | |
tree | 255ca4bf23ca31e33283f65fb477df22d0ce9211 /arch/arm/mach-vexpress | |
parent | 631e55f966668d7a957342b38d7148643d919d73 (diff) |
ARM: vexpress: use new init_early for clock tree and sched_clock init
Initialize the clock tree and our sched_clock() early.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-vexpress')
-rw-r--r-- | arch/arm/mach-vexpress/core.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/ct-ca9x4.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/v2m.c | 6 |
3 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h index 362780d868de..e0312a1dce3a 100644 --- a/arch/arm/mach-vexpress/core.h +++ b/arch/arm/mach-vexpress/core.h | |||
@@ -21,4 +21,5 @@ struct amba_device name##_device = { \ | |||
21 | struct map_desc; | 21 | struct map_desc; |
22 | 22 | ||
23 | void v2m_map_io(struct map_desc *tile, size_t num); | 23 | void v2m_map_io(struct map_desc *tile, size_t num); |
24 | void v2m_init_early(void); | ||
24 | extern struct sys_timer v2m_timer; | 25 | extern struct sys_timer v2m_timer; |
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c index 27baed18a256..ff48ebc1a40b 100644 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ b/arch/arm/mach-vexpress/ct-ca9x4.c | |||
@@ -180,6 +180,13 @@ static struct platform_device pmu_device = { | |||
180 | .resource = pmu_resources, | 180 | .resource = pmu_resources, |
181 | }; | 181 | }; |
182 | 182 | ||
183 | static void __init ct_ca9x4_init_early(void) | ||
184 | { | ||
185 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
186 | |||
187 | v2m_init_early(); | ||
188 | } | ||
189 | |||
183 | static void __init ct_ca9x4_init(void) | 190 | static void __init ct_ca9x4_init(void) |
184 | { | 191 | { |
185 | int i; | 192 | int i; |
@@ -194,8 +201,6 @@ static void __init ct_ca9x4_init(void) | |||
194 | l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff); | 201 | l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff); |
195 | #endif | 202 | #endif |
196 | 203 | ||
197 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
198 | |||
199 | for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++) | 204 | for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++) |
200 | amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource); | 205 | amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource); |
201 | 206 | ||
@@ -206,6 +211,7 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4") | |||
206 | .boot_params = PHYS_OFFSET + 0x00000100, | 211 | .boot_params = PHYS_OFFSET + 0x00000100, |
207 | .map_io = ct_ca9x4_map_io, | 212 | .map_io = ct_ca9x4_map_io, |
208 | .init_irq = ct_ca9x4_init_irq, | 213 | .init_irq = ct_ca9x4_init_irq, |
214 | .init_early = ct_ca9x4_init_early, | ||
209 | #if 0 | 215 | #if 0 |
210 | .timer = &ct_ca9x4_timer, | 216 | .timer = &ct_ca9x4_timer, |
211 | #else | 217 | #else |
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index f35d646a1bf1..63ef663fb0be 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -49,13 +49,15 @@ void __init v2m_map_io(struct map_desc *tile, size_t num) | |||
49 | iotable_init(tile, num); | 49 | iotable_init(tile, num); |
50 | } | 50 | } |
51 | 51 | ||
52 | void __init v2m_init_early(void) | ||
53 | { | ||
54 | versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000); | ||
55 | } | ||
52 | 56 | ||
53 | static void __init v2m_timer_init(void) | 57 | static void __init v2m_timer_init(void) |
54 | { | 58 | { |
55 | u32 scctrl; | 59 | u32 scctrl; |
56 | 60 | ||
57 | versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000); | ||
58 | |||
59 | /* Select 1MHz TIMCLK as the reference clock for SP804 timers */ | 61 | /* Select 1MHz TIMCLK as the reference clock for SP804 timers */ |
60 | scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL)); | 62 | scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL)); |
61 | scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK; | 63 | scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK; |