mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[ARM] rtc-sa1100: don't assume CLOCK_TICK_RATE to be a constant
As Nicolas and Russell pointed out, CLOCK_TICK_RATE is no more a constant on PXA when multiple processors and platforms are selected, change TIMER_FREQ in rtc-sa1100.c into a variable. Since the code to decide the clock tick rate is re-used from timer.c, introduce a common get_clock_tick_rate() for this. Signed-off-by: Eric Miao <[email protected]> Acked-by: Nicolas Pitre <[email protected]>
This commit is contained in:
parent
9f1442bbf9
commit
6769717d5d
6 changed files with 38 additions and 14 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include <asm/system.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <mach/pxa-regs.h>
|
||||
#include <mach/reset.h>
|
||||
|
|
@ -39,6 +40,21 @@ void clear_reset_status(unsigned int mask)
|
|||
pxa3xx_clear_reset_status(mask);
|
||||
}
|
||||
|
||||
unsigned long get_clock_tick_rate(void)
|
||||
{
|
||||
unsigned long clock_tick_rate;
|
||||
|
||||
if (cpu_is_pxa25x())
|
||||
clock_tick_rate = 3686400;
|
||||
else if (machine_is_mainstone())
|
||||
clock_tick_rate = 3249600;
|
||||
else
|
||||
clock_tick_rate = 3250000;
|
||||
|
||||
return clock_tick_rate;
|
||||
}
|
||||
EXPORT_SYMBOL(get_clock_tick_rate);
|
||||
|
||||
/*
|
||||
* Get the clock frequency as reflected by CCCR and the turbo flag.
|
||||
* We assume these values have been applied via a fcs.
|
||||
|
|
|
|||
|
|
@ -291,6 +291,8 @@
|
|||
*/
|
||||
extern unsigned int get_memclk_frequency_10khz(void);
|
||||
|
||||
/* return the clock tick rate of the OS timer */
|
||||
extern unsigned long get_clock_tick_rate(void);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,14 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/* Various drivers are still using the constant of CLOCK_TICK_RATE, for
|
||||
* those drivers to at least work, the definition is provided here.
|
||||
*
|
||||
* NOTE: this is no longer accurate when multiple processors and boards
|
||||
* are selected, newer drivers should not depend on this any more. Use
|
||||
* either the clocksource/clockevent or get this at run-time by calling
|
||||
* get_clock_tick_rate() (as defined in generic.c).
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_PXA25x)
|
||||
/* PXA250/210 timer base */
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <asm/mach/irq.h>
|
||||
#include <asm/mach/time.h>
|
||||
#include <mach/pxa-regs.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
/*
|
||||
* This is PXA's sched_clock implementation. This has a resolution
|
||||
|
|
@ -150,18 +149,11 @@ static struct irqaction pxa_ost0_irq = {
|
|||
|
||||
static void __init pxa_timer_init(void)
|
||||
{
|
||||
unsigned long clock_tick_rate;
|
||||
unsigned long clock_tick_rate = get_clock_tick_rate();
|
||||
|
||||
OIER = 0;
|
||||
OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;
|
||||
|
||||
if (cpu_is_pxa25x())
|
||||
clock_tick_rate = 3686400;
|
||||
else if (machine_is_mainstone())
|
||||
clock_tick_rate = 3249600;
|
||||
else
|
||||
clock_tick_rate = 3250000;
|
||||
|
||||
set_oscr2ns_scale(clock_tick_rate);
|
||||
|
||||
ckevt_pxa_osmr0.mult =
|
||||
|
|
|
|||
|
|
@ -59,6 +59,10 @@
|
|||
# define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
|
||||
# define __PREG(x) (io_v2p((unsigned long)&(x)))
|
||||
|
||||
static inline unsigned long get_clock_tick_rate(void)
|
||||
{
|
||||
return 3686400;
|
||||
}
|
||||
#else
|
||||
|
||||
# define __REG(x) io_p2v(x)
|
||||
|
|
|
|||
Loading…
Reference in a new issue