]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 7452/1: delay: allow timer-based delay implementation to be selected
authorWill Deacon <will.deacon@arm.com>
Fri, 6 Jul 2012 14:47:17 +0000 (15:47 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 9 Jul 2012 16:42:23 +0000 (17:42 +0100)
commit8e179097e3f9bd7972224981a1b44be9d7e6c7c4
tree43dcdcf9eebd9c88430df031305ca4eb5c2346f4
parenta8d8a677f2c359b6c101e7c5e8bf68f16b47b32c
ARM: 7452/1: delay: allow timer-based delay implementation to be selected

This patch allows a timer-based delay implementation to be selected by
switching the delay routines over to use get_cycles, which is
implemented in terms of read_current_timer. This further allows us to
skip the loop calibration and have a consistent delay function in the
face of core frequency scaling.

To avoid the pain of dealing with memory-mapped counters, this
implementation uses the co-processor interface to the architected timers
when they are available. The previous loop-based implementation is
kept around for CPUs without the architected timers and we retain both
the maximum delay (2ms) and the corresponding conversion factors for
determining the number of loops required for a given interval. Since the
indirection of the timer routines will only work when called from C,
the sa1100 sleep routines are modified to branch to the loop-based delay
functions directly.

Tested-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/delay.h
arch/arm/kernel/arch_timer.c
arch/arm/kernel/armksyms.c
arch/arm/lib/Makefile
arch/arm/lib/delay-loop.S [new file with mode: 0644]
arch/arm/lib/delay.S [deleted file]
arch/arm/lib/delay.c [new file with mode: 0644]
arch/arm/mach-sa1100/sleep.S