2 # SnapGear SG8100 (IXP425) target support
10 set *((long*) 0xc800000c) = 0x83
11 set *((long*) 0xc8000000) = 0x08
12 set *((long*) 0xc8000004) = 0x00
13 set *((long*) 0xc800000c) = 0x03
14 set *((long*) 0xc8000004) = 0x40
18 set *((long*) 0xc8000000) = $arg0
27 # set for 32MB (3CAS, 3RAS)
28 #set *((long*) 0xcc000000) = 0x18
29 set *((long*) 0xcc000000) = 0x18
32 set *((long*) 0xcc000004) = 0
35 set *((long*) 0xcc000008) = 0x03
39 set *((long*) 0xcc000004) = 0x384
42 # send PRECHARGE-ALL command
43 set *((long*) 0xcc000008) = 0x02
46 # send AUTO-REFRESH command
49 set *((long*) 0xcc000008) = 0x04
54 # send MODE (CAS3) command
55 set *((long*) 0xcc000008) = 0x01
58 # send NORMAL-OPERATION command
59 set *((long*) 0xcc000008) = 0x06
67 # Switch memory and expansion regions
70 set *((unsigned long *) 0x10000000) = 0xe3a01331
71 set *((unsigned long *) 0x10000004) = 0xe3811020
72 set *((unsigned long *) 0x10000008) = 0xe5912000
73 set *((unsigned long *) 0x1000000c) = 0xe3c22102
74 set *((unsigned long *) 0x10000010) = 0xe5812000
85 set *((unsigned long *) $addr) = $val
97 set $rd = *((unsigned long *) $addr)
101 set $addr = $addr + 4
110 set $addr0end = $addr0 + $size
111 while ($addr0 < $addr0end)
112 set $val0 = *((unsigned int *) $addr0)
113 set $val1 = *((unsigned int *) $addr1)
117 set $addr0 = $addr0 + 4
118 set $addr1 = $addr1 + 4
123 # Set BIG endian mode
126 set *((unsigned long *) 0x10000000) = 0xee110f10
127 set *((unsigned long *) 0x10000004) = 0xe3800080
128 set *((unsigned long *) 0x10000008) = 0xee010f10
129 set *((unsigned long *) 0x1000000c) = 0xee120f10
130 set *((unsigned long *) 0x10000010) = 0xe1a00000
131 set *((unsigned long *) 0x10000010) = 0xe24ff004
140 set *((unsigned long *) 0x10000000) = 0xee110f10
141 set *((unsigned long *) 0x10000004) = 0xe3800a01
142 set *((unsigned long *) 0x10000008) = 0xe380000c
143 set *((unsigned long *) 0x1000000c) = 0xee010f10
144 set *((unsigned long *) 0x10000010) = 0xee120f10
145 set *((unsigned long *) 0x10000014) = 0xe1a00000
146 set *((unsigned long *) 0x10000018) = 0xe24ff004
147 set *((unsigned long *) 0x1000001c) = 0xee071f15
148 set *((unsigned long *) 0x10000020) = 0xee120f10
149 set *((unsigned long *) 0x10000024) = 0xe1a00000
150 set *((unsigned long *) 0x10000028) = 0xe24ff004
156 # Enable the PCI clock (which is on GPIO14)
159 set *((unsigned long *) 0xc8004004) = 0x00003fff
160 set *((unsigned long *) 0xc8004018) = 0x000001ff
161 set *((unsigned long *) 0xc8004000) = 0x00004000
165 # Configure the flash region to be writable.
168 set *((unsigned long *) 0x10000000) = 0xe3a01331
169 set *((unsigned long *) 0x10000004) = 0xe5912000
170 set *((unsigned long *) 0x10000008) = 0xe3822002
171 set *((unsigned long *) 0x1000000c) = 0xe5812000
178 # FLASH writing code (16bit functions)
179 # This current scripting is setup for P30 Strata flash.
183 monitor short 0x50000000 = 0x20
184 monitor short 0x50000000 = 0xd0
186 monitor short 0x50000000 = 0xff
188 monitor short 0x50008000 = 0x20
189 monitor short 0x50008000 = 0xd0
191 monitor short 0x50008000 = 0xff
193 monitor short 0x50010000 = 0x20
194 monitor short 0x50010000 = 0xd0
196 monitor short 0x50010000 = 0xff
198 monitor short 0x50018000 = 0x20
199 monitor short 0x50018000 = 0xd0
201 monitor short 0x50018000 = 0xff
205 monitor short 0x50000000 = 0x60
206 monitor short 0x50000000 = 0xd0
208 monitor short 0x50000000 = 0xff
210 monitor short 0x50008000 = 0x60
211 monitor short 0x50008000 = 0xd0
213 monitor short 0x50008000 = 0xff
215 monitor short 0x50010000 = 0x60
216 monitor short 0x50010000 = 0xd0
218 monitor short 0x50010000 = 0xff
220 monitor short 0x50018000 = 0x60
221 monitor short 0x50018000 = 0xd0
223 monitor short 0x50018000 = 0xff
227 monitor short 0x50020000 = 0x20
228 monitor short 0x50020000 = 0xd0
230 monitor short 0x50020000 = 0xff
234 monitor short 0x50020000 = 0x60
235 monitor short 0x50020000 = 0xd0
237 monitor short 0x50020000 = 0xff
241 set *((unsigned long *) 0x10000000) = 0xe3a01205
242 set *((unsigned long *) 0x10000004) = 0xe3a02090
243 set *((unsigned long *) 0x10000008) = 0xe3822a09
244 set *((unsigned long *) 0x1000000c) = 0xe1c120b0
250 set *((unsigned long *) 0x10100000) = 0xe3a01205
251 set *((unsigned long *) 0x10100004) = 0xe3a02040
252 set *((unsigned long *) 0x10100008) = 0xe3822901
253 set *((unsigned long *) 0x1010000c) = 0xe3a03080
254 set *((unsigned long *) 0x10100010) = 0xe3a040ff
255 set *((unsigned long *) 0x10100014) = 0xe3844cff
256 set *((unsigned long *) 0x10100018) = 0xe3a05000
257 set *((unsigned long *) 0x1010001c) = 0xe3a06701
258 set *((unsigned long *) 0x10100020) = 0xe1c120b0
259 set *((unsigned long *) 0x10100024) = 0xe1d570b0
260 set *((unsigned long *) 0x10100028) = 0xe1c170b0
261 set *((unsigned long *) 0x1010002c) = 0xe1d170b0
262 set *((unsigned long *) 0x10100030) = 0xe1170003
263 set *((unsigned long *) 0x10100034) = 0x0afffffc
264 set *((unsigned long *) 0x10100038) = 0xe1c140b0
265 set *((unsigned long *) 0x1010003c) = 0xe2811002
266 set *((unsigned long *) 0x10100040) = 0xe2855002
267 set *((unsigned long *) 0x10100044) = 0xe1550006
268 set *((unsigned long *) 0x10100048) = 0x1afffff4
269 set *((unsigned long *) 0x1010004c) = 0xe1a00000
270 set *((unsigned long *) 0x10100050) = 0xe1a00000
271 set *((unsigned long *) 0x10100054) = 0xeafffffe
283 load boot/redboot/images/redboot-swap.elf
294 load boot/boot-swap.elf
301 # FLASH writing code (8bit functions)
304 set *((unsigned long *) 0x10000000) = 0xe3a01205
305 set *((unsigned long *) 0x10000004) = 0xe3a02020
306 set *((unsigned long *) 0x10000008) = 0xe5c12000
307 set *((unsigned long *) 0x1000000c) = 0xe3a020d0
308 set *((unsigned long *) 0x10000010) = 0xe5c12000
312 set *((unsigned long *) 0x10000000) = 0xe3a020ff
313 set *((unsigned long *) 0x10000004) = 0xe5c12000
319 set *((unsigned long *) 0x10000000) = 0xe3a01205
320 set *((unsigned long *) 0x10000004) = 0xe3811802
321 set *((unsigned long *) 0x10000008) = 0xe3a02020
322 set *((unsigned long *) 0x1000000c) = 0xe5c12000
323 set *((unsigned long *) 0x10000010) = 0xe3a020d0
324 set *((unsigned long *) 0x10000014) = 0xe5c12000
328 set *((unsigned long *) 0x10000000) = 0xe3a020ff
329 set *((unsigned long *) 0x10000004) = 0xe5c12000
334 define flash8-unlock1
335 set *((unsigned long *) 0x10000000) = 0xe3a01205
336 set *((unsigned long *) 0x10000004) = 0xe3a02060
337 set *((unsigned long *) 0x10000008) = 0xe5c12000
338 set *((unsigned long *) 0x1000000c) = 0xe3a020d0
339 set *((unsigned long *) 0x10000010) = 0xe5c12000
340 set *((unsigned long *) 0x10000014) = 0xe3a020ff
341 set *((unsigned long *) 0x10000018) = 0xe5c12000
346 define flash8-unlock2
347 set *((unsigned long *) 0x10000000) = 0xe3a01205
348 set *((unsigned long *) 0x10000004) = 0xe3811802
349 set *((unsigned long *) 0x10000008) = 0xe3a02060
350 set *((unsigned long *) 0x1000000c) = 0xe5c12000
351 set *((unsigned long *) 0x10000010) = 0xe3a020d0
352 set *((unsigned long *) 0x10000014) = 0xe5c12000
353 set *((unsigned long *) 0x10000018) = 0xe3a020ff
354 set *((unsigned long *) 0x1000001c) = 0xe5c12000
359 define flash8-program
360 set *((unsigned long *) 0x10100000) = 0xe3a01205
361 set *((unsigned long *) 0x10100004) = 0xe3a02040
362 set *((unsigned long *) 0x10100008) = 0xe3a03080
363 set *((unsigned long *) 0x1010000c) = 0xe3a040ff
364 set *((unsigned long *) 0x10100010) = 0xe3a05000
365 set *((unsigned long *) 0x10100014) = 0xe3a06701
366 set *((unsigned long *) 0x10100018) = 0xe5c12000
367 set *((unsigned long *) 0x1010001c) = 0xe5d57000
368 set *((unsigned long *) 0x10100020) = 0xe5c17000
369 set *((unsigned long *) 0x10100024) = 0xe5d17000
370 set *((unsigned long *) 0x10100028) = 0xe1170003
371 set *((unsigned long *) 0x1010002c) = 0x0afffffc
372 set *((unsigned long *) 0x10100030) = 0xe5c14000
373 set *((unsigned long *) 0x10100034) = 0xe2811001
374 set *((unsigned long *) 0x10100038) = 0xe2855001
375 set *((unsigned long *) 0x1010003c) = 0xe1550006
376 set *((unsigned long *) 0x10100040) = 0x1afffff4
377 set *((unsigned long *) 0x10100044) = 0xe1a00000
378 set *((unsigned long *) 0x10100048) = 0xe1a00000
379 set *((unsigned long *) 0x1010004c) = 0xeafffffe
383 define flash8-redboot
391 load boot/redboot/images/redboot-swap.elf
404 load boot/boot-swap.elf
412 # Set MAC addresses in the appropriate place. Makes it easier
413 # for redboot to work right...
416 set *((unsigned char *) 0x1c000) = 0x00
417 set *((unsigned char *) 0x1c001) = 0xcf
418 set *((unsigned char *) 0x1c002) = 0xd0
419 set *((unsigned char *) 0x1c003) = 0x00
420 set *((unsigned char *) 0x1c004) = 0x00
421 set *((unsigned char *) 0x1c005) = 0x00
422 set *((unsigned char *) 0x1c006) = 0x01
423 set *((unsigned char *) 0x1c007) = 0x00
427 # Set debugger into big endian mode.
436 # Startup commands...
441 target remote localhost:8888
447 set print asm-demangle