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