dot.gdbinit.nommu 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. # .gdbinit file
  2. # $Id$
  3. #-----
  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.5 2004/01/23 08:23:25 takata Exp $
  7. #-----
  8. # target platform: mappi
  9. # setting
  10. set width 0d70
  11. set radix 0d16
  12. debug_chaos
  13. # clk xin:cpu:bif:bus=25:200:50:50
  14. define clock_init
  15. set *(unsigned long *)0x00ef4024 = 2
  16. set *(unsigned long *)0x00ef4020 = 2
  17. set *(unsigned long *)0x00ef4010 = 0
  18. set *(unsigned long *)0x00ef4014 = 0
  19. set *(unsigned long *)0x00ef4004 = 3
  20. shell sleep 0.1
  21. set *(unsigned long *)0x00ef4008 = 0x00000200
  22. end
  23. # Initialize programmable ports
  24. define port_init
  25. set $sfrbase = 0x00ef0000
  26. set *(unsigned short *)0x00ef1060 = 0x5555
  27. set *(unsigned short *)0x00ef1062 = 0x5555
  28. set *(unsigned short *)0x00ef1064 = 0x5555
  29. set *(unsigned short *)0x00ef1066 = 0x5555
  30. set *(unsigned short *)0x00ef1068 = 0x5555
  31. set *(unsigned short *)0x00ef106a = 0x0000
  32. set *(unsigned short *)0x00ef106e = 0x5555
  33. set *(unsigned short *)0x00ef1070 = 0x5555
  34. # LED ON
  35. set *(unsigned char *)($sfrbase + 0x1015) = 0xff
  36. set *(unsigned char *)($sfrbase + 0x1085) = 0xff
  37. shell sleep 0.1
  38. # LED OFF
  39. set *(unsigned char *)($sfrbase + 0x1085) = 0x00
  40. end
  41. document port_init
  42. P5=LED(output), P6.b4=LAN_RESET(output)
  43. end
  44. # Initialize SDRAM controller
  45. define sdram_init
  46. # SDIR0
  47. set *(unsigned long *)0x00ef6008 = 0x00000182
  48. # SDIR1
  49. set *(unsigned long *)0x00ef600c = 0x00000001
  50. # Initialize wait
  51. shell sleep 0.1
  52. # Ch0-MOD
  53. set *(unsigned long *)0x00ef602c = 0x00000020
  54. # Ch0-TR
  55. set *(unsigned long *)0x00ef6028 = 0x00051502
  56. # Ch0-ADR (size:64MB)
  57. set *(unsigned long *)0x00ef6020 = 0x00000004
  58. # AutoRef On
  59. set *(unsigned long *)0x00ef6004 = 0x00010f05
  60. # Access enable
  61. set *(unsigned long *)0x00ef6024 = 0x00000001
  62. end
  63. document sdram_init
  64. SDRAM controller initialization
  65. 0x08000000 - 0x0bffffff (64MB)
  66. end
  67. # Initialize LAN controller
  68. define lanc_init
  69. set $sfrbase = 0x00ef0000
  70. # Set BSEL3 (BSEL3 for the Chaos's bselc)
  71. set *(unsigned long *)($sfrbase + 0x5300) = 0x07078040
  72. set *(unsigned long *)($sfrbase + 0x5304) = 0x01110102
  73. set *(unsigned long *)($sfrbase + 0x5308) = 0x00000001
  74. # Reset (P5=LED,P6.b4=LAN_RESET)
  75. set *(unsigned short *)($sfrbase + 0x106c) = 0x0000
  76. set *(unsigned char *)($sfrbase + 0x1016) = 0xff
  77. set *(unsigned char *)($sfrbase + 0x1086) = 0xff
  78. shell sleep 0.1
  79. # swivel: 0=normal, 4=reverse
  80. # set *(unsigned char *)($sfrbase + 0x1086) = 0x00
  81. set *(unsigned char *)($sfrbase + 0x1086) = 0x04
  82. set *(unsigned long *)(0x0c000330) = 0xffffffff
  83. # Set mac address
  84. set $lanc = (void*)0x0c000300
  85. set *(unsigned long *)($lanc + 0x0000) = 0x00610010
  86. set *(unsigned long *)($lanc + 0x0004) = 0x00200030
  87. set *(unsigned long *)($lanc + 0x0008) = 0x00400050
  88. set *(unsigned long *)($lanc + 0x000c) = 0x00600007
  89. end
  90. document lanc_init
  91. LAN controller initialization
  92. ex.) MAC address: 10 20 30 40 50 60
  93. end
  94. # LCD & CRT dual-head setting (8bpp)
  95. define dispc_init
  96. set $sfrbase = 0x00ef0000
  97. # BSEL4 Dispc
  98. set *(unsigned long *)($sfrbase + 0x5400) = 0x06078000
  99. set *(unsigned long *)($sfrbase + 0x5404) = 0x00101101
  100. end
  101. # MMU enable
  102. define mmu_enable
  103. set $evb=0x88000000
  104. set *(unsigned long *)0xffff0024=1
  105. end
  106. # MMU disable
  107. define mmu_disable
  108. set $evb=0
  109. set *(unsigned long *)0xffff0024=0
  110. end
  111. # Show TLB entries
  112. define show_tlb_entries
  113. set $i = 0
  114. set $addr = $arg0
  115. set $nr_entries = $arg1
  116. use_mon_code
  117. while ($i < $nr_entries)
  118. set $tlb_tag = *(unsigned long*)$addr
  119. set $tlb_data = *(unsigned long*)($addr + 4)
  120. printf " [%2d] 0x%08lx : 0x%08lx - 0x%08lx\n", $i, $addr, $tlb_tag, $tlb_data
  121. set $i = $i + 1
  122. set $addr = $addr + 8
  123. end
  124. use_debug_dma
  125. end
  126. define itlb
  127. set $itlb=0xfe000000
  128. show_tlb_entries $itlb 0d32
  129. end
  130. define dtlb
  131. set $dtlb=0xfe000800
  132. show_tlb_entries $dtlb 0d32
  133. end
  134. # Show current task structure
  135. define show_current
  136. set $current = $spi & 0xffffe000
  137. printf "$current=0x%08lX\n",$current
  138. print *(struct task_struct *)$current
  139. end
  140. # Show user assigned task structure
  141. define show_task
  142. set = $arg0 & 0xffffe000
  143. printf "$task=0x%08lX\n",$task
  144. print *(struct task_struct *)$task
  145. end
  146. document show_task
  147. Show user assigned task structure
  148. arg0 : task structure address
  149. end
  150. # Show M32R registers
  151. define show_regs
  152. printf " R0[0x%08lX] R1[0x%08lX] R2[0x%08lX] R3[0x%08lX]\n",$r0,$r1,$r2,$r3
  153. printf " R4[0x%08lX] R5[0x%08lX] R6[0x%08lX] R7[0x%08lX]\n",$r4,$r5,$r6,$r7
  154. printf " R8[0x%08lX] R9[0x%08lX] R10[0x%08lX] R11[0x%08lX]\n",$r8,$r9,$r10,$r11
  155. printf "R12[0x%08lX] FP[0x%08lX] LR[0x%08lX] SP[0x%08lX]\n",$r12,$fp,$lr,$sp
  156. printf "PSW[0x%08lX] CBR[0x%08lX] SPI[0x%08lX] SPU[0x%08lX]\n",$psw,$cbr,$spi,$spu
  157. printf "BPC[0x%08lX] PC[0x%08lX] ACCL[0x%08lX] ACCH[0x%08lX]\n",$bpc,$pc,$accl,$acch
  158. printf "EVB[0x%08lX]\n",$evb
  159. end
  160. # Setup all
  161. define setup
  162. use_mon_code
  163. set *(unsigned int)0xfffffffc=0x60
  164. shell sleep 0.1
  165. clock_init
  166. shell sleep 0.1
  167. port_init
  168. sdram_init
  169. lanc_init
  170. dispc_init
  171. set $evb=0x00000000
  172. end
  173. # Load modules
  174. define load_modules
  175. use_debug_dma
  176. load
  177. end
  178. # Set kernel parameters
  179. define set_kernel_parameters
  180. set $param = (void*)0x00001000
  181. # INITRD_START
  182. #set *(unsigned long *)($param + 0x0010) = 0x082a0000
  183. # INITRD_SIZE
  184. #set *(unsigned long *)($param + 0x0014) = 0x00000000
  185. # M32R_CPUCLK
  186. set *(unsigned long *)($param + 0x0018) = 0d200000000
  187. # M32R_BUSCLK
  188. set *(unsigned long *)($param + 0x001c) = 0d50000000
  189. # M32R_TIMER_DIVIDE
  190. set *(unsigned long *)($param + 0x0020) = 0d128
  191. set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.bbox-httpd nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \0"
  192. end
  193. # Boot
  194. define boot
  195. set_kernel_parameters
  196. set $fp = 0
  197. set $pc=0x00002000
  198. set *(long *)0xfffffff4=0x8080
  199. # b load_flat_binary
  200. # set *(unsigned char *)0x08001003=0x63
  201. # set *(unsigned char *)0x08001003=0x02
  202. si
  203. # c
  204. end
  205. # Set breakpoints
  206. define set_breakpoints
  207. b *0x08000030
  208. end
  209. # Restart
  210. define restart
  211. sdireset
  212. sdireset
  213. setup
  214. load_modules
  215. boot
  216. end
  217. sdireset
  218. sdireset
  219. file vmlinux
  220. target m32rsdi
  221. setup
  222. load_modules
  223. boot