]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
tcl/target/ti_k3: Add support for system reset using powerAP
authorShivasharan Nagalikar <shivasharan.nagalikar@ti.com>
Wed, 19 Feb 2025 08:23:03 +0000 (13:53 +0530)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 15 Mar 2025 10:14:58 +0000 (10:14 +0000)
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>
tcl/target/ti_k3.cfg

index b033ca9783f01309aa7c307d79275f693c981eb7..dbf8962cbf829eb33c39038634818758ca11cbf0 100644 (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"