qualcomm_qca4531.cfg 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # The QCA4531 is a two stream (2x2) 802.11b/g/n single-band programmable
  3. # Wi-Fi System-on-Chip (SoC) for the Internet of Things (IoT).
  4. #
  5. # Product page:
  6. # https://www.qualcomm.com/products/qca4531
  7. #
  8. # Notes:
  9. # - MIPS Processor ID (PRId): 0x00019374
  10. # - 24Kc MIPS processor with 64 KB I-Cache and 32 KB D-Cache,
  11. # operating at up to 650 MHz
  12. # - External 16-bit DDR1, operating at up to 200 MHz, DDR2 operating at up
  13. # to 300 MHz
  14. # - TRST is not available.
  15. # - EJTAG PrRst signal is not supported
  16. # - RESET_L pin B56 on the SoC will reset internal JTAG logic.
  17. #
  18. # Pins related for debug and bootstrap:
  19. # Name Pin Description
  20. # JTAG
  21. # JTAG_TCK GPIO0, (A27) Software configurable, default JTAG
  22. # JTAG_TDI GPIO1, (B23) Software configurable, default JTAG
  23. # JTAG_TDO GPIO2, (A28) Software configurable, default JTAG
  24. # JTAG_TMS GPIO3, (A29) Software configurable, default JTAG
  25. # Reset
  26. # RESET_L -, (B56) Input only
  27. # SYS_RST_L GPIO17, (A79) Output reset request or GPIO
  28. # Bootstrap
  29. # JTAG_MODE GPIO16, (A78) 0 - JTAG (Default); 1 - EJTAG
  30. # DDR_SELECT GPIO10, (A57) 0 - DDR2; 1 - DDR1
  31. # UART
  32. # UART0_SOUT GPIO10, (A57)
  33. # UART0_SIN GPIO9, (B49)
  34. # Per default we need to use "none" variant to be able properly "reset init"
  35. # or "reset halt" the CPU.
  36. reset_config none srst_pulls_trst
  37. # For SRST based variant we still need proper timings.
  38. # For ETH part the reset should be asserted at least for 10ms
  39. # Since there is no other information let's take 100ms to be sure.
  40. adapter srst pulse_width 100
  41. # according to the SoC documentation it should take at least 5ms from
  42. # reset end till bootstrap end. In the practice we need 8ms to get JTAG back
  43. # to live.
  44. adapter srst delay 8
  45. if { [info exists CHIPNAME] } {
  46. set _CHIPNAME $_CHIPNAME
  47. } else {
  48. set _CHIPNAME qca4531
  49. }
  50. jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x00000001
  51. set _TARGETNAME $_CHIPNAME.cpu
  52. target create $_TARGETNAME mips_m4k -endian big -chain-position $_TARGETNAME
  53. # provide watchdog helper.
  54. proc disable_watchdog { } {
  55. mww 0xb8060008 0x0
  56. }
  57. $_TARGETNAME configure -event halted { disable_watchdog }
  58. # Since PrRst is not supported and SRST will reset complete chip
  59. # with JTAG engine, we need to reset CPU from CPU itself.
  60. $_TARGETNAME configure -event reset-assert-pre {
  61. halt
  62. }
  63. $_TARGETNAME configure -event reset-assert {
  64. catch "mww 0xb806001C 0x01000000"
  65. }
  66. # To be able to trigger complete chip reset, in case JTAG is blocked
  67. # or CPU not responding, we still can use this helper.
  68. proc full_reset { } {
  69. reset_config srst_only
  70. reset
  71. halt
  72. reset_config none
  73. }
  74. # Section with helpers which can be used by boards
  75. proc qca4531_ddr2_550_550_init {} {
  76. # Clear reset flags for different SoC components
  77. mww 0xb806001c 0xfeceffff
  78. mww 0xb806001c 0xeeceffff
  79. mww 0xb806001c 0xe6ceffff
  80. # PMU configurations
  81. # Internal Switcher
  82. mww 0xb8116c40 0x633c8176
  83. # Increase the DDR voltage
  84. mww 0xb8116c44 0x10200000
  85. # XTAL Configurations
  86. mww 0xb81162c0 0x4b962100
  87. mww 0xb81162c4 0x480
  88. mww 0xb81162c8 0x04000144
  89. # Recommended PLL configurations
  90. mww 0xb81161c4 0x54086000
  91. mww 0xb8116244 0x54086000
  92. # PLL init
  93. mww 0xb8050008 0x0131001c
  94. mww 0xb8050000 0x40001580
  95. mww 0xb8050004 0x40015800
  96. mww 0xb8050008 0x0131001c
  97. mww 0xb8050000 0x00001580
  98. mww 0xb8050004 0x00015800
  99. mww 0xb8050008 0x01310000
  100. mww 0xb8050044 0x781003ff
  101. mww 0xb8050048 0x003c103f
  102. # DDR2 init
  103. mww 0xb8000108 0x401f0042
  104. mww 0xb80000b8 0x0000166d
  105. mww 0xb8000000 0xcfaaf33b
  106. mww 0xb800015c 0x0000000f
  107. mww 0xb8000004 0xa272efa8
  108. mww 0xb8000018 0x0000ffff
  109. mww 0xb80000c4 0x74444444
  110. mww 0xb80000c8 0x00000444
  111. mww 0xb8000004 0xa210ee28
  112. mww 0xb8000004 0xa2b2e1a8
  113. mww 0xb8000010 0x8
  114. mww 0xb80000bc 0x0
  115. mww 0xb8000010 0x10
  116. mww 0xb80000c0 0x0
  117. mww 0xb8000010 0x40
  118. mww 0xb800000c 0x2
  119. mww 0xb8000010 0x2
  120. mww 0xb8000008 0xb43
  121. mww 0xb8000010 0x1
  122. mww 0xb8000010 0x8
  123. mww 0xb8000010 0x4
  124. mww 0xb8000010 0x4
  125. mww 0xb8000008 0xa43
  126. mww 0xb8000010 0x1
  127. mww 0xb800000c 0x382
  128. mww 0xb8000010 0x2
  129. mww 0xb800000c 0x402
  130. mww 0xb8000010 0x2
  131. mww 0xb8000014 0x40be
  132. mww 0xb800001C 0x20
  133. mww 0xb8000020 0x20
  134. mww 0xb80000cc 0xfffff
  135. # UART GPIO programming
  136. mww 0xb8040000 0xff30b
  137. mww 0xb8040044 0x908
  138. mww 0xb8040034 0x160000
  139. }