@@ -30,6 +30,8 @@
#include <asm/mach/dma.h>
+#include "common.h"
+
#if 0
#define IRQDBG(args...) printk(args)
#else
@@ -46,7 +48,7 @@ void __init arch_dma_init(dma_t *dma)
*/
unsigned long h720x_gettimeoffset(void)
{
- return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH;
+ return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / H720X_LATCH;
}
/*
@@ -27,3 +27,6 @@ extern void __init h7202_init_time(void);
#ifdef CONFIG_ARCH_H7201
extern struct sys_timer h7201_timer;
#endif
+
+#define H720X_TICK_RATE 3686400
+#define H720X_LATCH ((H720X_TICK_RATE + HZ/2) / HZ) /* For divider */
@@ -46,7 +46,7 @@ static struct irqaction h7201_timer_irq = {
*/
void __init h7201_init_time(void)
{
- CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
+ CPU_REG (TIMER_VIRT, TM0_PERIOD) = H720X_LATCH;
CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;
@@ -180,7 +180,7 @@ static struct irqaction h7202_timer_irq = {
*/
void __init h7202_init_time(void)
{
- CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
+ CPU_REG (TIMER_VIRT, TM0_PERIOD) = H720X_LATCH;
CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;
As part of work to remove the global CLOCK_TICK_RATE symbol, this patch defines a sub-arch local value for use by the h720x code. Once all LATCH and CLOCK_TICK_RATE references are removed, we will remove all the definitions across sub-arches. Signed-off-by: Deepak Saxena <dsaxena@linaro.org> --- arch/arm/mach-h720x/common.c | 4 +++- arch/arm/mach-h720x/common.h | 3 +++ arch/arm/mach-h720x/cpu-h7201.c | 2 +- arch/arm/mach-h720x/cpu-h7202.c | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-)