Path: blob/master/arch/mips/loongson/common/time.c
10818 views
/*1* Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology2* Author: Fuxin Zhang, [email protected]3*4* Copyright (C) 2009 Lemote Inc.5* Author: Wu Zhangjin, [email protected]6*7* This program is free software; you can redistribute it and/or modify it8* under the terms of the GNU General Public License as published by the9* Free Software Foundation; either version 2 of the License, or (at your10* option) any later version.11*/12#include <asm/mc146818-time.h>13#include <asm/time.h>1415#include <loongson.h>16#include <cs5536/cs5536_mfgpt.h>1718void __init plat_time_init(void)19{20/* setup mips r4k timer */21mips_hpt_frequency = cpu_clock_freq / 2;2223setup_mfgpt0_timer();24}2526void read_persistent_clock(struct timespec *ts)27{28ts->tv_sec = mc146818_get_cmos_time();29ts->tv_nsec = 0;30}313233