Commit 493a451b authored by Russell King's avatar Russell King

ARM: vexpress: 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 631e55f9
...@@ -21,4 +21,5 @@ struct amba_device name##_device = { \ ...@@ -21,4 +21,5 @@ struct amba_device name##_device = { \
struct map_desc; struct map_desc;
void v2m_map_io(struct map_desc *tile, size_t num); void v2m_map_io(struct map_desc *tile, size_t num);
void v2m_init_early(void);
extern struct sys_timer v2m_timer; extern struct sys_timer v2m_timer;
...@@ -180,6 +180,13 @@ static struct platform_device pmu_device = { ...@@ -180,6 +180,13 @@ static struct platform_device pmu_device = {
.resource = pmu_resources, .resource = pmu_resources,
}; };
static void __init ct_ca9x4_init_early(void)
{
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
v2m_init_early();
}
static void __init ct_ca9x4_init(void) static void __init ct_ca9x4_init(void)
{ {
int i; int i;
...@@ -194,8 +201,6 @@ static void __init ct_ca9x4_init(void) ...@@ -194,8 +201,6 @@ static void __init ct_ca9x4_init(void)
l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff); l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff);
#endif #endif
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++) for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++)
amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource); amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource);
...@@ -206,6 +211,7 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4") ...@@ -206,6 +211,7 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4")
.boot_params = PHYS_OFFSET + 0x00000100, .boot_params = PHYS_OFFSET + 0x00000100,
.map_io = ct_ca9x4_map_io, .map_io = ct_ca9x4_map_io,
.init_irq = ct_ca9x4_init_irq, .init_irq = ct_ca9x4_init_irq,
.init_early = ct_ca9x4_init_early,
#if 0 #if 0
.timer = &ct_ca9x4_timer, .timer = &ct_ca9x4_timer,
#else #else
......
...@@ -49,13 +49,15 @@ void __init v2m_map_io(struct map_desc *tile, size_t num) ...@@ -49,13 +49,15 @@ void __init v2m_map_io(struct map_desc *tile, size_t num)
iotable_init(tile, num); iotable_init(tile, num);
} }
void __init v2m_init_early(void)
{
versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000);
}
static void __init v2m_timer_init(void) static void __init v2m_timer_init(void)
{ {
u32 scctrl; u32 scctrl;
versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000);
/* Select 1MHz TIMCLK as the reference clock for SP804 timers */ /* Select 1MHz TIMCLK as the reference clock for SP804 timers */
scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL)); scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL));
scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK; scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK;
......
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