ixp23xx.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. /*
  2. * arch/arm/mach-ixp23xx/include/mach/ixp23xx.h
  3. *
  4. * Register definitions for IXP23XX
  5. *
  6. * Copyright (C) 2003-2005 Intel Corporation.
  7. * Copyright (C) 2005 MontaVista Software, Inc.
  8. *
  9. * Maintainer: Deepak Saxena <dsaxena@plexity.net>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #ifndef __ASM_ARCH_IXP23XX_H
  16. #define __ASM_ARCH_IXP23XX_H
  17. /*
  18. * IXP2300 linux memory map:
  19. *
  20. * virt phys size
  21. * fffd0000 a0000000 64K XSI2CPP_CSR
  22. * fffc0000 c4000000 4K EXP_CFG
  23. * fff00000 c8000000 64K PERIPHERAL
  24. * fe000000 1c0000000 16M CAP_CSR
  25. * fd000000 1c8000000 16M MSF_CSR
  26. * fb000000 16M ---
  27. * fa000000 1d8000000 32M PCI_IO
  28. * f8000000 1da000000 32M PCI_CFG
  29. * f6000000 1de000000 32M PCI_CREG
  30. * f4000000 32M ---
  31. * f0000000 1e0000000 64M PCI_MEM
  32. * e[c-f]000000 per-platform mappings
  33. */
  34. /****************************************************************************
  35. * Static mappings.
  36. ****************************************************************************/
  37. #define IXP23XX_XSI2CPP_CSR_PHYS 0xa0000000
  38. #define IXP23XX_XSI2CPP_CSR_VIRT 0xfffd0000
  39. #define IXP23XX_XSI2CPP_CSR_SIZE 0x00010000
  40. #define IXP23XX_EXP_CFG_PHYS 0xc4000000
  41. #define IXP23XX_EXP_CFG_VIRT 0xfffc0000
  42. #define IXP23XX_EXP_CFG_SIZE 0x00001000
  43. #define IXP23XX_PERIPHERAL_PHYS 0xc8000000
  44. #define IXP23XX_PERIPHERAL_VIRT 0xfff00000
  45. #define IXP23XX_PERIPHERAL_SIZE 0x00010000
  46. #define IXP23XX_CAP_CSR_PHYS 0x1c0000000ULL
  47. #define IXP23XX_CAP_CSR_VIRT 0xfe000000
  48. #define IXP23XX_CAP_CSR_SIZE 0x01000000
  49. #define IXP23XX_MSF_CSR_PHYS 0x1c8000000ULL
  50. #define IXP23XX_MSF_CSR_VIRT 0xfd000000
  51. #define IXP23XX_MSF_CSR_SIZE 0x01000000
  52. #define IXP23XX_PCI_IO_PHYS 0x1d8000000ULL
  53. #define IXP23XX_PCI_IO_VIRT 0xfa000000
  54. #define IXP23XX_PCI_IO_SIZE 0x02000000
  55. #define IXP23XX_PCI_CFG_PHYS 0x1da000000ULL
  56. #define IXP23XX_PCI_CFG_VIRT 0xf8000000
  57. #define IXP23XX_PCI_CFG_SIZE 0x02000000
  58. #define IXP23XX_PCI_CFG0_VIRT IXP23XX_PCI_CFG_VIRT
  59. #define IXP23XX_PCI_CFG1_VIRT (IXP23XX_PCI_CFG_VIRT + 0x01000000)
  60. #define IXP23XX_PCI_CREG_PHYS 0x1de000000ULL
  61. #define IXP23XX_PCI_CREG_VIRT 0xf6000000
  62. #define IXP23XX_PCI_CREG_SIZE 0x02000000
  63. #define IXP23XX_PCI_CSR_VIRT (IXP23XX_PCI_CREG_VIRT + 0x01000000)
  64. #define IXP23XX_PCI_MEM_START 0xe0000000
  65. #define IXP23XX_PCI_MEM_PHYS 0x1e0000000ULL
  66. #define IXP23XX_PCI_MEM_VIRT 0xf0000000
  67. #define IXP23XX_PCI_MEM_SIZE 0x04000000
  68. /****************************************************************************
  69. * XSI2CPP CSRs.
  70. ****************************************************************************/
  71. #define IXP23XX_XSI2CPP_REG(x) ((volatile unsigned long *)(IXP23XX_XSI2CPP_CSR_VIRT + (x)))
  72. #define IXP23XX_CPP2XSI_CURR_XFER_REG3 IXP23XX_XSI2CPP_REG(0xf8)
  73. #define IXP23XX_CPP2XSI_ADDR_31 (1 << 19)
  74. #define IXP23XX_CPP2XSI_PSH_OFF (1 << 20)
  75. #define IXP23XX_CPP2XSI_COH_OFF (1 << 21)
  76. /****************************************************************************
  77. * Expansion Bus Config.
  78. ****************************************************************************/
  79. #define IXP23XX_EXP_CFG_REG(x) ((volatile unsigned long *)(IXP23XX_EXP_CFG_VIRT + (x)))
  80. #define IXP23XX_EXP_CS0 IXP23XX_EXP_CFG_REG(0x00)
  81. #define IXP23XX_EXP_CS1 IXP23XX_EXP_CFG_REG(0x04)
  82. #define IXP23XX_EXP_CS2 IXP23XX_EXP_CFG_REG(0x08)
  83. #define IXP23XX_EXP_CS3 IXP23XX_EXP_CFG_REG(0x0c)
  84. #define IXP23XX_EXP_CS4 IXP23XX_EXP_CFG_REG(0x10)
  85. #define IXP23XX_EXP_CS5 IXP23XX_EXP_CFG_REG(0x14)
  86. #define IXP23XX_EXP_CS6 IXP23XX_EXP_CFG_REG(0x18)
  87. #define IXP23XX_EXP_CS7 IXP23XX_EXP_CFG_REG(0x1c)
  88. #define IXP23XX_FLASH_WRITABLE (0x2)
  89. #define IXP23XX_FLASH_BUS8 (0x1)
  90. #define IXP23XX_EXP_CFG0 IXP23XX_EXP_CFG_REG(0x20)
  91. #define IXP23XX_EXP_CFG1 IXP23XX_EXP_CFG_REG(0x24)
  92. #define IXP23XX_EXP_CFG0_MEM_MAP (1 << 31)
  93. #define IXP23XX_EXP_CFG0_XSCALE_SPEED_SEL (3 << 22)
  94. #define IXP23XX_EXP_CFG0_XSCALE_SPEED_EN (1 << 21)
  95. #define IXP23XX_EXP_CFG0_CPP_SPEED_SEL (3 << 19)
  96. #define IXP23XX_EXP_CFG0_CPP_SPEED_EN (1 << 18)
  97. #define IXP23XX_EXP_CFG0_PCI_SWIN (3 << 16)
  98. #define IXP23XX_EXP_CFG0_PCI_DWIN (3 << 14)
  99. #define IXP23XX_EXP_CFG0_PCI33_MODE (1 << 13)
  100. #define IXP23XX_EXP_CFG0_QDR_SPEED_SEL (1 << 12)
  101. #define IXP23XX_EXP_CFG0_CPP_DIV_SEL (1 << 5)
  102. #define IXP23XX_EXP_CFG0_XSI_NOT_PRES (1 << 4)
  103. #define IXP23XX_EXP_CFG0_PROM_BOOT (1 << 3)
  104. #define IXP23XX_EXP_CFG0_PCI_ARB (1 << 2)
  105. #define IXP23XX_EXP_CFG0_PCI_HOST (1 << 1)
  106. #define IXP23XX_EXP_CFG0_FLASH_WIDTH (1 << 0)
  107. #define IXP23XX_EXP_UNIT_FUSE IXP23XX_EXP_CFG_REG(0x28)
  108. #define IXP23XX_EXP_MSF_MUX IXP23XX_EXP_CFG_REG(0x30)
  109. #define IXP23XX_EXP_CFG_FUSE IXP23XX_EXP_CFG_REG(0x34)
  110. #define IXP23XX_EXP_BUS_PHYS 0x90000000
  111. #define IXP23XX_EXP_BUS_WINDOW_SIZE 0x01000000
  112. #define IXP23XX_EXP_BUS_CS0_BASE (IXP23XX_EXP_BUS_PHYS + 0x00000000)
  113. #define IXP23XX_EXP_BUS_CS1_BASE (IXP23XX_EXP_BUS_PHYS + 0x01000000)
  114. #define IXP23XX_EXP_BUS_CS2_BASE (IXP23XX_EXP_BUS_PHYS + 0x02000000)
  115. #define IXP23XX_EXP_BUS_CS3_BASE (IXP23XX_EXP_BUS_PHYS + 0x03000000)
  116. #define IXP23XX_EXP_BUS_CS4_BASE (IXP23XX_EXP_BUS_PHYS + 0x04000000)
  117. #define IXP23XX_EXP_BUS_CS5_BASE (IXP23XX_EXP_BUS_PHYS + 0x05000000)
  118. #define IXP23XX_EXP_BUS_CS6_BASE (IXP23XX_EXP_BUS_PHYS + 0x06000000)
  119. #define IXP23XX_EXP_BUS_CS7_BASE (IXP23XX_EXP_BUS_PHYS + 0x07000000)
  120. /****************************************************************************
  121. * Peripherals.
  122. ****************************************************************************/
  123. #define IXP23XX_UART1_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x0000)
  124. #define IXP23XX_UART2_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x1000)
  125. #define IXP23XX_PMU_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x2000)
  126. #define IXP23XX_INTC_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x3000)
  127. #define IXP23XX_GPIO_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x4000)
  128. #define IXP23XX_TIMER_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x5000)
  129. #define IXP23XX_NPE0_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x6000)
  130. #define IXP23XX_DSR_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x7000)
  131. #define IXP23XX_NPE1_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x8000)
  132. #define IXP23XX_ETH0_VIRT (IXP23XX_PERIPHERAL_VIRT + 0x9000)
  133. #define IXP23XX_ETH1_VIRT (IXP23XX_PERIPHERAL_VIRT + 0xA000)
  134. #define IXP23XX_GIG0_VIRT (IXP23XX_PERIPHERAL_VIRT + 0xB000)
  135. #define IXP23XX_GIG1_VIRT (IXP23XX_PERIPHERAL_VIRT + 0xC000)
  136. #define IXP23XX_DDRS_VIRT (IXP23XX_PERIPHERAL_VIRT + 0xD000)
  137. #define IXP23XX_UART1_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x0000)
  138. #define IXP23XX_UART2_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x1000)
  139. #define IXP23XX_PMU_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x2000)
  140. #define IXP23XX_INTC_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x3000)
  141. #define IXP23XX_GPIO_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x4000)
  142. #define IXP23XX_TIMER_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x5000)
  143. #define IXP23XX_NPE0_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x6000)
  144. #define IXP23XX_DSR_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x7000)
  145. #define IXP23XX_NPE1_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x8000)
  146. #define IXP23XX_ETH0_PHYS (IXP23XX_PERIPHERAL_PHYS + 0x9000)
  147. #define IXP23XX_ETH1_PHYS (IXP23XX_PERIPHERAL_PHYS + 0xA000)
  148. #define IXP23XX_GIG0_PHYS (IXP23XX_PERIPHERAL_PHYS + 0xB000)
  149. #define IXP23XX_GIG1_PHYS (IXP23XX_PERIPHERAL_PHYS + 0xC000)
  150. #define IXP23XX_DDRS_PHYS (IXP23XX_PERIPHERAL_PHYS + 0xD000)
  151. /****************************************************************************
  152. * Interrupt controller.
  153. ****************************************************************************/
  154. #define IXP23XX_INTC_REG(x) ((volatile unsigned long *)(IXP23XX_INTC_VIRT + (x)))
  155. #define IXP23XX_INTR_ST1 IXP23XX_INTC_REG(0x00)
  156. #define IXP23XX_INTR_ST2 IXP23XX_INTC_REG(0x04)
  157. #define IXP23XX_INTR_ST3 IXP23XX_INTC_REG(0x08)
  158. #define IXP23XX_INTR_ST4 IXP23XX_INTC_REG(0x0c)
  159. #define IXP23XX_INTR_EN1 IXP23XX_INTC_REG(0x10)
  160. #define IXP23XX_INTR_EN2 IXP23XX_INTC_REG(0x14)
  161. #define IXP23XX_INTR_EN3 IXP23XX_INTC_REG(0x18)
  162. #define IXP23XX_INTR_EN4 IXP23XX_INTC_REG(0x1c)
  163. #define IXP23XX_INTR_SEL1 IXP23XX_INTC_REG(0x20)
  164. #define IXP23XX_INTR_SEL2 IXP23XX_INTC_REG(0x24)
  165. #define IXP23XX_INTR_SEL3 IXP23XX_INTC_REG(0x28)
  166. #define IXP23XX_INTR_SEL4 IXP23XX_INTC_REG(0x2c)
  167. #define IXP23XX_INTR_IRQ_ST1 IXP23XX_INTC_REG(0x30)
  168. #define IXP23XX_INTR_IRQ_ST2 IXP23XX_INTC_REG(0x34)
  169. #define IXP23XX_INTR_IRQ_ST3 IXP23XX_INTC_REG(0x38)
  170. #define IXP23XX_INTR_IRQ_ST4 IXP23XX_INTC_REG(0x3c)
  171. #define IXP23XX_INTR_IRQ_ENC_ST_OFFSET 0x54
  172. /****************************************************************************
  173. * GPIO.
  174. ****************************************************************************/
  175. #define IXP23XX_GPIO_REG(x) ((volatile unsigned long *)(IXP23XX_GPIO_VIRT + (x)))
  176. #define IXP23XX_GPIO_GPOUTR IXP23XX_GPIO_REG(0x00)
  177. #define IXP23XX_GPIO_GPOER IXP23XX_GPIO_REG(0x04)
  178. #define IXP23XX_GPIO_GPINR IXP23XX_GPIO_REG(0x08)
  179. #define IXP23XX_GPIO_GPISR IXP23XX_GPIO_REG(0x0c)
  180. #define IXP23XX_GPIO_GPIT1R IXP23XX_GPIO_REG(0x10)
  181. #define IXP23XX_GPIO_GPIT2R IXP23XX_GPIO_REG(0x14)
  182. #define IXP23XX_GPIO_GPCLKR IXP23XX_GPIO_REG(0x18)
  183. #define IXP23XX_GPIO_GPDBSELR IXP23XX_GPIO_REG(0x1c)
  184. #define IXP23XX_GPIO_STYLE_MASK 0x7
  185. #define IXP23XX_GPIO_STYLE_ACTIVE_HIGH 0x0
  186. #define IXP23XX_GPIO_STYLE_ACTIVE_LOW 0x1
  187. #define IXP23XX_GPIO_STYLE_RISING_EDGE 0x2
  188. #define IXP23XX_GPIO_STYLE_FALLING_EDGE 0x3
  189. #define IXP23XX_GPIO_STYLE_TRANSITIONAL 0x4
  190. #define IXP23XX_GPIO_STYLE_SIZE 3
  191. /****************************************************************************
  192. * Timer.
  193. ****************************************************************************/
  194. #define IXP23XX_TIMER_REG(x) ((volatile unsigned long *)(IXP23XX_TIMER_VIRT + (x)))
  195. #define IXP23XX_TIMER_CONT IXP23XX_TIMER_REG(0x00)
  196. #define IXP23XX_TIMER1_TIMESTAMP IXP23XX_TIMER_REG(0x04)
  197. #define IXP23XX_TIMER1_RELOAD IXP23XX_TIMER_REG(0x08)
  198. #define IXP23XX_TIMER2_TIMESTAMP IXP23XX_TIMER_REG(0x0c)
  199. #define IXP23XX_TIMER2_RELOAD IXP23XX_TIMER_REG(0x10)
  200. #define IXP23XX_TIMER_WDOG IXP23XX_TIMER_REG(0x14)
  201. #define IXP23XX_TIMER_WDOG_EN IXP23XX_TIMER_REG(0x18)
  202. #define IXP23XX_TIMER_WDOG_KEY IXP23XX_TIMER_REG(0x1c)
  203. #define IXP23XX_TIMER_WDOG_KEY_MAGIC 0x482e
  204. #define IXP23XX_TIMER_STATUS IXP23XX_TIMER_REG(0x20)
  205. #define IXP23XX_TIMER_SOFT_RESET IXP23XX_TIMER_REG(0x24)
  206. #define IXP23XX_TIMER_SOFT_RESET_EN IXP23XX_TIMER_REG(0x28)
  207. #define IXP23XX_TIMER_ENABLE (1 << 0)
  208. #define IXP23XX_TIMER_ONE_SHOT (1 << 1)
  209. /* Low order bits of reload value ignored */
  210. #define IXP23XX_TIMER_RELOAD_MASK (0x3)
  211. #define IXP23XX_TIMER_DISABLED (0x0)
  212. #define IXP23XX_TIMER1_INT_PEND (1 << 0)
  213. #define IXP23XX_TIMER2_INT_PEND (1 << 1)
  214. #define IXP23XX_TIMER_STATUS_TS_PEND (1 << 2)
  215. #define IXP23XX_TIMER_STATUS_WDOG_PEND (1 << 3)
  216. #define IXP23XX_TIMER_STATUS_WARM_RESET (1 << 4)
  217. /****************************************************************************
  218. * CAP CSRs.
  219. ****************************************************************************/
  220. #define IXP23XX_GLOBAL_REG(x) ((volatile unsigned long *)(IXP23XX_CAP_CSR_VIRT + 0x4a00 + (x)))
  221. #define IXP23XX_PRODUCT_ID IXP23XX_GLOBAL_REG(0x00)
  222. #define IXP23XX_MISC_CONTROL IXP23XX_GLOBAL_REG(0x04)
  223. #define IXP23XX_MSF_CLK_CNTRL IXP23XX_GLOBAL_REG(0x08)
  224. #define IXP23XX_RESET0 IXP23XX_GLOBAL_REG(0x0c)
  225. #define IXP23XX_RESET1 IXP23XX_GLOBAL_REG(0x10)
  226. #define IXP23XX_STRAP_OPTIONS IXP23XX_GLOBAL_REG(0x18)
  227. #define IXP23XX_ENABLE_WATCHDOG (1 << 24)
  228. #define IXP23XX_SHPC_INIT_COMP (1 << 21)
  229. #define IXP23XX_RST_ALL (1 << 16)
  230. #define IXP23XX_RESET_PCI (1 << 2)
  231. #define IXP23XX_PCI_UNIT_RESET (1 << 1)
  232. #define IXP23XX_XSCALE_RESET (1 << 0)
  233. #define IXP23XX_UENGINE_CSR_VIRT_BASE (IXP23XX_CAP_CSR_VIRT + 0x18000)
  234. /****************************************************************************
  235. * PCI CSRs.
  236. ****************************************************************************/
  237. #define IXP23XX_PCI_CREG(x) ((volatile unsigned long *)(IXP23XX_PCI_CREG_VIRT + (x)))
  238. #define IXP23XX_PCI_CMDSTAT IXP23XX_PCI_CREG(0x04)
  239. #define IXP23XX_PCI_SRAM_BAR IXP23XX_PCI_CREG(0x14)
  240. #define IXP23XX_PCI_SDRAM_BAR IXP23XX_PCI_CREG(0x18)
  241. #define IXP23XX_PCI_CSR(x) ((volatile unsigned long *)(IXP23XX_PCI_CREG_VIRT + 0x01000000 + (x)))
  242. #define IXP23XX_PCI_OUT_INT_STATUS IXP23XX_PCI_CSR(0x0030)
  243. #define IXP23XX_PCI_OUT_INT_MASK IXP23XX_PCI_CSR(0x0034)
  244. #define IXP23XX_PCI_SRAM_BASE_ADDR_MASK IXP23XX_PCI_CSR(0x00fc)
  245. #define IXP23XX_PCI_DRAM_BASE_ADDR_MASK IXP23XX_PCI_CSR(0x0100)
  246. #define IXP23XX_PCI_CONTROL IXP23XX_PCI_CSR(0x013c)
  247. #define IXP23XX_PCI_ADDR_EXT IXP23XX_PCI_CSR(0x0140)
  248. #define IXP23XX_PCI_ME_PUSH_STATUS IXP23XX_PCI_CSR(0x0148)
  249. #define IXP23XX_PCI_ME_PUSH_EN IXP23XX_PCI_CSR(0x014c)
  250. #define IXP23XX_PCI_ERR_STATUS IXP23XX_PCI_CSR(0x0150)
  251. #define IXP23XX_PCI_ERROR_STATUS IXP23XX_PCI_CSR(0x0150)
  252. #define IXP23XX_PCI_ERR_ENABLE IXP23XX_PCI_CSR(0x0154)
  253. #define IXP23XX_PCI_XSCALE_INT_STATUS IXP23XX_PCI_CSR(0x0158)
  254. #define IXP23XX_PCI_XSCALE_INT_ENABLE IXP23XX_PCI_CSR(0x015c)
  255. #define IXP23XX_PCI_CPP_ADDR_BITS IXP23XX_PCI_CSR(0x0160)
  256. #endif