Skip to content

Commit

Permalink
ARM: Realview/Versatile: remove useless TIMER_RELOAD calculations
Browse files Browse the repository at this point in the history
Realview/Versatile copied the Integrator timer code, including the
calculations for ensuring that the reload value fits into the 16-bit
counter.  However, these platforms have a 32-bit counter which is
clocked at a slower rate.

The result is that the preprocessor conditions are never triggered:
TICKS_PER_uSEC = 1, mSEC_10 = 10000, which is 0x2710 - less than
0x10000.

So, remove the unnecessary complexity, reducing the TIMER_RELOAD
calculation to just:

	TICKS_PER_uSEC * mSEC_10

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed May 2, 2010
1 parent e388771 commit fe8e1a5
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions arch/arm/plat-versatile/timer-sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,7 @@
/*
* How long is the timer interval?
*/
#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
#if TIMER_INTERVAL >= 0x100000
#define TIMER_RELOAD (TIMER_INTERVAL >> 8)
#define TIMER_DIVISOR (TIMER_CTRL_DIV256)
#elif TIMER_INTERVAL >= 0x10000
#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */
#define TIMER_DIVISOR (TIMER_CTRL_DIV16)
#else
#define TIMER_RELOAD (TIMER_INTERVAL)
#define TIMER_DIVISOR (TIMER_CTRL_DIV1)
#endif
#define TIMER_RELOAD (TICKS_PER_uSEC * mSEC_10)


static void __iomem *clksrc_base;
Expand Down

0 comments on commit fe8e1a5

Please sign in to comment.