tcl: introduce using_(jtag|swd|hla) helpers and use them in reset handler
Barely tested with plain SWD transport. Change-Id: I48b59136bf4294ffed737dba01f1b30ef83aa86b Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2003 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
committed by
Andreas Fritiofson
parent
36772a7ed0
commit
f8a6a07149
@@ -48,7 +48,7 @@ if { [info exists IMEMORY] && [string equal $IMEMORY true] } {
|
||||
adapter_khz 1000
|
||||
|
||||
adapter_nsrst_delay 100
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 100
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ $_TARGETNAME configure -event gdb-flash-erase-start {
|
||||
adapter_khz 500
|
||||
|
||||
adapter_nsrst_delay 100
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 100
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ $_TARGETNAME configure -event gdb-flash-erase-start {
|
||||
adapter_khz 500
|
||||
|
||||
adapter_nsrst_delay 100
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 100
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ adapter_khz 10
|
||||
|
||||
# delays on reset lines
|
||||
adapter_nsrst_delay 200
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 200
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ if { [info exists IMEMORY] && [string equal $IMEMORY true] } {
|
||||
adapter_khz 1000
|
||||
|
||||
adapter_nsrst_delay 100
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 100
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ if { [info exists BSTAPID] } {
|
||||
set _BSTAPID9 0x06428041
|
||||
}
|
||||
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID1 \
|
||||
-expected-id $_BSTAPID2 -expected-id $_BSTAPID3 \
|
||||
-expected-id $_BSTAPID4 -expected-id $_BSTAPID5 \
|
||||
@@ -82,7 +82,7 @@ flash bank $_FLASHNAME stm32f1x 0x08000000 0 0 0 $_TARGETNAME
|
||||
adapter_khz 1000
|
||||
|
||||
adapter_nsrst_delay 100
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 100
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ if { [info exists WORKAREASIZE] } {
|
||||
adapter_khz 1000
|
||||
|
||||
adapter_nsrst_delay 100
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 100
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ if { [info exists BSTAPID] } {
|
||||
set _BSTAPID 0x06411041
|
||||
}
|
||||
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ if { [info exists WORKAREASIZE] } {
|
||||
adapter_khz 1000
|
||||
|
||||
adapter_nsrst_delay 100
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 100
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ if { [info exists BSTAPID] } {
|
||||
set _BSTAPID2 0x06432041
|
||||
}
|
||||
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID1 -expected-id $_BSTAPID2
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ if { [info exists BSTAPID] } {
|
||||
set _BSTAPID2 0x06419041
|
||||
}
|
||||
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID1 \
|
||||
-expected-id $_BSTAPID2
|
||||
}
|
||||
@@ -69,7 +69,7 @@ flash bank $_FLASHNAME stm32f2x 0 0 0 0 $_TARGETNAME
|
||||
adapter_khz 1000
|
||||
|
||||
adapter_nsrst_delay 100
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 100
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ if { [info exists WORKAREASIZE] } {
|
||||
adapter_khz 100
|
||||
|
||||
adapter_nsrst_delay 100
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag_ntrst_delay 100
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ if { [info exists BSTAPID] } {
|
||||
set _BSTAPID 0x06416041
|
||||
}
|
||||
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ if { [info exists ENDIAN] } {
|
||||
|
||||
swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
|
||||
|
||||
if {$using_jtag} {
|
||||
if {[using_jtag]} {
|
||||
if { [info exists BSTAPID] } {
|
||||
set _BSTAPID $BSTAPID
|
||||
jtag newtap $_CHIPNAME bs -irlen 4 -ircapture 0xe -irmask 0xf -expected-id 0x269a862b
|
||||
|
||||
@@ -18,13 +18,8 @@
|
||||
# split out "chip" and "tag" so we can someday handle
|
||||
# them more uniformly irlen too...)
|
||||
|
||||
global using_jtag
|
||||
set using_jtag 1
|
||||
|
||||
proc swj_newdap {chip tag args} {
|
||||
global using_jtag
|
||||
set tran [transport select]
|
||||
if [string equal $tran "jtag"] { eval jtag newtap $chip $tag $args; set using_jtag 1 }
|
||||
if [string equal $tran "swd"] { eval swd newdap $chip $tag $args; set using_jtag 0 }
|
||||
if [string equal $tran "cmsis-dap"] { eval cmsis-dap newdap $chip $tag $args; set using_jtag 0 }
|
||||
if {[using_jtag]} { eval jtag newtap $chip $tag $args }
|
||||
if {[using_swd]} { eval swd newdap $chip $tag $args }
|
||||
if {[string equal [transport select] "cmsis-dap"]} { eval cmsis-dap newdap $chip $tag $args }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user