From c76e30c8bc2c1c14c06b18e66fd211c64835dbe4 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Tue, 1 Aug 2023 00:02:36 +0000 Subject: [PATCH] tcl/target: add Realtek RTL872xD config Sufficient to probe both cores via multiple APs. No support listed for jtag in the datasheet or usermanual. Tested against a BW-16 board: https://www.amebaiot.com/en/amebad/#partner_bw16 Change-Id: Idf82085e7b7327fdf3d6d668e6fb59eff6e0431b Signed-off-by: Karl Palsson Reviewed-on: https://review.openocd.org/c/openocd/+/7847 Reviewed-by: Antonio Borneo Tested-by: jenkins --- tcl/target/rtl872xd.cfg | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tcl/target/rtl872xd.cfg diff --git a/tcl/target/rtl872xd.cfg b/tcl/target/rtl872xd.cfg new file mode 100644 index 000000000..65730e217 --- /dev/null +++ b/tcl/target/rtl872xd.cfg @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: GPL-2.0-or-later OR MIT +# Realtek RTL872xD (ARM Cortex-M33 + M23, wifi+bt dualband soc) + +# HLA does not support AP other than 0 +if { [using_hla] } { + echo "ERROR: HLA transport cannot work with this target." + shutdown +} + +source [find target/swj-dp.tcl] + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME rtl872xd +} + +if { [info exists CPUTAPID] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x6ba02477 +} + +swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID +dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu + +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME.km0 cortex_m -endian little -dap $_CHIPNAME.dap -ap-num 1 +target create $_TARGETNAME.km4 cortex_m -endian little -dap $_CHIPNAME.dap -ap-num 2 + +cortex_m reset_config sysresetreq + +adapter speed 1000