This is an automated email from Gerrit.

Jiri Kastner (cz172...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/5877

-- gerrit

commit 9a50f3c54a7ebdf79ab31def5173c4a6f70c958d
Author: Lubomir Rintel <lkund...@v3.sk>
Date:   Mon Oct 19 11:22:04 2020 +0200

    target/jz4730: add reboot support
    
    This adds a routine that allows rebooting the machine using the
    watchdog timer.
    
    Change-Id: I2ad3dd787b7322d505c776ca5afc144f9b5e251c
    Signed-off-by: Lubomir Rintel <lkund...@v3.sk>
    Signed-off-by: Jiri Kastner <cz172...@gmail.com>

diff --git a/tcl/target/jz4730.cfg b/tcl/target/jz4730.cfg
index e64374a..bc47808 100644
--- a/tcl/target/jz4730.cfg
+++ b/tcl/target/jz4730.cfg
@@ -1,5 +1,9 @@
 # Ingenic JZ4730 (XBurst MIPS32r1-compatibe core)
 
+set  WDT_BASE_ADDR              0xb0004000
+set  WDT_WTCSR                  [expr   $WDT_BASE_ADDR  + 0x00]
+set  WDT_WTCNT                  [expr   $WDT_BASE_ADDR  + 0x04]
+
 if { [info exists CHIPNAME] } {
        set _CHIPNAME $CHIPNAME
 } else {
@@ -17,3 +21,14 @@ jtag newtap $_CHIPNAME cpu -irlen 5 -ircapture 0x1 -irmask 
0x1f -expected-id $_C
 set _TARGETNAME $_CHIPNAME.cpu
 target create $_TARGETNAME mips_m4k -endian little -chain-position $_TARGETNAME
 $_TARGETNAME mips_m4k xburst_btb
+
+proc reboot { } {
+       global WDT_WTCNT
+       global WDT_WTCSR
+
+       # Make it overflow in 32 ticks
+       mww phys $WDT_WTCNT                     0xffffffdf
+
+       # Start it
+       mwb phys $WDT_WTCSR                     0x10
+}

-- 


_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to