From: OpenOCD-Gerrit <ope...@us...> - 2014-06-28 09:30:04
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 6db70bc89b34b0e3e70358d3e58eefab9e7947c8 (commit) via f8a6a07149d88737f3d466e7ce620cc1f0874c6a (commit) from 36772a7ed0c31a99c721d1ea9131a8ecc56a263d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6db70bc89b34b0e3e70358d3e58eefab9e7947c8 Author: Paul Fertser <fer...@gm...> Date: Fri May 9 17:57:20 2014 +0400 drivers/cmsis_dap_usb: remove jtag reset hacks This should no longer be needed after tcl scripts are fixed to avoid calling jtag subcommands when jtag is not used. Barely tested with an frdm board. Change-Id: I75f02b088e6134562ae634417d97c48e377df6e9 Signed-off-by: Paul Fertser <fer...@gm...> Reviewed-on: http://openocd.zylin.com/2130 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <and...@gm...> diff --git a/src/jtag/drivers/cmsis_dap_usb.c b/src/jtag/drivers/cmsis_dap_usb.c index 6276595..8c81523 100644 --- a/src/jtag/drivers/cmsis_dap_usb.c +++ b/src/jtag/drivers/cmsis_dap_usb.c @@ -975,73 +975,6 @@ static const struct command_registration cmsis_dap_subcommand_handlers[] = { COMMAND_REGISTRATION_DONE }; -COMMAND_HANDLER(cmsis_dap_reset_command) -{ - LOG_DEBUG("cmsis_dap_reset_command"); - return ERROR_OK; -} - -COMMAND_HANDLER(cmsis_dap_jtag_command) -{ - LOG_DEBUG("cmsis_dap_jtag_command"); - return ERROR_OK; -} - -static const struct command_registration cmsis_dap_jtag_subcommand_handlers[] = { - { - .name = "init", - .mode = COMMAND_ANY, - .handler = cmsis_dap_jtag_command, - .usage = "" - }, - { - .name = "arp_init", - .mode = COMMAND_ANY, - .handler = cmsis_dap_jtag_command, - .usage = "" - }, - { - .name = "arp_init-reset", - .mode = COMMAND_ANY, - .handler = cmsis_dap_reset_command, - .usage = "" - }, - { - .name = "tapisenabled", - .mode = COMMAND_EXEC, - .jim_handler = jim_jtag_tap_enabler, - }, - { - .name = "tapenable", - .mode = COMMAND_EXEC, - .jim_handler = jim_jtag_tap_enabler, - }, - { - .name = "tapdisable", - .mode = COMMAND_EXEC, - .handler = cmsis_dap_jtag_command, - .usage = "", - }, - { - .name = "configure", - .mode = COMMAND_EXEC, - .handler = cmsis_dap_jtag_command, - .usage = "", - }, - { - .name = "cget", - .mode = COMMAND_EXEC, - .jim_handler = jim_jtag_configure, - }, - { - .name = "names", - .mode = COMMAND_ANY, - .handler = cmsis_dap_jtag_command, - .usage = "", - }, - COMMAND_REGISTRATION_DONE -}; - static const struct command_registration cmsis_dap_command_handlers[] = { { .name = "cmsis-dap", @@ -1057,14 +990,6 @@ static const struct command_registration cmsis_dap_command_handlers[] = { .help = "the vendor ID and product ID of the CMSIS-DAP device", .usage = "(vid pid)* ", }, - { - /* this is currently a nasty hack so we get - * reset working with non jtag interfaces */ - .name = "jtag", - .mode = COMMAND_ANY, - .usage = "", - .chain = cmsis_dap_jtag_subcommand_handlers, - }, COMMAND_REGISTRATION_DONE }; commit f8a6a07149d88737f3d466e7ce620cc1f0874c6a Author: Paul Fertser <fer...@gm...> Date: Sat Mar 1 22:40:54 2014 +0400 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 <fer...@gm...> Reviewed-on: http://openocd.zylin.com/2003 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <and...@gm...> diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 4153118..94590e1 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -21,7 +21,9 @@ proc jtag_init {} { # startup (at OpenOCD server startup, when JTAG may not yet work); and # potentially more (for reset types like cold, warm, etc) proc init_reset { mode } { - jtag arp_init-reset + if {[using_jtag]} { + jtag arp_init-reset + } } ######### diff --git a/src/target/startup.tcl b/src/target/startup.tcl index 033e9c9..cf2813b 100644 --- a/src/target/startup.tcl +++ b/src/target/startup.tcl @@ -63,7 +63,7 @@ proc ocd_process_reset_inner { MODE } { # Examine all targets on enabled taps. foreach t $targets { - if {[jtag tapisenabled [$t cget -chain-position]]} { + if {![using_jtag] || [jtag tapisenabled [$t cget -chain-position]]} { $t invoke-event examine-start set err [catch "$t arp_examine"] if { $err == 0 } { @@ -79,7 +79,7 @@ proc ocd_process_reset_inner { MODE } { } foreach t $targets { # C code needs to know if we expect to 'halt' - if {[jtag tapisenabled [$t cget -chain-position]]} { + if {![using_jtag] || [jtag tapisenabled [$t cget -chain-position]]} { $t arp_reset assert $halt } } @@ -94,7 +94,7 @@ proc ocd_process_reset_inner { MODE } { } foreach t $targets { # Again, de-assert code needs to know if we 'halt' - if {[jtag tapisenabled [$t cget -chain-position]]} { + if {![using_jtag] || [jtag tapisenabled [$t cget -chain-position]]} { $t arp_reset deassert $halt } } @@ -107,7 +107,7 @@ proc ocd_process_reset_inner { MODE } { # first executing any instructions. if { $halt } { foreach t $targets { - if {[jtag tapisenabled [$t cget -chain-position]] == 0} { + if {[using_jtag] && ![jtag tapisenabled [$t cget -chain-position]]} { continue } @@ -131,7 +131,7 @@ proc ocd_process_reset_inner { MODE } { #Pass 2 - if needed "init" if { 0 == [string compare init $MODE] } { foreach t $targets { - if {[jtag tapisenabled [$t cget -chain-position]] == 0} { + if {[using_jtag] && ![jtag tapisenabled [$t cget -chain-position]]} { continue } @@ -148,6 +148,21 @@ proc ocd_process_reset_inner { MODE } { } } +proc using_jtag {} { + set _TRANSPORT [ transport select ] + expr { [ string first "jtag" $_TRANSPORT ] != -1 } +} + +proc using_swd {} { + set _TRANSPORT [ transport select ] + expr { [ string first "swd" $_TRANSPORT ] != -1 } +} + +proc using_hla {} { + set _TRANSPORT [ transport select ] + expr { [ string first "hla" $_TRANSPORT ] != -1 } +} + ######### # Temporary migration aid. May be removed starting in January 2011. diff --git "a/tcl/target/1986\320\262\320\2651\321\202.cfg" "b/tcl/target/1986\320\262\320\2651\321\202.cfg" index 0338297..c76a211 100644 --- "a/tcl/target/1986\320\262\320\2651\321\202.cfg" +++ "b/tcl/target/1986\320\262\320\2651\321\202.cfg" @@ -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 } diff --git a/tcl/target/at91sam3XXX.cfg b/tcl/target/at91sam3XXX.cfg index f36475b..caadc53 100644 --- a/tcl/target/at91sam3XXX.cfg +++ b/tcl/target/at91sam3XXX.cfg @@ -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 } diff --git a/tcl/target/at91sam4XXX.cfg b/tcl/target/at91sam4XXX.cfg index cc2941a..1570114 100644 --- a/tcl/target/at91sam4XXX.cfg +++ b/tcl/target/at91sam4XXX.cfg @@ -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 } diff --git a/tcl/target/lpc17xx.cfg b/tcl/target/lpc17xx.cfg index 372107f..266cecb 100644 --- a/tcl/target/lpc17xx.cfg +++ b/tcl/target/lpc17xx.cfg @@ -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 } diff --git a/tcl/target/mdr32f9q2i.cfg b/tcl/target/mdr32f9q2i.cfg index 8e8262d..961451e 100644 --- a/tcl/target/mdr32f9q2i.cfg +++ b/tcl/target/mdr32f9q2i.cfg @@ -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 } diff --git a/tcl/target/stm32f1x.cfg b/tcl/target/stm32f1x.cfg index f32654a..c89a5b5 100644 --- a/tcl/target/stm32f1x.cfg +++ b/tcl/target/stm32f1x.cfg @@ -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 } diff --git a/tcl/target/stm32f2x.cfg b/tcl/target/stm32f2x.cfg index 5022ef7..4e43f0a 100644 --- a/tcl/target/stm32f2x.cfg +++ b/tcl/target/stm32f2x.cfg @@ -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 } diff --git a/tcl/target/stm32f3x.cfg b/tcl/target/stm32f3x.cfg index 3d68c4b..ec5941b 100644 --- a/tcl/target/stm32f3x.cfg +++ b/tcl/target/stm32f3x.cfg @@ -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 } diff --git a/tcl/target/stm32f4x.cfg b/tcl/target/stm32f4x.cfg index feca77c..30ec686 100644 --- a/tcl/target/stm32f4x.cfg +++ b/tcl/target/stm32f4x.cfg @@ -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 } diff --git a/tcl/target/stm32l.cfg b/tcl/target/stm32l.cfg index f9f7425..5d6a53e 100644 --- a/tcl/target/stm32l.cfg +++ b/tcl/target/stm32l.cfg @@ -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 } diff --git a/tcl/target/stm32w108xx.cfg b/tcl/target/stm32w108xx.cfg index 4bc51fc..faea0d8 100644 --- a/tcl/target/stm32w108xx.cfg +++ b/tcl/target/stm32w108xx.cfg @@ -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 diff --git a/tcl/target/swj-dp.tcl b/tcl/target/swj-dp.tcl index fa44583..bd348e6 100644 --- a/tcl/target/swj-dp.tcl +++ b/tcl/target/swj-dp.tcl @@ -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 } } ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/cmsis_dap_usb.c | 75 ------------------------ src/jtag/startup.tcl | 4 +- src/target/startup.tcl | 25 ++++++-- "tcl/target/1986\320\262\320\2651\321\202.cfg" | 2 +- tcl/target/at91sam3XXX.cfg | 2 +- tcl/target/at91sam4XXX.cfg | 2 +- tcl/target/lpc17xx.cfg | 2 +- tcl/target/mdr32f9q2i.cfg | 2 +- tcl/target/stm32f1x.cfg | 4 +- tcl/target/stm32f2x.cfg | 4 +- tcl/target/stm32f3x.cfg | 4 +- tcl/target/stm32f4x.cfg | 4 +- tcl/target/stm32l.cfg | 4 +- tcl/target/stm32w108xx.cfg | 2 +- tcl/target/swj-dp.tcl | 11 +--- 15 files changed, 42 insertions(+), 105 deletions(-) hooks/post-receive -- Main OpenOCD repository |