blob: 61e778ea5f5d4379fb5b84b2de444f8243145725 [file] [log] [blame]
wdenka562e1b2005-01-09 18:21:42 +00001#
2# GDB Init script for the Coldfire 5272 processor.
3#
Wolfgang Denk93e14592013-10-04 17:43:24 +02004# The main purpose of this script is to configure the
wdenka562e1b2005-01-09 18:21:42 +00005# DRAM controller so code can be loaded.
6#
7# This file was changed to suite the senTec COBRA5272 board.
Wolfgang Denk93e14592013-10-04 17:43:24 +02008#
wdenka562e1b2005-01-09 18:21:42 +00009
10define addresses
11
12set $mbar = 0x10000001
13set $scr = $mbar - 1 + 0x004
14set $spr = $mbar - 1 + 0x006
15set $pmr = $mbar - 1 + 0x008
16set $apmr = $mbar - 1 + 0x00e
17set $dir = $mbar - 1 + 0x010
18set $icr1 = $mbar - 1 + 0x020
19set $icr2 = $mbar - 1 + 0x024
20set $icr3 = $mbar - 1 + 0x028
21set $icr4 = $mbar - 1 + 0x02c
22set $isr = $mbar - 1 + 0x030
23set $pitr = $mbar - 1 + 0x034
24set $piwr = $mbar - 1 + 0x038
25set $pivr = $mbar - 1 + 0x03f
26set $csbr0 = $mbar - 1 + 0x040
27set $csor0 = $mbar - 1 + 0x044
28set $csbr1 = $mbar - 1 + 0x048
29set $csor1 = $mbar - 1 + 0x04c
30set $csbr2 = $mbar - 1 + 0x050
31set $csor2 = $mbar - 1 + 0x054
32set $csbr3 = $mbar - 1 + 0x058
33set $csor3 = $mbar - 1 + 0x05c
34set $csbr4 = $mbar - 1 + 0x060
35set $csor4 = $mbar - 1 + 0x064
36set $csbr5 = $mbar - 1 + 0x068
37set $csor5 = $mbar - 1 + 0x06c
38set $csbr6 = $mbar - 1 + 0x070
39set $csor6 = $mbar - 1 + 0x074
40set $csbr7 = $mbar - 1 + 0x078
41set $csor7 = $mbar - 1 + 0x07c
42set $pacnt = $mbar - 1 + 0x080
43set $paddr = $mbar - 1 + 0x084
44set $padat = $mbar - 1 + 0x086
45set $pbcnt = $mbar - 1 + 0x088
46set $pbddr = $mbar - 1 + 0x08c
47set $pbdat = $mbar - 1 + 0x08e
48set $pcddr = $mbar - 1 + 0x094
49set $pcdat = $mbar - 1 + 0x096
50set $pdcnt = $mbar - 1 + 0x098
51set $sdcr = $mbar - 1 + 0x180
52set $sdtr = $mbar - 1 + 0x184
53set $wrrr = $mbar - 1 + 0x280
54set $wirr = $mbar - 1 + 0x283
55set $wcr = $mbar - 1 + 0x288
56set $wer = $mbar - 1 + 0x28c
57
58end
59
60
61#
62# Setup system configuration
63#
64define setup-sys
65set *((unsigned short *) $scr) = 0x0003
66set *((unsigned short *) $spr) = 0xffff
67set *((unsigned char *) $pivr) = 0x4f
68end
69
70
71#
72# Setup Chip Selects (as per Motorola M5272C3 board)
73#
74define setup-cs
75
76# CS0 -- FLASH
77set *((unsigned long *) $csbr0) = 0xffe00201
78set *((unsigned long *) $csor0) = 0xffe00014
79
80# CS1 -- external bus test
81set *((unsigned long *) $csbr1) = 0x0
82set *((unsigned long *) $csor1) = 0x0
83
84# CS2 -- Optional FSRAM
85set *((unsigned long *) $csbr2) = 0x30000001
86set *((unsigned long *) $csor2) = 0xfff80000
87
88# CS3 -- not used
89set *((unsigned long *) $csbr3) = 0x0
90set *((unsigned long *) $csor3) = 0x0
91
92# CS4 -- not used
93set *((unsigned long *) $csbr4) = 0x0
94set *((unsigned long *) $csor4) = 0x0
95
96# CS5 -- PLI socket0
97set *((unsigned long *) $csbr5) = 0x0
98set *((unsigned long *) $csor5) = 0x0
99
100# CS6 -- PLI socket1
101set *((unsigned long *) $csbr6) = 0x0
102set *((unsigned long *) $csor6) = 0x0
103
104# CS7 -- SDRAM
105set *((unsigned long *) $csbr7) = 0x00000701
106set *((unsigned long *) $csor7) = 0xff00007c
107
108end
109
110
111#
112# Setup the DRAM controller.
113#
114
115define setup-dram
116set *((unsigned long *) $sdtr) = 0x0000f539
117set *((unsigned long *) $sdcr) = 0x00004211
118
119# Dummy write to start SDRAM
120set *((unsigned long *) 0) = 0
121end
122
123
124#
125# Setup for GPIO pins
126#
127define setup-ppio
128
129# PORT A -- the LED's
130set *((unsigned long *) $pacnt) = 0x00000000
131# lower 8 bits for output:
132set *((unsigned short *) $paddr) = 0xff
133# LED's off:
134set *((unsigned short *) $padat) = 0xff
135
136# PORT B
137set *((unsigned long *) $pbcnt) = 0x55554155
138set *((unsigned short *) $pbddr) = 0x0000
139set *((unsigned short *) $pbdat) = 0x17ea
140
141# PORT C
142#set *((unsigned short *) $pcddr) = 0x0000
143#set *((unsigned short *) $pcdat) = 0x1898
144
145# PORT D
146set *((unsigned long *) $pdcnt) = 0x00000000
147
148end
149
150
151#
152# Added for uClinux-coldfire target...
153#
154target bdm /dev/bdm
155
156addresses
157setup-sys
158setup-cs
159setup-dram
160setup-ppio
161set print pretty
162set print asm-demangle
163display/i $pc
164
165
166#
167load u-boot
168set $pc=0x20000
169c