Skip to contentSkip to conversation

set_rtc_time() cleanup / normalization

DISCUSSION Gabriel Paubert 1 participant 1 message May 15, 2003 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 10 lines · Geert Uytterhoeven
Quoted 9 lines · Richard Zidlicky
Quoted 7 lines · Gabriel Paubert
Quoted 1 line · Richard Zidlicky

- RTC should be accessed by proper rtc device driver only

This model is already broken by the fact that you read the time early in boot to get reasonable initial values. So I don't buy at all this argument.

Quoted 6 lines
Quoted 3 lines

reading it early during boot is a bit different, no worry about interrupts, long delays etc. Also this could be actually done by accessing /dev/rtc.

Actually this breaks on machines where the RTC is on i2c, since i2c wasn't initialized yet.

Well, that's tough, it should at least be read before the first userspace program is sorted. Could it be read and passed from a bootloader with a botinfo record (repeatedly read the clock until you cross a second boundary and get the timebase at this point).

Something like BI_CLOCK

struct bi_clock {
	unsigned long timebase;
	unsigned long tv_sec;
}

Reading the clock is easy under OF, don't know about others.

Gabriel

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/