tcl/target: add SPDX tag
[fw/openocd] / tcl / target / u8500.cfg
index 7d8bfe3757e4a21965c742c517d695f96b78c115..417fdd18f2d7fed3f269d4e7487380a80f92606e 100644 (file)
@@ -1,16 +1,18 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
 #  Copyright (C) ST-Ericsson SA 2011
 #  Author : michel.jaouen@stericsson.com
-#  U8500 target 
+#  U8500 target
 
 proc mmu_off {} {
        set cp [arm mrc 15 0 1 0 0]
-       set cp [expr ($cp & ~1)]
+       set cp [expr {$cp & ~1}]
        arm mcr 15 0 1 0 0 $cp
 }
 
 proc mmu_on {} {
        set cp [arm mrc 15 0 1 0 0]
-       set cp [expr ($cp | 1)]
+       set cp [expr {$cp | 1}]
        arm mcr 15 0 1 0 0 $cp
 }
 
@@ -18,20 +20,20 @@ proc ocd_gdb_restart {target_id} {
     global _TARGETNAME_1
        global _SMP
     targets $_TARGETNAME_1
-       if { [expr ($_SMP == 1)] } {
-       cortex_a smp_off
+       if { $_SMP == 1 } {
+       cortex_a smp off
        }
        rst_run
        halt
-       if { [expr ($_SMP == 1)]} {
-       cortex_a smp_on
+       if { $_SMP == 1 } {
+       cortex_a smp on
        }
 }
 
 proc smp_reg {} {
        global _TARGETNAME_1
     global _TARGETNAME_2
-    targets $_TARGETNAME_1 
+    targets $_TARGETNAME_1
        echo "$_TARGETNAME_1"
        set pc1 [reg pc]
        set stck1 [reg sp_svc]
@@ -52,9 +54,9 @@ proc pwrsts { } {
        irscan $_CHIPNAME.jrc 0x3a
        drscan $_CHIPNAME.jrc 4 0
        set pwrsts [drscan $_CHIPNAME.jrc 16 0]
-    echo "pwrsts ="$pwrsts
-    set a9 [expr (0x$pwrsts & 0xc)]
-       set ape [expr (0x$pwrsts & 0x3)]
+       echo "pwrsts ="$pwrsts
+       set a9 [expr "0x$pwrsts & 0xc"]
+       set ape [expr "0x$pwrsts & 0x3"]
        if {[string equal "0" $ape]} {
                echo "ape off"
        } else {
@@ -68,7 +70,7 @@ proc pwrsts { } {
                8 {
                        echo "A9 100% DVFS"
                  }
-               c { 
+               c {
                        echo "A9 50% DVFS"
                }
        }
@@ -81,12 +83,12 @@ proc poll_pwrsts { } {
        irscan $_CHIPNAME.jrc 0x3a
        drscan $_CHIPNAME.jrc 4 0
        set pwrsts [drscan $_CHIPNAME.jrc 16 0]
-       set pwrsts [expr (0x$pwrsts & 0xc)]
+       set pwrsts [expr "0x$pwrsts & 0xc"]
        while {[string equal "4" $pwrsts] && $i<20} {
                irscan $_CHIPNAME.jrc 0x3a
                drscan $_CHIPNAME.jrc 4 0;
                set pwrsts [drscan $_CHIPNAME.jrc 16 0]
-               set pwrsts [expr (0x$pwrsts & 0xc)]
+               set pwrsts [expr "0x$pwrsts & 0xc"]
                if {![string equal "4" $pwrsts]} {
                        set result 1
                } else {
@@ -144,7 +146,7 @@ tcl_port 5555
 telnet_port 4444
 gdb_port 3333
 
-if { [info exists CHIPNAME] } {        
+if { [info exists CHIPNAME] } {
 global _CHIPNAME
     set _CHIPNAME $CHIPNAME
 } else {
@@ -194,22 +196,18 @@ set _TARGETNAME_1 $TARGETNAME_1
 if { [info exists DAP_DBG1] } {
        set _DAP_DBG1 $DAP_DBG1
 } else {
-       set _DAP_DBG1 0x801A8000 
+       set _DAP_DBG1 0x801A8000
 }
 if { [info exists DAP_DBG2] } {
        set _DAP_DBG2 $DAP_DBG2
 } else {
-       set _DAP_DBG2 0x801AA000 
+       set _DAP_DBG2 0x801AA000
 }
 
 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
 
 target create $_TARGETNAME_1 cortex_a -dap $_CHIPNAME.dap -dbgbase $_DAP_DBG1 -coreid 0 -rtos linux
 
-$_TARGETNAME_1 configure -event gdb-attach {
-       halt
-}
-
 
 if { ![info exists TARGETNAME_2] } {
 global _TARGETNAME_2
@@ -221,10 +219,6 @@ set _TARGETNAME_2 $TARGETNAME_2
 
 target create $_TARGETNAME_2 cortex_a -dap $_CHIPNAME.dap -dbgbase $_DAP_DBG2 -coreid 1 -rtos linux
 
-$_TARGETNAME_2 configure -event gdb-attach {
-       halt
-}
-
 
 if {![info exists SMP]} {
 global _SMP
@@ -234,7 +228,7 @@ global _SMP
 set _SMP $SMP
 }
 global SMP
-if { $_SMP == 1} { 
+if { $_SMP == 1} {
 target smp $_CHIPNAME.cpu2 $_CHIPNAME.cpu1
 }
 
@@ -247,7 +241,7 @@ proc secsts1 { } {
                drscan $_CHIPNAME.jrc 4 4
        set secsts1 [drscan $_CHIPNAME.jrc 16 0]
        echo "secsts1 ="$secsts1
-       set secsts1 [expr (0x$secsts1 & 0x4)]
+       set secsts1 [expr "0x$secsts1 & 0x4"]
        if {![string equal "4" $secsts1]} {
        echo "APE target secured"
         } else {
@@ -262,7 +256,7 @@ proc att { } {
        drscan $_CHIPNAME.jrc 4 4
        set secsts1 [drscan $_CHIPNAME.jrc 16 0]
        echo "secsts1 ="$secsts1
-       set secsts1 [expr (0x$secsts1 & 0x4)]
+       set secsts1 [expr "0x$secsts1 & 0x4"]
        if {[string equal "4" $secsts1]} {
                if {[poll_pwrsts]==1} {
                enable_apetap
@@ -272,7 +266,7 @@ proc att { } {
        } else {
                echo "target secured"
        }
-       
+
 }
 
 
@@ -299,13 +293,13 @@ proc rst_run { } {
        drscan $_CHIPNAME.jrc 4 4
        set secsts1 [drscan $_CHIPNAME.jrc 16 0]
        echo "secsts1 ="$secsts1
-       set secsts1 [expr (0x$secsts1 & 0x4)]
+       set secsts1 [expr "0x$secsts1 & 0x4"]
        while {![string equal "4" $secsts1]} {
                irscan u8500.jrc 0x3a
                drscan u8500.jrc 4 4
                set secsts1 [drscan $_CHIPNAME.jrc 16 0]
                echo "secsts1 ="$secsts1
-               set secsts1 [expr (0x$secsts1 & 0x4)]
+               set secsts1 [expr "0x$secsts1 & 0x4"]
        }
        echo "ape debugable"
        enable_apetap
@@ -318,11 +312,11 @@ if {![info exists MAXSPEED]} {
 global _MAXSPEED
 set _MAXSPEED 15000
 } else {
-global _MAXSPEED 
+global _MAXSPEED
 set _MAXSPEED $MAXSPEED
 }
-global _MAXSPEED 
-adapter_khz $_MAXSPEED
+global _MAXSPEED
+adapter speed $_MAXSPEED
 
 
 gdb_breakpoint_override hard
@@ -330,5 +324,3 @@ set mem inaccessible-by-default-off
 
 jtag_ntrst_delay 100
 reset_config trst_and_srst combined
-
-