tcl: add SPDX tag
[fw/openocd] / tcl / chip / st / spear / spear3xx.tcl
index ce9e0cacd032b1fce1e5eb585166da556f6339e2..474ebe316f57ae12dba1ebc2fb5ffbd0d97fc12e 100644 (file)
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
 # Generic init scripts for all ST SPEAr3xx family
 # http://www.st.com/spear
 #
@@ -19,7 +21,7 @@ proc sp3xx_clock_default {} {
        mww 0xfca00014 0x0ffffff8       ;# set pll timeout to minimum (100us ?!?)
 
        # DDRCORE disable to change frequency
-       set val [expr ([mrw 0xfca8002c] & ~0x20000000) | 0x40000000]
+       set val [expr {([mrw 0xfca8002c] & ~0x20000000) | 0x40000000}]
        mww 0xfca8002c $val
        mww 0xfca8002c $val ;# Yes, write twice!
 
@@ -29,7 +31,7 @@ proc sp3xx_clock_default {} {
        mww 0xfca80008 0x00001c0e       ;# enable
        mww 0xfca80008 0x00001c06       ;# strobe
        mww 0xfca80008 0x00001c0e
-       while { [expr [mrw 0xfca80008] & 0x01] == 0x00 } { sleep 1 }
+       while { [expr {[mrw 0xfca80008] & 0x01}] == 0x00 } { sleep 1 }
 
        # programming PLL2
        mww 0xfca80018 0xa600010c       ;# M=166, P=1, N=12
@@ -37,13 +39,13 @@ proc sp3xx_clock_default {} {
        mww 0xfca80014 0x00001c0e       ;# enable
        mww 0xfca80014 0x00001c06       ;# strobe
        mww 0xfca80014 0x00001c0e
-       while { [expr [mrw 0xfca80014] & 0x01] == 0x00 } { sleep 1 }
+       while { [expr {[mrw 0xfca80014] & 0x01}] == 0x00 } { sleep 1 }
 
        mww 0xfca80028 0x00000082       ;# enable plltimeen
        mww 0xfca80024 0x00000511       ;# set hclkdiv="/2" & pclkdiv="/2"
 
        mww 0xfca00000 0x00000004       ;# setting SYSCTL to NORMAL mode
-       while { [expr [mrw 0xfca00000] & 0x20] != 0x20 } { sleep 1 }
+       while { [expr {[mrw 0xfca00000] & 0x20}] != 0x20 } { sleep 1 }
 
        # Select source of DDR clock
        #mmw 0xfca80020 0x10000000 0x70000000 ;# PLL1
@@ -120,3 +122,10 @@ proc sp310_emi_init {} {
        mww 0x4f000014 0x0000000e       ;# control_0_reg
        mww 0x4f000094 0x0000003f       ;# ack_reg
 }
+
+
+# Specific init scripts for ST SPEAr320
+proc sp320_init {} {
+       mww 0xb300000c 0xffffac04       ;# RAS function enable
+       mww 0xb3000010 0x00000001       ;# RAS mode select
+}