2018-12-28 11:32:24 +03:00
// SPDX-License-Identifier: GPL-2.0
2005-04-17 02:20:36 +04:00
/*
2009-05-08 11:44:00 +04:00
* arch / sh / kernel / time . c
2005-04-17 02:20:36 +04:00
*
* Copyright ( C ) 1999 Tetsuya Okada & Niibe Yutaka
* Copyright ( C ) 2000 Philipp Rumpf < prumpf @ tux . org >
2009-04-28 18:12:10 +04:00
* Copyright ( C ) 2002 - 2009 Paul Mundt
2005-04-17 02:20:36 +04:00
* Copyright ( C ) 2002 M . R . Brown < mrbrown @ linux - sh . org >
*/
# include <linux/kernel.h>
# include <linux/init.h>
# include <linux/profile.h>
2006-12-06 05:24:48 +03:00
# include <linux/timex.h>
# include <linux/sched.h>
2007-05-09 12:33:24 +04:00
# include <linux/clockchips.h>
2009-04-15 14:50:12 +04:00
# include <linux/platform_device.h>
2008-08-06 13:37:07 +04:00
# include <linux/smp.h>
2009-04-27 12:34:39 +04:00
# include <linux/rtc.h>
2006-01-17 09:14:17 +03:00
# include <asm/clock.h>
2005-04-17 02:20:36 +04:00
# include <asm/rtc.h>
2019-10-03 12:29:12 +03:00
# include <asm/platform_early.h>
2006-01-17 09:14:17 +03:00
2009-07-29 17:43:58 +04:00
static void __init sh_late_time_init ( void )
2009-04-28 12:19:50 +04:00
{
2009-06-14 14:45:40 +04:00
/*
* Make sure all compiled - in early timers register themselves .
2009-06-14 15:02:30 +04:00
*
* 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 .
2009-06-14 14:45:40 +04:00
*/
2019-10-03 12:29:13 +03:00
sh_early_platform_driver_register_all ( " earlytimer " ) ;
sh_early_platform_driver_probe ( " earlytimer " , 2 , 0 ) ;
2009-04-28 12:19:50 +04:00
}
2009-07-29 17:43:58 +04:00
2009-04-28 12:19:50 +04:00
void __init time_init ( void )
{
2018-04-20 18:46:39 +03:00
timer_probe ( ) ;
2009-04-28 12:19:50 +04:00
clk_init ( ) ;
2009-07-29 17:43:58 +04:00
late_time_init = sh_late_time_init ;
2009-04-28 12:19:50 +04:00
}