diff options
-rw-r--r-- | drivers/mtd/stm32_flash.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/stm32_flash.c b/drivers/mtd/stm32_flash.c index 71f48543a39..e16b6cd674f 100644 --- a/drivers/mtd/stm32_flash.c +++ b/drivers/mtd/stm32_flash.c @@ -137,6 +137,10 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) /* To make things simple use byte writes only */ for (i = 0; i < cnt; i++) { *(uchar *)(addr + i) = src[i]; + /* avoid re-ordering flash data write and busy status + * check as flash memory space attributes are generally Normal + */ + mb(); while (readl(&STM32_FLASH->sr) & STM32_FLASH_SR_BSY) ; } |