asm9260t.gdb 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #------------------------------------------------
  2. # SDRAM initialization script for the ASM9260T
  3. #------------------------------------------------
  4. define __setup_PLL
  5. echo "Enabling PLL for CPU" \n
  6. # outl(1<<2, REG_SET(HW_AHBCLKCTRL0));
  7. set *0x80040024 = 0x00000004
  8. # outl(1<<8, REG_SET(HW_AHBCLKCTRL1));
  9. set *0x80040034 = 0x00000100
  10. # outl(3<<9, REG_SET(HW_AHBCLKCTRL0));
  11. set *0x80040024 = 0x00000600
  12. # outl(inl(HW_PDRUNCFG)&0xFFFFFFFA, HW_PDRUNCFG);
  13. set *0x80040238 = 0x00000770
  14. # outl(2, HW_CPUCLKDIV);
  15. set *0x8004017C = 0x00000002
  16. # outl(2, HW_SYSAHBCLKDIV);
  17. set *0x80040180 = 0x00000002
  18. # outl(480, HW_SYSPLLCTRL);
  19. set *0x80040100 = 0x000001E0
  20. # __delay(50)
  21. set $i = 0
  22. while $i != 500
  23. set $i += 1
  24. end
  25. # outl(1, HW_MAINCLKSEL);
  26. set *0x80040120 = 0x00000001
  27. # outl(0, HW_MAINCLKUEN);
  28. set *0x80040124 = 0x00000000
  29. # outl(1, HW_MAINCLKUEN);
  30. set *0x80040124 = 0x00000001
  31. end
  32. define __setup_SDRAM
  33. echo "Enabling on-chip SDRAM" \n
  34. # outl((1<<6), REG_SET(HW_AHBCLKCTRL0));
  35. set *0x80040024 = 0x00000040
  36. # outl(0x00001188, HW_EMI_SCONR);
  37. set *0x80700000 = 0x00001188
  38. # outl(0x000a0500, HW_EMI_CTRL);
  39. set *0x8004034c = 0x000a0500
  40. # outl(0x20000000, HW_EMI_SCSLR2_LOW);
  41. set *0x8070001c = 0x20000000
  42. # outl(0x0000000c, HW_EMI_SMSKR2);
  43. set *0x8070005c = 0x0000000c
  44. # outl(0x024996d9, HW_EMI_STMG0R);
  45. set *0x80700004 = 0x024996d9
  46. # outl(0x00542b4f, HW_EMI_SMTMGR_SET0);
  47. set *0x80700094 = 0x00542b4f
  48. # outl(0x00003288, HW_EMI_SCTLR);
  49. set *0x8070000c = 0x00003288
  50. end
  51. # Step1: Connect to the J-Link gdb server
  52. define reset
  53. #target remote localhost:2331
  54. monitor reset
  55. # Step2: Reset peripheral (RSTC_CR)
  56. echo "------- Prepare for debug ASM9260T -------" \n
  57. __setup_PLL
  58. __setup_SDRAM
  59. # Step3: Load file(eg. getting-started project)
  60. load
  61. mon reg pc=0x20000000
  62. #info reg
  63. end