2 # $Id: dot.gdbinit.mappi,v 1.4 2004/10/20 02:24:37 takata Exp $
4 # NOTE: this file is generated by a script, "gen_gdbinit.pl".
5 # (Please type "gen_gdbinit.pl --help" and check the help message).
6 # $ Id: gen_gdbinit.pl,v 1.12 2004/07/26 09:56:10 takata Exp $
8 # target platform: mappi
15 # clk xin:cpu:bif:bus=30:360:180:90
17 set *(unsigned long *)0x00ef4024 = 2
18 set *(unsigned long *)0x00ef4020 = 1
19 set *(unsigned long *)0x00ef4010 = 0
20 set *(unsigned long *)0x00ef4014 = 0
21 set *(unsigned long *)0x00ef4004 = 5
23 set *(unsigned long *)0x00ef4008 = 0x00000200
26 # Initialize programmable ports
28 set $sfrbase = 0x00ef0000
29 set *(unsigned short *)0x00ef1060 = 0x5555
30 set *(unsigned short *)0x00ef1062 = 0x5555
31 set *(unsigned short *)0x00ef1064 = 0x5555
32 set *(unsigned short *)0x00ef1066 = 0x5555
33 set *(unsigned short *)0x00ef1068 = 0x5555
34 set *(unsigned short *)0x00ef106a = 0x0000
35 set *(unsigned short *)0x00ef106e = 0x5555
36 set *(unsigned short *)0x00ef1070 = 0x5555
38 set *(unsigned char *)($sfrbase + 0x1015) = 0xff
39 set *(unsigned char *)($sfrbase + 0x1085) = 0xff
42 set *(unsigned char *)($sfrbase + 0x1085) = 0x00
45 P5=LED(output), P6.b4=LAN_RESET(output)
48 # Initialize SDRAM controller
51 set *(unsigned long *)0x00ef6008 = 0x00000182
53 set *(unsigned long *)0x00ef600c = 0x00000001
57 set *(unsigned long *)0x00ef602c = 0x00000020
59 set *(unsigned long *)0x00ef6028 = 0x00051502
61 set *(unsigned long *)0x00ef6020 = 0x08000004
63 set *(unsigned long *)0x00ef6004 = 0x00010e2b
65 set *(unsigned long *)0x00ef6024 = 0x00000001
68 SDRAM controller initialization
69 0x08000000 - 0x0bffffff (64MB)
72 # Initialize LAN controller
74 set $sfrbase = 0x00ef0000
75 # Set BSEL3 (BSEL3 for the Chaos's bselc)
76 set *(unsigned long *)($sfrbase + 0x5300) = 0x0a0a8040
77 set *(unsigned long *)($sfrbase + 0x5304) = 0x01120203
78 set *(unsigned long *)($sfrbase + 0x5308) = 0x00000001
79 # Reset (P5=LED,P6.b4=LAN_RESET)
80 set *(unsigned short *)($sfrbase + 0x106c) = 0x0000
81 set *(unsigned char *)($sfrbase + 0x1016) = 0xff
82 set *(unsigned char *)($sfrbase + 0x1086) = 0xff
84 # swivel: 0=normal, 4=reverse
85 # set *(unsigned char *)($sfrbase + 0x1086) = 0x00
86 set *(unsigned char *)($sfrbase + 0x1086) = 0x04
87 set *(unsigned long *)(0x0c000330) = 0xffffffff
89 set $lanc = (void*)0x0c000300
90 set *(unsigned long *)($lanc + 0x0000) = 0x00610010
91 set *(unsigned long *)($lanc + 0x0004) = 0x00200030
92 set *(unsigned long *)($lanc + 0x0008) = 0x00400050
93 set *(unsigned long *)($lanc + 0x000c) = 0x00600007
96 LAN controller initialization
97 ex.) MAC address: 10 20 30 40 50 60
100 # LCD & CRT dual-head setting (8bpp)
102 set $sfrbase = 0x00ef0000
104 set *(unsigned long *)($sfrbase + 0x5400) = 0x0e0e8000
105 set *(unsigned long *)($sfrbase + 0x5404) = 0x0012220a
111 set *(unsigned long *)0xffff0024=1
117 set *(unsigned long *)0xffff0024=0
121 define show_tlb_entries
124 set $nr_entries = $arg1
126 while ($i < $nr_entries)
127 set $tlb_tag = *(unsigned long*)$addr
128 set $tlb_data = *(unsigned long*)($addr + 4)
129 printf " [%2d] 0x%08lx : 0x%08lx - 0x%08lx\n", $i, $addr, $tlb_tag, $tlb_data
131 set $addr = $addr + 8
137 show_tlb_entries $itlb 0d32
141 show_tlb_entries $dtlb 0d32
144 # Show current task structure
146 set $current = $spi & 0xffffe000
147 printf "$current=0x%08lX\n",$current
148 print *(struct task_struct *)$current
151 # Show user assigned task structure
153 set = $arg0 & 0xffffe000
154 printf "$task=0x%08lX\n",$task
155 print *(struct task_struct *)$task
158 Show user assigned task structure
159 arg0 : task structure address
162 # Show M32R registers
164 printf " R0[0x%08lX] R1[0x%08lX] R2[0x%08lX] R3[0x%08lX]\n",$r0,$r1,$r2,$r3
165 printf " R4[0x%08lX] R5[0x%08lX] R6[0x%08lX] R7[0x%08lX]\n",$r4,$r5,$r6,$r7
166 printf " R8[0x%08lX] R9[0x%08lX] R10[0x%08lX] R11[0x%08lX]\n",$r8,$r9,$r10,$r11
167 printf "R12[0x%08lX] FP[0x%08lX] LR[0x%08lX] SP[0x%08lX]\n",$r12,$fp,$lr,$sp
168 printf "PSW[0x%08lX] CBR[0x%08lX] SPI[0x%08lX] SPU[0x%08lX]\n",$psw,$cbr,$spi,$spu
169 printf "BPC[0x%08lX] PC[0x%08lX] ACCL[0x%08lX] ACCH[0x%08lX]\n",$bpc,$pc,$accl,$acch
170 printf "EVB[0x%08lX]\n",$evb
176 set *(unsigned int)0xfffffffc=0x60
193 # Set kernel parameters
194 define set_kernel_parameters
195 set $param = (void*)0x08001000
197 # set *(unsigned long *)($param + 0x0010) = 0x08300000
199 # set *(unsigned long *)($param + 0x0014) = 0x00000000
201 set *(unsigned long *)($param + 0x0018) = 0d360000000
203 set *(unsigned long *)($param + 0x001c) = 0d90000000
206 set *(unsigned long *)($param + 0x0020) = 0d128
208 set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x console=tty1 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0"
213 set_kernel_parameters
221 define set_breakpoints