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
108c2ecf20Sopenharmony_ci#include <asm/time.h>
118c2ecf20Sopenharmony_ci#include <asm/hpet.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <loongson.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_civoid __init plat_time_init(void)
168c2ecf20Sopenharmony_ci{
178c2ecf20Sopenharmony_ci	/* setup mips r4k timer */
188c2ecf20Sopenharmony_ci	mips_hpt_frequency = cpu_clock_freq / 2;
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#ifdef CONFIG_RS780_HPET
218c2ecf20Sopenharmony_ci	setup_hpet_timer();
228c2ecf20Sopenharmony_ci#endif
238c2ecf20Sopenharmony_ci}
24