Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
0004  * Author: Fuxin Zhang, zhangfx@lemote.com
0005  *
0006  * Copyright (C) 2009 Lemote Inc.
0007  * Author: Wu Zhangjin, wuzhangjin@gmail.com
0008  */
0009 #include <asm/mc146818-time.h>
0010 #include <asm/time.h>
0011 #include <asm/hpet.h>
0012 
0013 #include <loongson.h>
0014 #include <cs5536/cs5536_mfgpt.h>
0015 
0016 void __init plat_time_init(void)
0017 {
0018     /* setup mips r4k timer */
0019     mips_hpt_frequency = cpu_clock_freq / 2;
0020 
0021     setup_mfgpt0_timer();
0022 }
0023 
0024 void read_persistent_clock64(struct timespec64 *ts)
0025 {
0026     ts->tv_sec = mc146818_get_cmos_time();
0027     ts->tv_nsec = 0;
0028 }