2 # GDB Init script for the Coldfire 5272 processor.
4 # The main purpose of this script is to configure the
5 # DRAM controller so code can be loaded.
7 # This file was changed to suite the senTec COBRA5272 board.
12 set $mbar = 0x10000001
13 set $scr = $mbar - 1 + 0x004
14 set $spr = $mbar - 1 + 0x006
15 set $pmr = $mbar - 1 + 0x008
16 set $apmr = $mbar - 1 + 0x00e
17 set $dir = $mbar - 1 + 0x010
18 set $icr1 = $mbar - 1 + 0x020
19 set $icr2 = $mbar - 1 + 0x024
20 set $icr3 = $mbar - 1 + 0x028
21 set $icr4 = $mbar - 1 + 0x02c
22 set $isr = $mbar - 1 + 0x030
23 set $pitr = $mbar - 1 + 0x034
24 set $piwr = $mbar - 1 + 0x038
25 set $pivr = $mbar - 1 + 0x03f
26 set $csbr0 = $mbar - 1 + 0x040
27 set $csor0 = $mbar - 1 + 0x044
28 set $csbr1 = $mbar - 1 + 0x048
29 set $csor1 = $mbar - 1 + 0x04c
30 set $csbr2 = $mbar - 1 + 0x050
31 set $csor2 = $mbar - 1 + 0x054
32 set $csbr3 = $mbar - 1 + 0x058
33 set $csor3 = $mbar - 1 + 0x05c
34 set $csbr4 = $mbar - 1 + 0x060
35 set $csor4 = $mbar - 1 + 0x064
36 set $csbr5 = $mbar - 1 + 0x068
37 set $csor5 = $mbar - 1 + 0x06c
38 set $csbr6 = $mbar - 1 + 0x070
39 set $csor6 = $mbar - 1 + 0x074
40 set $csbr7 = $mbar - 1 + 0x078
41 set $csor7 = $mbar - 1 + 0x07c
42 set $pacnt = $mbar - 1 + 0x080
43 set $paddr = $mbar - 1 + 0x084
44 set $padat = $mbar - 1 + 0x086
45 set $pbcnt = $mbar - 1 + 0x088
46 set $pbddr = $mbar - 1 + 0x08c
47 set $pbdat = $mbar - 1 + 0x08e
48 set $pcddr = $mbar - 1 + 0x094
49 set $pcdat = $mbar - 1 + 0x096
50 set $pdcnt = $mbar - 1 + 0x098
51 set $sdcr = $mbar - 1 + 0x180
52 set $sdtr = $mbar - 1 + 0x184
53 set $wrrr = $mbar - 1 + 0x280
54 set $wirr = $mbar - 1 + 0x283
55 set $wcr = $mbar - 1 + 0x288
56 set $wer = $mbar - 1 + 0x28c
62 # Setup system configuration
65 set *((unsigned short *) $scr) = 0x0003
66 set *((unsigned short *) $spr) = 0xffff
67 set *((unsigned char *) $pivr) = 0x4f
72 # Setup Chip Selects (as per Motorola M5272C3 board)
77 set *((unsigned long *) $csbr0) = 0xffe00201
78 set *((unsigned long *) $csor0) = 0xffe00014
80 # CS1 -- external bus test
81 set *((unsigned long *) $csbr1) = 0x0
82 set *((unsigned long *) $csor1) = 0x0
84 # CS2 -- Optional FSRAM
85 set *((unsigned long *) $csbr2) = 0x30000001
86 set *((unsigned long *) $csor2) = 0xfff80000
89 set *((unsigned long *) $csbr3) = 0x0
90 set *((unsigned long *) $csor3) = 0x0
93 set *((unsigned long *) $csbr4) = 0x0
94 set *((unsigned long *) $csor4) = 0x0
97 set *((unsigned long *) $csbr5) = 0x0
98 set *((unsigned long *) $csor5) = 0x0
101 set *((unsigned long *) $csbr6) = 0x0
102 set *((unsigned long *) $csor6) = 0x0
105 set *((unsigned long *) $csbr7) = 0x00000701
106 set *((unsigned long *) $csor7) = 0xff00007c
112 # Setup the DRAM controller.
116 set *((unsigned long *) $sdtr) = 0x0000f539
117 set *((unsigned long *) $sdcr) = 0x00004211
119 # Dummy write to start SDRAM
120 set *((unsigned long *) 0) = 0
125 # Setup for GPIO pins
129 # PORT A -- the LED's
130 set *((unsigned long *) $pacnt) = 0x00000000
131 # lower 8 bits for output:
132 set *((unsigned short *) $paddr) = 0xff
134 set *((unsigned short *) $padat) = 0xff
137 set *((unsigned long *) $pbcnt) = 0x55554155
138 set *((unsigned short *) $pbddr) = 0x0000
139 set *((unsigned short *) $pbdat) = 0x17ea
142 #set *((unsigned short *) $pcddr) = 0x0000
143 #set *((unsigned short *) $pcdat) = 0x1898
146 set *((unsigned long *) $pdcnt) = 0x00000000
152 # Added for uClinux-coldfire target...
162 set print asm-demangle