aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-versatile/core.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-01-11 07:55:38 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-02-19 06:11:05 -0500
commitad3bb19c5bd17cebe8e9a97dc0b53e274a05f23b (patch)
tree511f751baee2a140bff05ee2c4a52ea070d20f48 /arch/arm/mach-versatile/core.c
parentc735c9873d0c2f269fd16f4b04903da41a44cbcf (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/core.c')
-rw-r--r--arch/arm/mach-versatile/core.c23
1 files changed, 11 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
765void __init versatile_init(void) 765/* Early initializations */
766void __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
776void __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