diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-11 07:55:38 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-19 06:11:05 -0500 |
commit | ad3bb19c5bd17cebe8e9a97dc0b53e274a05f23b (patch) | |
tree | 511f751baee2a140bff05ee2c4a52ea070d20f48 /arch/arm/mach-versatile | |
parent | c735c9873d0c2f269fd16f4b04903da41a44cbcf (diff) |
ARM: versatile: 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-versatile')
-rw-r--r-- | arch/arm/mach-versatile/core.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-versatile/core.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-versatile/versatile_ab.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-versatile/versatile_pb.c | 1 |
4 files changed, 14 insertions, 12 deletions
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index b4f1f17eeb8d..606e046905e3 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -762,14 +762,21 @@ static void versatile_leds_event(led_event_t ledevt) | |||
762 | } | 762 | } |
763 | #endif /* CONFIG_LEDS */ | 763 | #endif /* CONFIG_LEDS */ |
764 | 764 | ||
765 | void __init versatile_init(void) | 765 | /* Early initializations */ |
766 | void __init versatile_init_early(void) | ||
766 | { | 767 | { |
767 | int i; | 768 | void __iomem *sys = __io_address(VERSATILE_SYS_BASE); |
768 | |||
769 | osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET; | ||
770 | 769 | ||
770 | osc4_clk.vcoreg = sys + VERSATILE_SYS_OSCCLCD_OFFSET; | ||
771 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 771 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
772 | 772 | ||
773 | versatile_sched_clock_init(sys + VERSATILE_SYS_24MHz_OFFSET, 24000000); | ||
774 | } | ||
775 | |||
776 | void __init versatile_init(void) | ||
777 | { | ||
778 | int i; | ||
779 | |||
773 | platform_device_register(&versatile_flash_device); | 780 | platform_device_register(&versatile_flash_device); |
774 | platform_device_register(&versatile_i2c_device); | 781 | platform_device_register(&versatile_i2c_device); |
775 | platform_device_register(&smc91x_device); | 782 | platform_device_register(&smc91x_device); |
@@ -786,12 +793,6 @@ void __init versatile_init(void) | |||
786 | } | 793 | } |
787 | 794 | ||
788 | /* | 795 | /* |
789 | * The sched_clock counter | ||
790 | */ | ||
791 | #define REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + \ | ||
792 | VERSATILE_SYS_24MHz_OFFSET) | ||
793 | |||
794 | /* | ||
795 | * Where is the timer (VA)? | 796 | * Where is the timer (VA)? |
796 | */ | 797 | */ |
797 | #define TIMER0_VA_BASE __io_address(VERSATILE_TIMER0_1_BASE) | 798 | #define TIMER0_VA_BASE __io_address(VERSATILE_TIMER0_1_BASE) |
@@ -806,8 +807,6 @@ static void __init versatile_timer_init(void) | |||
806 | { | 807 | { |
807 | u32 val; | 808 | u32 val; |
808 | 809 | ||
809 | versatile_sched_clock_init(REFCOUNTER, 24000000); | ||
810 | |||
811 | /* | 810 | /* |
812 | * set clock frequency: | 811 | * set clock frequency: |
813 | * VERSATILE_REFCLK is 32KHz | 812 | * VERSATILE_REFCLK is 32KHz |
diff --git a/arch/arm/mach-versatile/core.h b/arch/arm/mach-versatile/core.h index 9d39886a8351..e04768a6c5dc 100644 --- a/arch/arm/mach-versatile/core.h +++ b/arch/arm/mach-versatile/core.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/amba/bus.h> | 25 | #include <linux/amba/bus.h> |
26 | 26 | ||
27 | extern void __init versatile_init(void); | 27 | extern void __init versatile_init(void); |
28 | extern void __init versatile_init_early(void); | ||
28 | extern void __init versatile_init_irq(void); | 29 | extern void __init versatile_init_irq(void); |
29 | extern void __init versatile_map_io(void); | 30 | extern void __init versatile_map_io(void); |
30 | extern struct sys_timer versatile_timer; | 31 | extern struct sys_timer versatile_timer; |
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c index aa9730fb13bf..f8ae64b3eed0 100644 --- a/arch/arm/mach-versatile/versatile_ab.c +++ b/arch/arm/mach-versatile/versatile_ab.c | |||
@@ -37,6 +37,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB") | |||
37 | /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ | 37 | /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ |
38 | .boot_params = 0x00000100, | 38 | .boot_params = 0x00000100, |
39 | .map_io = versatile_map_io, | 39 | .map_io = versatile_map_io, |
40 | .init_early = versatile_init_early, | ||
40 | .init_irq = versatile_init_irq, | 41 | .init_irq = versatile_init_irq, |
41 | .timer = &versatile_timer, | 42 | .timer = &versatile_timer, |
42 | .init_machine = versatile_init, | 43 | .init_machine = versatile_init, |
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c index bf469642a3f8..97fb30691c47 100644 --- a/arch/arm/mach-versatile/versatile_pb.c +++ b/arch/arm/mach-versatile/versatile_pb.c | |||
@@ -110,6 +110,7 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB") | |||
110 | /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ | 110 | /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ |
111 | .boot_params = 0x00000100, | 111 | .boot_params = 0x00000100, |
112 | .map_io = versatile_map_io, | 112 | .map_io = versatile_map_io, |
113 | .init_early = versatile_init_early, | ||
113 | .init_irq = versatile_init_irq, | 114 | .init_irq = versatile_init_irq, |
114 | .timer = &versatile_timer, | 115 | .timer = &versatile_timer, |
115 | .init_machine = versatile_pb_init, | 116 | .init_machine = versatile_pb_init, |