bonito64.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. /*
  2. * Bonito Register Map
  3. *
  4. * This file is the original bonito.h from Algorithmics with minor changes
  5. * to fit into linux.
  6. *
  7. * Copyright (c) 1999 Algorithmics Ltd
  8. *
  9. * Carsten Langgaard, carstenl@mips.com
  10. * Copyright (C) 2001 MIPS Technologies, Inc. All rights reserved.
  11. *
  12. * Algorithmics gives permission for anyone to use and modify this file
  13. * without any obligation or license condition except that you retain
  14. * this copyright message in any source redistribution in whole or part.
  15. *
  16. */
  17. /* Revision 1.48 autogenerated on 08/17/99 15:20:01 */
  18. /* This bonito64 version editted from bonito.h Revision 1.48 on 11/09/00 */
  19. #ifndef _ASM_MIPS_BOARDS_BONITO64_H
  20. #define _ASM_MIPS_BOARDS_BONITO64_H
  21. #ifdef __ASSEMBLY__
  22. /* offsets from base register */
  23. #define BONITO(x) (x)
  24. #else
  25. /*
  26. * Algorithmics Bonito64 system controller register base.
  27. */
  28. extern unsigned long _pcictrl_bonito;
  29. extern unsigned long _pcictrl_bonito_pcicfg;
  30. #define BONITO(x) *(volatile u32 *)(_pcictrl_bonito + (x))
  31. #endif /* __ASSEMBLY__ */
  32. #define BONITO_BOOT_BASE 0x1fc00000
  33. #define BONITO_BOOT_SIZE 0x00100000
  34. #define BONITO_BOOT_TOP (BONITO_BOOT_BASE+BONITO_BOOT_SIZE-1)
  35. #define BONITO_FLASH_BASE 0x1c000000
  36. #define BONITO_FLASH_SIZE 0x03000000
  37. #define BONITO_FLASH_TOP (BONITO_FLASH_BASE+BONITO_FLASH_SIZE-1)
  38. #define BONITO_SOCKET_BASE 0x1f800000
  39. #define BONITO_SOCKET_SIZE 0x00400000
  40. #define BONITO_SOCKET_TOP (BONITO_SOCKET_BASE+BONITO_SOCKET_SIZE-1)
  41. #define BONITO_REG_BASE 0x1fe00000
  42. #define BONITO_REG_SIZE 0x00040000
  43. #define BONITO_REG_TOP (BONITO_REG_BASE+BONITO_REG_SIZE-1)
  44. #define BONITO_DEV_BASE 0x1ff00000
  45. #define BONITO_DEV_SIZE 0x00100000
  46. #define BONITO_DEV_TOP (BONITO_DEV_BASE+BONITO_DEV_SIZE-1)
  47. #define BONITO_PCILO_BASE 0x10000000
  48. #define BONITO_PCILO_SIZE 0x0c000000
  49. #define BONITO_PCILO_TOP (BONITO_PCILO_BASE+BONITO_PCILO_SIZE-1)
  50. #define BONITO_PCILO0_BASE 0x10000000
  51. #define BONITO_PCILO1_BASE 0x14000000
  52. #define BONITO_PCILO2_BASE 0x18000000
  53. #define BONITO_PCIHI_BASE 0x20000000
  54. #define BONITO_PCIHI_SIZE 0x20000000
  55. #define BONITO_PCIHI_TOP (BONITO_PCIHI_BASE+BONITO_PCIHI_SIZE-1)
  56. #define BONITO_PCIIO_BASE 0x1fd00000
  57. #define BONITO_PCIIO_SIZE 0x00100000
  58. #define BONITO_PCIIO_TOP (BONITO_PCIIO_BASE+BONITO_PCIIO_SIZE-1)
  59. #define BONITO_PCICFG_BASE 0x1fe80000
  60. #define BONITO_PCICFG_SIZE 0x00080000
  61. #define BONITO_PCICFG_TOP (BONITO_PCICFG_BASE+BONITO_PCICFG_SIZE-1)
  62. /* Bonito Register Bases */
  63. #define BONITO_PCICONFIGBASE 0x00
  64. #define BONITO_REGBASE 0x100
  65. /* PCI Configuration Registers */
  66. #define BONITO_PCI_REG(x) BONITO(BONITO_PCICONFIGBASE + (x))
  67. #define BONITO_PCIDID BONITO_PCI_REG(0x00)
  68. #define BONITO_PCICMD BONITO_PCI_REG(0x04)
  69. #define BONITO_PCICLASS BONITO_PCI_REG(0x08)
  70. #define BONITO_PCILTIMER BONITO_PCI_REG(0x0c)
  71. #define BONITO_PCIBASE0 BONITO_PCI_REG(0x10)
  72. #define BONITO_PCIBASE1 BONITO_PCI_REG(0x14)
  73. #define BONITO_PCIBASE2 BONITO_PCI_REG(0x18)
  74. #define BONITO_PCIEXPRBASE BONITO_PCI_REG(0x30)
  75. #define BONITO_PCIINT BONITO_PCI_REG(0x3c)
  76. #define BONITO_PCICMD_PERR_CLR 0x80000000
  77. #define BONITO_PCICMD_SERR_CLR 0x40000000
  78. #define BONITO_PCICMD_MABORT_CLR 0x20000000
  79. #define BONITO_PCICMD_MTABORT_CLR 0x10000000
  80. #define BONITO_PCICMD_TABORT_CLR 0x08000000
  81. #define BONITO_PCICMD_MPERR_CLR 0x01000000
  82. #define BONITO_PCICMD_PERRRESPEN 0x00000040
  83. #define BONITO_PCICMD_ASTEPEN 0x00000080
  84. #define BONITO_PCICMD_SERREN 0x00000100
  85. #define BONITO_PCILTIMER_BUSLATENCY 0x0000ff00
  86. #define BONITO_PCILTIMER_BUSLATENCY_SHIFT 8
  87. /* 1. Bonito h/w Configuration */
  88. /* Power on register */
  89. #define BONITO_BONPONCFG BONITO(BONITO_REGBASE + 0x00)
  90. #define BONITO_BONPONCFG_SYSCONTROLLERRD 0x00040000
  91. #define BONITO_BONPONCFG_ROMCS1SAMP 0x00020000
  92. #define BONITO_BONPONCFG_ROMCS0SAMP 0x00010000
  93. #define BONITO_BONPONCFG_CPUBIGEND 0x00004000
  94. /* Added by RPF 11-9-00 */
  95. #define BONITO_BONPONCFG_BURSTORDER 0x00001000
  96. /* --- */
  97. #define BONITO_BONPONCFG_CPUPARITY 0x00002000
  98. #define BONITO_BONPONCFG_CPUTYPE 0x00000007
  99. #define BONITO_BONPONCFG_CPUTYPE_SHIFT 0
  100. #define BONITO_BONPONCFG_PCIRESET_OUT 0x00000008
  101. #define BONITO_BONPONCFG_IS_ARBITER 0x00000010
  102. #define BONITO_BONPONCFG_ROMBOOT 0x000000c0
  103. #define BONITO_BONPONCFG_ROMBOOT_SHIFT 6
  104. #define BONITO_BONPONCFG_ROMBOOT_FLASH (0x0<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
  105. #define BONITO_BONPONCFG_ROMBOOT_SOCKET (0x1<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
  106. #define BONITO_BONPONCFG_ROMBOOT_SDRAM (0x2<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
  107. #define BONITO_BONPONCFG_ROMBOOT_CPURESET (0x3<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
  108. #define BONITO_BONPONCFG_ROMCS0WIDTH 0x00000100
  109. #define BONITO_BONPONCFG_ROMCS1WIDTH 0x00000200
  110. #define BONITO_BONPONCFG_ROMCS0FAST 0x00000400
  111. #define BONITO_BONPONCFG_ROMCS1FAST 0x00000800
  112. #define BONITO_BONPONCFG_CONFIG_DIS 0x00000020
  113. /* Other Bonito configuration */
  114. #define BONITO_BONGENCFG_OFFSET 0x4
  115. #define BONITO_BONGENCFG BONITO(BONITO_REGBASE + BONITO_BONGENCFG_OFFSET)
  116. #define BONITO_BONGENCFG_DEBUGMODE 0x00000001
  117. #define BONITO_BONGENCFG_SNOOPEN 0x00000002
  118. #define BONITO_BONGENCFG_CPUSELFRESET 0x00000004
  119. #define BONITO_BONGENCFG_FORCE_IRQA 0x00000008
  120. #define BONITO_BONGENCFG_IRQA_ISOUT 0x00000010
  121. #define BONITO_BONGENCFG_IRQA_FROM_INT1 0x00000020
  122. #define BONITO_BONGENCFG_BYTESWAP 0x00000040
  123. #define BONITO_BONGENCFG_UNCACHED 0x00000080
  124. #define BONITO_BONGENCFG_PREFETCHEN 0x00000100
  125. #define BONITO_BONGENCFG_WBEHINDEN 0x00000200
  126. #define BONITO_BONGENCFG_CACHEALG 0x00000c00
  127. #define BONITO_BONGENCFG_CACHEALG_SHIFT 10
  128. #define BONITO_BONGENCFG_PCIQUEUE 0x00001000
  129. #define BONITO_BONGENCFG_CACHESTOP 0x00002000
  130. #define BONITO_BONGENCFG_MSTRBYTESWAP 0x00004000
  131. #define BONITO_BONGENCFG_BUSERREN 0x00008000
  132. #define BONITO_BONGENCFG_NORETRYTIMEOUT 0x00010000
  133. #define BONITO_BONGENCFG_SHORTCOPYTIMEOUT 0x00020000
  134. /* 2. IO & IDE configuration */
  135. #define BONITO_IODEVCFG BONITO(BONITO_REGBASE + 0x08)
  136. /* 3. IO & IDE configuration */
  137. #define BONITO_SDCFG BONITO(BONITO_REGBASE + 0x0c)
  138. /* 4. PCI address map control */
  139. #define BONITO_PCIMAP BONITO(BONITO_REGBASE + 0x10)
  140. #define BONITO_PCIMEMBASECFG BONITO(BONITO_REGBASE + 0x14)
  141. #define BONITO_PCIMAP_CFG BONITO(BONITO_REGBASE + 0x18)
  142. /* 5. ICU & GPIO regs */
  143. /* GPIO Regs - r/w */
  144. #define BONITO_GPIODATA_OFFSET 0x1c
  145. #define BONITO_GPIODATA BONITO(BONITO_REGBASE + BONITO_GPIODATA_OFFSET)
  146. #define BONITO_GPIOIE BONITO(BONITO_REGBASE + 0x20)
  147. /* ICU Configuration Regs - r/w */
  148. #define BONITO_INTEDGE BONITO(BONITO_REGBASE + 0x24)
  149. #define BONITO_INTSTEER BONITO(BONITO_REGBASE + 0x28)
  150. #define BONITO_INTPOL BONITO(BONITO_REGBASE + 0x2c)
  151. /* ICU Enable Regs - IntEn & IntISR are r/o. */
  152. #define BONITO_INTENSET BONITO(BONITO_REGBASE + 0x30)
  153. #define BONITO_INTENCLR BONITO(BONITO_REGBASE + 0x34)
  154. #define BONITO_INTEN BONITO(BONITO_REGBASE + 0x38)
  155. #define BONITO_INTISR BONITO(BONITO_REGBASE + 0x3c)
  156. /* PCI mail boxes */
  157. #define BONITO_PCIMAIL0_OFFSET 0x40
  158. #define BONITO_PCIMAIL1_OFFSET 0x44
  159. #define BONITO_PCIMAIL2_OFFSET 0x48
  160. #define BONITO_PCIMAIL3_OFFSET 0x4c
  161. #define BONITO_PCIMAIL0 BONITO(BONITO_REGBASE + 0x40)
  162. #define BONITO_PCIMAIL1 BONITO(BONITO_REGBASE + 0x44)
  163. #define BONITO_PCIMAIL2 BONITO(BONITO_REGBASE + 0x48)
  164. #define BONITO_PCIMAIL3 BONITO(BONITO_REGBASE + 0x4c)
  165. /* 6. PCI cache */
  166. #define BONITO_PCICACHECTRL BONITO(BONITO_REGBASE + 0x50)
  167. #define BONITO_PCICACHETAG BONITO(BONITO_REGBASE + 0x54)
  168. #define BONITO_PCIBADADDR BONITO(BONITO_REGBASE + 0x58)
  169. #define BONITO_PCIMSTAT BONITO(BONITO_REGBASE + 0x5c)
  170. /*
  171. #define BONITO_PCIRDPOST BONITO(BONITO_REGBASE + 0x60)
  172. #define BONITO_PCIDATA BONITO(BONITO_REGBASE + 0x64)
  173. */
  174. /* 7. IDE DMA & Copier */
  175. #define BONITO_CONFIGBASE 0x000
  176. #define BONITO_BONITOBASE 0x100
  177. #define BONITO_LDMABASE 0x200
  178. #define BONITO_COPBASE 0x300
  179. #define BONITO_REG_BLOCKMASK 0x300
  180. #define BONITO_LDMACTRL BONITO(BONITO_LDMABASE + 0x0)
  181. #define BONITO_LDMASTAT BONITO(BONITO_LDMABASE + 0x0)
  182. #define BONITO_LDMAADDR BONITO(BONITO_LDMABASE + 0x4)
  183. #define BONITO_LDMAGO BONITO(BONITO_LDMABASE + 0x8)
  184. #define BONITO_LDMADATA BONITO(BONITO_LDMABASE + 0xc)
  185. #define BONITO_COPCTRL BONITO(BONITO_COPBASE + 0x0)
  186. #define BONITO_COPSTAT BONITO(BONITO_COPBASE + 0x0)
  187. #define BONITO_COPPADDR BONITO(BONITO_COPBASE + 0x4)
  188. #define BONITO_COPDADDR BONITO(BONITO_COPBASE + 0x8)
  189. #define BONITO_COPGO BONITO(BONITO_COPBASE + 0xc)
  190. /* ###### Bit Definitions for individual Registers #### */
  191. /* Gen DMA. */
  192. #define BONITO_IDECOPDADDR_DMA_DADDR 0x0ffffffc
  193. #define BONITO_IDECOPDADDR_DMA_DADDR_SHIFT 2
  194. #define BONITO_IDECOPPADDR_DMA_PADDR 0xfffffffc
  195. #define BONITO_IDECOPPADDR_DMA_PADDR_SHIFT 2
  196. #define BONITO_IDECOPGO_DMA_SIZE 0x0000fffe
  197. #define BONITO_IDECOPGO_DMA_SIZE_SHIFT 0
  198. #define BONITO_IDECOPGO_DMA_WRITE 0x00010000
  199. #define BONITO_IDECOPGO_DMAWCOUNT 0x000f0000
  200. #define BONITO_IDECOPGO_DMAWCOUNT_SHIFT 16
  201. #define BONITO_IDECOPCTRL_DMA_STARTBIT 0x80000000
  202. #define BONITO_IDECOPCTRL_DMA_RSTBIT 0x40000000
  203. /* DRAM - sdCfg */
  204. #define BONITO_SDCFG_AROWBITS 0x00000003
  205. #define BONITO_SDCFG_AROWBITS_SHIFT 0
  206. #define BONITO_SDCFG_ACOLBITS 0x0000000c
  207. #define BONITO_SDCFG_ACOLBITS_SHIFT 2
  208. #define BONITO_SDCFG_ABANKBIT 0x00000010
  209. #define BONITO_SDCFG_ASIDES 0x00000020
  210. #define BONITO_SDCFG_AABSENT 0x00000040
  211. #define BONITO_SDCFG_AWIDTH64 0x00000080
  212. #define BONITO_SDCFG_BROWBITS 0x00000300
  213. #define BONITO_SDCFG_BROWBITS_SHIFT 8
  214. #define BONITO_SDCFG_BCOLBITS 0x00000c00
  215. #define BONITO_SDCFG_BCOLBITS_SHIFT 10
  216. #define BONITO_SDCFG_BBANKBIT 0x00001000
  217. #define BONITO_SDCFG_BSIDES 0x00002000
  218. #define BONITO_SDCFG_BABSENT 0x00004000
  219. #define BONITO_SDCFG_BWIDTH64 0x00008000
  220. #define BONITO_SDCFG_EXTRDDATA 0x00010000
  221. #define BONITO_SDCFG_EXTRASCAS 0x00020000
  222. #define BONITO_SDCFG_EXTPRECH 0x00040000
  223. #define BONITO_SDCFG_EXTRASWIDTH 0x00180000
  224. #define BONITO_SDCFG_EXTRASWIDTH_SHIFT 19
  225. /* Changed by RPF 11-9-00 */
  226. #define BONITO_SDCFG_DRAMMODESET 0x00200000
  227. /* --- */
  228. #define BONITO_SDCFG_DRAMEXTREGS 0x00400000
  229. #define BONITO_SDCFG_DRAMPARITY 0x00800000
  230. /* Added by RPF 11-9-00 */
  231. #define BONITO_SDCFG_DRAMBURSTLEN 0x03000000
  232. #define BONITO_SDCFG_DRAMBURSTLEN_SHIFT 24
  233. #define BONITO_SDCFG_DRAMMODESET_DONE 0x80000000
  234. /* --- */
  235. /* PCI Cache - pciCacheCtrl */
  236. #define BONITO_PCICACHECTRL_CACHECMD 0x00000007
  237. #define BONITO_PCICACHECTRL_CACHECMD_SHIFT 0
  238. #define BONITO_PCICACHECTRL_CACHECMDLINE 0x00000018
  239. #define BONITO_PCICACHECTRL_CACHECMDLINE_SHIFT 3
  240. #define BONITO_PCICACHECTRL_CMDEXEC 0x00000020
  241. #define BONITO_PCICACHECTRL_IOBCCOH_PRES 0x00000100
  242. #define BONITO_PCICACHECTRL_IOBCCOH_EN 0x00000200
  243. #define BONITO_PCICACHECTRL_CPUCOH_PRES 0x00000400
  244. #define BONITO_PCICACHECTRL_CPUCOH_EN 0x00000800
  245. #define BONITO_IODEVCFG_BUFFBIT_CS0 0x00000001
  246. #define BONITO_IODEVCFG_SPEEDBIT_CS0 0x00000002
  247. #define BONITO_IODEVCFG_MOREABITS_CS0 0x00000004
  248. #define BONITO_IODEVCFG_BUFFBIT_CS1 0x00000008
  249. #define BONITO_IODEVCFG_SPEEDBIT_CS1 0x00000010
  250. #define BONITO_IODEVCFG_MOREABITS_CS1 0x00000020
  251. #define BONITO_IODEVCFG_BUFFBIT_CS2 0x00000040
  252. #define BONITO_IODEVCFG_SPEEDBIT_CS2 0x00000080
  253. #define BONITO_IODEVCFG_MOREABITS_CS2 0x00000100
  254. #define BONITO_IODEVCFG_BUFFBIT_CS3 0x00000200
  255. #define BONITO_IODEVCFG_SPEEDBIT_CS3 0x00000400
  256. #define BONITO_IODEVCFG_MOREABITS_CS3 0x00000800
  257. #define BONITO_IODEVCFG_BUFFBIT_IDE 0x00001000
  258. #define BONITO_IODEVCFG_SPEEDBIT_IDE 0x00002000
  259. #define BONITO_IODEVCFG_WORDSWAPBIT_IDE 0x00004000
  260. #define BONITO_IODEVCFG_MODEBIT_IDE 0x00008000
  261. #define BONITO_IODEVCFG_DMAON_IDE 0x001f0000
  262. #define BONITO_IODEVCFG_DMAON_IDE_SHIFT 16
  263. #define BONITO_IODEVCFG_DMAOFF_IDE 0x01e00000
  264. #define BONITO_IODEVCFG_DMAOFF_IDE_SHIFT 21
  265. #define BONITO_IODEVCFG_EPROMSPLIT 0x02000000
  266. /* Added by RPF 11-9-00 */
  267. #define BONITO_IODEVCFG_CPUCLOCKPERIOD 0xfc000000
  268. #define BONITO_IODEVCFG_CPUCLOCKPERIOD_SHIFT 26
  269. /* --- */
  270. /* gpio */
  271. #define BONITO_GPIO_GPIOW 0x000003ff
  272. #define BONITO_GPIO_GPIOW_SHIFT 0
  273. #define BONITO_GPIO_GPIOR 0x01ff0000
  274. #define BONITO_GPIO_GPIOR_SHIFT 16
  275. #define BONITO_GPIO_GPINR 0xfe000000
  276. #define BONITO_GPIO_GPINR_SHIFT 25
  277. #define BONITO_GPIO_IOW(N) (1<<(BONITO_GPIO_GPIOW_SHIFT+(N)))
  278. #define BONITO_GPIO_IOR(N) (1<<(BONITO_GPIO_GPIOR_SHIFT+(N)))
  279. #define BONITO_GPIO_INR(N) (1<<(BONITO_GPIO_GPINR_SHIFT+(N)))
  280. /* ICU */
  281. #define BONITO_ICU_MBOXES 0x0000000f
  282. #define BONITO_ICU_MBOXES_SHIFT 0
  283. #define BONITO_ICU_DMARDY 0x00000010
  284. #define BONITO_ICU_DMAEMPTY 0x00000020
  285. #define BONITO_ICU_COPYRDY 0x00000040
  286. #define BONITO_ICU_COPYEMPTY 0x00000080
  287. #define BONITO_ICU_COPYERR 0x00000100
  288. #define BONITO_ICU_PCIIRQ 0x00000200
  289. #define BONITO_ICU_MASTERERR 0x00000400
  290. #define BONITO_ICU_SYSTEMERR 0x00000800
  291. #define BONITO_ICU_DRAMPERR 0x00001000
  292. #define BONITO_ICU_RETRYERR 0x00002000
  293. #define BONITO_ICU_GPIOS 0x01ff0000
  294. #define BONITO_ICU_GPIOS_SHIFT 16
  295. #define BONITO_ICU_GPINS 0x7e000000
  296. #define BONITO_ICU_GPINS_SHIFT 25
  297. #define BONITO_ICU_MBOX(N) (1<<(BONITO_ICU_MBOXES_SHIFT+(N)))
  298. #define BONITO_ICU_GPIO(N) (1<<(BONITO_ICU_GPIOS_SHIFT+(N)))
  299. #define BONITO_ICU_GPIN(N) (1<<(BONITO_ICU_GPINS_SHIFT+(N)))
  300. /* pcimap */
  301. #define BONITO_PCIMAP_PCIMAP_LO0 0x0000003f
  302. #define BONITO_PCIMAP_PCIMAP_LO0_SHIFT 0
  303. #define BONITO_PCIMAP_PCIMAP_LO1 0x00000fc0
  304. #define BONITO_PCIMAP_PCIMAP_LO1_SHIFT 6
  305. #define BONITO_PCIMAP_PCIMAP_LO2 0x0003f000
  306. #define BONITO_PCIMAP_PCIMAP_LO2_SHIFT 12
  307. #define BONITO_PCIMAP_PCIMAP_2 0x00040000
  308. #define BONITO_PCIMAP_WIN(WIN, ADDR) ((((ADDR)>>26) & BONITO_PCIMAP_PCIMAP_LO0) << ((WIN)*6))
  309. #define BONITO_PCIMAP_WINSIZE (1<<26)
  310. #define BONITO_PCIMAP_WINOFFSET(ADDR) ((ADDR) & (BONITO_PCIMAP_WINSIZE - 1))
  311. #define BONITO_PCIMAP_WINBASE(ADDR) ((ADDR) << 26)
  312. /* pcimembaseCfg */
  313. #define BONITO_PCIMEMBASECFG_MASK 0xf0000000
  314. #define BONITO_PCIMEMBASECFG_MEMBASE0_MASK 0x0000001f
  315. #define BONITO_PCIMEMBASECFG_MEMBASE0_MASK_SHIFT 0
  316. #define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS 0x000003e0
  317. #define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS_SHIFT 5
  318. #define BONITO_PCIMEMBASECFG_MEMBASE0_CACHED 0x00000400
  319. #define BONITO_PCIMEMBASECFG_MEMBASE0_IO 0x00000800
  320. #define BONITO_PCIMEMBASECFG_MEMBASE1_MASK 0x0001f000
  321. #define BONITO_PCIMEMBASECFG_MEMBASE1_MASK_SHIFT 12
  322. #define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS 0x003e0000
  323. #define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS_SHIFT 17
  324. #define BONITO_PCIMEMBASECFG_MEMBASE1_CACHED 0x00400000
  325. #define BONITO_PCIMEMBASECFG_MEMBASE1_IO 0x00800000
  326. #define BONITO_PCIMEMBASECFG_ASHIFT 23
  327. #define BONITO_PCIMEMBASECFG_AMASK 0x007fffff
  328. #define BONITO_PCIMEMBASECFGSIZE(WIN, SIZE) (((~((SIZE)-1))>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)
  329. #define BONITO_PCIMEMBASECFGBASE(WIN, BASE) (((BASE)>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS)
  330. #define BONITO_PCIMEMBASECFG_SIZE(WIN, CFG) (((((~(CFG)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)) << (BONITO_PCIMEMBASECFG_ASHIFT - BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) | BONITO_PCIMEMBASECFG_AMASK)
  331. #define BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
  332. #define BONITO_PCIMEMBASECFG_ADDRTRANS(WIN, CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
  333. #define BONITO_PCITOPHYS(WIN, ADDR, CFG) ( \
  334. (((ADDR) & (~(BONITO_PCIMEMBASECFG_MASK))) & (~(BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG)))) | \
  335. (BONITO_PCIMEMBASECFG_ADDRTRANS(WIN, CFG)) \
  336. )
  337. /* PCICmd */
  338. #define BONITO_PCICMD_MEMEN 0x00000002
  339. #define BONITO_PCICMD_MSTREN 0x00000004
  340. #endif /* _ASM_MIPS_BOARDS_BONITO64_H */