From 4b550488f894c899aa54dc935c8fee47bca2b7df Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 11 Oct 2007 23:46:08 +0100 Subject: [MIPS] Deforest the function pointer jungle in the time code. Hard to follow who is pointing what to where and why so it's simply getting in the way of the time code renovation. Signed-off-by: Ralf Baechle --- include/asm-mips/time.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'include/asm-mips/time.h') diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index a632cef830a..74ab33157d6 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h @@ -26,15 +26,13 @@ extern spinlock_t rtc_lock; /* - * RTC ops. By default, they point to no-RTC functions. - * rtc_mips_get_time - mktime(year, mon, day, hour, min, sec) in seconds. + * RTC ops. By default, they point to weak no-op RTC functions. * rtc_mips_set_time - reverse the above translation and set time to RTC. * rtc_mips_set_mmss - similar to rtc_set_time, but only min and sec need * to be set. Used by RTC sync-up. */ -extern unsigned long (*rtc_mips_get_time)(void); -extern int (*rtc_mips_set_time)(unsigned long); -extern int (*rtc_mips_set_mmss)(unsigned long); +extern int rtc_mips_set_time(unsigned long); +extern int rtc_mips_set_mmss(unsigned long); /* * Timer interrupt functions. @@ -75,11 +73,9 @@ extern asmlinkage void ll_local_timer_interrupt(int irq); /* * board specific routines required by time_init(). - * board_time_init is defaulted to NULL and can remain so. - * plat_timer_setup must be setup properly in machine setup routine. */ struct irqaction; -extern void (*board_time_init)(void); +extern void plat_time_init(void); extern void plat_timer_setup(struct irqaction *irq); /* -- cgit v1.2.3 From 90b02340dcc6ce00bf22c48f4865915f5989e5e4 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 11 Oct 2007 23:46:09 +0100 Subject: [MIPS] Switch from to_tm to rtc_time_to_tm This replaces the MIPS-specific to_tm function with the generic rtc_time_to_tm function. The big difference between the two functions is that rtc_time_to_tm uses epoch 70 while to_tm uses 1970, so the result of rtc_time_to_tm needs to be fixed up. Signed-off-by: Ralf Baechle --- include/asm-mips/time.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include/asm-mips/time.h') diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index 74ab33157d6..963507d33f6 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h @@ -48,13 +48,6 @@ extern void (*mips_timer_ack)(void); */ extern struct clocksource clocksource_mips; -/* - * to_tm() converts system time back to (year, mon, day, hour, min, sec). - * It is intended to help implement rtc_set_time() functions. - * Copied from PPC implementation. - */ -extern void to_tm(unsigned long tim, struct rtc_time *tm); - /* * high-level timer interrupt routines. */ -- cgit v1.2.3 From 91a2fcc88634663e9e13dcdfad0e4a860e64aeee Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 11 Oct 2007 23:46:09 +0100 Subject: [MIPS] Consolidate all variants of MIPS cp0 timer interrupt handlers. Signed-off-by: Ralf Baechle --- include/asm-mips/time.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include/asm-mips/time.h') diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index 963507d33f6..3516b32c9ef 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h @@ -49,20 +49,14 @@ extern void (*mips_timer_ack)(void); extern struct clocksource clocksource_mips; /* - * high-level timer interrupt routines. + * The low-level timer interrupt routine. */ -extern irqreturn_t timer_interrupt(int irq, void *dev_id); - -/* - * the corresponding low-level timer interrupt routine. - */ -extern asmlinkage void ll_timer_interrupt(int irq); +extern void ll_timer_interrupt(int irq, void *dev_id); /* * profiling and process accouting is done separately in local_timer_interrupt */ extern void local_timer_interrupt(int irq, void *dev_id); -extern asmlinkage void ll_local_timer_interrupt(int irq); /* * board specific routines required by time_init(). @@ -78,4 +72,10 @@ extern void plat_timer_setup(struct irqaction *irq); */ extern unsigned int mips_hpt_frequency; +/* + * The performance counter IRQ on MIPS is a close relative to the timer IRQ + * so it lives here. + */ +extern int (*perf_irq)(void); + #endif /* _ASM_TIME_H */ -- cgit v1.2.3 From 7bcf7717b6a047c272410d0cd00213185fe6b99d Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 11 Oct 2007 23:46:09 +0100 Subject: [MIPS] Implement clockevents for R4000-style cp0 count/compare interrupt Signed-off-by: Ralf Baechle --- include/asm-mips/time.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/asm-mips/time.h') diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index 3516b32c9ef..35555bd5c52 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h @@ -48,11 +48,6 @@ extern void (*mips_timer_ack)(void); */ extern struct clocksource clocksource_mips; -/* - * The low-level timer interrupt routine. - */ -extern void ll_timer_interrupt(int irq, void *dev_id); - /* * profiling and process accouting is done separately in local_timer_interrupt */ @@ -78,4 +73,9 @@ extern unsigned int mips_hpt_frequency; */ extern int (*perf_irq)(void); +/* + * Initialize the calling CPU's compare interrupt as clockevent device + */ +extern void mips_clockevent_init(void); + #endif /* _ASM_TIME_H */ -- cgit v1.2.3