From e172909335b6238fca9d2f3f98f4de8331ed1501 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Thu, 28 Jun 2012 22:32:32 +0400 Subject: clocksource: move the NSEC_PER_SEC constant to common header Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- arch/ppc/mach-mpc85xx/include/mach/clocks.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch') diff --git a/arch/ppc/mach-mpc85xx/include/mach/clocks.h b/arch/ppc/mach-mpc85xx/include/mach/clocks.h index 94771682e8..2ab367b2ec 100644 --- a/arch/ppc/mach-mpc85xx/include/mach/clocks.h +++ b/arch/ppc/mach-mpc85xx/include/mach/clocks.h @@ -10,8 +10,6 @@ struct sys_info { unsigned long freqLocalBus; }; -#define NSEC_PER_SEC 1000000000L - unsigned long fsl_get_bus_freq(ulong dummy); unsigned long fsl_get_timebase_clock(void); void fsl_get_sys_info(struct sys_info *sysInfo); -- cgit v1.2.3 From dbf834072701075078fb460fcbaf60e407cae7a8 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Thu, 28 Jun 2012 22:32:33 +0400 Subject: MIPS: XBurst: fix the JZ4755's clocksource input frequency value The 40 KHz frequency value was used to parry __lshrdi3() error on little-endian MIPS because the __lshrdi3() function is used in clocksource code. The true value of the JZ4755's external clock frequency is 24 MHz. Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- arch/mips/mach-xburst/csrc-jz4750.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/mips/mach-xburst/csrc-jz4750.c b/arch/mips/mach-xburst/csrc-jz4750.c index f625b703a1..dc7135a4c4 100644 --- a/arch/mips/mach-xburst/csrc-jz4750.c +++ b/arch/mips/mach-xburst/csrc-jz4750.c @@ -28,7 +28,7 @@ #include #include -#define JZ_TIMER_CLOCK 40000 +#define JZ_TIMER_CLOCK 24000000 static uint64_t jz4750_cs_read(void) { -- cgit v1.2.3 From c325d97cfdaf44df8e497725fcb34500f228a712 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Thu, 28 Jun 2012 22:32:34 +0400 Subject: MIPS: XBurst: use clocks_calc_mult_shift() for JZ4755's clocksource Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- arch/mips/mach-xburst/csrc-jz4750.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/mips/mach-xburst/csrc-jz4750.c b/arch/mips/mach-xburst/csrc-jz4750.c index dc7135a4c4..36e401e480 100644 --- a/arch/mips/mach-xburst/csrc-jz4750.c +++ b/arch/mips/mach-xburst/csrc-jz4750.c @@ -38,12 +38,13 @@ static uint64_t jz4750_cs_read(void) static struct clocksource jz4750_cs = { .read = jz4750_cs_read, .mask = CLOCKSOURCE_MASK(32), - .shift = 10, }; static int clocksource_init(void) { - jz4750_cs.mult = clocksource_hz2mult(JZ_TIMER_CLOCK, jz4750_cs.shift); + clocks_calc_mult_shift(&jz4750_cs.mult, &jz4750_cs.shift, + JZ_TIMER_CLOCK, NSEC_PER_SEC, 10); + init_clock(&jz4750_cs); __raw_writel(TCU_OSTCSR_PRESCALE1 | TCU_OSTCSR_EXT_EN, -- cgit v1.2.3