tcl/target/ti_k3: Add support for system reset using powerAP

TI K3 Debug systems have a Power Access Port (Power-AP) which allows
for functionality such as reset via debugger that using the SPREC
register. SoCs/Boards that do not have support for SRST or TRST can
make use of this to force a system reset via debug access.

Change-Id: Ic5f9cc7f7fba77b353b0c0b42d8afc02502251a0
Signed-off-by: Shivasharan Nagalikar <shivasharan.nagalikar@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8769
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Shivasharan Nagalikar
2025-02-19 13:53:03 +05:30
committed by Antonio Borneo
parent a8555b0b6d
commit a2c3c791ad
+15
View File
@@ -79,6 +79,12 @@ set _gp_mcu_ap_unlock_offsets {0xf0 0x60}
# Generic mem-ap port number
set _mem_ap_num 2
# Generic AP_SEL PWR Register number
set _power_ap_num 3
# Generic SPREC RESET BANK and Field number
set _powerap_sprec_reset 0xf0
# Set configuration overrides for each SOC
switch $_soc {
am263 {
@@ -96,6 +102,8 @@ switch $_soc {
set R5_DBGBASE {0x90030000 0x90032000 0x90050000 0x90052000}
set R5_CTIBASE {0x90038000 0x90039000 0x90058000 0x90059000}
set _r5_ap_num 5
set _power_ap_num 7
}
am273 {
set _K3_DAP_TAPID 0x1bb6a02f
@@ -513,3 +521,10 @@ if { 0 == [string compare [adapter name] dmem ] } {
# AXI AP access port for SoC address map
target create $_CHIPNAME.axi_ap mem_ap -dap $_CHIPNAME.dap -ap-num $_mem_ap_num
}
# Reset system using (Debug Reset) SPREC Register,SYSTEMRESET bit field via apreg
proc dbg_sys_reset {} {
$::_CHIPNAME.dap apreg $::_power_ap_num $::_powerap_sprec_reset 0x1
}
add_help_text dbg_sys_reset "Debugger initiated system reset attempt via Power-AP"