dot.gdbinit 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. # .gdbinit file
  2. # $Id: dot.gdbinit,v 1.1 2004/07/27 06:54:20 sakugawa Exp $
  3. # setting
  4. set width 0d70
  5. set radix 0d16
  6. set height 0
  7. debug_chaos
  8. # clk xin:cpu:bus=1:8:1
  9. define clock_init_on_181
  10. set *(unsigned long *)0x00ef400c = 0x2
  11. set *(unsigned long *)0x00ef4004 = 0x1
  12. shell sleep 0.1
  13. set *(unsigned long *)0x00ef4000 = 0x101
  14. end
  15. # clk xin:cpu:bus=1:8:2
  16. define clock_init_on_182
  17. set *(unsigned long *)0x00ef400c = 0x1
  18. set *(unsigned long *)0x00ef4004 = 0x1
  19. shell sleep 0.1
  20. set *(unsigned long *)0x00ef4000 = 0x101
  21. end
  22. # clk xin:cpu:bus=1:8:4
  23. define clock_init_on_184
  24. set *(unsigned long *)0x00ef400c = 0x0
  25. set *(unsigned long *)0x00ef4004 = 0x1
  26. shell sleep 0.1
  27. set *(unsigned long *)0x00ef4000 = 0x101
  28. end
  29. # clk xin:cpu:bus=1:1:1
  30. define clock_init_off
  31. shell sleep 0.1
  32. set *(unsigned long *)0x00ef4000 = 0x0
  33. shell sleep 0.1
  34. set *(unsigned long *)0x00ef4004 = 0x0
  35. shell sleep 0.1
  36. set *(unsigned long *)0x00ef400c = 0x0
  37. end
  38. define tlb_init
  39. set $tlbbase = 0xfe000000
  40. set *(unsigned long *)($tlbbase + 0x04) = 0x0
  41. set *(unsigned long *)($tlbbase + 0x0c) = 0x0
  42. set *(unsigned long *)($tlbbase + 0x14) = 0x0
  43. set *(unsigned long *)($tlbbase + 0x1c) = 0x0
  44. set *(unsigned long *)($tlbbase + 0x24) = 0x0
  45. set *(unsigned long *)($tlbbase + 0x2c) = 0x0
  46. set *(unsigned long *)($tlbbase + 0x34) = 0x0
  47. set *(unsigned long *)($tlbbase + 0x3c) = 0x0
  48. set *(unsigned long *)($tlbbase + 0x44) = 0x0
  49. set *(unsigned long *)($tlbbase + 0x4c) = 0x0
  50. set *(unsigned long *)($tlbbase + 0x54) = 0x0
  51. set *(unsigned long *)($tlbbase + 0x5c) = 0x0
  52. set *(unsigned long *)($tlbbase + 0x64) = 0x0
  53. set *(unsigned long *)($tlbbase + 0x6c) = 0x0
  54. set *(unsigned long *)($tlbbase + 0x74) = 0x0
  55. set *(unsigned long *)($tlbbase + 0x7c) = 0x0
  56. set *(unsigned long *)($tlbbase + 0x84) = 0x0
  57. set *(unsigned long *)($tlbbase + 0x8c) = 0x0
  58. set *(unsigned long *)($tlbbase + 0x94) = 0x0
  59. set *(unsigned long *)($tlbbase + 0x9c) = 0x0
  60. set *(unsigned long *)($tlbbase + 0xa4) = 0x0
  61. set *(unsigned long *)($tlbbase + 0xac) = 0x0
  62. set *(unsigned long *)($tlbbase + 0xb4) = 0x0
  63. set *(unsigned long *)($tlbbase + 0xbc) = 0x0
  64. set *(unsigned long *)($tlbbase + 0xc4) = 0x0
  65. set *(unsigned long *)($tlbbase + 0xcc) = 0x0
  66. set *(unsigned long *)($tlbbase + 0xd4) = 0x0
  67. set *(unsigned long *)($tlbbase + 0xdc) = 0x0
  68. set *(unsigned long *)($tlbbase + 0xe4) = 0x0
  69. set *(unsigned long *)($tlbbase + 0xec) = 0x0
  70. set *(unsigned long *)($tlbbase + 0xf4) = 0x0
  71. set *(unsigned long *)($tlbbase + 0xfc) = 0x0
  72. set $tlbbase = 0xfe000800
  73. set *(unsigned long *)($tlbbase + 0x04) = 0x0
  74. set *(unsigned long *)($tlbbase + 0x0c) = 0x0
  75. set *(unsigned long *)($tlbbase + 0x14) = 0x0
  76. set *(unsigned long *)($tlbbase + 0x1c) = 0x0
  77. set *(unsigned long *)($tlbbase + 0x24) = 0x0
  78. set *(unsigned long *)($tlbbase + 0x2c) = 0x0
  79. set *(unsigned long *)($tlbbase + 0x34) = 0x0
  80. set *(unsigned long *)($tlbbase + 0x3c) = 0x0
  81. set *(unsigned long *)($tlbbase + 0x44) = 0x0
  82. set *(unsigned long *)($tlbbase + 0x4c) = 0x0
  83. set *(unsigned long *)($tlbbase + 0x54) = 0x0
  84. set *(unsigned long *)($tlbbase + 0x5c) = 0x0
  85. set *(unsigned long *)($tlbbase + 0x64) = 0x0
  86. set *(unsigned long *)($tlbbase + 0x6c) = 0x0
  87. set *(unsigned long *)($tlbbase + 0x74) = 0x0
  88. set *(unsigned long *)($tlbbase + 0x7c) = 0x0
  89. set *(unsigned long *)($tlbbase + 0x84) = 0x0
  90. set *(unsigned long *)($tlbbase + 0x8c) = 0x0
  91. set *(unsigned long *)($tlbbase + 0x94) = 0x0
  92. set *(unsigned long *)($tlbbase + 0x9c) = 0x0
  93. set *(unsigned long *)($tlbbase + 0xa4) = 0x0
  94. set *(unsigned long *)($tlbbase + 0xac) = 0x0
  95. set *(unsigned long *)($tlbbase + 0xb4) = 0x0
  96. set *(unsigned long *)($tlbbase + 0xbc) = 0x0
  97. set *(unsigned long *)($tlbbase + 0xc4) = 0x0
  98. set *(unsigned long *)($tlbbase + 0xcc) = 0x0
  99. set *(unsigned long *)($tlbbase + 0xd4) = 0x0
  100. set *(unsigned long *)($tlbbase + 0xdc) = 0x0
  101. set *(unsigned long *)($tlbbase + 0xe4) = 0x0
  102. set *(unsigned long *)($tlbbase + 0xec) = 0x0
  103. set *(unsigned long *)($tlbbase + 0xf4) = 0x0
  104. set *(unsigned long *)($tlbbase + 0xfc) = 0x0
  105. end
  106. define load_modules
  107. use_debug_dma
  108. load
  109. end
  110. # Set kernel parameters
  111. define set_kernel_parameters
  112. set $param = (void*)0x88001000
  113. # INITRD_START
  114. # set *(unsigned long *)($param + 0x0010) = 0x08300000
  115. # INITRD_SIZE
  116. # set *(unsigned long *)($param + 0x0014) = 0x00400000
  117. # M32R_CPUCLK
  118. set *(unsigned long *)($param + 0x0018) = 0d200000000
  119. # M32R_BUSCLK
  120. set *(unsigned long *)($param + 0x001c) = 0d50000000
  121. # set *(unsigned long *)($param + 0x001c) = 0d25000000
  122. # M32R_TIMER_DIVIDE
  123. set *(unsigned long *)($param + 0x0020) = 0d128
  124. set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x console=tty1 \
  125. root=/dev/nfsroot \
  126. nfsroot=192.168.0.1:/project/m32r-linux/export/root.2.6 \
  127. nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 \
  128. mem=16m \0"
  129. end
  130. define boot
  131. set_kernel_parameters
  132. set $pc=0x88002000
  133. set $fp=0
  134. set $evb=0x88000000
  135. si
  136. c
  137. end
  138. # Show TLB entries
  139. define show_tlb_entries
  140. set $i = 0
  141. set $addr = $arg0
  142. use_mon_code
  143. while ($i < 0d32 )
  144. set $tlb_tag = *(unsigned long*)$addr
  145. set $tlb_data = *(unsigned long*)($addr + 4)
  146. printf " [%2d] 0x%08lx : 0x%08lx - 0x%08lx\n", $i, $addr, $tlb_tag, $tlb_data
  147. set $i = $i + 1
  148. set $addr = $addr + 8
  149. end
  150. # use_debug_dma
  151. end
  152. define itlb
  153. set $itlb=0xfe000000
  154. show_tlb_entries $itlb
  155. end
  156. define dtlb
  157. set $dtlb=0xfe000800
  158. show_tlb_entries $dtlb
  159. end
  160. define show_regs
  161. printf " R0[%08lx] R1[%08lx] R2[%08lx] R3[%08lx]\n",$r0,$r1,$r2,$r3
  162. printf " R4[%08lx] R5[%08lx] R6[%08lx] R7[%08lx]\n",$r4,$r5,$r6,$r7
  163. printf " R8[%08lx] R9[%08lx] R10[%08lx] R11[%08lx]\n",$r8,$r9,$r10,$r11
  164. printf "R12[%08lx] FP[%08lx] LR[%08lx] SP[%08lx]\n",$r12,$fp,$lr,$sp
  165. printf "PSW[%08lx] CBR[%08lx] SPI[%08lx] SPU[%08lx]\n",$psw,$cbr,$spi,$spu
  166. printf "BPC[%08lx] PC[%08lx] ACCL[%08lx] ACCH[%08lx]\n",$bpc,$pc,$accl,$acch
  167. printf "EVB[%08lx]\n",$evb
  168. end
  169. define restart
  170. sdireset
  171. sdireset
  172. en 1
  173. set $pc=0x0
  174. c
  175. tlb_init
  176. setup
  177. load_modules
  178. boot
  179. end
  180. define setup
  181. debug_chaos
  182. # Clock
  183. # shell sleep 0.1
  184. # clock_init_off
  185. # shell sleep 1
  186. # clock_init_on_182
  187. # shell sleep 0.1
  188. # SDRAM
  189. set *(unsigned long *)0xa0ef6004 = 0x0001053f
  190. set *(unsigned long *)0xa0ef6028 = 0x00031102
  191. end
  192. sdireset
  193. sdireset
  194. file vmlinux
  195. target m32rsdi
  196. set $pc=0x0
  197. b *0x30000
  198. c
  199. dis 1
  200. setup
  201. tlb_init
  202. load_modules
  203. boot