imx233: fix user timer

The running count is only 16-bit wide, since the always tick
setting derives from the crystal clock at 24MHz the user timer
cannot be set lower than ~300Hz which is already too high.
Switch to the 32KHz crystal source to fix this.

Change-Id: Ie7775460b17ea7ab331738734e3d688ad5563857
This commit is contained in:
Amaury Pouly 2012-10-21 14:42:32 +02:00
parent e86991f484
commit 709827b5ea
2 changed files with 3 additions and 3 deletions

View file

@ -61,8 +61,8 @@
#define FRAME_PHYS_ADDR (DRAM_ORIG + DRAM_SIZE - TTB_SIZE - FRAME_SIZE)
#define FRAME ((void *)(FRAME_PHYS_ADDR - UNCACHED_DRAM_ADDR + BUFFERED_DRAM_ADDR))
/* Timer runs at APBX speed which is derived from ref_xtal@24MHz */
#define TIMER_FREQ 24000000
/* Timer runs at 32KHz, derived from clk32k@32KHz */
#define TIMER_FREQ 32000
/* USBOTG */
#define USB_QHARRAY_ATTR __attribute__((section(".qharray"),nocommon,aligned(2048)))

View file

@ -58,7 +58,7 @@ bool timer_set(long cycles, bool start)
bool timer_start(IF_COP_VOID(int core))
{
imx233_setup_timer(USER_TIMER_NR, true, timer_cycles,
HW_TIMROT_TIMCTRL__SELECT_TICK_ALWAYS, HW_TIMROT_TIMCTRL__PRESCALE_1,
HW_TIMROT_TIMCTRL__SELECT_32KHZ_XTAL, HW_TIMROT_TIMCTRL__PRESCALE_1,
false, &timer_fn);
return true;
}