path: root/arch/mips/include
diff options
authorWu Zhangjin <wuzhangjin@gmail.com>2009-11-17 01:32:57 +0800
committerRalf Baechle <ralf@linux-mips.org>2009-12-17 01:57:19 +0000
commit916daba8a9f2617ded8b9255e6b39f066ef60178 (patch)
tree63aa70b44e483bc30154130707e4d7529493543c /arch/mips/include
parent6e552c9b3aa7ba3be57b9569ec92a38af5c65e48 (diff)
MIPS: Lemote 2F: Add cs5536 MFGPT timer support
CPUFreq support for Loongson 2F requires an external timer. Because the frequency of the MIPS Timer is related to the CPU frequency which itself is variable another timer of constant frequency is required. Export the mfgpt0 counter disable / enable operations for the coming suspend support to suspend / resume the timer. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Cc: cpufreq@vger.kernel.org, Cc: Dave Jones <davej@redhat.com>, Cc: Dominik Brodowski <linux@dominikbrodowski.net>, Cc: yanh@lemote.com Cc: huhb@lemote.com, Patchwork: http://patchwork.linux-mips.org/patch/658/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-loongson/cs5536/cs5536_mfgpt.h b/arch/mips/include/asm/mach-loongson/cs5536/cs5536_mfgpt.h
new file mode 100644
index 00000000000..4b493d6772c
--- /dev/null
+++ b/arch/mips/include/asm/mach-loongson/cs5536/cs5536_mfgpt.h
@@ -0,0 +1,35 @@
+ * cs5536 mfgpt header file
+ */
+#ifndef _CS5536_MFGPT_H
+#define _CS5536_MFGPT_H
+#include <cs5536/cs5536.h>
+#include <cs5536/cs5536_pci.h>
+#ifdef CONFIG_CS5536_MFGPT
+extern void setup_mfgpt0_timer(void);
+extern void disable_mfgpt0_counter(void);
+extern void enable_mfgpt0_counter(void);
+static inline void __maybe_unused setup_mfgpt0_timer(void)
+static inline void __maybe_unused disable_mfgpt0_counter(void)
+static inline void __maybe_unused enable_mfgpt0_counter(void)
+#define MFGPT_TICK_RATE 14318000
+#define COMPARE ((MFGPT_TICK_RATE + HZ/2) / HZ)
+#define MFGPT_BASE mfgpt_base
+#define MFGPT0_CMP2 (MFGPT_BASE + 2)
+#define MFGPT0_CNT (MFGPT_BASE + 4)
+#define MFGPT0_SETUP (MFGPT_BASE + 6)
+#endif /*!_CS5536_MFGPT_H */