summaryrefslogtreecommitdiff
path: root/include/drivers/delay_timer.h
diff options
context:
space:
mode:
authorJuan Castillo <juan.castillo@arm.com>2015-12-01 16:10:15 +0000
committerJuan Castillo <juan.castillo@arm.com>2015-12-04 10:23:33 +0000
commit540a5ba8d955b6f369322b099f70bb5dc6787a06 (patch)
tree1153875d19771cfb9eb47571c3a926bad8b6778d /include/drivers/delay_timer.h
parentf3974ea5b17b0ec88091a8a8c59e56da0fe507f0 (diff)
Fix SP804 delay timer on FVP
This patch fixes several issues with the SP804 delay timer on FVP: * By default, the SP804 dual timer on FVP runs at 32 KHz. In order to run the timer at 35 MHz (as specified in the FVP user manual) the Overwrite bit in the SP810 control register must be set. * The CLKMULT and CLKDIV definitions are mixed up: delta(us) = delta(ticks) * T(us) = delta(ticks) / f(MHz) From the delay function: delta_us = (delta * ops->clk_mult) / ops->clk_div; Matching both expressions: 1 / f(MHz) = ops->clk_mult / ops->clk_div And consequently: f(MHz) = ops->clk_div / ops->clk_mult Which, for a 35 MHz timer, translates to: ops->clk_div = 35 ops->clk_mult = 1 * The comment in the delay timer header file has been corrected: The ratio of the multiplier and the divider is the clock period in microseconds, not the frequency. Change-Id: Iffd5ce0a5a28fa47c0720c0336d81b678ff8fdf1
Diffstat (limited to 'include/drivers/delay_timer.h')
-rw-r--r--include/drivers/delay_timer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/drivers/delay_timer.h b/include/drivers/delay_timer.h
index 4f3bdc88..0dec626c 100644
--- a/include/drivers/delay_timer.h
+++ b/include/drivers/delay_timer.h
@@ -38,7 +38,7 @@
* The driver must be initialized with a structure that provides a
* function pointer to return the timer value and a clock
* multiplier/divider. The ratio of the multiplier and the divider is
- * the clock frequency in MHz.
+ * the clock period in microseconds.
********************************************************************/
typedef struct timer_ops {