Commit ad3bb19c authored by Russell King's avatar Russell King

ARM: versatile: use new init_early for clock tree and sched_clock init

Initialize the clock tree and our sched_clock() early.
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent c735c987
...@@ -762,14 +762,21 @@ static void versatile_leds_event(led_event_t ledevt) ...@@ -762,14 +762,21 @@ static void versatile_leds_event(led_event_t ledevt)
} }
#endif /* CONFIG_LEDS */ #endif /* CONFIG_LEDS */
void __init versatile_init(void) /* Early initializations */
void __init versatile_init_early(void)
{ {
int i; void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET;
osc4_clk.vcoreg = sys + VERSATILE_SYS_OSCCLCD_OFFSET;
clkdev_add_table(lookups, ARRAY_SIZE(lookups)); clkdev_add_table(lookups, ARRAY_SIZE(lookups));
versatile_sched_clock_init(sys + VERSATILE_SYS_24MHz_OFFSET, 24000000);
}
void __init versatile_init(void)
{
int i;
platform_device_register(&versatile_flash_device); platform_device_register(&versatile_flash_device);
platform_device_register(&versatile_i2c_device); platform_device_register(&versatile_i2c_device);
platform_device_register(&smc91x_device); platform_device_register(&smc91x_device);
...@@ -785,12 +792,6 @@ void __init versatile_init(void) ...@@ -785,12 +792,6 @@ void __init versatile_init(void)
#endif #endif
} }
/*
* The sched_clock counter
*/
#define REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + \
VERSATILE_SYS_24MHz_OFFSET)
/* /*
* Where is the timer (VA)? * Where is the timer (VA)?
*/ */
...@@ -806,8 +807,6 @@ static void __init versatile_timer_init(void) ...@@ -806,8 +807,6 @@ static void __init versatile_timer_init(void)
{ {
u32 val; u32 val;
versatile_sched_clock_init(REFCOUNTER, 24000000);
/* /*
* set clock frequency: * set clock frequency:
* VERSATILE_REFCLK is 32KHz * VERSATILE_REFCLK is 32KHz
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/amba/bus.h> #include <linux/amba/bus.h>
extern void __init versatile_init(void); extern void __init versatile_init(void);
extern void __init versatile_init_early(void);
extern void __init versatile_init_irq(void); extern void __init versatile_init_irq(void);
extern void __init versatile_map_io(void); extern void __init versatile_map_io(void);
extern struct sys_timer versatile_timer; extern struct sys_timer versatile_timer;
......
...@@ -37,6 +37,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB") ...@@ -37,6 +37,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
.boot_params = 0x00000100, .boot_params = 0x00000100,
.map_io = versatile_map_io, .map_io = versatile_map_io,
.init_early = versatile_init_early,
.init_irq = versatile_init_irq, .init_irq = versatile_init_irq,
.timer = &versatile_timer, .timer = &versatile_timer,
.init_machine = versatile_init, .init_machine = versatile_init,
......
...@@ -110,6 +110,7 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB") ...@@ -110,6 +110,7 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
.boot_params = 0x00000100, .boot_params = 0x00000100,
.map_io = versatile_map_io, .map_io = versatile_map_io,
.init_early = versatile_init_early,
.init_irq = versatile_init_irq, .init_irq = versatile_init_irq,
.timer = &versatile_timer, .timer = &versatile_timer,
.init_machine = versatile_pb_init, .init_machine = versatile_pb_init,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment