[MIPS] IP27: Add clocksource drivers
[firefly-linux-kernel-4.4.55.git] / arch / mips / sgi-ip27 / ip27-timer.c
index 31346162e9fabecaaba3b3232cabfa4da347e6be..b7b3479b6bce2deca63503654f473fe2d3b33924 100644 (file)
@@ -123,7 +123,7 @@ again:
 #include <asm/sn/sn0/hubio.h>
 #include <asm/pci/bridge.h>
 
-static __init unsigned long get_m48t35_time(void)
+unsigned long read_persistent_clock(void)
 {
         unsigned int year, month, date, hour, min, sec;
        struct m48t35_rtc *rtc;
@@ -200,17 +200,23 @@ void __init plat_timer_setup(struct irqaction *irq)
        setup_irq(irqno, &rt_irqaction);
 }
 
-static cycle_t ip27_hpt_read(void)
+static cycle_t hub_rt_read(void)
 {
        return REMOTE_HUB_L(cputonasid(0), PI_RT_COUNT);
 }
 
-void __init ip27_time_init(void)
+struct clocksource ht_rt_clocksource = {
+       .name   = "HUB",
+       .rating = 200,
+       .read   = hub_rt_read,
+       .mask   = CLOCKSOURCE_MASK(52),
+       .shift  = 32,
+       .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+void __init plat_time_init(void)
 {
-       clocksource_mips.read = ip27_hpt_read;
-       mips_hpt_frequency = CYCLES_PER_SEC;
-       xtime.tv_sec = get_m48t35_time();
-       xtime.tv_nsec = 0;
+       clocksource_register(&ht_rt_clocksource);
 }
 
 void __init cpu_time_init(void)