gt64120.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /*
  2. * Copyright (C) 2000, 2004, 2005 MIPS Technologies, Inc.
  3. * All rights reserved.
  4. * Authors: Carsten Langgaard <carstenl@mips.com>
  5. * Maciej W. Rozycki <macro@mips.com>
  6. * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
  7. *
  8. * This program is free software; you can distribute it and/or modify it
  9. * under the terms of the GNU General Public License (Version 2) as
  10. * published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  15. * for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  20. */
  21. #ifndef _ASM_GT64120_H
  22. #define _ASM_GT64120_H
  23. #include <asm/addrspace.h>
  24. #include <asm/byteorder.h>
  25. #define MSK(n) ((1 << (n)) - 1)
  26. /*
  27. * Register offset addresses
  28. */
  29. /* CPU Configuration. */
  30. #define GT_CPU_OFS 0x000
  31. #define GT_MULTI_OFS 0x120
  32. /* CPU Address Decode. */
  33. #define GT_SCS10LD_OFS 0x008
  34. #define GT_SCS10HD_OFS 0x010
  35. #define GT_SCS32LD_OFS 0x018
  36. #define GT_SCS32HD_OFS 0x020
  37. #define GT_CS20LD_OFS 0x028
  38. #define GT_CS20HD_OFS 0x030
  39. #define GT_CS3BOOTLD_OFS 0x038
  40. #define GT_CS3BOOTHD_OFS 0x040
  41. #define GT_PCI0IOLD_OFS 0x048
  42. #define GT_PCI0IOHD_OFS 0x050
  43. #define GT_PCI0M0LD_OFS 0x058
  44. #define GT_PCI0M0HD_OFS 0x060
  45. #define GT_ISD_OFS 0x068
  46. #define GT_PCI0M1LD_OFS 0x080
  47. #define GT_PCI0M1HD_OFS 0x088
  48. #define GT_PCI1IOLD_OFS 0x090
  49. #define GT_PCI1IOHD_OFS 0x098
  50. #define GT_PCI1M0LD_OFS 0x0a0
  51. #define GT_PCI1M0HD_OFS 0x0a8
  52. #define GT_PCI1M1LD_OFS 0x0b0
  53. #define GT_PCI1M1HD_OFS 0x0b8
  54. #define GT_PCI1M1LD_OFS 0x0b0
  55. #define GT_PCI1M1HD_OFS 0x0b8
  56. #define GT_SCS10AR_OFS 0x0d0
  57. #define GT_SCS32AR_OFS 0x0d8
  58. #define GT_CS20R_OFS 0x0e0
  59. #define GT_CS3BOOTR_OFS 0x0e8
  60. #define GT_PCI0IOREMAP_OFS 0x0f0
  61. #define GT_PCI0M0REMAP_OFS 0x0f8
  62. #define GT_PCI0M1REMAP_OFS 0x100
  63. #define GT_PCI1IOREMAP_OFS 0x108
  64. #define GT_PCI1M0REMAP_OFS 0x110
  65. #define GT_PCI1M1REMAP_OFS 0x118
  66. /* CPU Error Report. */
  67. #define GT_CPUERR_ADDRLO_OFS 0x070
  68. #define GT_CPUERR_ADDRHI_OFS 0x078
  69. #define GT_CPUERR_DATALO_OFS 0x128 /* GT-64120A only */
  70. #define GT_CPUERR_DATAHI_OFS 0x130 /* GT-64120A only */
  71. #define GT_CPUERR_PARITY_OFS 0x138 /* GT-64120A only */
  72. /* CPU Sync Barrier. */
  73. #define GT_PCI0SYNC_OFS 0x0c0
  74. #define GT_PCI1SYNC_OFS 0x0c8
  75. /* SDRAM and Device Address Decode. */
  76. #define GT_SCS0LD_OFS 0x400
  77. #define GT_SCS0HD_OFS 0x404
  78. #define GT_SCS1LD_OFS 0x408
  79. #define GT_SCS1HD_OFS 0x40c
  80. #define GT_SCS2LD_OFS 0x410
  81. #define GT_SCS2HD_OFS 0x414
  82. #define GT_SCS3LD_OFS 0x418
  83. #define GT_SCS3HD_OFS 0x41c
  84. #define GT_CS0LD_OFS 0x420
  85. #define GT_CS0HD_OFS 0x424
  86. #define GT_CS1LD_OFS 0x428
  87. #define GT_CS1HD_OFS 0x42c
  88. #define GT_CS2LD_OFS 0x430
  89. #define GT_CS2HD_OFS 0x434
  90. #define GT_CS3LD_OFS 0x438
  91. #define GT_CS3HD_OFS 0x43c
  92. #define GT_BOOTLD_OFS 0x440
  93. #define GT_BOOTHD_OFS 0x444
  94. #define GT_ADERR_OFS 0x470
  95. /* SDRAM Configuration. */
  96. #define GT_SDRAM_CFG_OFS 0x448
  97. #define GT_SDRAM_OPMODE_OFS 0x474
  98. #define GT_SDRAM_BM_OFS 0x478
  99. #define GT_SDRAM_ADDRDECODE_OFS 0x47c
  100. /* SDRAM Parameters. */
  101. #define GT_SDRAM_B0_OFS 0x44c
  102. #define GT_SDRAM_B1_OFS 0x450
  103. #define GT_SDRAM_B2_OFS 0x454
  104. #define GT_SDRAM_B3_OFS 0x458
  105. /* Device Parameters. */
  106. #define GT_DEV_B0_OFS 0x45c
  107. #define GT_DEV_B1_OFS 0x460
  108. #define GT_DEV_B2_OFS 0x464
  109. #define GT_DEV_B3_OFS 0x468
  110. #define GT_DEV_BOOT_OFS 0x46c
  111. /* ECC. */
  112. #define GT_ECC_ERRDATALO 0x480 /* GT-64120A only */
  113. #define GT_ECC_ERRDATAHI 0x484 /* GT-64120A only */
  114. #define GT_ECC_MEM 0x488 /* GT-64120A only */
  115. #define GT_ECC_CALC 0x48c /* GT-64120A only */
  116. #define GT_ECC_ERRADDR 0x490 /* GT-64120A only */
  117. /* DMA Record. */
  118. #define GT_DMA0_CNT_OFS 0x800
  119. #define GT_DMA1_CNT_OFS 0x804
  120. #define GT_DMA2_CNT_OFS 0x808
  121. #define GT_DMA3_CNT_OFS 0x80c
  122. #define GT_DMA0_SA_OFS 0x810
  123. #define GT_DMA1_SA_OFS 0x814
  124. #define GT_DMA2_SA_OFS 0x818
  125. #define GT_DMA3_SA_OFS 0x81c
  126. #define GT_DMA0_DA_OFS 0x820
  127. #define GT_DMA1_DA_OFS 0x824
  128. #define GT_DMA2_DA_OFS 0x828
  129. #define GT_DMA3_DA_OFS 0x82c
  130. #define GT_DMA0_NEXT_OFS 0x830
  131. #define GT_DMA1_NEXT_OFS 0x834
  132. #define GT_DMA2_NEXT_OFS 0x838
  133. #define GT_DMA3_NEXT_OFS 0x83c
  134. #define GT_DMA0_CUR_OFS 0x870
  135. #define GT_DMA1_CUR_OFS 0x874
  136. #define GT_DMA2_CUR_OFS 0x878
  137. #define GT_DMA3_CUR_OFS 0x87c
  138. /* DMA Channel Control. */
  139. #define GT_DMA0_CTRL_OFS 0x840
  140. #define GT_DMA1_CTRL_OFS 0x844
  141. #define GT_DMA2_CTRL_OFS 0x848
  142. #define GT_DMA3_CTRL_OFS 0x84c
  143. /* DMA Arbiter. */
  144. #define GT_DMA_ARB_OFS 0x860
  145. /* Timer/Counter. */
  146. #define GT_TC0_OFS 0x850
  147. #define GT_TC1_OFS 0x854
  148. #define GT_TC2_OFS 0x858
  149. #define GT_TC3_OFS 0x85c
  150. #define GT_TC_CONTROL_OFS 0x864
  151. /* PCI Internal. */
  152. #define GT_PCI0_CMD_OFS 0xc00
  153. #define GT_PCI0_TOR_OFS 0xc04
  154. #define GT_PCI0_BS_SCS10_OFS 0xc08
  155. #define GT_PCI0_BS_SCS32_OFS 0xc0c
  156. #define GT_PCI0_BS_CS20_OFS 0xc10
  157. #define GT_PCI0_BS_CS3BT_OFS 0xc14
  158. #define GT_PCI1_IACK_OFS 0xc30
  159. #define GT_PCI0_IACK_OFS 0xc34
  160. #define GT_PCI0_BARE_OFS 0xc3c
  161. #define GT_PCI0_PREFMBR_OFS 0xc40
  162. #define GT_PCI0_SCS10_BAR_OFS 0xc48
  163. #define GT_PCI0_SCS32_BAR_OFS 0xc4c
  164. #define GT_PCI0_CS20_BAR_OFS 0xc50
  165. #define GT_PCI0_CS3BT_BAR_OFS 0xc54
  166. #define GT_PCI0_SSCS10_BAR_OFS 0xc58
  167. #define GT_PCI0_SSCS32_BAR_OFS 0xc5c
  168. #define GT_PCI0_SCS3BT_BAR_OFS 0xc64
  169. #define GT_PCI1_CMD_OFS 0xc80
  170. #define GT_PCI1_TOR_OFS 0xc84
  171. #define GT_PCI1_BS_SCS10_OFS 0xc88
  172. #define GT_PCI1_BS_SCS32_OFS 0xc8c
  173. #define GT_PCI1_BS_CS20_OFS 0xc90
  174. #define GT_PCI1_BS_CS3BT_OFS 0xc94
  175. #define GT_PCI1_BARE_OFS 0xcbc
  176. #define GT_PCI1_PREFMBR_OFS 0xcc0
  177. #define GT_PCI1_SCS10_BAR_OFS 0xcc8
  178. #define GT_PCI1_SCS32_BAR_OFS 0xccc
  179. #define GT_PCI1_CS20_BAR_OFS 0xcd0
  180. #define GT_PCI1_CS3BT_BAR_OFS 0xcd4
  181. #define GT_PCI1_SSCS10_BAR_OFS 0xcd8
  182. #define GT_PCI1_SSCS32_BAR_OFS 0xcdc
  183. #define GT_PCI1_SCS3BT_BAR_OFS 0xce4
  184. #define GT_PCI1_CFGADDR_OFS 0xcf0
  185. #define GT_PCI1_CFGDATA_OFS 0xcf4
  186. #define GT_PCI0_CFGADDR_OFS 0xcf8
  187. #define GT_PCI0_CFGDATA_OFS 0xcfc
  188. /* Interrupts. */
  189. #define GT_INTRCAUSE_OFS 0xc18
  190. #define GT_INTRMASK_OFS 0xc1c
  191. #define GT_PCI0_ICMASK_OFS 0xc24
  192. #define GT_PCI0_SERR0MASK_OFS 0xc28
  193. #define GT_CPU_INTSEL_OFS 0xc70
  194. #define GT_PCI0_INTSEL_OFS 0xc74
  195. #define GT_HINTRCAUSE_OFS 0xc98
  196. #define GT_HINTRMASK_OFS 0xc9c
  197. #define GT_PCI0_HICMASK_OFS 0xca4
  198. #define GT_PCI1_SERR1MASK_OFS 0xca8
  199. /*
  200. * I2O Support Registers
  201. */
  202. #define INBOUND_MESSAGE_REGISTER0_PCI_SIDE 0x010
  203. #define INBOUND_MESSAGE_REGISTER1_PCI_SIDE 0x014
  204. #define OUTBOUND_MESSAGE_REGISTER0_PCI_SIDE 0x018
  205. #define OUTBOUND_MESSAGE_REGISTER1_PCI_SIDE 0x01c
  206. #define INBOUND_DOORBELL_REGISTER_PCI_SIDE 0x020
  207. #define INBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE 0x024
  208. #define INBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE 0x028
  209. #define OUTBOUND_DOORBELL_REGISTER_PCI_SIDE 0x02c
  210. #define OUTBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE 0x030
  211. #define OUTBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE 0x034
  212. #define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE 0x040
  213. #define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE 0x044
  214. #define QUEUE_CONTROL_REGISTER_PCI_SIDE 0x050
  215. #define QUEUE_BASE_ADDRESS_REGISTER_PCI_SIDE 0x054
  216. #define INBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE 0x060
  217. #define INBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE 0x064
  218. #define INBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE 0x068
  219. #define INBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE 0x06c
  220. #define OUTBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE 0x070
  221. #define OUTBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE 0x074
  222. #define OUTBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE 0x078
  223. #define OUTBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE 0x07c
  224. #define INBOUND_MESSAGE_REGISTER0_CPU_SIDE 0x1c10
  225. #define INBOUND_MESSAGE_REGISTER1_CPU_SIDE 0x1c14
  226. #define OUTBOUND_MESSAGE_REGISTER0_CPU_SIDE 0x1c18
  227. #define OUTBOUND_MESSAGE_REGISTER1_CPU_SIDE 0x1c1c
  228. #define INBOUND_DOORBELL_REGISTER_CPU_SIDE 0x1c20
  229. #define INBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE 0x1c24
  230. #define INBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE 0x1c28
  231. #define OUTBOUND_DOORBELL_REGISTER_CPU_SIDE 0x1c2c
  232. #define OUTBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE 0x1c30
  233. #define OUTBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE 0x1c34
  234. #define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE 0x1c40
  235. #define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE 0x1c44
  236. #define QUEUE_CONTROL_REGISTER_CPU_SIDE 0x1c50
  237. #define QUEUE_BASE_ADDRESS_REGISTER_CPU_SIDE 0x1c54
  238. #define INBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c60
  239. #define INBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c64
  240. #define INBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c68
  241. #define INBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c6c
  242. #define OUTBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c70
  243. #define OUTBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c74
  244. #define OUTBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c78
  245. #define OUTBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c7c
  246. /*
  247. * Register encodings
  248. */
  249. #define GT_CPU_ENDIAN_SHF 12
  250. #define GT_CPU_ENDIAN_MSK (MSK(1) << GT_CPU_ENDIAN_SHF)
  251. #define GT_CPU_ENDIAN_BIT GT_CPU_ENDIAN_MSK
  252. #define GT_CPU_WR_SHF 16
  253. #define GT_CPU_WR_MSK (MSK(1) << GT_CPU_WR_SHF)
  254. #define GT_CPU_WR_BIT GT_CPU_WR_MSK
  255. #define GT_CPU_WR_DXDXDXDX 0
  256. #define GT_CPU_WR_DDDD 1
  257. #define GT_PCI_DCRM_SHF 21
  258. #define GT_PCI_LD_SHF 0
  259. #define GT_PCI_LD_MSK (MSK(15) << GT_PCI_LD_SHF)
  260. #define GT_PCI_HD_SHF 0
  261. #define GT_PCI_HD_MSK (MSK(7) << GT_PCI_HD_SHF)
  262. #define GT_PCI_REMAP_SHF 0
  263. #define GT_PCI_REMAP_MSK (MSK(11) << GT_PCI_REMAP_SHF)
  264. #define GT_CFGADDR_CFGEN_SHF 31
  265. #define GT_CFGADDR_CFGEN_MSK (MSK(1) << GT_CFGADDR_CFGEN_SHF)
  266. #define GT_CFGADDR_CFGEN_BIT GT_CFGADDR_CFGEN_MSK
  267. #define GT_CFGADDR_BUSNUM_SHF 16
  268. #define GT_CFGADDR_BUSNUM_MSK (MSK(8) << GT_CFGADDR_BUSNUM_SHF)
  269. #define GT_CFGADDR_DEVNUM_SHF 11
  270. #define GT_CFGADDR_DEVNUM_MSK (MSK(5) << GT_CFGADDR_DEVNUM_SHF)
  271. #define GT_CFGADDR_FUNCNUM_SHF 8
  272. #define GT_CFGADDR_FUNCNUM_MSK (MSK(3) << GT_CFGADDR_FUNCNUM_SHF)
  273. #define GT_CFGADDR_REGNUM_SHF 2
  274. #define GT_CFGADDR_REGNUM_MSK (MSK(6) << GT_CFGADDR_REGNUM_SHF)
  275. #define GT_SDRAM_BM_ORDER_SHF 2
  276. #define GT_SDRAM_BM_ORDER_MSK (MSK(1) << GT_SDRAM_BM_ORDER_SHF)
  277. #define GT_SDRAM_BM_ORDER_BIT GT_SDRAM_BM_ORDER_MSK
  278. #define GT_SDRAM_BM_ORDER_SUB 1
  279. #define GT_SDRAM_BM_ORDER_LIN 0
  280. #define GT_SDRAM_BM_RSVD_ALL1 0xffb
  281. #define GT_SDRAM_ADDRDECODE_ADDR_SHF 0
  282. #define GT_SDRAM_ADDRDECODE_ADDR_MSK (MSK(3) << GT_SDRAM_ADDRDECODE_ADDR_SHF)
  283. #define GT_SDRAM_ADDRDECODE_ADDR_0 0
  284. #define GT_SDRAM_ADDRDECODE_ADDR_1 1
  285. #define GT_SDRAM_ADDRDECODE_ADDR_2 2
  286. #define GT_SDRAM_ADDRDECODE_ADDR_3 3
  287. #define GT_SDRAM_ADDRDECODE_ADDR_4 4
  288. #define GT_SDRAM_ADDRDECODE_ADDR_5 5
  289. #define GT_SDRAM_ADDRDECODE_ADDR_6 6
  290. #define GT_SDRAM_ADDRDECODE_ADDR_7 7
  291. #define GT_SDRAM_B0_CASLAT_SHF 0
  292. #define GT_SDRAM_B0_CASLAT_MSK (MSK(2) << GT_SDRAM_B0__SHF)
  293. #define GT_SDRAM_B0_CASLAT_2 1
  294. #define GT_SDRAM_B0_CASLAT_3 2
  295. #define GT_SDRAM_B0_FTDIS_SHF 2
  296. #define GT_SDRAM_B0_FTDIS_MSK (MSK(1) << GT_SDRAM_B0_FTDIS_SHF)
  297. #define GT_SDRAM_B0_FTDIS_BIT GT_SDRAM_B0_FTDIS_MSK
  298. #define GT_SDRAM_B0_SRASPRCHG_SHF 3
  299. #define GT_SDRAM_B0_SRASPRCHG_MSK (MSK(1) << GT_SDRAM_B0_SRASPRCHG_SHF)
  300. #define GT_SDRAM_B0_SRASPRCHG_BIT GT_SDRAM_B0_SRASPRCHG_MSK
  301. #define GT_SDRAM_B0_SRASPRCHG_2 0
  302. #define GT_SDRAM_B0_SRASPRCHG_3 1
  303. #define GT_SDRAM_B0_B0COMPAB_SHF 4
  304. #define GT_SDRAM_B0_B0COMPAB_MSK (MSK(1) << GT_SDRAM_B0_B0COMPAB_SHF)
  305. #define GT_SDRAM_B0_B0COMPAB_BIT GT_SDRAM_B0_B0COMPAB_MSK
  306. #define GT_SDRAM_B0_64BITINT_SHF 5
  307. #define GT_SDRAM_B0_64BITINT_MSK (MSK(1) << GT_SDRAM_B0_64BITINT_SHF)
  308. #define GT_SDRAM_B0_64BITINT_BIT GT_SDRAM_B0_64BITINT_MSK
  309. #define GT_SDRAM_B0_64BITINT_2 0
  310. #define GT_SDRAM_B0_64BITINT_4 1
  311. #define GT_SDRAM_B0_BW_SHF 6
  312. #define GT_SDRAM_B0_BW_MSK (MSK(1) << GT_SDRAM_B0_BW_SHF)
  313. #define GT_SDRAM_B0_BW_BIT GT_SDRAM_B0_BW_MSK
  314. #define GT_SDRAM_B0_BW_32 0
  315. #define GT_SDRAM_B0_BW_64 1
  316. #define GT_SDRAM_B0_BLODD_SHF 7
  317. #define GT_SDRAM_B0_BLODD_MSK (MSK(1) << GT_SDRAM_B0_BLODD_SHF)
  318. #define GT_SDRAM_B0_BLODD_BIT GT_SDRAM_B0_BLODD_MSK
  319. #define GT_SDRAM_B0_PAR_SHF 8
  320. #define GT_SDRAM_B0_PAR_MSK (MSK(1) << GT_SDRAM_B0_PAR_SHF)
  321. #define GT_SDRAM_B0_PAR_BIT GT_SDRAM_B0_PAR_MSK
  322. #define GT_SDRAM_B0_BYPASS_SHF 9
  323. #define GT_SDRAM_B0_BYPASS_MSK (MSK(1) << GT_SDRAM_B0_BYPASS_SHF)
  324. #define GT_SDRAM_B0_BYPASS_BIT GT_SDRAM_B0_BYPASS_MSK
  325. #define GT_SDRAM_B0_SRAS2SCAS_SHF 10
  326. #define GT_SDRAM_B0_SRAS2SCAS_MSK (MSK(1) << GT_SDRAM_B0_SRAS2SCAS_SHF)
  327. #define GT_SDRAM_B0_SRAS2SCAS_BIT GT_SDRAM_B0_SRAS2SCAS_MSK
  328. #define GT_SDRAM_B0_SRAS2SCAS_2 0
  329. #define GT_SDRAM_B0_SRAS2SCAS_3 1
  330. #define GT_SDRAM_B0_SIZE_SHF 11
  331. #define GT_SDRAM_B0_SIZE_MSK (MSK(1) << GT_SDRAM_B0_SIZE_SHF)
  332. #define GT_SDRAM_B0_SIZE_BIT GT_SDRAM_B0_SIZE_MSK
  333. #define GT_SDRAM_B0_SIZE_16M 0
  334. #define GT_SDRAM_B0_SIZE_64M 1
  335. #define GT_SDRAM_B0_EXTPAR_SHF 12
  336. #define GT_SDRAM_B0_EXTPAR_MSK (MSK(1) << GT_SDRAM_B0_EXTPAR_SHF)
  337. #define GT_SDRAM_B0_EXTPAR_BIT GT_SDRAM_B0_EXTPAR_MSK
  338. #define GT_SDRAM_B0_BLEN_SHF 13
  339. #define GT_SDRAM_B0_BLEN_MSK (MSK(1) << GT_SDRAM_B0_BLEN_SHF)
  340. #define GT_SDRAM_B0_BLEN_BIT GT_SDRAM_B0_BLEN_MSK
  341. #define GT_SDRAM_B0_BLEN_8 0
  342. #define GT_SDRAM_B0_BLEN_4 1
  343. #define GT_SDRAM_CFG_REFINT_SHF 0
  344. #define GT_SDRAM_CFG_REFINT_MSK (MSK(14) << GT_SDRAM_CFG_REFINT_SHF)
  345. #define GT_SDRAM_CFG_NINTERLEAVE_SHF 14
  346. #define GT_SDRAM_CFG_NINTERLEAVE_MSK (MSK(1) << GT_SDRAM_CFG_NINTERLEAVE_SHF)
  347. #define GT_SDRAM_CFG_NINTERLEAVE_BIT GT_SDRAM_CFG_NINTERLEAVE_MSK
  348. #define GT_SDRAM_CFG_RMW_SHF 15
  349. #define GT_SDRAM_CFG_RMW_MSK (MSK(1) << GT_SDRAM_CFG_RMW_SHF)
  350. #define GT_SDRAM_CFG_RMW_BIT GT_SDRAM_CFG_RMW_MSK
  351. #define GT_SDRAM_CFG_NONSTAGREF_SHF 16
  352. #define GT_SDRAM_CFG_NONSTAGREF_MSK (MSK(1) << GT_SDRAM_CFG_NONSTAGREF_SHF)
  353. #define GT_SDRAM_CFG_NONSTAGREF_BIT GT_SDRAM_CFG_NONSTAGREF_MSK
  354. #define GT_SDRAM_CFG_DUPCNTL_SHF 19
  355. #define GT_SDRAM_CFG_DUPCNTL_MSK (MSK(1) << GT_SDRAM_CFG_DUPCNTL_SHF)
  356. #define GT_SDRAM_CFG_DUPCNTL_BIT GT_SDRAM_CFG_DUPCNTL_MSK
  357. #define GT_SDRAM_CFG_DUPBA_SHF 20
  358. #define GT_SDRAM_CFG_DUPBA_MSK (MSK(1) << GT_SDRAM_CFG_DUPBA_SHF)
  359. #define GT_SDRAM_CFG_DUPBA_BIT GT_SDRAM_CFG_DUPBA_MSK
  360. #define GT_SDRAM_CFG_DUPEOT0_SHF 21
  361. #define GT_SDRAM_CFG_DUPEOT0_MSK (MSK(1) << GT_SDRAM_CFG_DUPEOT0_SHF)
  362. #define GT_SDRAM_CFG_DUPEOT0_BIT GT_SDRAM_CFG_DUPEOT0_MSK
  363. #define GT_SDRAM_CFG_DUPEOT1_SHF 22
  364. #define GT_SDRAM_CFG_DUPEOT1_MSK (MSK(1) << GT_SDRAM_CFG_DUPEOT1_SHF)
  365. #define GT_SDRAM_CFG_DUPEOT1_BIT GT_SDRAM_CFG_DUPEOT1_MSK
  366. #define GT_SDRAM_OPMODE_OP_SHF 0
  367. #define GT_SDRAM_OPMODE_OP_MSK (MSK(3) << GT_SDRAM_OPMODE_OP_SHF)
  368. #define GT_SDRAM_OPMODE_OP_NORMAL 0
  369. #define GT_SDRAM_OPMODE_OP_NOP 1
  370. #define GT_SDRAM_OPMODE_OP_PRCHG 2
  371. #define GT_SDRAM_OPMODE_OP_MODE 3
  372. #define GT_SDRAM_OPMODE_OP_CBR 4
  373. #define GT_TC_CONTROL_ENTC0_SHF 0
  374. #define GT_TC_CONTROL_ENTC0_MSK (MSK(1) << GT_TC_CONTROL_ENTC0_SHF)
  375. #define GT_TC_CONTROL_ENTC0_BIT GT_TC_CONTROL_ENTC0_MSK
  376. #define GT_TC_CONTROL_SELTC0_SHF 1
  377. #define GT_TC_CONTROL_SELTC0_MSK (MSK(1) << GT_TC_CONTROL_SELTC0_SHF)
  378. #define GT_TC_CONTROL_SELTC0_BIT GT_TC_CONTROL_SELTC0_MSK
  379. #define GT_PCI0_BARE_SWSCS3BOOTDIS_SHF 0
  380. #define GT_PCI0_BARE_SWSCS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS3BOOTDIS_SHF)
  381. #define GT_PCI0_BARE_SWSCS3BOOTDIS_BIT GT_PCI0_BARE_SWSCS3BOOTDIS_MSK
  382. #define GT_PCI0_BARE_SWSCS32DIS_SHF 1
  383. #define GT_PCI0_BARE_SWSCS32DIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS32DIS_SHF)
  384. #define GT_PCI0_BARE_SWSCS32DIS_BIT GT_PCI0_BARE_SWSCS32DIS_MSK
  385. #define GT_PCI0_BARE_SWSCS10DIS_SHF 2
  386. #define GT_PCI0_BARE_SWSCS10DIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS10DIS_SHF)
  387. #define GT_PCI0_BARE_SWSCS10DIS_BIT GT_PCI0_BARE_SWSCS10DIS_MSK
  388. #define GT_PCI0_BARE_INTIODIS_SHF 3
  389. #define GT_PCI0_BARE_INTIODIS_MSK (MSK(1) << GT_PCI0_BARE_INTIODIS_SHF)
  390. #define GT_PCI0_BARE_INTIODIS_BIT GT_PCI0_BARE_INTIODIS_MSK
  391. #define GT_PCI0_BARE_INTMEMDIS_SHF 4
  392. #define GT_PCI0_BARE_INTMEMDIS_MSK (MSK(1) << GT_PCI0_BARE_INTMEMDIS_SHF)
  393. #define GT_PCI0_BARE_INTMEMDIS_BIT GT_PCI0_BARE_INTMEMDIS_MSK
  394. #define GT_PCI0_BARE_CS3BOOTDIS_SHF 5
  395. #define GT_PCI0_BARE_CS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_CS3BOOTDIS_SHF)
  396. #define GT_PCI0_BARE_CS3BOOTDIS_BIT GT_PCI0_BARE_CS3BOOTDIS_MSK
  397. #define GT_PCI0_BARE_CS20DIS_SHF 6
  398. #define GT_PCI0_BARE_CS20DIS_MSK (MSK(1) << GT_PCI0_BARE_CS20DIS_SHF)
  399. #define GT_PCI0_BARE_CS20DIS_BIT GT_PCI0_BARE_CS20DIS_MSK
  400. #define GT_PCI0_BARE_SCS32DIS_SHF 7
  401. #define GT_PCI0_BARE_SCS32DIS_MSK (MSK(1) << GT_PCI0_BARE_SCS32DIS_SHF)
  402. #define GT_PCI0_BARE_SCS32DIS_BIT GT_PCI0_BARE_SCS32DIS_MSK
  403. #define GT_PCI0_BARE_SCS10DIS_SHF 8
  404. #define GT_PCI0_BARE_SCS10DIS_MSK (MSK(1) << GT_PCI0_BARE_SCS10DIS_SHF)
  405. #define GT_PCI0_BARE_SCS10DIS_BIT GT_PCI0_BARE_SCS10DIS_MSK
  406. #define GT_INTRCAUSE_MASABORT0_SHF 18
  407. #define GT_INTRCAUSE_MASABORT0_MSK (MSK(1) << GT_INTRCAUSE_MASABORT0_SHF)
  408. #define GT_INTRCAUSE_MASABORT0_BIT GT_INTRCAUSE_MASABORT0_MSK
  409. #define GT_INTRCAUSE_TARABORT0_SHF 19
  410. #define GT_INTRCAUSE_TARABORT0_MSK (MSK(1) << GT_INTRCAUSE_TARABORT0_SHF)
  411. #define GT_INTRCAUSE_TARABORT0_BIT GT_INTRCAUSE_TARABORT0_MSK
  412. #define GT_PCI0_CFGADDR_REGNUM_SHF 2
  413. #define GT_PCI0_CFGADDR_REGNUM_MSK (MSK(6) << GT_PCI0_CFGADDR_REGNUM_SHF)
  414. #define GT_PCI0_CFGADDR_FUNCTNUM_SHF 8
  415. #define GT_PCI0_CFGADDR_FUNCTNUM_MSK (MSK(3) << GT_PCI0_CFGADDR_FUNCTNUM_SHF)
  416. #define GT_PCI0_CFGADDR_DEVNUM_SHF 11
  417. #define GT_PCI0_CFGADDR_DEVNUM_MSK (MSK(5) << GT_PCI0_CFGADDR_DEVNUM_SHF)
  418. #define GT_PCI0_CFGADDR_BUSNUM_SHF 16
  419. #define GT_PCI0_CFGADDR_BUSNUM_MSK (MSK(8) << GT_PCI0_CFGADDR_BUSNUM_SHF)
  420. #define GT_PCI0_CFGADDR_CONFIGEN_SHF 31
  421. #define GT_PCI0_CFGADDR_CONFIGEN_MSK (MSK(1) << GT_PCI0_CFGADDR_CONFIGEN_SHF)
  422. #define GT_PCI0_CFGADDR_CONFIGEN_BIT GT_PCI0_CFGADDR_CONFIGEN_MSK
  423. #define GT_PCI0_CMD_MBYTESWAP_SHF 0
  424. #define GT_PCI0_CMD_MBYTESWAP_MSK (MSK(1) << GT_PCI0_CMD_MBYTESWAP_SHF)
  425. #define GT_PCI0_CMD_MBYTESWAP_BIT GT_PCI0_CMD_MBYTESWAP_MSK
  426. #define GT_PCI0_CMD_MWORDSWAP_SHF 10
  427. #define GT_PCI0_CMD_MWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_MWORDSWAP_SHF)
  428. #define GT_PCI0_CMD_MWORDSWAP_BIT GT_PCI0_CMD_MWORDSWAP_MSK
  429. #define GT_PCI0_CMD_SBYTESWAP_SHF 16
  430. #define GT_PCI0_CMD_SBYTESWAP_MSK (MSK(1) << GT_PCI0_CMD_SBYTESWAP_SHF)
  431. #define GT_PCI0_CMD_SBYTESWAP_BIT GT_PCI0_CMD_SBYTESWAP_MSK
  432. #define GT_PCI0_CMD_SWORDSWAP_SHF 11
  433. #define GT_PCI0_CMD_SWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_SWORDSWAP_SHF)
  434. #define GT_PCI0_CMD_SWORDSWAP_BIT GT_PCI0_CMD_SWORDSWAP_MSK
  435. #define GT_INTR_T0EXP_SHF 8
  436. #define GT_INTR_T0EXP_MSK (MSK(1) << GT_INTR_T0EXP_SHF)
  437. #define GT_INTR_T0EXP_BIT GT_INTR_T0EXP_MSK
  438. #define GT_INTR_RETRYCTR0_SHF 20
  439. #define GT_INTR_RETRYCTR0_MSK (MSK(1) << GT_INTR_RETRYCTR0_SHF)
  440. #define GT_INTR_RETRYCTR0_BIT GT_INTR_RETRYCTR0_MSK
  441. /*
  442. * Misc
  443. */
  444. #define GT_DEF_PCI0_IO_BASE 0x10000000UL
  445. #define GT_DEF_PCI0_IO_SIZE 0x02000000UL
  446. #define GT_DEF_PCI0_MEM0_BASE 0x12000000UL
  447. #define GT_DEF_PCI0_MEM0_SIZE 0x02000000UL
  448. #define GT_DEF_BASE 0x14000000UL
  449. #define GT_MAX_BANKSIZE (256 * 1024 * 1024) /* Max 256MB bank */
  450. #define GT_LATTIM_MIN 6 /* Minimum lat */
  451. /*
  452. * The gt64120_dep.h file must define the following macros
  453. *
  454. * GT_READ(ofs, data_pointer)
  455. * GT_WRITE(ofs, data) - read/write GT64120 registers in 32bit
  456. *
  457. * TIMER - gt64120 timer irq, temporary solution until
  458. * full gt64120 cascade interrupt support is in place
  459. */
  460. #include <mach-gt64120.h>
  461. /*
  462. * Because of an error/peculiarity in the Galileo chip, we need to swap the
  463. * bytes when running bigendian. We also provide non-swapping versions.
  464. */
  465. #define __GT_READ(ofs) \
  466. (*(volatile u32 *)(GT64120_BASE+(ofs)))
  467. #define __GT_WRITE(ofs, data) \
  468. do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0)
  469. #define GT_READ(ofs) le32_to_cpu(__GT_READ(ofs))
  470. #define GT_WRITE(ofs, data) __GT_WRITE(ofs, cpu_to_le32(data))
  471. extern void gt641xx_set_base_clock(unsigned int clock);
  472. extern int gt641xx_timer0_state(void);
  473. #endif /* _ASM_GT64120_H */