dot.gdbinit.vdec2 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. # .gdbinit file
  2. # $Id: dot.gdbinit.vdec2,v 1.2 2004/11/11 02:03:15 takata Exp $
  3. # setting
  4. set width 0d70
  5. set radix 0d16
  6. use_debug_dma
  7. # Initialize SDRAM controller for Mappi
  8. define sdram_init
  9. # SDIR0
  10. set *(unsigned long *)0x00ef6008=0x00000182
  11. # SDIR1
  12. set *(unsigned long *)0x00ef600c=0x00000001
  13. # Initialize wait
  14. shell sleep 1
  15. # Ch0-MOD
  16. set *(unsigned long *)0x00ef602c=0x00000020
  17. # Ch0-TR
  18. set *(unsigned long *)0x00ef6028=0x00041302
  19. # Ch0-ADR
  20. set *(unsigned long *)0x00ef6020=0x08000004
  21. # AutoRef On
  22. set *(unsigned long *)0x00ef6004=0x00010705
  23. # Access enable
  24. set *(unsigned long *)0x00ef6024=0x00000001
  25. end
  26. document sdram_init
  27. Mappi SDRAM controller initialization
  28. 0x08000000 - 0x0bffffff (64MB)
  29. end
  30. # Initialize SDRAM controller for Mappi
  31. define sdram_init2
  32. # SDIR0
  33. set *(unsigned long *)0x00ef6008=0x00000182
  34. # Ch0-MOD
  35. set *(unsigned long *)0x00ef602c=0x00000020
  36. # Ch0-TR
  37. set *(unsigned long *)0x00ef6028=0x00010002
  38. # Ch0-ADR
  39. set *(unsigned long *)0x00ef6020=0x08000004
  40. # AutoRef On
  41. set *(unsigned long *)0x00ef6004=0x00010107
  42. # SDIR1
  43. set *(unsigned long *)0x00ef600c=0x00000001
  44. # Initialize wait
  45. shell sleep 1
  46. # Access enable
  47. set *(unsigned long *)0x00ef6024=0x00000001
  48. shell sleep 1
  49. end
  50. document sdram_init
  51. Mappi SDRAM controller initialization
  52. 0x08000000 - 0x0bffffff (64MB)
  53. end
  54. # Initialize LAN controller for Mappi
  55. define lanc_init
  56. # Set BSEL1 (BSEL3 for the Chaos's bselc)
  57. #set *(unsigned long *)0x00ef5004 = 0x0fff330f
  58. #set *(unsigned long *)0x00ef5004 = 0x01113301
  59. # set *(unsigned long *)0x00ef5004 = 0x02011101
  60. # set *(unsigned long *)0x00ef5004 = 0x04441104
  61. # BSEL5
  62. # set *(unsigned long *)0x00ef5014 = 0x0ccc310c
  63. # set *(unsigned long *)0x00ef5014 = 0x0303310f
  64. # set *(unsigned long *)0x00ef5014 = 0x01011102 -> NG
  65. # set *(unsigned long *)0x00ef5014 = 0x03033103
  66. set *(unsigned long *)0x00ef500c = 0x0b0b1304
  67. set *(unsigned long *)0x00ef5010 = 0x03033302
  68. # set *(unsigned long *)0x00ef5018 = 0x02223302
  69. end
  70. # MMU enable
  71. define mmu_enable
  72. set $evb=0x88000000
  73. set *(unsigned long *)0xffff0024=1
  74. end
  75. # MMU disable
  76. define mmu_disable
  77. set $evb=0
  78. set *(unsigned long *)0xffff0024=0
  79. end
  80. # Show TLB entries
  81. define show_tlb_entries
  82. set $i = 0
  83. set $addr = $arg0
  84. while ($i < 0d16 )
  85. set $tlb_tag = *(unsigned long*)$addr
  86. set $tlb_data = *(unsigned long*)($addr + 4)
  87. printf " [%2d] 0x%08lx : 0x%08lx - 0x%08lx\n", $i, $addr, $tlb_tag, $tlb_data
  88. set $i = $i + 1
  89. set $addr = $addr + 8
  90. end
  91. end
  92. define itlb
  93. set $itlb=0xfe000000
  94. show_tlb_entries $itlb
  95. end
  96. define dtlb
  97. set $dtlb=0xfe000800
  98. show_tlb_entries $dtlb
  99. end
  100. # Cache ON
  101. define set_cache_type
  102. set $mctype = (void*)0xfffffff8
  103. # chaos
  104. # set *(unsigned long *)($mctype) = 0x0000c000
  105. # m32102 i-cache only
  106. set *(unsigned long *)($mctype) = 0x00008000
  107. # m32102 d-cache only
  108. # set *(unsigned long *)($mctype) = 0x00004000
  109. end
  110. define cache_on
  111. set $param = (void*)0x08001000
  112. set *(unsigned long *)($param) = 0x60ff6102
  113. end
  114. # Show current task structure
  115. define show_current
  116. set $current = $spi & 0xffffe000
  117. printf "$current=0x%08lX\n",$current
  118. print *(struct task_struct *)$current
  119. end
  120. # Show user assigned task structure
  121. define show_task
  122. set $task = $arg0 & 0xffffe000
  123. printf "$task=0x%08lX\n",$task
  124. print *(struct task_struct *)$task
  125. end
  126. document show_task
  127. Show user assigned task structure
  128. arg0 : task structure address
  129. end
  130. # Show M32R registers
  131. define show_regs
  132. printf " R0[0x%08lX] R1[0x%08lX] R2[0x%08lX] R3[0x%08lX]\n",$r0,$r1,$r2,$r3
  133. printf " R4[0x%08lX] R5[0x%08lX] R6[0x%08lX] R7[0x%08lX]\n",$r4,$r5,$r6,$r7
  134. printf " R8[0x%08lX] R9[0x%08lX] R10[0x%08lX] R11[0x%08lX]\n",$r8,$r9,$r10,$r11
  135. printf "R12[0x%08lX] FP[0x%08lX] LR[0x%08lX] SP[0x%08lX]\n",$r12,$fp,$lr,$sp
  136. printf "PSW[0x%08lX] CBR[0x%08lX] SPI[0x%08lX] SPU[0x%08lX]\n",$psw,$cbr,$spi,$spu
  137. printf "BPC[0x%08lX] PC[0x%08lX] ACCL[0x%08lX] ACCH[0x%08lX]\n",$bpc,$pc,$accl,$acch
  138. printf "EVB[0x%08lX]\n",$evb
  139. set $mests = *(unsigned long *)0xffff000c
  140. set $mdeva = *(unsigned long *)0xffff0010
  141. printf "MESTS[0x%08lX] MDEVA[0x%08lX]\n",$mests,$mdeva
  142. end
  143. # Setup all
  144. define setup
  145. sdram_init
  146. # lanc_init
  147. # dispc_init
  148. # set $evb=0x08000000
  149. end
  150. # Load modules
  151. define load_modules
  152. use_debug_dma
  153. load
  154. # load busybox.mot
  155. end
  156. # Set kernel parameters
  157. define set_kernel_parameters
  158. set $param = (void*)0x08001000
  159. ## MOUNT_ROOT_RDONLY
  160. set {long}($param+0x00)=0
  161. ## RAMDISK_FLAGS
  162. #set {long}($param+0x04)=0
  163. ## ORIG_ROOT_DEV
  164. #set {long}($param+0x08)=0x00000100
  165. ## LOADER_TYPE
  166. #set {long}($param+0x0C)=0
  167. ## INITRD_START
  168. set {long}($param+0x10)=0x082a0000
  169. ## INITRD_SIZE
  170. set {long}($param+0x14)=0d6200000
  171. # M32R_CPUCLK
  172. set *(unsigned long *)($param + 0x0018) = 0d25000000
  173. # M32R_BUSCLK
  174. set *(unsigned long *)($param + 0x001c) = 0d25000000
  175. # M32R_TIMER_DIVIDE
  176. set *(unsigned long *)($param + 0x0020) = 0d128
  177. set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.2.6 nfsaddrs=192.168.0.102:192.168.0.1:192.168.0.1:255.255.255.0:mappi: \0"
  178. end
  179. # Boot
  180. define boot
  181. set_kernel_parameters
  182. debug_chaos
  183. set $pc=0x08002000
  184. set $fp=0
  185. del b
  186. si
  187. end
  188. # Restart
  189. define restart
  190. sdireset
  191. sdireset
  192. setup
  193. load_modules
  194. boot
  195. end
  196. sdireset
  197. sdireset
  198. file vmlinux
  199. target m32rsdi
  200. restart
  201. boot