Skip to content

Commit

Permalink
ARM: delete struct sys_timer
Browse files Browse the repository at this point in the history
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: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
  • Loading branch information
nvswarren committed Dec 24, 2012
1 parent 7704c09 commit 6bb27d7
Show file tree
Hide file tree
Showing 495 changed files with 629 additions and 1,224 deletions.
3 changes: 1 addition & 2 deletions arch/arm/include/asm/mach/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

struct tag;
struct meminfo;
struct sys_timer;
struct pt_regs;
struct smp_operations;
#ifdef CONFIG_SMP
Expand Down Expand Up @@ -48,7 +47,7 @@ struct machine_desc {
void (*map_io)(void);/* IO mapping function */
void (*init_early)(void);
void (*init_irq)(void);
struct sys_timer *timer; /* system tick timer */
void (*init_time)(void);
void (*init_machine)(void);
void (*init_late)(void);
#ifdef CONFIG_MULTI_IRQ_HANDLER
Expand Down
16 changes: 0 additions & 16 deletions arch/arm/include/asm/mach/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,6 @@
#ifndef __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);

struct timespec;
Expand Down
9 changes: 1 addition & 8 deletions arch/arm/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
#include <asm/mach/arch.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) || \
defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE)
/* this needs a better home */
Expand Down Expand Up @@ -120,8 +115,6 @@ int __init register_persistent_clock(clock_access_fn read_boot,

void __init time_init(void)
{
system_timer = machine_desc->timer;
system_timer->init();
machine_desc->init_time();
sched_clock_postinit();
}

5 changes: 0 additions & 5 deletions arch/arm/mach-at91/at91rm9200_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,3 @@ void __init at91rm9200_timer_init(void)
/* register clocksource */
clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
}

struct sys_timer at91rm9200_timer = {
.init = at91rm9200_timer_init,
};

6 changes: 1 addition & 5 deletions arch/arm/mach-at91/at91sam926x_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static int __init of_at91sam926x_pit_init(void)
/*
* 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 bits;
Expand Down Expand Up @@ -279,7 +279,3 @@ void __init at91sam926x_ioremap_pit(u32 addr)
if (!pit_base_addr)
panic("Impossible to ioremap PIT\n");
}

struct sys_timer at91sam926x_timer = {
.init = at91sam926x_pit_init,
};
5 changes: 0 additions & 5 deletions arch/arm/mach-at91/at91x40_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

struct sys_timer at91x40_timer = {
.init = at91x40_timer_init,
};

2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-1arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static void __init onearm_board_init(void)

MACHINE_START(ONEARM, "Ajeco 1ARM single board computer")
/* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = onearm_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-afeb-9260v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static void __init afeb9260_board_init(void)

MACHINE_START(AFEB9260, "Custom afeb9260 board")
/* Maintainer: Sergey Lapin <slapin@ossfans.org> */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = afeb9260_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-cam60.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static void __init cam60_board_init(void)

MACHINE_START(CAM60, "KwikByte CAM60")
/* Maintainer: KwikByte */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = cam60_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-carmeva.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static void __init carmeva_board_init(void)

MACHINE_START(CARMEVA, "Carmeva")
/* Maintainer: Conitec Datasystems */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = carmeva_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-cpu9krea.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ MACHINE_START(CPUAT9260, "Eukrea CPU9260")
MACHINE_START(CPUAT9G20, "Eukrea CPU9G20")
#endif
/* Maintainer: Eric Benard - EUKREA Electromatique */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = cpu9krea_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-cpuat91.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void __init cpuat91_board_init(void)

MACHINE_START(CPUAT91, "Eukrea")
/* Maintainer: Eric Benard - EUKREA Electromatique */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = cpuat91_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-csb337.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static void __init csb337_board_init(void)

MACHINE_START(CSB337, "Cogent CSB337")
/* Maintainer: Bill Gatliff */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = csb337_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-csb637.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static void __init csb637_board_init(void)

