- Implement missing get_ticks(), get_timer() and get_tbclk() functions
to fix build error
- Simplify the implementation of __udelay() and fix an OBIWAN error in
the bogus rollover handling
The period of the MX28_HW_DIGCTL_MICROSECONDS counter is 2^32, thus
in the rollover case the correct calculation would be:
incr = 0x100000000 - old;
incr += new;
instead of:
incr = 0xffffffff - old;
incr += new;
But in 32bit arithmetic that is the same as:
incr = 0 - old;
incr += new;
which is in no way different from the else path:
incr += new - old;
Thus the 'if' clause is absolutely useless!
Whoever invented this routine should read up on two's complement
arithmetic!
Subtracting two unsigned integers with a finite number of bits in
two's complement arithmetic will _ALWAYS_ yield the difference
between the two numbers (thus the number of ticks between two timer
reads). There is NO NEED for any fancy rollover checks if one only
deals with differences between timer ticks rather than absolute
tick values!
- Add some debug code to verify the rollover handling
- Remove unused us_to_tick()