Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: orion: implement ARM delay timer

Implement an ARM delay timer to be used for udelay() on orion legacy
platforms. This allows us to skip the delay loop calibration at boot.

It also means that udelay() will be unaffected by CPU frequency changes
when cpufreq is enabled on these platforms.

Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+13
+13
arch/arm/plat-orion/time.c
··· 18 18 #include <linux/irq.h> 19 19 #include <linux/sched_clock.h> 20 20 #include <plat/time.h> 21 + #include <asm/delay.h> 21 22 22 23 /* 23 24 * MBus bridge block registers. ··· 189 188 timer_base = _timer_base; 190 189 } 191 190 191 + static unsigned long orion_delay_timer_read(void) 192 + { 193 + return ~readl(timer_base + TIMER0_VAL_OFF); 194 + } 195 + 196 + static struct delay_timer orion_delay_timer = { 197 + .read_current_timer = orion_delay_timer_read, 198 + }; 199 + 192 200 void __init 193 201 orion_time_init(void __iomem *_bridge_base, u32 _bridge_timer1_clr_mask, 194 202 unsigned int irq, unsigned int tclk) ··· 211 201 bridge_timer1_clr_mask = _bridge_timer1_clr_mask; 212 202 213 203 ticks_per_jiffy = (tclk + HZ/2) / HZ; 204 + 205 + orion_delay_timer.freq = tclk; 206 + register_current_timer_delay(&orion_delay_timer); 214 207 215 208 /* 216 209 * Set scale and timer for sched_clock.