ixp425.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. /*
  2. * include/asm-arm/arch-ixp425/ixp425.h
  3. *
  4. * Register definitions for IXP425
  5. *
  6. * Copyright (C) 2002 Intel Corporation.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #ifndef _ASM_ARM_IXP425_H_
  14. #define _ASM_ARM_IXP425_H_
  15. #define BIT(x) (1<<(x))
  16. /* FIXME: Only this does work for u-boot... find out why... [RS] */
  17. #define UBOOT_REG_FIX 1
  18. #ifdef UBOOT_REG_FIX
  19. # undef io_p2v
  20. # undef __REG
  21. # ifndef __ASSEMBLY__
  22. # define io_p2v(PhAdd) (PhAdd)
  23. # define __REG(x) (*((volatile u32 *)io_p2v(x)))
  24. # define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y)))
  25. # else
  26. # define __REG(x) (x)
  27. # endif
  28. #endif /* UBOOT_REG_FIX */
  29. /*
  30. *
  31. * IXP425 Memory map:
  32. *
  33. * Phy Phy Size Map Size Virt Description
  34. * =========================================================================
  35. *
  36. * 0x00000000 0x10000000 SDRAM 1
  37. *
  38. * 0x10000000 0x10000000 SDRAM 2
  39. *
  40. * 0x20000000 0x10000000 SDRAM 3
  41. *
  42. * 0x30000000 0x10000000 SDRAM 4
  43. *
  44. * The above four are aliases to the same memory location (0x00000000)
  45. *
  46. * 0x48000000 0x4000000 PCI Memory
  47. *
  48. * 0x50000000 0x10000000 Not Mapped EXP BUS
  49. *
  50. * 0x6000000 0x00004000 0x4000 0xFFFEB000 QMgr
  51. *
  52. * 0xC0000000 0x100 0x1000 0xFFFDD000 PCI CFG
  53. *
  54. * 0xC4000000 0x100 0x1000 0xFFFDE000 EXP CFG
  55. *
  56. * 0xC8000000 0xC000 0xC000 0xFFFDF000 PERIPHERAL
  57. *
  58. * 0xCC000000 0x100 0x1000 Not Mapped SDRAM CFG
  59. */
  60. /*
  61. * SDRAM
  62. */
  63. #define IXP425_SDRAM_BASE (0x00000000)
  64. #define IXP425_SDRAM_BASE_ALT (0x10000000)
  65. /*
  66. * PCI Configuration space
  67. */
  68. #define IXP425_PCI_CFG_BASE_PHYS (0xC0000000)
  69. #define IXP425_PCI_CFG_BASE_VIRT (0xFFFD0000)
  70. #define IXP425_PCI_CFG_REGION_SIZE (0x00001000)
  71. /*
  72. * Expansion BUS Configuration registers
  73. */
  74. #define IXP425_EXP_CFG_BASE_PHYS (0xC4000000)
  75. #define IXP425_EXP_CFG_BASE_VIRT (0xFFFD1000)
  76. #define IXP425_EXP_CFG_REGION_SIZE (0x00001000)
  77. /*
  78. * Peripheral space
  79. */
  80. #define IXP425_PERIPHERAL_BASE_PHYS (0xC8000000)
  81. #define IXP425_PERIPHERAL_BASE_VIRT (0xFFFD2000)
  82. #define IXP425_PERIPHERAL_REGION_SIZE (0x0000C000)
  83. /*
  84. * SDRAM configuration registers
  85. */
  86. #define IXP425_SDRAM_CFG_BASE_PHYS (0xCC000000)
  87. /*
  88. * Q Manager space .. not static mapped
  89. */
  90. #define IXP425_QMGR_BASE_PHYS (0x60000000)
  91. #define IXP425_QMGR_BASE_VIRT (0xFFFDE000)
  92. #define IXP425_QMGR_REGION_SIZE (0x00004000)
  93. /*
  94. * Expansion BUS
  95. *
  96. * Expansion Bus 'lives' at either base1 or base 2 depending on the value of
  97. * Exp Bus config registers:
  98. *
  99. * Setting bit 31 of IXP425_EXP_CFG0 puts SDRAM at zero,
  100. * and The expansion bus to IXP425_EXP_BUS_BASE2
  101. */
  102. #define IXP425_EXP_BUS_BASE1_PHYS (0x00000000)
  103. #define IXP425_EXP_BUS_BASE2_PHYS (0x50000000)
  104. #define IXP425_EXP_BUS_BASE2_VIRT (0xF0000000)
  105. #define IXP425_EXP_BUS_BASE_PHYS IXP425_EXP_BUS_BASE2_PHYS
  106. #define IXP425_EXP_BUS_BASE_VIRT IXP425_EXP_BUS_BASE2_VIRT
  107. #define IXP425_EXP_BUS_REGION_SIZE (0x08000000)
  108. #define IXP425_EXP_BUS_CSX_REGION_SIZE (0x01000000)
  109. #define IXP425_EXP_BUS_CS0_BASE_PHYS (IXP425_EXP_BUS_BASE2_PHYS + 0x00000000)
  110. #define IXP425_EXP_BUS_CS1_BASE_PHYS (IXP425_EXP_BUS_BASE2_PHYS + 0x01000000)
  111. #define IXP425_EXP_BUS_CS2_BASE_PHYS (IXP425_EXP_BUS_BASE2_PHYS + 0x02000000)
  112. #define IXP425_EXP_BUS_CS3_BASE_PHYS (IXP425_EXP_BUS_BASE2_PHYS + 0x03000000)
  113. #define IXP425_EXP_BUS_CS4_BASE_PHYS (IXP425_EXP_BUS_BASE2_PHYS + 0x04000000)
  114. #define IXP425_EXP_BUS_CS5_BASE_PHYS (IXP425_EXP_BUS_BASE2_PHYS + 0x05000000)
  115. #define IXP425_EXP_BUS_CS6_BASE_PHYS (IXP425_EXP_BUS_BASE2_PHYS + 0x06000000)
  116. #define IXP425_EXP_BUS_CS7_BASE_PHYS (IXP425_EXP_BUS_BASE2_PHYS + 0x07000000)
  117. #define IXP425_EXP_BUS_CS0_BASE_VIRT (IXP425_EXP_BUS_BASE2_VIRT + 0x00000000)
  118. #define IXP425_EXP_BUS_CS1_BASE_VIRT (IXP425_EXP_BUS_BASE2_VIRT + 0x01000000)
  119. #define IXP425_EXP_BUS_CS2_BASE_VIRT (IXP425_EXP_BUS_BASE2_VIRT + 0x02000000)
  120. #define IXP425_EXP_BUS_CS3_BASE_VIRT (IXP425_EXP_BUS_BASE2_VIRT + 0x03000000)
  121. #define IXP425_EXP_BUS_CS4_BASE_VIRT (IXP425_EXP_BUS_BASE2_VIRT + 0x04000000)
  122. #define IXP425_EXP_BUS_CS5_BASE_VIRT (IXP425_EXP_BUS_BASE2_VIRT + 0x05000000)
  123. #define IXP425_EXP_BUS_CS6_BASE_VIRT (IXP425_EXP_BUS_BASE2_VIRT + 0x06000000)
  124. #define IXP425_EXP_BUS_CS7_BASE_VIRT (IXP425_EXP_BUS_BASE2_VIRT + 0x07000000)
  125. #define IXP425_FLASH_WRITABLE (0x2)
  126. #define IXP425_FLASH_DEFAULT (0xbcd23c40)
  127. #define IXP425_FLASH_WRITE (0xbcd23c42)
  128. #define IXP425_EXP_CS0_OFFSET 0x00
  129. #define IXP425_EXP_CS1_OFFSET 0x04
  130. #define IXP425_EXP_CS2_OFFSET 0x08
  131. #define IXP425_EXP_CS3_OFFSET 0x0C
  132. #define IXP425_EXP_CS4_OFFSET 0x10
  133. #define IXP425_EXP_CS5_OFFSET 0x14
  134. #define IXP425_EXP_CS6_OFFSET 0x18
  135. #define IXP425_EXP_CS7_OFFSET 0x1C
  136. #define IXP425_EXP_CFG0_OFFSET 0x20
  137. #define IXP425_EXP_CFG1_OFFSET 0x24
  138. #define IXP425_EXP_CFG2_OFFSET 0x28
  139. #define IXP425_EXP_CFG3_OFFSET 0x2C
  140. /*
  141. * Expansion Bus Controller registers.
  142. */
  143. #ifndef __ASSEMBLY__
  144. #define IXP425_EXP_REG(x) ((volatile u32 *)(IXP425_EXP_CFG_BASE_VIRT+(x)))
  145. #else
  146. #define IXP425_EXP_REG(x) (IXP425_EXP_CFG_BASE_PHYS+(x))
  147. #endif
  148. #define IXP425_EXP_CS0 IXP425_EXP_REG(IXP425_EXP_CS0_OFFSET)
  149. #define IXP425_EXP_CS1 IXP425_EXP_REG(IXP425_EXP_CS1_OFFSET)
  150. #define IXP425_EXP_CS2 IXP425_EXP_REG(IXP425_EXP_CS2_OFFSET)
  151. #define IXP425_EXP_CS3 IXP425_EXP_REG(IXP425_EXP_CS3_OFFSET)
  152. #define IXP425_EXP_CS4 IXP425_EXP_REG(IXP425_EXP_CS4_OFFSET)
  153. #define IXP425_EXP_CS5 IXP425_EXP_REG(IXP425_EXP_CS5_OFFSET)
  154. #define IXP425_EXP_CS6 IXP425_EXP_REG(IXP425_EXP_CS6_OFFSET)
  155. #define IXP425_EXP_CS7 IXP425_EXP_REG(IXP425_EXP_CS7_OFFSET)
  156. #define IXP425_EXP_CFG0 IXP425_EXP_REG(IXP425_EXP_CFG0_OFFSET)
  157. #define IXP425_EXP_CFG1 IXP425_EXP_REG(IXP425_EXP_CFG1_OFFSET)
  158. #define IXP425_EXP_CFG2 IXP425_EXP_REG(IXP425_EXP_CFG2_OFFSET)
  159. #define IXP425_EXP_CFG3 IXP425_EXP_REG(IXP425_EXP_CFG3_OFFSET)
  160. /*
  161. * SDRAM Controller registers.
  162. */
  163. #define IXP425_SDR_CONFIG_OFFSET 0x00
  164. #define IXP425_SDR_REFRESH_OFFSET 0x04
  165. #define IXP425_SDR_IR_OFFSET 0x08
  166. #define IXP425_SDRAM_REG(x) (IXP425_SDRAM_CFG_BASE_PHYS+(x))
  167. #define IXP425_SDR_CONFIG IXP425_SDRAM_REG(IXP425_SDR_CONFIG_OFFSET)
  168. #define IXP425_SDR_REFRESH IXP425_SDRAM_REG(IXP425_SDR_REFRESH_OFFSET)
  169. #define IXP425_SDR_IR IXP425_SDRAM_REG(IXP425_SDR_IR_OFFSET)
  170. /*
  171. * UART registers
  172. */
  173. #define IXP425_UART1 0
  174. #define IXP425_UART2 0x1000
  175. #define IXP425_UART_RBR_OFFSET 0x00
  176. #define IXP425_UART_THR_OFFSET 0x00
  177. #define IXP425_UART_DLL_OFFSET 0x00
  178. #define IXP425_UART_IER_OFFSET 0x04
  179. #define IXP425_UART_DLH_OFFSET 0x04
  180. #define IXP425_UART_IIR_OFFSET 0x08
  181. #define IXP425_UART_FCR_OFFSET 0x00
  182. #define IXP425_UART_LCR_OFFSET 0x0c
  183. #define IXP425_UART_MCR_OFFSET 0x10
  184. #define IXP425_UART_LSR_OFFSET 0x14
  185. #define IXP425_UART_MSR_OFFSET 0x18
  186. #define IXP425_UART_SPR_OFFSET 0x1c
  187. #define IXP425_UART_ISR_OFFSET 0x20
  188. #define IXP425_UART_CFG_BASE_PHYS (0xc8000000)
  189. #define RBR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_RBR_OFFSET)
  190. #define THR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_THR_OFFSET)
  191. #define DLL(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_DLL_OFFSET)
  192. #define IER(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_IER_OFFSET)
  193. #define DLH(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_DLH_OFFSET)
  194. #define IIR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_IIR_OFFSET)
  195. #define FCR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_FCR_OFFSET)
  196. #define LCR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_LCR_OFFSET)
  197. #define MCR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_MCR_OFFSET)
  198. #define LSR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_LSR_OFFSET)
  199. #define MSR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_MSR_OFFSET)
  200. #define SPR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_SPR_OFFSET)
  201. #define ISR(x) __REG(IXP425_UART_CFG_BASE_PHYS+(x)+IXP425_UART_ISR_OFFSET)
  202. #define IER_DMAE (1 << 7) /* DMA Requests Enable */
  203. #define IER_UUE (1 << 6) /* UART Unit Enable */
  204. #define IER_NRZE (1 << 5) /* NRZ coding Enable */
  205. #define IER_RTIOE (1 << 4) /* Receiver Time Out Interrupt Enable */
  206. #define IER_MIE (1 << 3) /* Modem Interrupt Enable */
  207. #define IER_RLSE (1 << 2) /* Receiver Line Status Interrupt Enable */
  208. #define IER_TIE (1 << 1) /* Transmit Data request Interrupt Enable */
  209. #define IER_RAVIE (1 << 0) /* Receiver Data Available Interrupt Enable */
  210. #define IIR_FIFOES1 (1 << 7) /* FIFO Mode Enable Status */
  211. #define IIR_FIFOES0 (1 << 6) /* FIFO Mode Enable Status */
  212. #define IIR_TOD (1 << 3) /* Time Out Detected */
  213. #define IIR_IID2 (1 << 2) /* Interrupt Source Encoded */
  214. #define IIR_IID1 (1 << 1) /* Interrupt Source Encoded */
  215. #define IIR_IP (1 << 0) /* Interrupt Pending (active low) */
  216. #define FCR_ITL2 (1 << 7) /* Interrupt Trigger Level */
  217. #define FCR_ITL1 (1 << 6) /* Interrupt Trigger Level */
  218. #define FCR_RESETTF (1 << 2) /* Reset Transmitter FIFO */
  219. #define FCR_RESETRF (1 << 1) /* Reset Receiver FIFO */
  220. #define FCR_TRFIFOE (1 << 0) /* Transmit and Receive FIFO Enable */
  221. #define FCR_ITL_1 (0)
  222. #define FCR_ITL_8 (FCR_ITL1)
  223. #define FCR_ITL_16 (FCR_ITL2)
  224. #define FCR_ITL_32 (FCR_ITL2|FCR_ITL1)
  225. #define LCR_DLAB (1 << 7) /* Divisor Latch Access Bit */
  226. #define LCR_SB (1 << 6) /* Set Break */
  227. #define LCR_STKYP (1 << 5) /* Sticky Parity */
  228. #define LCR_EPS (1 << 4) /* Even Parity Select */
  229. #define LCR_PEN (1 << 3) /* Parity Enable */
  230. #define LCR_STB (1 << 2) /* Stop Bit */
  231. #define LCR_WLS1 (1 << 1) /* Word Length Select */
  232. #define LCR_WLS0 (1 << 0) /* Word Length Select */
  233. #define LSR_FIFOE (1 << 7) /* FIFO Error Status */
  234. #define LSR_TEMT (1 << 6) /* Transmitter Empty */
  235. #define LSR_TDRQ (1 << 5) /* Transmit Data Request */
  236. #define LSR_BI (1 << 4) /* Break Interrupt */
  237. #define LSR_FE (1 << 3) /* Framing Error */
  238. #define LSR_PE (1 << 2) /* Parity Error */
  239. #define LSR_OE (1 << 1) /* Overrun Error */
  240. #define LSR_DR (1 << 0) /* Data Ready */
  241. #define MCR_LOOP (1 << 4) */
  242. #define MCR_OUT2 (1 << 3) /* force MSR_DCD in loopback mode */
  243. #define MCR_OUT1 (1 << 2) /* force MSR_RI in loopback mode */
  244. #define MCR_RTS (1 << 1) /* Request to Send */
  245. #define MCR_DTR (1 << 0) /* Data Terminal Ready */
  246. #define MSR_DCD (1 << 7) /* Data Carrier Detect */
  247. #define MSR_RI (1 << 6) /* Ring Indicator */
  248. #define MSR_DSR (1 << 5) /* Data Set Ready */
  249. #define MSR_CTS (1 << 4) /* Clear To Send */
  250. #define MSR_DDCD (1 << 3) /* Delta Data Carrier Detect */
  251. #define MSR_TERI (1 << 2) /* Trailing Edge Ring Indicator */
  252. #define MSR_DDSR (1 << 1) /* Delta Data Set Ready */
  253. #define MSR_DCTS (1 << 0) /* Delta Clear To Send */
  254. #define IXP425_CONSOLE_UART_BASE_VIRT IXP425_UART1_BASE_VIRT
  255. #define IXP425_CONSOLE_UART_BASE_PHYS IXP425_UART1_BASE_PHYS
  256. /*
  257. * Peripheral Space Registers
  258. */
  259. #define IXP425_UART1_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x0000)
  260. #define IXP425_UART2_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x1000)
  261. #define IXP425_PMU_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x2000)
  262. #define IXP425_INTC_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x3000)
  263. #define IXP425_GPIO_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x4000)
  264. #define IXP425_TIMER_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x5000)
  265. #define IXP425_NPEA_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x6000)
  266. #define IXP425_NPEB_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x7000)
  267. #define IXP425_NPEC_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x8000)
  268. #define IXP425_EthA_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0x9000)
  269. #define IXP425_EthB_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0xA000)
  270. #define IXP425_USB_BASE_PHYS (IXP425_PERIPHERAL_BASE_PHYS + 0xB000)
  271. #define IXP425_UART1_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x0000)
  272. #define IXP425_UART2_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x1000)
  273. #define IXP425_PMU_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x2000)
  274. #define IXP425_INTC_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x3000)
  275. #define IXP425_GPIO_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x4000)
  276. #define IXP425_TIMER_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x5000)
  277. #define IXP425_NPEA_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x6000)
  278. #define IXP425_NPEB_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x7000)
  279. #define IXP425_NPEC_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x8000)
  280. #define IXP425_EthA_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0x9000)
  281. #define IXP425_EthB_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0xA000)
  282. #define IXP425_USB_BASE_VIRT (IXP425_PERIPHERAL_BASE_VIRT + 0xB000)
  283. /*
  284. * UART Register Definitions , Offsets only as there are 2 UARTS.
  285. * IXP425_UART1_BASE , IXP425_UART2_BASE.
  286. */
  287. #undef UART_NO_RX_INTERRUPT
  288. #define IXP425_UART_XTAL 14745600
  289. /*
  290. * Constants to make it easy to access Interrupt Controller registers
  291. */
  292. #define IXP425_ICPR_OFFSET 0x00 /* Interrupt Status */
  293. #define IXP425_ICMR_OFFSET 0x04 /* Interrupt Enable */
  294. #define IXP425_ICLR_OFFSET 0x08 /* Interrupt IRQ/FIQ Select */
  295. #define IXP425_ICIP_OFFSET 0x0C /* IRQ Status */
  296. #define IXP425_ICFP_OFFSET 0x10 /* FIQ Status */
  297. #define IXP425_ICHR_OFFSET 0x14 /* Interrupt Priority */
  298. #define IXP425_ICIH_OFFSET 0x18 /* IRQ Highest Pri Int */
  299. #define IXP425_ICFH_OFFSET 0x1C /* FIQ Highest Pri Int */
  300. /*
  301. * Interrupt Controller Register Definitions.
  302. */
  303. #ifndef __ASSEMBLY__
  304. #define IXP425_INTC_REG(x) ((volatile u32 *)(IXP425_INTC_BASE_VIRT+(x)))
  305. #else
  306. #define IXP425_INTC_REG(x) (IXP425_INTC_BASE_PHYS+(x))
  307. #endif
  308. #define IXP425_ICPR IXP425_INTC_REG(IXP425_ICPR_OFFSET)
  309. #define IXP425_ICMR IXP425_INTC_REG(IXP425_ICMR_OFFSET)
  310. #define IXP425_ICLR IXP425_INTC_REG(IXP425_ICLR_OFFSET)
  311. #define IXP425_ICIP IXP425_INTC_REG(IXP425_ICIP_OFFSET)
  312. #define IXP425_ICFP IXP425_INTC_REG(IXP425_ICFP_OFFSET)
  313. #define IXP425_ICHR IXP425_INTC_REG(IXP425_ICHR_OFFSET)
  314. #define IXP425_ICIH IXP425_INTC_REG(IXP425_ICIH_OFFSET)
  315. #define IXP425_ICFH IXP425_INTC_REG(IXP425_ICFH_OFFSET)
  316. /*
  317. * Constants to make it easy to access GPIO registers
  318. */
  319. #define IXP425_GPIO_GPOUTR_OFFSET 0x00
  320. #define IXP425_GPIO_GPOER_OFFSET 0x04
  321. #define IXP425_GPIO_GPINR_OFFSET 0x08
  322. #define IXP425_GPIO_GPISR_OFFSET 0x0C
  323. #define IXP425_GPIO_GPIT1R_OFFSET 0x10
  324. #define IXP425_GPIO_GPIT2R_OFFSET 0x14
  325. #define IXP425_GPIO_GPCLKR_OFFSET 0x18
  326. #define IXP425_GPIO_GPDBSELR_OFFSET 0x1C
  327. /*
  328. * GPIO Register Definitions.
  329. * [Only perform 32bit reads/writes]
  330. */
  331. #define IXP425_GPIO_REG(x) ((volatile u32 *)(IXP425_GPIO_BASE_VIRT+(x)))
  332. #define IXP425_GPIO_GPOUTR IXP425_GPIO_REG(IXP425_GPIO_GPOUTR_OFFSET)
  333. #define IXP425_GPIO_GPOER IXP425_GPIO_REG(IXP425_GPIO_GPOER_OFFSET)
  334. #define IXP425_GPIO_GPINR IXP425_GPIO_REG(IXP425_GPIO_GPINR_OFFSET)
  335. #define IXP425_GPIO_GPISR IXP425_GPIO_REG(IXP425_GPIO_GPISR_OFFSET)
  336. #define IXP425_GPIO_GPIT1R IXP425_GPIO_REG(IXP425_GPIO_GPIT1R_OFFSET)
  337. #define IXP425_GPIO_GPIT2R IXP425_GPIO_REG(IXP425_GPIO_GPIT2R_OFFSET)
  338. #define IXP425_GPIO_GPCLKR IXP425_GPIO_REG(IXP425_GPIO_GPCLKR_OFFSET)
  339. #define IXP425_GPIO_GPDBSELR IXP425_GPIO_REG(IXP425_GPIO_GPDBSELR_OFFSET)
  340. /*
  341. * Constants to make it easy to access Timer Control/Status registers
  342. */
  343. #define IXP425_OSTS_OFFSET 0x00 /* Continious TimeStamp */
  344. #define IXP425_OST1_OFFSET 0x04 /* Timer 1 Timestamp */
  345. #define IXP425_OSRT1_OFFSET 0x08 /* Timer 1 Reload */
  346. #define IXP425_OST2_OFFSET 0x0C /* Timer 2 Timestamp */
  347. #define IXP425_OSRT2_OFFSET 0x10 /* Timer 2 Reload */
  348. #define IXP425_OSWT_OFFSET 0x14 /* Watchdog Timer */
  349. #define IXP425_OSWE_OFFSET 0x18 /* Watchdog Enable */
  350. #define IXP425_OSWK_OFFSET 0x1C /* Watchdog Key */
  351. #define IXP425_OSST_OFFSET 0x20 /* Timer Status */
  352. /*
  353. * Operating System Timer Register Definitions.
  354. */
  355. #ifndef __ASSEMBLY__
  356. #define IXP425_TIMER_REG(x) ((volatile u32 *)(IXP425_TIMER_BASE_PHYS+(x)))
  357. #else
  358. #define IXP425_TIMER_REG(x) (IXP425_TIMER_BASE_PHYS+(x))
  359. #endif
  360. #define IXP425_OSTS IXP425_TIMER_REG(IXP425_OSTS_OFFSET)
  361. #define IXP425_OST1 IXP425_TIMER_REG(IXP425_OST1_OFFSET)
  362. #define IXP425_OSRT1 IXP425_TIMER_REG(IXP425_OSRT1_OFFSET)
  363. #define IXP425_OST2 IXP425_TIMER_REG(IXP425_OST2_OFFSET)
  364. #define IXP425_OSRT2 IXP425_TIMER_REG(IXP425_OSRT2_OFFSET)
  365. #define IXP425_OSWT IXP425_TIMER_REG(IXP425_OSWT_OFFSET)
  366. #define IXP425_OSWE IXP425_TIMER_REG(IXP425_OSWE_OFFSET)
  367. #define IXP425_OSWK IXP425_TIMER_REG(IXP425_OSWK_OFFSET)
  368. #define IXP425_OSST IXP425_TIMER_REG(IXP425_OSST_OFFSET)
  369. /*
  370. * Timer register values and bit definitions
  371. */
  372. #define IXP425_OST_ENABLE BIT(0)
  373. #define IXP425_OST_ONE_SHOT BIT(1)
  374. /* Low order bits of reload value ignored */
  375. #define IXP425_OST_RELOAD_MASK (0x3)
  376. #define IXP425_OST_DISABLED (0x0)
  377. #define IXP425_OSST_TIMER_1_PEND BIT(0)
  378. #define IXP425_OSST_TIMER_2_PEND BIT(1)
  379. #define IXP425_OSST_TIMER_TS_PEND BIT(2)
  380. #define IXP425_OSST_TIMER_WDOG_PEND BIT(3)
  381. #define IXP425_OSST_TIMER_WARM_RESET BIT(4)
  382. /*
  383. * Constants to make it easy to access PCI Control/Status registers
  384. */
  385. #define PCI_NP_AD_OFFSET 0x00
  386. #define PCI_NP_CBE_OFFSET 0x04
  387. #define PCI_NP_WDATA_OFFSET 0x08
  388. #define PCI_NP_RDATA_OFFSET 0x0c
  389. #define PCI_CRP_AD_CBE_OFFSET 0x10
  390. #define PCI_CRP_WDATA_OFFSET 0x14
  391. #define PCI_CRP_RDATA_OFFSET 0x18
  392. #define PCI_CSR_OFFSET 0x1c
  393. #define PCI_ISR_OFFSET 0x20
  394. #define PCI_INTEN_OFFSET 0x24
  395. #define PCI_DMACTRL_OFFSET 0x28
  396. #define PCI_AHBMEMBASE_OFFSET 0x2c
  397. #define PCI_AHBIOBASE_OFFSET 0x30
  398. #define PCI_PCIMEMBASE_OFFSET 0x34
  399. #define PCI_AHBDOORBELL_OFFSET 0x38
  400. #define PCI_PCIDOORBELL_OFFSET 0x3C
  401. #define PCI_ATPDMA0_AHBADDR_OFFSET 0x40
  402. #define PCI_ATPDMA0_PCIADDR_OFFSET 0x44
  403. #define PCI_ATPDMA0_LENADDR_OFFSET 0x48
  404. #define PCI_ATPDMA1_AHBADDR_OFFSET 0x4C
  405. #define PCI_ATPDMA1_PCIADDR_OFFSET 0x50
  406. #define PCI_ATPDMA1_LENADDR_OFFSET 0x54
  407. /*
  408. * PCI Control/Status Registers
  409. */
  410. #define IXP425_PCI_CSR(x) ((volatile u32 *)(IXP425_PCI_CFG_BASE_VIRT+(x)))
  411. #define PCI_NP_AD IXP425_PCI_CSR(PCI_NP_AD_OFFSET)
  412. #define PCI_NP_CBE IXP425_PCI_CSR(PCI_NP_CBE_OFFSET)
  413. #define PCI_NP_WDATA IXP425_PCI_CSR(PCI_NP_WDATA_OFFSET)
  414. #define PCI_NP_RDATA IXP425_PCI_CSR(PCI_NP_RDATA_OFFSET)
  415. #define PCI_CRP_AD_CBE IXP425_PCI_CSR(PCI_CRP_AD_CBE_OFFSET)
  416. #define PCI_CRP_WDATA IXP425_PCI_CSR(PCI_CRP_WDATA_OFFSET)
  417. #define PCI_CRP_RDATA IXP425_PCI_CSR(PCI_CRP_RDATA_OFFSET)
  418. #define PCI_CSR IXP425_PCI_CSR(PCI_CSR_OFFSET)
  419. #define PCI_ISR IXP425_PCI_CSR(PCI_ISR_OFFSET)
  420. #define PCI_INTEN IXP425_PCI_CSR(PCI_INTEN_OFFSET)
  421. #define PCI_DMACTRL IXP425_PCI_CSR(PCI_DMACTRL_OFFSET)
  422. #define PCI_AHBMEMBASE IXP425_PCI_CSR(PCI_AHBMEMBASE_OFFSET)
  423. #define PCI_AHBIOBASE IXP425_PCI_CSR(PCI_AHBIOBASE_OFFSET)
  424. #define PCI_PCIMEMBASE IXP425_PCI_CSR(PCI_PCIMEMBASE_OFFSET)
  425. #define PCI_AHBDOORBELL IXP425_PCI_CSR(PCI_AHBDOORBELL_OFFSET)
  426. #define PCI_PCIDOORBELL IXP425_PCI_CSR(PCI_PCIDOORBELL_OFFSET)
  427. #define PCI_ATPDMA0_AHBADDR IXP425_PCI_CSR(PCI_ATPDMA0_AHBADDR_OFFSET)
  428. #define PCI_ATPDMA0_PCIADDR IXP425_PCI_CSR(PCI_ATPDMA0_PCIADDR_OFFSET)
  429. #define PCI_ATPDMA0_LENADDR IXP425_PCI_CSR(PCI_ATPDMA0_LENADDR_OFFSET)
  430. #define PCI_ATPDMA1_AHBADDR IXP425_PCI_CSR(PCI_ATPDMA1_AHBADDR_OFFSET)
  431. #define PCI_ATPDMA1_PCIADDR IXP425_PCI_CSR(PCI_ATPDMA1_PCIADDR_OFFSET)
  432. #define PCI_ATPDMA1_LENADDR IXP425_PCI_CSR(PCI_ATPDMA1_LENADDR_OFFSET)
  433. /*
  434. * PCI register values and bit definitions
  435. */
  436. /* CSR bit definitions */
  437. #define PCI_CSR_HOST BIT(0)
  438. #define PCI_CSR_ARBEN BIT(1)
  439. #define PCI_CSR_ADS BIT(2)
  440. #define PCI_CSR_PDS BIT(3)
  441. #define PCI_CSR_ABE BIT(4)
  442. #define PCI_CSR_DBT BIT(5)
  443. #define PCI_CSR_ASE BIT(8)
  444. #define PCI_CSR_IC BIT(15)
  445. /* ISR (Interrupt status) Register bit definitions */
  446. #define PCI_ISR_PSE BIT(0)
  447. #define PCI_ISR_PFE BIT(1)
  448. #define PCI_ISR_PPE BIT(2)
  449. #define PCI_ISR_AHBE BIT(3)
  450. #define PCI_ISR_APDC BIT(4)
  451. #define PCI_ISR_PADC BIT(5)
  452. #define PCI_ISR_ADB BIT(6)
  453. #define PCI_ISR_PDB BIT(7)
  454. /* INTEN (Interrupt Enable) Register bit definitions */
  455. #define PCI_INTEN_PSE BIT(0)
  456. #define PCI_INTEN_PFE BIT(1)
  457. #define PCI_INTEN_PPE BIT(2)
  458. #define PCI_INTEN_AHBE BIT(3)
  459. #define PCI_INTEN_APDC BIT(4)
  460. #define PCI_INTEN_PADC BIT(5)
  461. #define PCI_INTEN_ADB BIT(6)
  462. #define PCI_INTEN_PDB BIT(7)
  463. /*
  464. * Shift value for byte enable on NP cmd/byte enable register
  465. */
  466. #define IXP425_PCI_NP_CBE_BESL 4
  467. /*
  468. * PCI commands supported by NP access unit
  469. */
  470. #define NP_CMD_IOREAD 0x2
  471. #define NP_CMD_IOWRITE 0x3
  472. #define NP_CMD_CONFIGREAD 0xa
  473. #define NP_CMD_CONFIGWRITE 0xb
  474. #define NP_CMD_MEMREAD 0x6
  475. #define NP_CMD_MEMWRITE 0x7
  476. #if 0
  477. #ifndef __ASSEMBLY__
  478. extern int ixp425_pci_read(u32 addr, u32 cmd, u32* data);
  479. extern int ixp425_pci_write(u32 addr, u32 cmd, u32 data);
  480. extern void ixp425_pci_init(void *);
  481. #endif
  482. #endif
  483. /*
  484. * Constants for CRP access into local config space
  485. */
  486. #define CRP_AD_CBE_BESL 20
  487. #define CRP_AD_CBE_WRITE BIT(16)
  488. /*
  489. * Clock Speed Definitions.
  490. */
  491. #define IXP425_PERIPHERAL_BUS_CLOCK (66) /* 66Mhzi APB BUS */
  492. #endif