/* *InordertosettheCMOSclockprecisely,update_persistent_clock64hasto *becalled500msafterthesecondnowtimehasstarted,becausewhen *nowtimeiswrittenintotheregistersoftheCMOSclock,itwill *jumptothenextsecondprecisely500mslater.ChecktheDallas *DS1287datasheetfordetails.
*/ int update_persistent_clock64(struct timespec64 now)
{
time64_t nowtime = now.tv_sec; int retval = 0; int real_seconds, real_minutes, cmos_minutes; unsignedchar save_control, save_freq_select;
/* irq are locally disabled here */
spin_lock(&rtc_lock); /* tell the clock it's being set */
save_control = CMOS_READ(RTC_CONTROL);
CMOS_WRITE((save_control | RTC_SET), RTC_CONTROL);
/* The following flags have to be released exactly in this order, *otherwisetheDS1287willnotresettheoscillatorandwillnot *updateprecisely500mslater.Youwon'tfindthismentioned *intheDallasSemiconductordatasheets,butwhobelievesdata *sheetsanyway...--MarkusKuhn
*/
CMOS_WRITE(save_control, RTC_CONTROL);
CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
spin_unlock(&rtc_lock);
return retval;
}
void __init plat_time_init(void)
{ int ioasic_clock = 0;
u32 start, end; int i = HZ / 8;
/* Set up the rate of periodic DS1287 interrupts. */
ds1287_set_base_clock(HZ);
/* On some I/O ASIC systems we have the I/O ASIC's counter. */ if (IOASIC)
ioasic_clock = dec_ioasic_clocksource_init() == 0; if (cpu_has_counter) {
ds1287_timer_state(); while (!ds1287_timer_state())
;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.