TCL/SPEAr: move device specific code
[fw/openocd] / tcl / chip / st / spear / spear310.tcl
1 # Specific init scripts for ST SPEAr310 system on chip
2 # http://www.st.com/spear
3 #
4 # Date:      2010-09-23
5 # Author:    Antonio Borneo <borneo.antonio@gmail.com>
6
7
8 proc sp310_init {} {
9         mww 0xfca80034 0x0000ffff       ;# enable all RAS clocks
10         mww 0xfca80040 0x00000000       ;# remove all RAS resets
11         mww 0xb4000008 0x00002ff4       ;# RAS function enable
12
13         mww 0xfca80050 0x00000001       ;# Enable clk mem port 1
14
15         mww 0xfca8013c 0x2f7bc210       ;# plgpio_pad_drv
16         mww 0xfca80140 0x017bdef6
17 }
18
19 proc sp310_emi_init {} {
20         # set EMI pad strength
21         mmw 0xfca80134 0x0e000000 0x00000000
22         mmw 0xfca80138 0x0e739ce7 0x00000000
23         mmw 0xfca8013c 0x00039ce7 0x00000000
24
25         # set safe EMI timing as in BootROM
26         #mww 0x4f000000 0x0000000f      ;# tAP_0_reg
27         #mww 0x4f000004 0x00000000      ;# tSDP_0_reg
28         #mww 0x4f000008 0x000000ff      ;# tDPw_0_reg
29         #mww 0x4f00000c 0x00000111      ;# tDPr_0_reg
30         #mww 0x4f000010 0x00000002      ;# tDCS_0_reg
31
32         # set fast EMI timing as in Linux
33         mww 0x4f000000 0x00000010       ;# tAP_0_reg
34         mww 0x4f000004 0x00000005       ;# tSDP_0_reg
35         mww 0x4f000008 0x0000000a       ;# tDPw_0_reg
36         mww 0x4f00000c 0x0000000a       ;# tDPr_0_reg
37         mww 0x4f000010 0x00000005       ;# tDCS_0_re
38
39         # 32bit wide, 8/16/32bit access
40         mww 0x4f000014 0x0000000e       ;# control_0_reg
41         mww 0x4f000094 0x0000003f       ;# ack_reg
42 }