Skip to content
Snippets Groups Projects
Commit b6e7ef4b authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Stefano Babic
Browse files

ARM: mxs: spl_boot.c: make early_delay more robust


It's true that booting normally doesn't take long enough for the
register to roll (which actually happens in a little over an hour, not
just a few seconds). However, the counter starts at power-on, and if
the board is held in reset to be booted over USB, one actually risks
hitting wrap-around during boot, which can both result in too short
delays (if the "st += delay" calculation makes st small) and
theoretically also unbound delays (if st ends up being UINT_MAX and
one just misses sampling digctl_microseconds at that point).

It doesn't take more code to DTRT, and once bitten, twice shy.

Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
parent b1278a8e
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment