Skip to contentSkip to conversation

lemote: CS5536 MFGPT as system clock source support

PATCH In review yanhua 1 participant 1 message Apr 9, 2009 MIPS

lore
Share & tools
lore

yanhua

author
#0 lore raw

PATCH 5/14 lemote: CS5536 MFGPT as system clock source support

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(-)
arch/mips/lemote/lm2f/Kconfig +0 -0
index 25fb9c0..bdf34e5 100644
@@ -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

(quoted diff) +0 -0

b/arch/mips/lemote/lm2f/common/Makefile
index d13d2e8..765874a 100644

arch/mips/lemote/lm2f/common/Makefile +0 -0
@@ -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

(quoted diff) +0 -0

b/arch/mips/lemote/lm2f/common/mfgpt.c
index e62a7fd..2179b86 100644

arch/mips/lemote/lm2f/common/mfgpt.c +0 -0
@@ -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);

(quoted diff) +0 -0

b/arch/mips/lemote/lm2f/fuloong/setup.c
index e0c393e..e6590f4 100644

arch/mips/lemote/lm2f/fuloong/setup.c +0 -0
@@ -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
}

(quoted diff) +0 -0

b/arch/mips/lemote/lm2f/yeeloong/setup.c
index 33c422c..815a42a 100644

arch/mips/lemote/lm2f/yeeloong/setup.c +0 -0
@@ -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
}

Signature · 1 line
1.5.6.5