freebsd-skq/sys/arm/freescale
Ian Lepore 928e4f221d Replace the hard-coded way-too-small minimum event timer period with a value
calculated at runtime based on how long it takes to set up an event in
hardware.  This fixes the intermittant 1-minute hang at boot on imx5
systems, and also the occasional oversleeping while running.  It doesn't
affect imx6 systems, which use different hardware for eventtimers.

It turns out that it usually takes about 30 timer ticks to set up the timer
compare register, and the old hard-coded minimum period was 10 ticks.  On
the rare occasions when a timeout event that short was set up, we'd miss
the event and have to wait about 64 seconds for counter rollover before
the compare interrupt would fire.

Instead of just hardcoding a new bigger value, the code now measures the
time it takes to do the register read/write sequence to set up the compare
register, scales it up by 1.5x to be safe, and calculates the minimum event
period from the result.  In the real world, the minimum period works out to
about 750 nanoseconds on imx5 hardware.
2017-03-19 21:53:12 +00:00
..
imx Replace the hard-coded way-too-small minimum event timer period with a value 2017-03-19 21:53:12 +00:00
vybrid Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
fsl_ocotp.c Move arm's devmap to some generic place, so it can be used 2016-04-26 11:53:37 +00:00
fsl_ocotpreg.h Make it possible to access the ocotp registers before the ocotp device 2014-02-16 03:09:39 +00:00
fsl_ocotpvar.h It turns out Freescale cleverly made the ocotp device compatible across 2014-02-15 21:21:57 +00:00