From 2374db956b0fb280c98653c0af9551ba69b5c7d5 Mon Sep 17 00:00:00 2001 From: Tomas Vanek Date: Tue, 3 Feb 2026 21:03:38 +0100 Subject: [PATCH] tcl/target/at91samd, atsame5x: drop swj on swd only targets Historically swj_newdap was necessary to handle HLA properly. Since commit 60f104f45013 ("hla_transport: split command registration per transport") there is no point in using swj_newdap on SWD only devices. No board files referring these targets select swd transport. While on it remove useless endianness option handling. Change-Id: I3b47750cc69fc9009fdd4cfdccfc213792d1b7ee Signed-off-by: Tomas Vanek Reviewed-on: https://review.openocd.org/c/openocd/+/9433 Reviewed-by: Antonio Borneo Tested-by: jenkins --- tcl/target/at91samdXX.cfg | 12 +++--------- tcl/target/atsame5x.cfg | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/tcl/target/at91samdXX.cfg b/tcl/target/at91samdXX.cfg index 5132109ba..893854309 100644 --- a/tcl/target/at91samdXX.cfg +++ b/tcl/target/at91samdXX.cfg @@ -7,7 +7,7 @@ # # samdXX devices only support SWD transports. # -source [find target/swj-dp.tcl] +transport select swd if { [info exists CHIPNAME] } { set _CHIPNAME $CHIPNAME @@ -15,12 +15,6 @@ if { [info exists CHIPNAME] } { set _CHIPNAME at91samd } -if { [info exists ENDIAN] } { - set _ENDIAN $ENDIAN -} else { - set _ENDIAN little -} - # Work-area is a space in RAM used for flash programming # By default use 2kB if { [info exists WORKAREASIZE] } { @@ -35,11 +29,11 @@ if { [info exists CPUTAPID] } { set _CPUTAPID 0x4ba00477 } -swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID +swd newdap $_CHIPNAME cpu -expected-id $_CPUTAPID dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap +target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 diff --git a/tcl/target/atsame5x.cfg b/tcl/target/atsame5x.cfg index 5093d41b0..0f759a242 100644 --- a/tcl/target/atsame5x.cfg +++ b/tcl/target/atsame5x.cfg @@ -8,7 +8,7 @@ # # Devices only support SWD transports. # -source [find target/swj-dp.tcl] +transport select swd if { [info exists CHIPNAME] } { set _CHIPNAME $CHIPNAME @@ -16,12 +16,6 @@ if { [info exists CHIPNAME] } { set _CHIPNAME atsame5 } -if { [info exists ENDIAN] } { - set _ENDIAN $ENDIAN -} else { - set _ENDIAN little -} - # Work-area is a space in RAM used for flash programming # By default use 32kB (the smallest RAM size is 128kB) if { [info exists WORKAREASIZE] } { @@ -36,11 +30,11 @@ if { [info exists CPUTAPID] } { set _CPUTAPID 0x4ba00477 } -swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID +swd newdap $_CHIPNAME cpu -expected-id $_CPUTAPID dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap +target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0