summaryrefslogtreecommitdiffstats
path: root/arch/mips/loongson/common
diff options
context:
space:
mode:
authorHuacai Chen <chenhc@lemote.com>2014-11-04 14:15:31 +0800
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 07:45:02 +0100
commite292ccde216e571faad475e4331c188f22a28182 (patch)
tree18bd2792fa52b3cd3f1aa2bc305262b75f80d8f8 /arch/mips/loongson/common
parent89467e73d3881a470ce4ffdcba1d5a5ed618379a (diff)
downloadlinux-e292ccde216e571faad475e4331c188f22a28182.tar.gz
linux-e292ccde216e571faad475e4331c188f22a28182.tar.bz2
linux-e292ccde216e571faad475e4331c188f22a28182.zip
MIPS: Loongson-3: Add RS780/SBX00 HPET support
CPUFreq driver need external timer, so add hpet at first. In Loongson 3, only Core-0 can receive external interrupt. As a result, timekeeping cannot absolutely use HPET timer. We use a hybrid solution: Core-0 use HPET as its clock event device, but other cores still use MIPS; clock source is global and doesn't need interrupt, so use HPET. Signed-off-by: Huacai Chen <chenhc@lemote.com> Signed-off-by: Hongliang Tao <taohl@lemote.com> Cc: John Crispin <john@phrozen.org> Cc: Steven J. Hill <Steven.Hill@imgtec.com> Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang <zhangfx@lemote.com> Cc: Zhangjin Wu <wuzhangjin@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/8329/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/loongson/common')
-rw-r--r--arch/mips/loongson/common/time.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/mips/loongson/common/time.c b/arch/mips/loongson/common/time.c
index 262a1f65b05e..e1a5382ad47e 100644
--- a/arch/mips/loongson/common/time.c
+++ b/arch/mips/loongson/common/time.c
@@ -12,6 +12,7 @@
*/
#include <asm/mc146818-time.h>
#include <asm/time.h>
+#include <asm/hpet.h>
#include <loongson.h>
#include <cs5536/cs5536_mfgpt.h>
@@ -21,7 +22,11 @@ void __init plat_time_init(void)
/* setup mips r4k timer */
mips_hpt_frequency = cpu_clock_freq / 2;
+#ifdef CONFIG_RS780_HPET
+ setup_hpet_timer();
+#else
setup_mfgpt0_timer();
+#endif
}
void read_persistent_clock(struct timespec *ts)