diff options
Diffstat (limited to 'arch/arm/mach-footbridge/time.c')
-rw-r--r-- | arch/arm/mach-footbridge/time.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/arch/arm/mach-footbridge/time.c b/arch/arm/mach-footbridge/time.c index 2c64a0b0502e..5d02e95dede3 100644 --- a/arch/arm/mach-footbridge/time.c +++ b/arch/arm/mach-footbridge/time.c | |||
@@ -34,27 +34,12 @@ static int rtc_base; | |||
34 | static unsigned long __init get_isa_cmos_time(void) | 34 | static unsigned long __init get_isa_cmos_time(void) |
35 | { | 35 | { |
36 | unsigned int year, mon, day, hour, min, sec; | 36 | unsigned int year, mon, day, hour, min, sec; |
37 | int i; | ||
38 | 37 | ||
39 | // check to see if the RTC makes sense..... | 38 | // check to see if the RTC makes sense..... |
40 | if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0) | 39 | if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0) |
41 | return mktime(1970, 1, 1, 0, 0, 0); | 40 | return mktime(1970, 1, 1, 0, 0, 0); |
42 | 41 | ||
43 | /* The Linux interpretation of the CMOS clock register contents: | 42 | do { |
44 | * When the Update-In-Progress (UIP) flag goes from 1 to 0, the | ||
45 | * RTC registers show the second which has precisely just started. | ||
46 | * Let's hope other operating systems interpret the RTC the same way. | ||
47 | */ | ||
48 | /* read RTC exactly on falling edge of update flag */ | ||
49 | for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */ | ||
50 | if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) | ||
51 | break; | ||
52 | |||
53 | for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */ | ||
54 | if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)) | ||
55 | break; | ||
56 | |||
57 | do { /* Isn't this overkill ? UIP above should guarantee consistency */ | ||
58 | sec = CMOS_READ(RTC_SECONDS); | 43 | sec = CMOS_READ(RTC_SECONDS); |
59 | min = CMOS_READ(RTC_MINUTES); | 44 | min = CMOS_READ(RTC_MINUTES); |
60 | hour = CMOS_READ(RTC_HOURS); | 45 | hour = CMOS_READ(RTC_HOURS); |