On Do, 2015-07-16 at 10:51 +0200, Daniel Schultz wrote:
> The dmtimer0 is too inaccurate to be used for measurements.
> We switch to the more accurate dmtimer2.

What are you trying to measure? Is the resolution or the accuracy too
low?

> +#define CLK_M_OSC    25000000

> +static int dmtimer_init(void)
> +{
> +     dmtimer_cs.mult = clocksource_hz2mult(CLK_M_OSC, dmtimer_cs.shift);
> +     /* Enable counter */
> +     writel(0x3, base + TCLR);
> +
> +     return init_clock(&dmtimer_cs);

You use a fixed M_OSC of 25 MHz, but this value actually depends on the
the board. The AM335x supports 19.2, 24 and 26 MHz in addition to 25
MHz.

The advantage of using dmtimer0 is that it is always available and runs
at 32KiHz on every board.

Regards,
Jan
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to