Commit 746140c7 authored by Kevin Hilman's avatar Kevin Hilman Committed by Russell King

[ARM] 3855/1: Add generic time support

This patch adds Generic time-of-day support for the ARM architecture.

The support is currently added using #ifdef's so that it can support
sub-arches that do not (yet) have a clocksource added.  As sub-arches
add clocksource support, they should 'select GENERIC_TIME'
Signed-off-by: default avatarDeepak Saxena <dsaxena@mvista.com>
Signed-off-by: default avatarDaniel Walker <dwalker@mvista.com>
Signed-off-by: default avatarKevin Hilman <khilman@mvista.com>
Acked-by: default avatarJohn Stultz <johnstul@us.ibm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 82606c66
...@@ -17,6 +17,10 @@ config ARM ...@@ -17,6 +17,10 @@ config ARM
Europe. There is an ARM Linux project with a web page at Europe. There is an ARM Linux project with a web page at
<http://www.arm.linux.org.uk/>. <http://www.arm.linux.org.uk/>.
config GENERIC_TIME
bool
default n
config MMU config MMU
bool bool
default y default y
......
...@@ -69,10 +69,12 @@ EXPORT_SYMBOL(profile_pc); ...@@ -69,10 +69,12 @@ EXPORT_SYMBOL(profile_pc);
*/ */
int (*set_rtc)(void); int (*set_rtc)(void);
#ifndef CONFIG_GENERIC_TIME
static unsigned long dummy_gettimeoffset(void) static unsigned long dummy_gettimeoffset(void)
{ {
return 0; return 0;
} }
#endif
/* /*
* Scheduler clock - returns current time in nanosec units. * Scheduler clock - returns current time in nanosec units.
...@@ -230,6 +232,7 @@ static inline void do_leds(void) ...@@ -230,6 +232,7 @@ static inline void do_leds(void)
#define do_leds() #define do_leds()
#endif #endif
#ifndef CONFIG_GENERIC_TIME
void do_gettimeofday(struct timeval *tv) void do_gettimeofday(struct timeval *tv)
{ {
unsigned long flags; unsigned long flags;
...@@ -291,6 +294,7 @@ int do_settimeofday(struct timespec *tv) ...@@ -291,6 +294,7 @@ int do_settimeofday(struct timespec *tv)
} }
EXPORT_SYMBOL(do_settimeofday); EXPORT_SYMBOL(do_settimeofday);
#endif /* !CONFIG_GENERIC_TIME */
/** /**
* save_time_delta - Save the offset between system time and RTC time * save_time_delta - Save the offset between system time and RTC time
...@@ -500,8 +504,10 @@ device_initcall(timer_init_sysfs); ...@@ -500,8 +504,10 @@ device_initcall(timer_init_sysfs);
void __init time_init(void) void __init time_init(void)
{ {
#ifndef CONFIG_GENERIC_TIME
if (system_timer->offset == NULL) if (system_timer->offset == NULL)
system_timer->offset = dummy_gettimeoffset; system_timer->offset = dummy_gettimeoffset;
#endif
system_timer->init(); system_timer->init();
#ifdef CONFIG_NO_IDLE_HZ #ifdef CONFIG_NO_IDLE_HZ
......
...@@ -38,7 +38,9 @@ struct sys_timer { ...@@ -38,7 +38,9 @@ struct sys_timer {
void (*init)(void); void (*init)(void);
void (*suspend)(void); void (*suspend)(void);
void (*resume)(void); void (*resume)(void);
#ifndef CONFIG_GENERIC_TIME
unsigned long (*offset)(void); unsigned long (*offset)(void);
#endif
#ifdef CONFIG_NO_IDLE_HZ #ifdef CONFIG_NO_IDLE_HZ
struct dyn_tick_timer *dyn_tick; struct dyn_tick_timer *dyn_tick;
......
#ifndef _ASM_ARM_TIMEOFDAY_H
#define _ASM_ARM_TIMEOFDAY_H
#include <asm-generic/timeofday.h>
#endif
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