MACHINE_START(CSB637, "Cogent CSB637")
/* Maintainer: Bill Gatliff */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = csb637_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static const char *at91_dt_board_compat[] __initdata = {

DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
/* Maintainer: Atmel */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = at91_dt_initialize,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-eb01.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void __init at91eb01_init_early(void)

MACHINE_START(AT91EB01, "Atmel AT91 EB01")
/* Maintainer: Greg Ungerer <gerg@snapgear.com> */
.timer = &at91x40_timer,
.init_time = at91x40_timer_init,
.handle_irq = at91_aic_handle_irq,
.init_early = at91eb01_init_early,
.init_irq = at91eb01_init_irq,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-eb9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static void __init eb9200_board_init(void)
}

MACHINE_START(ATEB9200, "Embest ATEB9200")
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = eb9200_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-ecbat91.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static void __init ecb_at91board_init(void)

MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
/* Maintainer: emQbit.com */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ecb_at91init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-eco920.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static void __init eco920_board_init(void)

MACHINE_START(ECO920, "eco920")
/* Maintainer: Sascha Hauer */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = eco920_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-flexibity.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static void __init flexibity_board_init(void)

MACHINE_START(FLEXIBITY, "Flexibity Connect")
/* Maintainer: Maxim Osipov */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = flexibity_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-foxg20.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static void __init foxg20_board_init(void)

MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20")
/* Maintainer: Sergio Tanzilli */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = foxg20_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-gsia18s.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static void __init gsia18s_board_init(void)
}

MACHINE_START(GSIA18S, "GS_IA18_S")
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = gsia18s_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-kafa.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static void __init kafa_board_init(void)

MACHINE_START(KAFA, "Sperry-Sun KAFA")
/* Maintainer: Sergei Sharonov */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = kafa_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-kb9202.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static void __init kb9202_board_init(void)

MACHINE_START(KB9200, "KB920x")
/* Maintainer: KwikByte, Inc. */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = kb9202_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-neocore926.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ static void __init neocore926_board_init(void)

MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926")
/* Maintainer: ADENEO */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = neocore926_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-pcontrol-g20.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void __init pcontrol_g20_board_init(void)

MACHINE_START(PCONTROL_G20, "PControl G20")
/* Maintainer: pgsellmann@portner-elektronik.at */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = pcontrol_g20_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-picotux200.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void __init picotux200_board_init(void)

MACHINE_START(PICOTUX2XX, "picotux 200")
/* Maintainer: Kleinhenz Elektronik GmbH */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = picotux200_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-qil-a9260.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static void __init ek_board_init(void)

MACHINE_START(QIL_A9260, "CALAO QIL_A9260")
/* Maintainer: calao-systems */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-rm9200dk.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void __init dk_board_init(void)

MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
/* Maintainer: SAN People/Atmel */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = dk_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-rm9200ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static void __init ek_board_init(void)

MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
/* Maintainer: SAN People/Atmel */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-rsi-ews.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static void __init rsi_ews_board_init(void)

MACHINE_START(RSI_EWS, "RSI EWS")
/* Maintainer: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de> */
.timer = &at91rm9200_timer,
.init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = rsi_ews_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9-l9260.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static void __init ek_board_init(void)

MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
/* Maintainer: Olimex */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9260ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static void __init ek_board_init(void)

MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
/* Maintainer: Atmel */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9261ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")
#endif
/* Maintainer: Atmel */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9263ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ static void __init ek_board_init(void)

MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
/* Maintainer: Atmel */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-at91/board-sam9g20ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ static void __init ek_board_init(void)

MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK")
/* Maintainer: Atmel */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand All @@ -419,7 +419,7 @@ MACHINE_END

MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod")
/* Maintainer: Atmel */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9m10g45ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ static void __init ek_board_init(void)

MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK")
/* Maintainer: Atmel */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-sam9rlek.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ static void __init ek_board_init(void)

MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
/* Maintainer: Atmel */
.timer = &at91sam926x_timer,
.init_time = at91sam926x_pit_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = ek_init_early,
Expand Down
Loading

0 comments on commit 6bb27d7

Please sign in to comment.