Skip to content
  • Rasmus Villemoes's avatar
    ARM: mxs: spl_boot.c: make early_delay more robust · b6e7ef4b
    Rasmus Villemoes authored and Stefano Babic's avatar Stefano Babic committed
    
    
    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>
    b6e7ef4b