This is an automated email from Gerrit.

"Shivasharan <shivasharan.nagali...@ti.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8769

-- gerrit

commit 0f5b6b5002094d4d2c78afc7f5fe1e601bcd7bc2
Author: Shivasharan Nagalikar <shivasharan.nagali...@ti.com>
Date:   Wed Feb 19 13:53:03 2025 +0530

    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.nagali...@ti.com>

diff --git a/tcl/target/ti_k3.cfg b/tcl/target/ti_k3.cfg
index 2ae0f75b80..8cecbe2611 100644
--- a/tcl/target/ti_k3.cfg
+++ b/tcl/target/ti_k3.cfg
@@ -77,6 +77,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 {
@@ -94,6 +100,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
@@ -499,3 +507,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"

-- 

Reply via email to