arm64: dts: rk3399-box: vdd_gpu force PWM mode via regulator mode
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / kernel / time.c
index a551f88ae2c13e173749e75c80a2776f8d2a80cf..59779699a1a40ef3a1940aa0d878c16164ea5398 100644 (file)
@@ -18,6 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <linux/clockchips.h>
 #include <linux/export.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/delay.h>
 #include <linux/clocksource.h>
+#include <linux/clk-provider.h>
+#include <linux/acpi.h>
 
 #include <clocksource/arm_arch_timer.h>
 
 #include <asm/thread_info.h>
 #include <asm/stacktrace.h>
 
-#ifdef CONFIG_SMP
 unsigned long profile_pc(struct pt_regs *regs)
 {
        struct stackframe frame;
@@ -50,8 +52,11 @@ unsigned long profile_pc(struct pt_regs *regs)
        frame.fp = regs->regs[29];
        frame.sp = regs->sp;
        frame.pc = regs->pc;
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+       frame.graph = -1; /* no task info */
+#endif
        do {
-               int ret = unwind_frame(&frame);
+               int ret = unwind_frame(NULL, &frame);
                if (ret < 0)
                        return 0;
        } while (in_lock_functions(frame.pc));
@@ -59,34 +64,20 @@ unsigned long profile_pc(struct pt_regs *regs)
        return frame.pc;
 }
 EXPORT_SYMBOL(profile_pc);
-#endif
-
-static u64 sched_clock_mult __read_mostly;
-
-unsigned long long notrace sched_clock(void)
-{
-       return arch_timer_read_counter() * sched_clock_mult;
-}
-
-int read_current_timer(unsigned long *timer_value)
-{
-       *timer_value = arch_timer_read_counter();
-       return 0;
-}
 
 void __init time_init(void)
 {
        u32 arch_timer_rate;
 
-       clocksource_of_init();
+       of_clk_init(NULL);
+       clocksource_probe();
+
+       tick_setup_hrtimer_broadcast();
 
        arch_timer_rate = arch_timer_get_rate();
        if (!arch_timer_rate)
                panic("Unable to initialise architected timer.\n");
 
-       /* Cache the sched_clock multiplier to save a divide in the hot path. */
-       sched_clock_mult = NSEC_PER_SEC / arch_timer_rate;
-
        /* Calibrate the delay loop directly */
        lpj_fine = arch_timer_rate / HZ;
 }