void __init time_init(void) { if (board_time_init) board_time_init(); clk_init(); rtc_sh_get_time(&xtime); set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST local_timer_setup(smp_processor_id()); #endif /* * Find the timer to use as the system timer, it will be * initialized for us. */ sys_timer = get_sys_timer(); if (unlikely(!sys_timer)) panic("System timer missing.\n"); printk(KERN_INFO "Using %s for system timer\n", sys_timer->name); }
void __init time_init(void) { if (board_time_init) board_time_init(); clk_init(); rtc_sh_get_time(&xtime); set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST local_timer_setup(smp_processor_id()); #endif /* * Make sure all compiled-in early timers register themselves. * * Run probe() for two "earlytimer" devices, these will be the * clockevents and clocksource devices respectively. In the event * that only a clockevents device is available, we -ENODEV on the * clocksource and the jiffies clocksource is used transparently * instead. No error handling is necessary here. */ early_platform_driver_register_all("earlytimer"); early_platform_driver_probe("earlytimer", 2, 0); }
void __init time_init(void) { if (board_time_init) board_time_init(); clk_init(); rtc_sh_get_time(&xtime); set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST local_timer_setup(smp_processor_id()); #endif /* * Find the timer to use as the system timer, it will be * initialized for us. */ sys_timer = get_sys_timer(); printk(KERN_INFO "Using %s for system timer\n", sys_timer->name); if (sys_timer->ops->read) clocksource_sh.read = sys_timer->ops->read; init_sh_clocksource(); if (sh_hpt_frequency) printk("Using %lu.%03lu MHz high precision timer.\n", ((sh_hpt_frequency + 500) / 1000) / 1000, ((sh_hpt_frequency + 500) / 1000) % 1000); }
static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm) { struct timespec tv; rtc_sh_get_time(&tv); rtc_time_to_tm(tv.tv_sec, tm); return 0; }
unsigned int get_rtc_time(struct rtc_time *tm) { if (rtc_sh_get_time != null_rtc_get_time) { struct timespec tv; rtc_sh_get_time(&tv); rtc_time_to_tm(tv.tv_sec, tm); } return RTC_24H; }
void __init time_init(void) { if (board_time_init) board_time_init(); hwblk_init(); clk_init(); rtc_sh_get_time(&xtime); set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); late_time_init = sh_late_time_init; }
void __init time_init(void) { if (board_time_init) board_time_init(); clk_init(); rtc_sh_get_time(&xtime); set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); /* * Find the timer to use as the system timer, it will be * initialized for us. */ sys_timer = get_sys_timer(); printk(KERN_INFO "Using %s for system timer\n", sys_timer->name); if (sys_timer->ops->read) clocksource_sh.read = sys_timer->ops->read; init_sh_clocksource(); if (sh_hpt_frequency) printk("Using %lu.%03lu MHz high precision timer.\n", ((sh_hpt_frequency + 500) / 1000) / 1000, ((sh_hpt_frequency + 500) / 1000) % 1000); #if defined(CONFIG_SH_KGDB) /* * Set up kgdb as requested. We do it here because the serial * init uses the timer vars we just set up for figuring baud. */ kgdb_init(); #endif }
void read_persistent_clock(struct timespec *ts) { rtc_sh_get_time(ts); }
unsigned long read_persistent_clock(void) { struct timespec tv; rtc_sh_get_time(&tv); return tv.tv_sec; }