summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadzim Dambrouski <pftbest@gmail.com>2015-10-23 21:14:06 +0300
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2015-11-10 16:48:47 +0100
commit4cd3246f2a3a3a5032edcaed3cf807dd916f0aea (patch)
tree2ef1b86868e2ceb729f80ba5f866da8dc540209a
parent35629363733a8e68c61f6698eaaeffdf66d3ec65 (diff)
downloadu-boot-imx-4cd3246f2a3a3a5032edcaed3cf807dd916f0aea.zip
u-boot-imx-4cd3246f2a3a3a5032edcaed3cf807dd916f0aea.tar.gz
u-boot-imx-4cd3246f2a3a3a5032edcaed3cf807dd916f0aea.tar.bz2
arm: stm32f4: fix a bug when only first sector gets erased
flash_lock call is inside a for loop, so after the first iteration flash is locked and no more sectors can be erased. Move flash_lock out of the loop. Signed-off-by: Vadzim Dambrouski <pftbest@gmail.com>
-rw-r--r--arch/arm/cpu/armv7m/stm32f4/flash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7m/stm32f4/flash.c b/arch/arm/cpu/armv7m/stm32f4/flash.c
index e5c6111..ae63790 100644
--- a/arch/arm/cpu/armv7m/stm32f4/flash.c
+++ b/arch/arm/cpu/armv7m/stm32f4/flash.c
@@ -114,9 +114,9 @@ int flash_erase(flash_info_t *info, int first, int last)
;
clrbits_le32(&STM32_FLASH->cr, STM32_FLASH_CR_SER);
- stm32f4_flash_lock(1);
}
+ stm32f4_flash_lock(1);
return 0;
}