diff options
author | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
commit | bac30d1a78d0f11c613968fc8b351a91ed465386 (patch) | |
tree | e52f3c876522a2f6047a6ec1c27df2e8a79486b8 /arch/arm/mach-footbridge/time.c | |
parent | e8222502ee6157e2713da9e0792c21f4ad458d50 (diff) | |
parent | ca9ba4471c1203bb6e759b76e83167fec54fe590 (diff) |
Merge ../linux-2.6
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); |