hardware.h 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. #ifndef __XTENSA_S6000_HARDWARE_H
  2. #define __XTENSA_S6000_HARDWARE_H
  3. #define S6_SCLK 1843200
  4. #define S6_MEM_REG 0x20000000
  5. #define S6_MEM_EFI 0x33F00000
  6. #define S6_MEM_PCIE_DATARAM1 0x34000000
  7. #define S6_MEM_XLMI 0x37F80000
  8. #define S6_MEM_PIF_DATARAM1 0x37FFC000
  9. #define S6_MEM_GMAC 0x38000000
  10. #define S6_MEM_I2S 0x3A000000
  11. #define S6_MEM_EGIB 0x3C000000
  12. #define S6_MEM_PCIE_CFG 0x3E000000
  13. #define S6_MEM_PIF_DATARAM 0x3FFE0000
  14. #define S6_MEM_XLMI_DATARAM 0x3FFF0000
  15. #define S6_MEM_DDR 0x40000000
  16. #define S6_MEM_PCIE_APER 0xC0000000
  17. #define S6_MEM_AUX 0xF0000000
  18. /* Device addresses */
  19. #define S6_REG_SCB S6_MEM_REG
  20. #define S6_REG_NB (S6_REG_SCB + 0x10000)
  21. #define S6_REG_LMSDMA (S6_REG_SCB + 0x20000)
  22. #define S6_REG_NI (S6_REG_SCB + 0x30000)
  23. #define S6_REG_NIDMA (S6_REG_SCB + 0x40000)
  24. #define S6_REG_NS (S6_REG_SCB + 0x50000)
  25. #define S6_REG_DDR (S6_REG_SCB + 0x60000)
  26. #define S6_REG_GREG1 (S6_REG_SCB + 0x70000)
  27. #define S6_REG_DP (S6_REG_SCB + 0x80000)
  28. #define S6_REG_DPDMA (S6_REG_SCB + 0x90000)
  29. #define S6_REG_EGIB (S6_REG_SCB + 0xA0000)
  30. #define S6_REG_PCIE (S6_REG_SCB + 0xB0000)
  31. #define S6_REG_I2S (S6_REG_SCB + 0xC0000)
  32. #define S6_REG_GMAC (S6_REG_SCB + 0xD0000)
  33. #define S6_REG_HIFDMA (S6_REG_SCB + 0xE0000)
  34. #define S6_REG_GREG2 (S6_REG_SCB + 0xF0000)
  35. #define S6_REG_APB S6_REG_SCB
  36. #define S6_REG_UART (S6_REG_APB + 0x0000)
  37. #define S6_REG_INTC (S6_REG_APB + 0x2000)
  38. #define S6_REG_SPI (S6_REG_APB + 0x3000)
  39. #define S6_REG_I2C (S6_REG_APB + 0x4000)
  40. #define S6_REG_GPIO (S6_REG_APB + 0x8000)
  41. /* Global register block */
  42. #define S6_GREG1_PLL_LOCKCLEAR 0x000
  43. #define S6_GREG1_PLL_LOCK_SYS 0
  44. #define S6_GREG1_PLL_LOCK_IO 1
  45. #define S6_GREG1_PLL_LOCK_AIM 2
  46. #define S6_GREG1_PLL_LOCK_DP0 3
  47. #define S6_GREG1_PLL_LOCK_DP2 4
  48. #define S6_GREG1_PLL_LOCK_DDR 5
  49. #define S6_GREG1_PLL_LOCKSTAT 0x004
  50. #define S6_GREG1_PLL_LOCKSTAT_CURLOCK 0
  51. #define S6_GREG1_PLL_LOCKSTAT_EVERUNLCK 8
  52. #define S6_GREG1_PLLSEL 0x010
  53. #define S6_GREG1_PLLSEL_AIM 0
  54. #define S6_GREG1_PLLSEL_AIM_DDR2 0
  55. #define S6_GREG1_PLLSEL_AIM_300MHZ 1
  56. #define S6_GREG1_PLLSEL_AIM_240MHZ 2
  57. #define S6_GREG1_PLLSEL_AIM_200MHZ 3
  58. #define S6_GREG1_PLLSEL_AIM_150MHZ 4
  59. #define S6_GREG1_PLLSEL_AIM_120MHZ 5
  60. #define S6_GREG1_PLLSEL_AIM_40MHZ 6
  61. #define S6_GREG1_PLLSEL_AIM_PLLAIMREF 7
  62. #define S6_GREG1_PLLSEL_AIM_MASK 7
  63. #define S6_GREG1_PLLSEL_DDR 8
  64. #define S6_GREG1_PLLSEL_DDR_HS 0
  65. #define S6_GREG1_PLLSEL_DDR_333MHZ 1
  66. #define S6_GREG1_PLLSEL_DDR_250MHZ 2
  67. #define S6_GREG1_PLLSEL_DDR_200MHZ 3
  68. #define S6_GREG1_PLLSEL_DDR_167MHZ 4
  69. #define S6_GREG1_PLLSEL_DDR_100MHZ 5
  70. #define S6_GREG1_PLLSEL_DDR_33MHZ 6
  71. #define S6_GREG1_PLLSEL_DDR_PLLIOREF 7
  72. #define S6_GREG1_PLLSEL_DDR_MASK 7
  73. #define S6_GREG1_PLLSEL_GMAC 16
  74. #define S6_GREG1_PLLSEL_GMAC_125MHZ 0
  75. #define S6_GREG1_PLLSEL_GMAC_25MHZ 1
  76. #define S6_GREG1_PLLSEL_GMAC_2500KHZ 2
  77. #define S6_GREG1_PLLSEL_GMAC_EXTERN 3
  78. #define S6_GREG1_PLLSEL_GMAC_MASK 3
  79. #define S6_GREG1_PLLSEL_GMII 18
  80. #define S6_GREG1_PLLSEL_GMII_111MHZ 0
  81. #define S6_GREG1_PLLSEL_GMII_IOREF 1
  82. #define S6_GREG1_PLLSEL_GMII_NONE 2
  83. #define S6_GREG1_PLLSEL_GMII_125MHZ 3
  84. #define S6_GREG1_PLLSEL_GMII_MASK 3
  85. #define S6_GREG1_SYSUNLOCKCNT 0x020
  86. #define S6_GREG1_IOUNLOCKCNT 0x024
  87. #define S6_GREG1_AIMUNLOCKCNT 0x028
  88. #define S6_GREG1_DP0UNLOCKCNT 0x02C
  89. #define S6_GREG1_DP2UNLOCKCNT 0x030
  90. #define S6_GREG1_DDRUNLOCKCNT 0x034
  91. #define S6_GREG1_CLKBAL0 0x040
  92. #define S6_GREG1_CLKBAL0_LSGB 0
  93. #define S6_GREG1_CLKBAL0_LSPX 8
  94. #define S6_GREG1_CLKBAL0_MEMDO 16
  95. #define S6_GREG1_CLKBAL0_HSXT1 24
  96. #define S6_GREG1_CLKBAL1 0x044
  97. #define S6_GREG1_CLKBAL1_HSISEF 0
  98. #define S6_GREG1_CLKBAL1_HSNI 8
  99. #define S6_GREG1_CLKBAL1_HSNS 16
  100. #define S6_GREG1_CLKBAL1_HSISEFCFG 24
  101. #define S6_GREG1_CLKBAL2 0x048
  102. #define S6_GREG1_CLKBAL2_LSNB 0
  103. #define S6_GREG1_CLKBAL2_LSSB 8
  104. #define S6_GREG1_CLKBAL2_LSREST 24
  105. #define S6_GREG1_CLKBAL3 0x04C
  106. #define S6_GREG1_CLKBAL3_ISEFXAD 0
  107. #define S6_GREG1_CLKBAL3_ISEFLMS 8
  108. #define S6_GREG1_CLKBAL3_ISEFISEF 16
  109. #define S6_GREG1_CLKBAL3_DDRDD 24
  110. #define S6_GREG1_CLKBAL4 0x050
  111. #define S6_GREG1_CLKBAL4_DDRDP 0
  112. #define S6_GREG1_CLKBAL4_DDRDO 8
  113. #define S6_GREG1_CLKBAL4_DDRNB 16
  114. #define S6_GREG1_CLKBAL4_DDRLMS 24
  115. #define S6_GREG1_BLOCKENA 0x100
  116. #define S6_GREG1_BLOCK_DDR 0
  117. #define S6_GREG1_BLOCK_DP 1
  118. #define S6_GREG1_BLOCK_NSNI 2
  119. #define S6_GREG1_BLOCK_PCIE 3
  120. #define S6_GREG1_BLOCK_GMAC 4
  121. #define S6_GREG1_BLOCK_I2S 5
  122. #define S6_GREG1_BLOCK_EGIB 6
  123. #define S6_GREG1_BLOCK_SB 7
  124. #define S6_GREG1_BLOCK_XT1 8
  125. #define S6_GREG1_CLKGATE 0x104
  126. #define S6_GREG1_BGATE_AIMNORTH 9
  127. #define S6_GREG1_BGATE_AIMEAST 10
  128. #define S6_GREG1_BGATE_AIMWEST 11
  129. #define S6_GREG1_BGATE_AIMSOUTH 12
  130. #define S6_GREG1_CHIPRES 0x108
  131. #define S6_GREG1_CHIPRES_SOFTRES 0
  132. #define S6_GREG1_CHIPRES_LOSTLOCK 1
  133. #define S6_GREG1_RESETCAUSE 0x10C
  134. #define S6_GREG1_RESETCAUSE_RESETN 0
  135. #define S6_GREG1_RESETCAUSE_GLOBAL 1
  136. #define S6_GREG1_RESETCAUSE_WDOGTIMER 2
  137. #define S6_GREG1_RESETCAUSE_SWCHIP 3
  138. #define S6_GREG1_RESETCAUSE_PLLSYSLOSS 4
  139. #define S6_GREG1_RESETCAUSE_PCIE 5
  140. #define S6_GREG1_RESETCAUSE_CREATEDGLOB 6
  141. #define S6_GREG1_REFCLOCKCNT 0x110
  142. #define S6_GREG1_RESETTIMER 0x114
  143. #define S6_GREG1_NMITIMER 0x118
  144. #define S6_GREG1_GLOBAL_TIMER 0x11C
  145. #define S6_GREG1_TIMER0 0x180
  146. #define S6_GREG1_TIMER1 0x184
  147. #define S6_GREG1_UARTCLOCKSEL 0x204
  148. #define S6_GREG1_CHIPVERSPACKG 0x208
  149. #define S6_GREG1_CHIPVERSPACKG_CHIPVID 0
  150. #define S6_GREG1_CHIPVERSPACKG_PACKSEL 8
  151. #define S6_GREG1_ONDIETERMCTRL 0x20C
  152. #define S6_GREG1_ONDIETERMCTRL_WEST 0
  153. #define S6_GREG1_ONDIETERMCTRL_NORTH 2
  154. #define S6_GREG1_ONDIETERMCTRL_EAST 4
  155. #define S6_GREG1_ONDIETERMCTRL_SOUTH 6
  156. #define S6_GREG1_ONDIETERMCTRL_NONE 0
  157. #define S6_GREG1_ONDIETERMCTRL_75OHM 2
  158. #define S6_GREG1_ONDIETERMCTRL_MASK 3
  159. #define S6_GREG1_BOOT_CFG0 0x210
  160. #define S6_GREG1_BOOT_CFG0_AIMSTRONG 1
  161. #define S6_GREG1_BOOT_CFG0_MINIBOOTDL 2
  162. #define S6_GREG1_BOOT_CFG0_OCDGPIO8SET 5
  163. #define S6_GREG1_BOOT_CFG0_OCDGPIOENA 6
  164. #define S6_GREG1_BOOT_CFG0_DOWNSTREAM 7
  165. #define S6_GREG1_BOOT_CFG0_PLLSYSDIV 8
  166. #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_300MHZ 1
  167. #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_240MHZ 2
  168. #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_200MHZ 3
  169. #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_150MHZ 4
  170. #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_120MHZ 5
  171. #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_40MHZ 6
  172. #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_MASK 7
  173. #define S6_GREG1_BOOT_CFG0_BALHSLMS 12
  174. #define S6_GREG1_BOOT_CFG0_BALHSNB 18
  175. #define S6_GREG1_BOOT_CFG0_BALHSXAD 24
  176. #define S6_GREG1_BOOT_CFG1 0x214
  177. #define S6_GREG1_BOOT_CFG1_PCIE1LANE 1
  178. #define S6_GREG1_BOOT_CFG1_MPLLPRESCALE 2
  179. #define S6_GREG1_BOOT_CFG1_MPLLNCY 4
  180. #define S6_GREG1_BOOT_CFG1_MPLLNCY5 9
  181. #define S6_GREG1_BOOT_CFG1_BALHSREST 14
  182. #define S6_GREG1_BOOT_CFG1_BALHSPSMEMS 20
  183. #define S6_GREG1_BOOT_CFG1_BALLSGI 26
  184. #define S6_GREG1_BOOT_CFG2 0x218
  185. #define S6_GREG1_BOOT_CFG2_PEID 0
  186. #define S6_GREG1_BOOT_CFG3 0x21C
  187. #define S6_GREG1_DRAMBUSYHOLDOF 0x220
  188. #define S6_GREG1_DRAMBUSYHOLDOF_XT0 0
  189. #define S6_GREG1_DRAMBUSYHOLDOF_XT1 4
  190. #define S6_GREG1_DRAMBUSYHOLDOF_XT_MASK 7
  191. #define S6_GREG1_PCIEBAR1SIZE 0x224
  192. #define S6_GREG1_PCIEBAR2SIZE 0x228
  193. #define S6_GREG1_PCIEVENDOR 0x22C
  194. #define S6_GREG1_PCIEDEVICE 0x230
  195. #define S6_GREG1_PCIEREV 0x234
  196. #define S6_GREG1_PCIECLASS 0x238
  197. #define S6_GREG1_XT1DCACHEMISS 0x240
  198. #define S6_GREG1_XT1ICACHEMISS 0x244
  199. #define S6_GREG1_HWSEMAPHORE(n) (0x400 + 4 * (n))
  200. #define S6_GREG1_HWSEMAPHORE_NB 16
  201. /* peripheral interrupt numbers */
  202. #define S6_INTC_GPIO(n) (n) /* 0..3 */
  203. #define S6_INTC_I2C 4
  204. #define S6_INTC_SPI 5
  205. #define S6_INTC_NB_ERR 6
  206. #define S6_INTC_DMA_LMSERR 7
  207. #define S6_INTC_DMA_LMSLOWWMRK(n) (8 + (n)) /* 0..11 */
  208. #define S6_INTC_DMA_LMSPENDCNT(n) (20 + (n)) /* 0..11 */
  209. #define S6_INTC_DMA HOSTLOWWMRK(n) (32 + (n)) /* 0..6 */
  210. #define S6_INTC_DMA_HOSTPENDCNT(n) (39 + (n)) /* 0..6 */
  211. #define S6_INTC_DMA_HOSTERR 46
  212. #define S6_INTC_UART(n) (47 + (n)) /* 0..1 */
  213. #define S6_INTC_XAD 49
  214. #define S6_INTC_NI_ERR 50
  215. #define S6_INTC_NI_INFIFOFULL 51
  216. #define S6_INTC_DMA_NIERR 52
  217. #define S6_INTC_DMA_NILOWWMRK(n) (53 + (n)) /* 0..3 */
  218. #define S6_INTC_DMA_NIPENDCNT(n) (57 + (n)) /* 0..3 */
  219. #define S6_INTC_DDR 61
  220. #define S6_INTC_NS_ERR 62
  221. #define S6_INTC_EFI_CFGERR 63
  222. #define S6_INTC_EFI_ISEFTEST 64
  223. #define S6_INTC_EFI_WRITEERR 65
  224. #define S6_INTC_NMI_TIMER 66
  225. #define S6_INTC_PLLLOCK_SYS 67
  226. #define S6_INTC_PLLLOCK_IO 68
  227. #define S6_INTC_PLLLOCK_AIM 69
  228. #define S6_INTC_PLLLOCK_DP0 70
  229. #define S6_INTC_PLLLOCK_DP2 71
  230. #define S6_INTC_I2S_ERR 72
  231. #define S6_INTC_GMAC_STAT 73
  232. #define S6_INTC_GMAC_ERR 74
  233. #define S6_INTC_GIB_ERR 75
  234. #define S6_INTC_PCIE_ERR 76
  235. #define S6_INTC_PCIE_MSI(n) (77 + (n)) /* 0..3 */
  236. #define S6_INTC_PCIE_INTA 81
  237. #define S6_INTC_PCIE_INTB 82
  238. #define S6_INTC_PCIE_INTC 83
  239. #define S6_INTC_PCIE_INTD 84
  240. #define S6_INTC_SW(n) (85 + (n)) /* 0..9 */
  241. #define S6_INTC_SW_ENABLE(n) (85 + 256 + (n))
  242. #define S6_INTC_DMA_DP_ERR 95
  243. #define S6_INTC_DMA_DPLOWWMRK(n) (96 + (n)) /* 0..3 */
  244. #define S6_INTC_DMA_DPPENDCNT(n) (100 + (n)) /* 0..3 */
  245. #define S6_INTC_DMA_DPTERMCNT(n) (104 + (n)) /* 0..3 */
  246. #define S6_INTC_TIMER0 108
  247. #define S6_INTC_TIMER1 109
  248. #define S6_INTC_DMA_HOSTTERMCNT(n) (110 + (n)) /* 0..6 */
  249. #endif /* __XTENSA_S6000_HARDWARE_H */