From: yanhua <yanh@lemote.com>
To: linux-mips@linux-mips.org, "Ralf Baechle" <ralf@linux-mips.org>,
彭亮锦 <penglj@lemote.com>,
"zhangfx@lemote.com" <zhangfx@lemote.com>
Subject: [PATCH 5/14] lemote: CS5536 MFGPT as system clock source support
Date: Thu, 09 Apr 2009 12:56:19 +0800 [thread overview]
Message-ID: <49DD7FF3.20505@lemote.com> (raw)
The cpu count timer should not be used if oprofile and cpufreq are to be
supported. Instead the CS5536' mfgpt is a proper timer alternative
---
arch/mips/lemote/lm2f/Kconfig | 15 +++++++++++----
arch/mips/lemote/lm2f/common/Makefile | 2 +-
arch/mips/lemote/lm2f/common/mfgpt.c | 4 ++--
arch/mips/lemote/lm2f/fuloong/setup.c | 2 +-
arch/mips/lemote/lm2f/yeeloong/setup.c | 2 +-
5 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/arch/mips/lemote/lm2f/Kconfig b/arch/mips/lemote/lm2f/Kconfig
index 25fb9c0..bdf34e5 100644
--- a/arch/mips/lemote/lm2f/Kconfig
+++ b/arch/mips/lemote/lm2f/Kconfig
@@ -6,8 +6,8 @@ choice
config LEMOTE_FULOONG2F
bool "Lemote Fuloong mini-PC"
select ARCH_SPARSEMEM_ENABLE
- select CEVT_R4K
- select CSRC_R4K
+ select CEVT_R4K if ! CS5536_MFGPT
+ select CSRC_R4K if ! CS5536_MFGPT
select SYS_HAS_CPU_LOONGSON2
select DMA_NONCOHERENT
select BOOT_ELF32
@@ -31,8 +31,8 @@ config LEMOTE_FULOONG2F
config LEMOTE_YEELOONG2F
bool "Lemote Yeloong2F mini Notebook"
select ARCH_SPARSEMEM_ENABLE
- select CEVT_R4K
- select CSRC_R4K
+ select CEVT_R4K if ! CS5536_MFGPT
+ select CSRC_R4K if ! CS5536_MFGPT
select SYS_HAS_CPU_LOONGSON2
select DMA_NONCOHERENT
select BOOT_ELF32
@@ -62,6 +62,13 @@ config CS5536
bool
select CS5536_RTC_BUG
+config CS5536_MFGPT
+ bool "Using cs5536's MFGPT as system clock"
+ depends on CS5536
+ help
+ This is needed if cpufreq and oprofile should be enabled in
+ Loongson2(F) machines
+
config LEMOTE_NAS
bool "Lemote NAS machine"
depends on LEMOTE_FULOONG2F
diff --git a/arch/mips/lemote/lm2f/common/Makefile
b/arch/mips/lemote/lm2f/common/Makefile
index d13d2e8..765874a 100644
--- a/arch/mips/lemote/lm2f/common/Makefile
+++ b/arch/mips/lemote/lm2f/common/Makefile
@@ -5,5 +5,5 @@
# Makefile for the loongson2f CPUS, generic files
#
-obj-y += mem.o mipsdha.o pci.o mem.o plat.o
+obj-y += mem.o mipsdha.o pci.o mem.o plat.o mfgpt.o
obj-$(CONFIG_CS5536) += cs5536_vsm.o
diff --git a/arch/mips/lemote/lm2f/common/mfgpt.c
b/arch/mips/lemote/lm2f/common/mfgpt.c
index e62a7fd..2179b86 100644
--- a/arch/mips/lemote/lm2f/common/mfgpt.c
+++ b/arch/mips/lemote/lm2f/common/mfgpt.c
@@ -147,7 +147,7 @@ void __init setup_mfgpt_timer(void)
struct clock_event_device *cd = &mfgpt_clockevent;
unsigned int cpu = smp_processor_id();
- cd->cpumask = cpumask_of_cpu(cpu);
+ cd->cpumask = cpumask_of(cpu);
clockevent_set_clock(cd, MFGFT_TICK_RATE);
cd->max_delta_ns = clockevent_delta2ns(0xFFFF, cd);
cd->min_delta_ns = clockevent_delta2ns(0xF, cd);
@@ -218,5 +218,5 @@ int __init init_mfgpt_clocksource(void)
clocksource_mfgpt.mult = clocksource_hz2mult(MFGFT_TICK_RATE, 22);
return clocksource_register(&clocksource_mfgpt);
}
-/* Too late for kernel calc delay */
+/* too late to calc delay */
//arch_initcall(init_mfgpt_clocksource);
diff --git a/arch/mips/lemote/lm2f/fuloong/setup.c
b/arch/mips/lemote/lm2f/fuloong/setup.c
index e0c393e..e6590f4 100644
--- a/arch/mips/lemote/lm2f/fuloong/setup.c
+++ b/arch/mips/lemote/lm2f/fuloong/setup.c
@@ -60,7 +60,7 @@ void __init plat_time_init(void)
/* setup mips r4k timer */
mips_hpt_frequency = cpu_clock_freq / 2;
-#ifdef CONFIG_LS2F_CPU_FREQ
+#ifdef CONFIG_CS5536_MFGPT
init_mfgpt_clocksource();
#endif
}
diff --git a/arch/mips/lemote/lm2f/yeeloong/setup.c
b/arch/mips/lemote/lm2f/yeeloong/setup.c
index 33c422c..815a42a 100644
--- a/arch/mips/lemote/lm2f/yeeloong/setup.c
+++ b/arch/mips/lemote/lm2f/yeeloong/setup.c
@@ -60,7 +60,7 @@ void __init plat_time_init(void)
/* setup mips r4k timer */
mips_hpt_frequency = cpu_clock_freq / 2;
-#ifdef CONFIG_LS2F_CPU_FREQ
+#ifdef CONFIG_CS5536_MFGPT
init_mfgpt_clocksource();
#endif
}
--
1.5.6.5
reply other threads:[~2009-04-09 4:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49DD7FF3.20505@lemote.com \
--to=yanh@lemote.com \
--cc=linux-mips@linux-mips.org \
--cc=penglj@lemote.com \
--cc=ralf@linux-mips.org \
--cc=zhangfx@lemote.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.