summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-08-27 15:56:11 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2017-08-27 17:49:45 +0200
commitb81c1555ef7025a23c8e1e6e27259983adac9e5d (patch)
treef9dd8f8581366c84883f0cc24fd1fe74bcd56b0c
parent7677a9946f90a277c24aaa45366cefee19dd1ab8 (diff)
downloadrockbox-b81c1555ef7025a23c8e1e6e27259983adac9e5d.tar.gz
rockbox-b81c1555ef7025a23c8e1e6e27259983adac9e5d.tar.bz2
rockbox-b81c1555ef7025a23c8e1e6e27259983adac9e5d.zip
imx233: fix potential bug in udelay
Change-Id: I5c8f5d9917f7a3353862c856bd9bbbbe9b291b1d
-rw-r--r--firmware/target/arm/imx233/system-imx233.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/system-imx233.c b/firmware/target/arm/imx233/system-imx233.c
index 165a32d143..078e052b30 100644
--- a/firmware/target/arm/imx233/system-imx233.c
+++ b/firmware/target/arm/imx233/system-imx233.c
@@ -257,7 +257,9 @@ void imx233_reset_block(volatile uint32_t *block_reg)
void udelay(unsigned us)
{
uint32_t ref = HW_DIGCTL_MICROSECONDS;
- while(!imx233_us_elapsed(ref, us));
+ /* increase number of us by 1 to make sure we wait *at least* the requested
+ * time */
+ while(!imx233_us_elapsed(ref, us + 1));
}
void imx233_digctl_set_arm_cache_timings(unsigned timings)