Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sami Nurmenniemi
u-boot-stm32
Commits
ea07545d
Commit
ea07545d
authored
Mar 02, 2015
by
Yuri Tikhonov
Browse files
RT106081. STM32F4: fix-up u-boot self-update (with caches on)
Signed-off-by:
Yuri Tikhonov
<
yur@emcraft.com
>
parent
15db5150
Changes
1
Hide whitespace changes
Inline
Side-by-side
cpu/arm_cortexm3/stm32/envm.c
View file @
ea07545d
...
@@ -260,9 +260,6 @@ stm32_flash_program(u32 offset, void *buf, u32 size)
...
@@ -260,9 +260,6 @@ stm32_flash_program(u32 offset, void *buf, u32 size)
stm32_flash_cr_unlock
();
stm32_flash_cr_unlock
();
STM32_FLASH_REGS
->
cr
|=
STM32_FLASH_CR_PG
;
STM32_FLASH_REGS
->
cr
|=
STM32_FLASH_CR_PG
;
#if defined(CONFIG_STM32F7_DCACHE_ON) || defined(CONFIG_STM32F7_ICACHE_ON)
stm32f7_envm_as_dev
();
#endif
/* Since we are using 32x parallelism (set in CR), copy by 4 bytes */
/* Since we are using 32x parallelism (set in CR), copy by 4 bytes */
while
(
words
--
)
{
while
(
words
--
)
{
*
dst
++
=
*
src
++
;
*
dst
++
=
*
src
++
;
...
@@ -270,9 +267,7 @@ stm32_flash_program(u32 offset, void *buf, u32 size)
...
@@ -270,9 +267,7 @@ stm32_flash_program(u32 offset, void *buf, u32 size)
while
(
STM32_FLASH_REGS
->
sr
&
STM32_FLASH_SR_BSY
)
while
(
STM32_FLASH_REGS
->
sr
&
STM32_FLASH_SR_BSY
)
;
;
}
}
#if defined(CONFIG_STM32F7_DCACHE_ON) || defined(CONFIG_STM32F7_ICACHE_ON)
stm32f7_envm_as_mem
();
#endif
STM32_FLASH_REGS
->
cr
&=
~
STM32_FLASH_CR_PG
;
STM32_FLASH_REGS
->
cr
&=
~
STM32_FLASH_CR_PG
;
stm32_flash_cr_lock
();
stm32_flash_cr_lock
();
...
@@ -323,6 +318,9 @@ envm_write(u32 offset, void * buf, u32 size)
...
@@ -323,6 +318,9 @@ envm_write(u32 offset, void * buf, u32 size)
{
{
s32
ret
=
0
;
s32
ret
=
0
;
#if defined(CONFIG_STM32F7_DCACHE_ON) || defined(CONFIG_STM32F7_ICACHE_ON)
stm32f7_envm_as_dev
();
#endif
/* Basic sanity check. More checking in the "get_block" routine */
/* Basic sanity check. More checking in the "get_block" routine */
if
((
offset
<
STM32_FLASH_BASE
)
||
if
((
offset
<
STM32_FLASH_BASE
)
||
((
offset
+
size
)
>
(
STM32_FLASH_BASE
+
STM32_FLASH_SIZE
)))
{
((
offset
+
size
)
>
(
STM32_FLASH_BASE
+
STM32_FLASH_SIZE
)))
{
...
@@ -338,5 +336,8 @@ envm_write(u32 offset, void * buf, u32 size)
...
@@ -338,5 +336,8 @@ envm_write(u32 offset, void * buf, u32 size)
ret
=
size
;
ret
=
size
;
xit:
xit:
#if defined(CONFIG_STM32F7_DCACHE_ON) || defined(CONFIG_STM32F7_ICACHE_ON)
stm32f7_envm_as_dev
();
#endif
return
ret
;
return
ret
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment