dot.gdbinit.nommu 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. # .gdbinit file
  2. # $Id: dot.gdbinit.oaks32r,v 1.4 2004/10/20 02:24:37 takata Exp $
  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.12 2004/07/26 09:56:10 takata Exp $
  7. #-----
  8. # target platform: oaks32r
  9. # setting
  10. set width 0d70
  11. set radix 0d16
  12. # clk xin:cpu:bus=16:66:33
  13. define clock_init
  14. set *(unsigned long *)0x00ef4008 = 1
  15. shell sleep 0.1
  16. set *(unsigned long *)0x00ef4000 = 0x00020100
  17. end
  18. # Initialize programmable ports
  19. define port_init
  20. set *(unsigned long *)0x00ef1000 = 0x1
  21. set *(unsigned long *)0x00ef1060 = 0x01400001
  22. set *(unsigned long *)0x00ef1064 = 0x00015555
  23. set *(unsigned long *)0x00ef1068 = 0x55555050
  24. set *(unsigned long *)0x00ef106c = 0x05150040
  25. end
  26. # Initialize SDRAM controller
  27. define sdram_init
  28. set *(unsigned long *)0x00ef6008 = 0x00000182
  29. set *(unsigned long *)0x00ef600c = 0x00000001
  30. shell sleep 0.1
  31. set *(unsigned long *)0x00ef602c = 0x00000010
  32. set *(unsigned long *)0x00ef6028 = 0x00000300
  33. set *(unsigned long *)0x00ef6048 = 0x00000001
  34. set *(unsigned long *)0x00ef6020 = 0x01000041
  35. set *(unsigned long *)0x00ef6004 = 0x00010117
  36. set *(unsigned long *)0x00ef6010 = 0x00000001
  37. set *(unsigned long *)0x00ef6024 = 0x00000001
  38. end
  39. document sdram_init
  40. SDRAM controller initialization
  41. 0x01000000 - 0x017fffff (8MB)
  42. end
  43. # Initialize LAN controller
  44. define lanc_init
  45. set *(unsigned long *)0x00ef5008 = 0x03031303
  46. #RST DRV (P64)
  47. set *(unsigned char *)0x00ef1046 = 0x08
  48. set *(unsigned char *)0x00ef1026 = 0xff
  49. set *(unsigned char *)0x00ef1026 = 0x00
  50. set *(unsigned short *)0x02000630 = 0xffff
  51. end
  52. # Show current task structure
  53. define show_current
  54. set $current = $spi & 0xffffe000
  55. printf "$current=0x%08lX\n",$current
  56. print *(struct task_struct *)$current
  57. end
  58. # Show user assigned task structure
  59. define show_task
  60. set = $arg0 & 0xffffe000
  61. printf "$task=0x%08lX\n",$task
  62. print *(struct task_struct *)$task
  63. end
  64. document show_task
  65. Show user assigned task structure
  66. arg0 : task structure address
  67. end
  68. # Show M32R registers
  69. define show_regs
  70. printf " R0[0x%08lX] R1[0x%08lX] R2[0x%08lX] R3[0x%08lX]\n",$r0,$r1,$r2,$r3
  71. printf " R4[0x%08lX] R5[0x%08lX] R6[0x%08lX] R7[0x%08lX]\n",$r4,$r5,$r6,$r7
  72. printf " R8[0x%08lX] R9[0x%08lX] R10[0x%08lX] R11[0x%08lX]\n",$r8,$r9,$r10,$r11
  73. printf "R12[0x%08lX] FP[0x%08lX] LR[0x%08lX] SP[0x%08lX]\n",$r12,$fp,$lr,$sp
  74. printf "PSW[0x%08lX] CBR[0x%08lX] SPI[0x%08lX] SPU[0x%08lX]\n",$psw,$cbr,$spi,$spu
  75. printf "BPC[0x%08lX] PC[0x%08lX] ACCL[0x%08lX] ACCH[0x%08lX]\n",$bpc,$pc,$accl,$acch
  76. end
  77. # Setup all
  78. define setup
  79. use_mon_code
  80. set *(unsigned int)0xfffffffc=0x60
  81. shell sleep 0.1
  82. clock_init
  83. shell sleep 0.1
  84. port_init
  85. sdram_init
  86. lanc_init
  87. end
  88. # Load modules
  89. define load_modules
  90. use_debug_dma
  91. load
  92. end
  93. # Set kernel parameters
  94. define set_kernel_parameters
  95. set $param = (void*)0x01001000
  96. # INITRD_START
  97. # set *(unsigned long *)($param + 0x0010) = 0x00000000
  98. # INITRD_SIZE
  99. # set *(unsigned long *)($param + 0x0014) = 0x00000000
  100. # M32R_CPUCLK
  101. set *(unsigned long *)($param + 0x0018) = 0d66666667
  102. # M32R_BUSCLK
  103. set *(unsigned long *)($param + 0x001c) = 0d33333333
  104. # M32R_TIMER_DIVIDE
  105. set *(unsigned long *)($param + 0x0020) = 0d128
  106. set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x 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"
  107. end
  108. # Boot
  109. define boot
  110. set_kernel_parameters
  111. set $fp = 0
  112. set $pc = 0x01002000
  113. si
  114. c
  115. end
  116. # Set breakpoints
  117. define set_breakpoints
  118. b *0x00000020
  119. b *0x00000030
  120. end
  121. # Restart
  122. define restart
  123. sdireset
  124. sdireset
  125. setup
  126. load_modules
  127. boot
  128. end
  129. sdireset
  130. sdireset
  131. file vmlinux
  132. target m32rsdi
  133. setup
  134. #load_modules
  135. #set_breakpoints
  136. #boot