Rename SCHED_CHANGE_PRI to better describe functionality.
[bertos.git] / bertos / cpu / arm / scripts / openocd / openocd-0.2.0_at91sam7_gdb.cfg
1 # Change the default telnet port...
2 telnet_port 4444
3
4 # Port for TCL connection.
5 tcl_port 6666
6
7 # GDB connects here
8 gdb_port 3333
9 gdb_memory_map enable
10
11 interface ft2232
12 ft2232_device_desc "Amontec JTAGkey"
13 ft2232_layout jtagkey
14 ft2232_vid_pid 0x0403 0xcff8
15
16
17 #use combined on interfaces or targets that can't set TRST/SRST separately
18 reset_config srst_only srst_pulls_trst
19
20 if { [info exists CHIPNAME] } { 
21    set  _CHIPNAME $CHIPNAME    
22 } else {         
23    set  _CHIPNAME sam7
24 }
25
26 if { [info exists ENDIAN] } {   
27    set  _ENDIAN $ENDIAN    
28 } else {         
29    set  _ENDIAN little
30 }
31
32 if { [info exists CPUTAPID ] } {
33    set _CPUTAPID $CPUTAPID
34 } else {
35    set _CPUTAPID 0x3f0f0f0f
36 }
37
38 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
39
40 set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
41 target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi
42
43 $_TARGETNAME configure -event reset-start {
44         # disable watchdog
45         mww 0xfffffd44 0x00008000       
46         # enable user reset
47         mww 0xfffffd08 0xa5000001       
48         # CKGR_MOR : enable the main oscillator
49         mww 0xfffffc20 0x00000601       
50         sleep 10
51         # CKGR_PLLR: 96.1097 MHz
52         mww 0xfffffc2c 0x00481c0e       
53         sleep 10
54         # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz
55         mww 0xfffffc30 0x00000007       
56         sleep 10
57         # MC_FMR: flash mode (FWS=1,FMCN=60)
58         mww 0xffffff60 0x003c0100       
59         sleep 10
60         # reset PC
61         reg pc 00000000
62 }
63
64 $_TARGETNAME configure -event gdb-detach {
65         shutdown
66 }
67
68 $_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x4000 -work-area-backup 0
69
70 #flash bank <driver> <base> <size> <chip_width> <bus_width>
71 flash bank at91sam7 0 0 0 0 0