Skip to content
Snippets Groups Projects
Commit 6bb27d73 authored by Stephen Warren's avatar Stephen Warren
Browse files

ARM: delete struct sys_timer

Now that the only field in struct sys_timer is .init, delete the struct,
and replace the machine descriptor .timer field with the initialization
function itself.

This will enable moving timer drivers into drivers/clocksource without
having to place a public prototype of each struct sys_timer object into
include/linux; the intent is to create a single of_clocksource_init()
function that determines which timer driver to initialize by scanning
the device dtree, much like the proposed irqchip_init() at:
http://www.spinics.net/lists/arm-kernel/msg203686.html



Includes mach-omap2 fixes from Igor Grinberg.

Tested-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
parent 7704c095
No related merge requests found
Showing
with 17 additions and 55 deletions
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
struct tag; struct tag;
struct meminfo; struct meminfo;
struct sys_timer;
struct pt_regs; struct pt_regs;
struct smp_operations; struct smp_operations;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -48,7 +47,7 @@ struct machine_desc { ...@@ -48,7 +47,7 @@ struct machine_desc {
void (*map_io)(void);/* IO mapping function */ void (*map_io)(void);/* IO mapping function */
void (*init_early)(void); void (*init_early)(void);
void (*init_irq)(void); void (*init_irq)(void);
struct sys_timer *timer; /* system tick timer */ void (*init_time)(void);
void (*init_machine)(void); void (*init_machine)(void);
void (*init_late)(void); void (*init_late)(void);
#ifdef CONFIG_MULTI_IRQ_HANDLER #ifdef CONFIG_MULTI_IRQ_HANDLER
......
...@@ -10,22 +10,6 @@ ...@@ -10,22 +10,6 @@
#ifndef __ASM_ARM_MACH_TIME_H #ifndef __ASM_ARM_MACH_TIME_H
#define __ASM_ARM_MACH_TIME_H #define __ASM_ARM_MACH_TIME_H
/*
* This is our kernel timer structure.
*
* - init
* Initialise the kernels jiffy timer source, claim interrupt
* using setup_irq. This is called early on during initialisation
* while interrupts are still disabled on the local CPU.
* - offset
* Return the timer offset in microseconds since the last timer
* interrupt. Note: this must take account of any unprocessed
* timer interrupt which may be pending.
*/
struct sys_timer {
void (*init)(void);
};
extern void timer_tick(void); extern void timer_tick(void);
struct timespec; struct timespec;
......
...@@ -30,11 +30,6 @@ ...@@ -30,11 +30,6 @@
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
/*
* Our system timer.
*/
static struct sys_timer *system_timer;
#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \ #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \
defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE)
/* this needs a better home */ /* this needs a better home */
...@@ -120,8 +115,6 @@ int __init register_persistent_clock(clock_access_fn read_boot, ...@@ -120,8 +115,6 @@ int __init register_persistent_clock(clock_access_fn read_boot,
void __init time_init(void) void __init time_init(void)
{ {
system_timer = machine_desc->timer; machine_desc->init_time();
system_timer->init();
sched_clock_postinit(); sched_clock_postinit();
} }
...@@ -274,8 +274,3 @@ void __init at91rm9200_timer_init(void) ...@@ -274,8 +274,3 @@ void __init at91rm9200_timer_init(void)
/* register clocksource */ /* register clocksource */
clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
} }
struct sys_timer at91rm9200_timer = {
.init = at91rm9200_timer_init,
};
...@@ -224,7 +224,7 @@ static int __init of_at91sam926x_pit_init(void) ...@@ -224,7 +224,7 @@ static int __init of_at91sam926x_pit_init(void)
/* /*
* Set up both clocksource and clockevent support. * Set up both clocksource and clockevent support.
*/ */
static void __init at91sam926x_pit_init(void) void __init at91sam926x_pit_init(void)
{ {
unsigned long pit_rate; unsigned long pit_rate;
unsigned bits; unsigned bits;
...@@ -279,7 +279,3 @@ void __init at91sam926x_ioremap_pit(u32 addr) ...@@ -279,7 +279,3 @@ void __init at91sam926x_ioremap_pit(u32 addr)
if (!pit_base_addr) if (!pit_base_addr)
panic("Impossible to ioremap PIT\n"); panic("Impossible to ioremap PIT\n");
} }
struct sys_timer at91sam926x_timer = {
.init = at91sam926x_pit_init,
};
...@@ -82,8 +82,3 @@ void __init at91x40_timer_init(void) ...@@ -82,8 +82,3 @@ void __init at91x40_timer_init(void)
at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN)); at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN));
} }
struct sys_timer at91x40_timer = {
.init = at91x40_timer_init,
};
...@@ -90,7 +90,7 @@ static void __init onearm_board_init(void) ...@@ -90,7 +90,7 @@ static void __init onearm_board_init(void)
MACHINE_START(ONEARM, "Ajeco 1ARM single board computer") MACHINE_START(ONEARM, "Ajeco 1ARM single board computer")
/* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
.timer = &at91rm9200_timer, .init_time = at91rm9200_timer_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = onearm_init_early, .init_early = onearm_init_early,
......
...@@ -210,7 +210,7 @@ static void __init afeb9260_board_init(void) ...@@ -210,7 +210,7 @@ static void __init afeb9260_board_init(void)
MACHINE_START(AFEB9260, "Custom afeb9260 board") MACHINE_START(AFEB9260, "Custom afeb9260 board")
/* Maintainer: Sergey Lapin <slapin@ossfans.org> */ /* Maintainer: Sergey Lapin <slapin@ossfans.org> */
.timer = &at91sam926x_timer, .init_time = at91sam926x_pit_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = afeb9260_init_early, .init_early = afeb9260_init_early,
......
...@@ -187,7 +187,7 @@ static void __init cam60_board_init(void) ...@@ -187,7 +187,7 @@ static void __init cam60_board_init(void)
MACHINE_START(CAM60, "KwikByte CAM60") MACHINE_START(CAM60, "KwikByte CAM60")
/* Maintainer: KwikByte */ /* Maintainer: KwikByte */
.timer = &at91sam926x_timer, .init_time = at91sam926x_pit_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = cam60_init_early, .init_early = cam60_init_early,
......
...@@ -157,7 +157,7 @@ static void __init carmeva_board_init(void) ...@@ -157,7 +157,7 @@ static void __init carmeva_board_init(void)
MACHINE_START(CARMEVA, "Carmeva") MACHINE_START(CARMEVA, "Carmeva")
/* Maintainer: Conitec Datasystems */ /* Maintainer: Conitec Datasystems */
.timer = &at91rm9200_timer, .init_time = at91rm9200_timer_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = carmeva_init_early, .init_early = carmeva_init_early,
......
...@@ -374,7 +374,7 @@ MACHINE_START(CPUAT9260, "Eukrea CPU9260") ...@@ -374,7 +374,7 @@ MACHINE_START(CPUAT9260, "Eukrea CPU9260")
MACHINE_START(CPUAT9G20, "Eukrea CPU9G20") MACHINE_START(CPUAT9G20, "Eukrea CPU9G20")
#endif #endif
/* Maintainer: Eric Benard - EUKREA Electromatique */ /* Maintainer: Eric Benard - EUKREA Electromatique */
.timer = &at91sam926x_timer, .init_time = at91sam926x_pit_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = cpu9krea_init_early, .init_early = cpu9krea_init_early,
......
...@@ -178,7 +178,7 @@ static void __init cpuat91_board_init(void) ...@@ -178,7 +178,7 @@ static void __init cpuat91_board_init(void)
MACHINE_START(CPUAT91, "Eukrea") MACHINE_START(CPUAT91, "Eukrea")
/* Maintainer: Eric Benard - EUKREA Electromatique */ /* Maintainer: Eric Benard - EUKREA Electromatique */
.timer = &at91rm9200_timer, .init_time = at91rm9200_timer_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = cpuat91_init_early, .init_early = cpuat91_init_early,
......
...@@ -251,7 +251,7 @@ static void __init csb337_board_init(void) ...@@ -251,7 +251,7 @@ static void __init csb337_board_init(void)
MACHINE_START(CSB337, "Cogent CSB337") MACHINE_START(CSB337, "Cogent CSB337")
/* Maintainer: Bill Gatliff */ /* Maintainer: Bill Gatliff */
.timer = &at91rm9200_timer, .init_time = at91rm9200_timer_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = csb337_init_early, .init_early = csb337_init_early,
......
...@@ -132,7 +132,7 @@ static void __init csb637_board_init(void) ...@@ -132,7 +132,7 @@ static void __init csb637_board_init(void)
MACHINE_START(CSB637, "Cogent CSB637") MACHINE_START(CSB637, "Cogent CSB637")
/* Maintainer: Bill Gatliff */ /* Maintainer: Bill Gatliff */
.timer = &at91rm9200_timer, .init_time = at91rm9200_timer_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = csb637_init_early, .init_early = csb637_init_early,
......
...@@ -49,7 +49,7 @@ static const char *at91_dt_board_compat[] __initdata = { ...@@ -49,7 +49,7 @@ static const char *at91_dt_board_compat[] __initdata = {
DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
/* Maintainer: Atmel */ /* Maintainer: Atmel */
.timer = &at91sam926x_timer, .init_time = at91sam926x_pit_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = at91_dt_initialize, .init_early = at91_dt_initialize,
......
...@@ -44,7 +44,7 @@ static void __init at91eb01_init_early(void) ...@@ -44,7 +44,7 @@ static void __init at91eb01_init_early(void)
MACHINE_START(AT91EB01, "Atmel AT91 EB01") MACHINE_START(AT91EB01, "Atmel AT91 EB01")
/* Maintainer: Greg Ungerer <gerg@snapgear.com> */ /* Maintainer: Greg Ungerer <gerg@snapgear.com> */
.timer = &at91x40_timer, .init_time = at91x40_timer_init,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = at91eb01_init_early, .init_early = at91eb01_init_early,
.init_irq = at91eb01_init_irq, .init_irq = at91eb01_init_irq,
......
...@@ -116,7 +116,7 @@ static void __init eb9200_board_init(void) ...@@ -116,7 +116,7 @@ static void __init eb9200_board_init(void)
} }
MACHINE_START(ATEB9200, "Embest ATEB9200") MACHINE_START(ATEB9200, "Embest ATEB9200")
.timer = &at91rm9200_timer, .init_time = at91rm9200_timer_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = eb9200_init_early, .init_early = eb9200_init_early,
......
...@@ -181,7 +181,7 @@ static void __init ecb_at91board_init(void) ...@@ -181,7 +181,7 @@ static void __init ecb_at91board_init(void)
MACHINE_START(ECBAT91, "emQbit's ECB_AT91") MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
/* Maintainer: emQbit.com */ /* Maintainer: emQbit.com */
.timer = &at91rm9200_timer, .init_time = at91rm9200_timer_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = ecb_at91init_early, .init_early = ecb_at91init_early,
......
...@@ -149,7 +149,7 @@ static void __init eco920_board_init(void) ...@@ -149,7 +149,7 @@ static void __init eco920_board_init(void)
MACHINE_START(ECO920, "eco920") MACHINE_START(ECO920, "eco920")
/* Maintainer: Sascha Hauer */ /* Maintainer: Sascha Hauer */
.timer = &at91rm9200_timer, .init_time = at91rm9200_timer_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = eco920_init_early, .init_early = eco920_init_early,
......
...@@ -159,7 +159,7 @@ static void __init flexibity_board_init(void) ...@@ -159,7 +159,7 @@ static void __init flexibity_board_init(void)
MACHINE_START(FLEXIBITY, "Flexibity Connect") MACHINE_START(FLEXIBITY, "Flexibity Connect")
/* Maintainer: Maxim Osipov */ /* Maintainer: Maxim Osipov */
.timer = &at91sam926x_timer, .init_time = at91sam926x_pit_init,
.map_io = at91_map_io, .map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq, .handle_irq = at91_aic_handle_irq,
.init_early = flexibity_init_early, .init_early = flexibity_init_early,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment