1 set $IPSBAR = 0x40000000
3 set $DCR = $IPSBAR + 0x000040
4 set $DACR0 = $IPSBAR + 0x000048
5 set $DMR0 = $IPSBAR + 0x00004C
7 set $CSAR0 = $IPSBAR + 0x000080
8 set $CSMR0 = $IPSBAR + 0x000084
9 set $CSCR0 = $IPSBAR + 0x00008A
11 set $PAR_SDRAM = $IPSBAR + 0x100046
12 set $PAR_AD = $IPSBAR + 0x100040
14 set $WCR = $IPSBAR + 0x140000
18 while ($delay < 20000)
25 while ($delay < 10000)
31 # 2MB FLASH on CS0 at 0x80000000
32 set *(unsigned short *)$CSAR0 = 0x00008000
33 set *(unsigned long *)$CSMR0 = 0x001F0101
34 set *(unsigned short *)$CSCR0 = 0x00001980
38 # Set PAR_SDRAM to allow SDRAM signals to be enable
39 set *(unsigned char *)$PAR_SDRAM = 0x3F
40 # Set PAR_AD to allow 32-bit SDRAM if the external boot device is 16-bit
41 set *(unsigned char *)$PAR_AD = 0xE1
44 set *(unsigned short *)$DCR = 0x0446
45 set *(unsigned long *)$DACR0 = 0x00001300
46 set *(unsigned long *)$DMR0 = 0x00FC0001
48 # Set IP in DACR and init precharge.
49 set *(unsigned long *)$DACR0 |= 0x00000008
50 set *(0x00000000) = 0xAA55AA55
54 set *(unsigned long *)$DACR0 |= 0x00008000
56 set *(unsigned long *)$DACR0 |= 0x00000040
57 set *(0x00000400) = 0xAA55AA55
63 set *(unsigned char *)$WCR = 0x00
69 # Set VBR to the vector table.
71 # Set internal SRAM to start at 0x20000000
72 set $rambar = 0x20000001
80 set $srambase = 0x20000000
81 set $sramsize = 0x00010000
83 printf "Testing SRAM : 0x%08X - 0x%08X\n", $srambase, ($srambase + $sramsize)
85 while $i < ($srambase + $sramsize)
86 set *(unsigned long *)($i) = 0xAA55AA55
88 if 0xAA55AA55 != *(unsigned long *)$i
89 printf " 0x%08X = FAIL\n", $i
91 printf " 0x%08X = OK", $i
102 set $sdrambase = 0x00000000
103 set $sdramsize = 0x01000000
105 printf "Testing SDRAM : 0x%08X - 0x%08X\n", $sdrambase, ($sdrambase + $sdramsize)
107 while $i < ($sdrambase + $sdramsize)
108 set *(unsigned long *)($i) = 0xAA55AA55
110 if 0xAA55AA55 != *(unsigned long *)$i
111 printf " 0x%08X = FAIL\n", $i
113 printf " 0x%08X = OK", $i
119 set $i = $i + 0x10000
125 set $pc = *(long *)0x00000004
130 define debug-printexception
131 printf "vector: %d", *(unsigned short *)$sp >> 2 &0x1F
132 printf "old pc: 0x%08x", *(unsigned long *)($sp + 4)
133 printf "old sr: 0x%02x", *(unsigned short *)($sp + 2)