ARM: versatile: use new init_early for clock tree and sched_clock init
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 11 Jan 2011 12:55:38 +0000 (12:55 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 19 Feb 2011 11:11:05 +0000 (11:11 +0000)
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>
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/core.h
arch/arm/mach-versatile/versatile_ab.c
arch/arm/mach-versatile/versatile_pb.c

index b4f1f17eeb8df59d5ecef123f2b6a02bb5dd79cb..606e046905e30bf2590b4d076181e912df08f430 100644 (file)
@@ -762,14 +762,21 @@ static void versatile_leds_event(led_event_t ledevt)
 }
 #endif /* CONFIG_LEDS */
 
-void __init versatile_init(void)
+/* Early initializations */
+void __init versatile_init_early(void)
 {
-       int i;
-
-       osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET;
+       void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
 
+       osc4_clk.vcoreg = sys + VERSATILE_SYS_OSCCLCD_OFFSET;
        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_i2c_device);
        platform_device_register(&smc91x_device);
@@ -785,12 +792,6 @@ void __init versatile_init(void)
 #endif
 }
 
-/*
- * The sched_clock counter
- */
-#define REFCOUNTER             (__io_address(VERSATILE_SYS_BASE) + \
-                                VERSATILE_SYS_24MHz_OFFSET)
-
 /*
  * Where is the timer (VA)?
  */
@@ -806,8 +807,6 @@ static void __init versatile_timer_init(void)
 {
        u32 val;
 
-       versatile_sched_clock_init(REFCOUNTER, 24000000);
-
        /* 
         * set clock frequency: 
         *      VERSATILE_REFCLK is 32KHz
index 9d39886a8351d360dac960830f1fa870e31bc7be..e04768a6c5dcf965624c27b1712af588ad768594 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/amba/bus.h>
 
 extern void __init versatile_init(void);
+extern void __init versatile_init_early(void);
 extern void __init versatile_init_irq(void);
 extern void __init versatile_map_io(void);
 extern struct sys_timer versatile_timer;
index aa9730fb13bfa287efcf8c53161da1bd97e6cf20..f8ae64b3eed09b132fe745fecddb5ca1cc2d2790 100644 (file)
@@ -37,6 +37,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
        .boot_params    = 0x00000100,
        .map_io         = versatile_map_io,
+       .init_early     = versatile_init_early,
        .init_irq       = versatile_init_irq,
        .timer          = &versatile_timer,
        .init_machine   = versatile_init,
index bf469642a3f811c9032dc34358d8f9ef556ffa10..97fb30691c47b41b5a2e2d2fa16ef6f2f4633cd0 100644 (file)
@@ -110,6 +110,7 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
        .boot_params    = 0x00000100,
        .map_io         = versatile_map_io,
+       .init_early     = versatile_init_early,
        .init_irq       = versatile_init_irq,
        .timer          = &versatile_timer,
        .init_machine   = versatile_pb_init,