Skip to content
Snippets Groups Projects
Commit cc440ca1 authored by Edgar Grimberg's avatar Edgar Grimberg Committed by David Brownell
Browse files

tcl/str7x: Reset init unlocks the flash


For STR7x flash, the device cannot be queried for the protect status.
The solution is to remove the protection on reset init. The driver
also initialises the sector protect field to unprotected.

[dbrownell@users.sourceforge.net: line length shrinkage]

Signed-off-by: default avatarEdgar Grimberg <edgar.grimberg@zylin.com>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
parent 503f6139
Branches
No related tags found
No related merge requests found
...@@ -34,7 +34,14 @@ set _TARGETNAME $_CHIPNAME.cpu ...@@ -34,7 +34,14 @@ set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm7tdmi -endian little -chain-position 0 -variant arm7tdmi target create $_TARGETNAME arm7tdmi -endian little -chain-position 0 -variant arm7tdmi
$_TARGETNAME configure -event reset-start { jtag_khz 10 } $_TARGETNAME configure -event reset-start { jtag_khz 10 }
$_TARGETNAME configure -event reset-init { jtag_khz 3000 } $_TARGETNAME configure -event reset-init {
jtag_khz 3000
# Because the hardware cannot be interrogated for the protection state
# of sectors, initialize all the sectors to be unprotected. The initial
# state is reflected by the driver, too.
flash protect 0 0 last off
}
$_TARGETNAME configure -event gdb-flash-erase-start { $_TARGETNAME configure -event gdb-flash-erase-start {
flash protect 0 0 7 off flash protect 0 0 7 off
} }
......
...@@ -36,7 +36,15 @@ set _TARGETNAME $_CHIPNAME.cpu ...@@ -36,7 +36,15 @@ set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm7tdmi -endian little -chain-position 0 -variant arm7tdmi target create $_TARGETNAME arm7tdmi -endian little -chain-position 0 -variant arm7tdmi
$_TARGETNAME configure -event reset-start { jtag_khz 10 } $_TARGETNAME configure -event reset-start { jtag_khz 10 }
$_TARGETNAME configure -event reset-init { jtag_khz 3000 } $_TARGETNAME configure -event reset-init {
jtag_khz 3000
# Because the hardware cannot be interrogated for the protection state
# of sectors, initialize all the sectors to be unprotected. The initial
# state is reflected by the driver, too.
flash protect 0 0 last off
flash protect 1 0 last off
}
$_TARGETNAME configure -event gdb-flash-erase-start { $_TARGETNAME configure -event gdb-flash-erase-start {
flash protect 0 0 7 off flash protect 0 0 7 off
flash protect 1 0 1 off flash protect 1 0 1 off
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment