ionte: u-boot supports boot counters within persistent memory (or any register) to keep track of failing boot attempt, redundant env partition and other stuff, but you need to tweak it to your product req.