summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Lima <joao.lima@hbkworld.com>2025-10-03 11:00:48 +0100
committerKhem Raj <raj.khem@gmail.com>2025-10-03 09:47:39 -0700
commit1103d2da8dca68f7bf6adb76cc1990eb058196d8 (patch)
tree945077d0da947955826be662e1d9b401f738e3d5
parent0a6e4464ec2cc42e49332cd0b315b3b784e3aa3a (diff)
downloadmeta-openembedded-1103d2da8dca68f7bf6adb76cc1990eb058196d8.tar.gz
openocd: add dmem support to am64xx and j784s4 platforms
Platform support patches: - Add SWD native configuration files for AM64x and J784s4 boards - Configure DMEM access parameters in ti_k3.cfg for direct memory operations - Set up DAPBUS debugger and emulated AP descriptions Signed-off-by: Joao Lima <joao.lima@hbkworld.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/openocd/openocd/0001-tcl-board-ti_-_swd_native.cfg-Add-support-for-direct.patch77
-rw-r--r--meta-oe/recipes-devtools/openocd/openocd/0002-tcl-target-ti_k3.cfg-Add-support-for-direct-memory-a.patch65
-rw-r--r--meta-oe/recipes-devtools/openocd/openocd_git.bb2
3 files changed, 144 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/openocd/openocd/0001-tcl-board-ti_-_swd_native.cfg-Add-support-for-direct.patch b/meta-oe/recipes-devtools/openocd/openocd/0001-tcl-board-ti_-_swd_native.cfg-Add-support-for-direct.patch
new file mode 100644
index 0000000000..8a3b72321f
--- /dev/null
+++ b/meta-oe/recipes-devtools/openocd/openocd/0001-tcl-board-ti_-_swd_native.cfg-Add-support-for-direct.patch
@@ -0,0 +1,77 @@
1From 5c55d79ecfecc4a1b5a5ebcf649227ca1e1bf38e Mon Sep 17 00:00:00 2001
2From: Joao Lima <joao.lima@hbkworld.com>
3Date: Tue, 30 Sep 2025 12:13:04 +0000
4Subject: [PATCH 1/2] tcl/board/ti_*_swd_native.cfg: Add support for direct
5 memory access via SW
6
7Add support for SWD emulation as a transport method for
8direct memory operations of boards TI AM64x and TI J784s4
9
10Upstream-Status: Submitted [http://openocd.zylin.com/#/c/9020/]
11
12Change-Id: I17fe9b2bef5c58886625bfdb88d92645ba4d7da7
13Signed-off-by: Joao Lima <joao.lima@hbkworld.com>
14---
15 tcl/board/ti_am64xx_swd_native.cfg | 23 +++++++++++++++++++++++
16 tcl/board/ti_j784s4_swd_native.cfg | 22 ++++++++++++++++++++++
17 2 files changed, 45 insertions(+)
18 create mode 100644 tcl/board/ti_am64xx_swd_native.cfg
19 create mode 100644 tcl/board/ti_j784s4_swd_native.cfg
20
21diff --git a/tcl/board/ti_am64xx_swd_native.cfg b/tcl/board/ti_am64xx_swd_native.cfg
22new file mode 100644
23index 000000000..d3727149e
24--- /dev/null
25+++ b/tcl/board/ti_am64xx_swd_native.cfg
26@@ -0,0 +1,23 @@
27+# SPDX-License-Identifier: GPL-2.0-or-later
28+# Copyright (C) 2022-2023 Texas Instruments Incorporated - http://www.ti.com/
29+#
30+# Texas Instruments am642
31+# Link: https://www.ti.com/product/AM642
32+#
33+# This configuration file is used as a self hosted debug configuration that
34+# works on every AM642 platform based on firewall configuration permitted
35+# in the system.
36+#
37+# In this system openOCD runs on one of the CPUs inside AM625 and provides
38+# network ports that can then be used to debug the microcontrollers on the
39+# SoC - either self hosted IDE OR remotely.
40+
41+# We are using dmem, which uses dapdirect_swd transport
42+adapter driver dmem
43+transport select swd
44+
45+if { ![info exists SOC] } {
46+ set SOC am642
47+}
48+
49+source [find target/ti_k3.cfg]
50diff --git a/tcl/board/ti_j784s4_swd_native.cfg b/tcl/board/ti_j784s4_swd_native.cfg
51new file mode 100644
52index 000000000..13b2ac3b8
53--- /dev/null
54+++ b/tcl/board/ti_j784s4_swd_native.cfg
55@@ -0,0 +1,22 @@
56+# SPDX-License-Identifier: GPL-2.0-or-later
57+# Copyright (C) 2022-2023 Texas Instruments Incorporated - http://www.ti.com/
58+#
59+# Texas Instruments TDA4VM/J721E
60+# Link: https://www.ti.com/product/TDA4VM
61+#
62+# This configuration file is used as a self hosted debug configuration that
63+# works on every TDA4VM platform based on firewall configuration permitted
64+# in the system.
65+#
66+# In this system openOCD runs on one of the CPUs inside TDA4VM and provides
67+# network ports that can then be used to debug the microcontrollers on the
68+# SoC - either self hosted IDE OR remotely.
69+
70+# We are using dmem, which uses dapdirect_swd transport
71+adapter driver dmem
72+transport select swd
73+
74+if { ![info exists SOC] } {
75+ set SOC j784s4
76+}
77+source [find target/ti_k3.cfg]
diff --git a/meta-oe/recipes-devtools/openocd/openocd/0002-tcl-target-ti_k3.cfg-Add-support-for-direct-memory-a.patch b/meta-oe/recipes-devtools/openocd/openocd/0002-tcl-target-ti_k3.cfg-Add-support-for-direct-memory-a.patch
new file mode 100644
index 0000000000..c879696ef5
--- /dev/null
+++ b/meta-oe/recipes-devtools/openocd/openocd/0002-tcl-target-ti_k3.cfg-Add-support-for-direct-memory-a.patch
@@ -0,0 +1,65 @@
1From 39bc4461642eaaf993d0a6cf772d51cdde8c0ae8 Mon Sep 17 00:00:00 2001
2From: Joao Lima <joao.lima@hbkworld.com>
3Date: Tue, 30 Sep 2025 12:13:30 +0000
4Subject: [PATCH 2/2] tcl/target/ti_k3.cfg: Add support for direct memory
5 access via SWD
6
7Adds support for direct memory access via SWD emulation for AM64x and
8J784s4 boards, configuring addresses and parameters required for
9direct memory operations.
10
11Upstream-Status: Submitted [http://openocd.zylin.com/#/c/9021/]
12
13Change-Id: Iebc16612b3990b2ef19ddc4143b66ab1bcbfe0f3
14Signed-off-by: Joao Lima <joao.lima@hbkworld.com>
15---
16 tcl/target/ti_k3.cfg | 22 +++++++++++++++++++++-
17 1 file changed, 21 insertions(+), 1 deletion(-)
18
19diff --git a/tcl/target/ti_k3.cfg b/tcl/target/ti_k3.cfg
20index 0dee74e5e..6b0ac2e52 100644
21--- a/tcl/target/ti_k3.cfg
22+++ b/tcl/target/ti_k3.cfg
23@@ -176,6 +176,16 @@ switch $_soc {
24 # Uses the same JTAG ID
25 set _armv8_cores 0
26 }
27+
28+ # Setup DMEM access descriptions
29+ # DAPBUS (Debugger) description
30+ set _dmem_base_address 0x740002000
31+ set _dmem_ap_address_offset 0x100
32+ set _dmem_max_aps 10
33+ # Emulated AP description
34+ set _dmem_emu_base_address 0x760000000
35+ set _dmem_emu_base_address_map_to 0x1d500000
36+ set _dmem_emu_ap_list 1
37 }
38 am625 {
39 set _K3_DAP_TAPID 0x0bb7e02f
40@@ -333,7 +343,7 @@ switch $_soc {
41 set ARMV8_CTIBASE {0x90420000 0x90520000 0x90620000 0x90720000
42 0x90820000 0x90920000 0x90a20000 0x90b20000}
43
44- # J721s2 has 4 clusters of 2 R5 cores each.
45+ # J784s4 has 4 clusters of 2 R5 cores each.
46 set _r5_cores 8
47 set R5_DBGBASE {0x9d010000 0x9d012000
48 0x9d410000 0x9d412000
49@@ -348,6 +358,16 @@ switch $_soc {
50 main1_r5.0 main1_r5.1
51 main2_r5.0 main2_r5.1}
52
53+ # Setup DMEM access descriptions
54+ # DAPBUS (Debugger) description
55+ set _dmem_base_address 0x4c40002000
56+ set _dmem_ap_address_offset 0x100
57+ set _dmem_max_aps 8
58+ # Emulated AP description
59+ set _dmem_emu_base_address 0x4c60000000
60+ set _dmem_emu_base_address_map_to 0x1d600000
61+ set _dmem_emu_ap_list 1
62+
63 # sysctrl CTI base
64 set CM3_CTIBASE {0x20001000}
65 # Sysctrl power-ap unlock offsets
diff --git a/meta-oe/recipes-devtools/openocd/openocd_git.bb b/meta-oe/recipes-devtools/openocd/openocd_git.bb
index 3b7705c41d..ce1389b060 100644
--- a/meta-oe/recipes-devtools/openocd/openocd_git.bb
+++ b/meta-oe/recipes-devtools/openocd/openocd_git.bb
@@ -10,6 +10,8 @@ SRC_URI = " \
10 git://github.com/msteveb/jimtcl.git;protocol=https;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/jimtcl;name=jimtcl;branch=master \ 10 git://github.com/msteveb/jimtcl.git;protocol=https;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/jimtcl;name=jimtcl;branch=master \
11 git://repo.or.cz/r/libjaylink.git;protocol=http;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/src/jtag/drivers/libjaylink;name=libjaylink;branch=master \ 11 git://repo.or.cz/r/libjaylink.git;protocol=http;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/src/jtag/drivers/libjaylink;name=libjaylink;branch=master \
12 file://0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch \ 12 file://0001-Makefile.am-Use-SOURCE_DATE_EPOCH-environment-variab.patch \
13 file://0001-tcl-board-ti_-_swd_native.cfg-Add-support-for-direct.patch \
14 file://0002-tcl-target-ti_k3.cfg-Add-support-for-direct-memory-a.patch \
13" 15"
14 16
15SRCREV_FORMAT = "openocd" 17SRCREV_FORMAT = "openocd"