xref: /kernel/linux/linux-5.10/arch/mips/loongson2ef/common/time.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/arch/mips/loongson2ef/common/
18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
48c2ecf20Sopenharmony_ci * Author: Fuxin Zhang, zhangfx@lemote.com
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 2009 Lemote Inc.
78c2ecf20Sopenharmony_ci * Author: Wu Zhangjin, wuzhangjin@gmail.com
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#include <asm/mc146818-time.h>
108c2ecf20Sopenharmony_ci#include <asm/time.h>
118c2ecf20Sopenharmony_ci#include <asm/hpet.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <loongson.h>
148c2ecf20Sopenharmony_ci#include <cs5536/cs5536_mfgpt.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_civoid __init plat_time_init(void)
178c2ecf20Sopenharmony_ci{
188c2ecf20Sopenharmony_ci	/* setup mips r4k timer */
198c2ecf20Sopenharmony_ci	mips_hpt_frequency = cpu_clock_freq / 2;
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci	setup_mfgpt0_timer();
228c2ecf20Sopenharmony_ci}
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_civoid read_persistent_clock64(struct timespec64 *ts)
258c2ecf20Sopenharmony_ci{
268c2ecf20Sopenharmony_ci	ts->tv_sec = mc146818_get_cmos_time();
278c2ecf20Sopenharmony_ci	ts->tv_nsec = 0;
288c2ecf20Sopenharmony_ci}
29

Indexes created Thu Nov 07 10:32:03 CST 2024