slarmUnprocessedDataOperation.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. /*
  2. * arch/arm/mach-netx/include/mach/netx-regs.h
  3. *
  4. * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2
  8. * as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #ifndef __ASM_ARCH_NETX_REGS_H
  20. #define __ASM_ARCH_NETX_REGS_H
  21. /* offsets relative to the beginning of the io space */
  22. #define NETX_OFS_SYSTEM 0x00000
  23. #define NETX_OFS_MEMCR 0x00100
  24. #define NETX_OFS_DPMAS 0x03000
  25. #define NETX_OFS_GPIO 0x00800
  26. #define NETX_OFS_PIO 0x00900
  27. #define NETX_OFS_UART0 0x00a00
  28. #define NETX_OFS_UART1 0x00a40
  29. #define NETX_OFS_UART2 0x00a80
  30. #define NETX_OF_MIIMU 0x00b00
  31. #define NETX_OFS_SPI 0x00c00
  32. #define NETX_OFS_I2C 0x00d00
  33. #define NETX_OFS_SYSTIME 0x01100
  34. #define NETX_OFS_RTC 0x01200
  35. #define NETX_OFS_EXTBUS 0x03600
  36. #define NETX_OFS_LCD 0x04000
  37. #define NETX_OFS_USB 0x20000
  38. #define NETX_OFS_XMAC0 0x60000
  39. #define NETX_OFS_XMAC1 0x61000
  40. #define NETX_OFS_XMAC2 0x62000
  41. #define NETX_OFS_XMAC3 0x63000
  42. #define NETX_OFS_XMAC(no) (0x60000 + (no) * 0x1000)
  43. #define NETX_OFS_PFIFO 0x64000
  44. #define NETX_OFS_XPEC0 0x70000
  45. #define NETX_OFS_XPEC1 0x74000
  46. #define NETX_OFS_XPEC2 0x78000
  47. #define NETX_OFS_XPEC3 0x7c000
  48. #define NETX_OFS_XPEC(no) (0x70000 + (no) * 0x4000)
  49. #define NETX_OFS_VIC 0xff000
  50. /* physical addresses */
  51. #define NETX_PA_SYSTEM (NETX_IO_PHYS + NETX_OFS_SYSTEM)
  52. #define NETX_PA_MEMCR (NETX_IO_PHYS + NETX_OFS_MEMCR)
  53. #define NETX_PA_DPMAS (NETX_IO_PHYS + NETX_OFS_DPMAS)
  54. #define NETX_PA_GPIO (NETX_IO_PHYS + NETX_OFS_GPIO)
  55. #define NETX_PA_PIO (NETX_IO_PHYS + NETX_OFS_PIO)
  56. #define NETX_PA_UART0 (NETX_IO_PHYS + NETX_OFS_UART0)
  57. #define NETX_PA_UART1 (NETX_IO_PHYS + NETX_OFS_UART1)
  58. #define NETX_PA_UART2 (NETX_IO_PHYS + NETX_OFS_UART2)
  59. #define NETX_PA_MIIMU (NETX_IO_PHYS + NETX_OF_MIIMU)
  60. #define NETX_PA_SPI (NETX_IO_PHYS + NETX_OFS_SPI)
  61. #define NETX_PA_I2C (NETX_IO_PHYS + NETX_OFS_I2C)
  62. #define NETX_PA_SYSTIME (NETX_IO_PHYS + NETX_OFS_SYSTIME)
  63. #define NETX_PA_RTC (NETX_IO_PHYS + NETX_OFS_RTC)
  64. #define NETX_PA_EXTBUS (NETX_IO_PHYS + NETX_OFS_EXTBUS)
  65. #define NETX_PA_LCD (NETX_IO_PHYS + NETX_OFS_LCD)
  66. #define NETX_PA_USB (NETX_IO_PHYS + NETX_OFS_USB)
  67. #define NETX_PA_XMAC0 (NETX_IO_PHYS + NETX_OFS_XMAC0)
  68. #define NETX_PA_XMAC1 (NETX_IO_PHYS + NETX_OFS_XMAC1)
  69. #define NETX_PA_XMAC2 (NETX_IO_PHYS + NETX_OFS_XMAC2)
  70. #define NETX_PA_XMAC3 (NETX_IO_PHYS + NETX_OFS_XMAC3)
  71. #define NETX_PA_XMAC(no) (NETX_IO_PHYS + NETX_OFS_XMAC(no))
  72. #define NETX_PA_PFIFO (NETX_IO_PHYS + NETX_OFS_PFIFO)
  73. #define NETX_PA_XPEC0 (NETX_IO_PHYS + NETX_OFS_XPEC0)
  74. #define NETX_PA_XPEC1 (NETX_IO_PHYS + NETX_OFS_XPEC1)
  75. #define NETX_PA_XPEC2 (NETX_IO_PHYS + NETX_OFS_XPEC2)
  76. #define NETX_PA_XPEC3 (NETX_IO_PHYS + NETX_OFS_XPEC3)
  77. #define NETX_PA_XPEC(no) (NETX_IO_PHYS + NETX_OFS_XPEC(no))
  78. #define NETX_PA_VIC (NETX_IO_PHYS + NETX_OFS_VIC)
  79. /* virtual addresses */
  80. #define NETX_VA_SYSTEM (NETX_IO_VIRT + NETX_OFS_SYSTEM)
  81. #define NETX_VA_MEMCR (NETX_IO_VIRT + NETX_OFS_MEMCR)
  82. #define NETX_VA_DPMAS (NETX_IO_VIRT + NETX_OFS_DPMAS)
  83. #define NETX_VA_GPIO (NETX_IO_VIRT + NETX_OFS_GPIO)
  84. #define NETX_VA_PIO (NETX_IO_VIRT + NETX_OFS_PIO)
  85. #define NETX_VA_UART0 (NETX_IO_VIRT + NETX_OFS_UART0)
  86. #define NETX_VA_UART1 (NETX_IO_VIRT + NETX_OFS_UART1)
  87. #define NETX_VA_UART2 (NETX_IO_VIRT + NETX_OFS_UART2)
  88. #define NETX_VA_MIIMU (NETX_IO_VIRT + NETX_OF_MIIMU)
  89. #define NETX_VA_SPI (NETX_IO_VIRT + NETX_OFS_SPI)
  90. #define NETX_VA_I2C (NETX_IO_VIRT + NETX_OFS_I2C)
  91. #define NETX_VA_SYSTIME (NETX_IO_VIRT + NETX_OFS_SYSTIME)
  92. #define NETX_VA_RTC (NETX_IO_VIRT + NETX_OFS_RTC)
  93. #define NETX_VA_EXTBUS (NETX_IO_VIRT + NETX_OFS_EXTBUS)
  94. #define NETX_VA_LCD (NETX_IO_VIRT + NETX_OFS_LCD)
  95. #define NETX_VA_USB (NETX_IO_VIRT + NETX_OFS_USB)
  96. #define NETX_VA_XMAC0 (NETX_IO_VIRT + NETX_OFS_XMAC0)
  97. #define NETX_VA_XMAC1 (NETX_IO_VIRT + NETX_OFS_XMAC1)
  98. #define NETX_VA_XMAC2 (NETX_IO_VIRT + NETX_OFS_XMAC2)
  99. #define NETX_VA_XMAC3 (NETX_IO_VIRT + NETX_OFS_XMAC3)
  100. #define NETX_VA_XMAC(no) (NETX_IO_VIRT + NETX_OFS_XMAC(no))
  101. #define NETX_VA_PFIFO (NETX_IO_VIRT + NETX_OFS_PFIFO)
  102. #define NETX_VA_XPEC0 (NETX_IO_VIRT + NETX_OFS_XPEC0)
  103. #define NETX_VA_XPEC1 (NETX_IO_VIRT + NETX_OFS_XPEC1)
  104. #define NETX_VA_XPEC2 (NETX_IO_VIRT + NETX_OFS_XPEC2)
  105. #define NETX_VA_XPEC3 (NETX_IO_VIRT + NETX_OFS_XPEC3)
  106. #define NETX_VA_XPEC(no) (NETX_IO_VIRT + NETX_OFS_XPEC(no))
  107. #define NETX_VA_VIC (NETX_IO_VIRT + NETX_OFS_VIC)
  108. /*********************************
  109. * System functions *
  110. *********************************/
  111. /* Registers */
  112. #define NETX_SYSTEM_REG(ofs) IOMEM(NETX_VA_SYSTEM + (ofs))
  113. #define NETX_SYSTEM_BOO_SR NETX_SYSTEM_REG(0x00)
  114. #define NETX_SYSTEM_IOC_CR NETX_SYSTEM_REG(0x04)
  115. #define NETX_SYSTEM_IOC_MR NETX_SYSTEM_REG(0x08)
  116. /* FIXME: Docs are not consistent */
  117. /* #define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x08) */
  118. #define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x0c)
  119. #define NETX_SYSTEM_PHY_CONTROL NETX_SYSTEM_REG(0x10)
  120. #define NETX_SYSTEM_REV NETX_SYSTEM_REG(0x34)
  121. #define NETX_SYSTEM_IOC_ACCESS_KEY NETX_SYSTEM_REG(0x70)
  122. #define NETX_SYSTEM_WDG_TR NETX_SYSTEM_REG(0x200)
  123. #define NETX_SYSTEM_WDG_CTR NETX_SYSTEM_REG(0x204)
  124. #define NETX_SYSTEM_WDG_IRQ_TIMEOUT NETX_SYSTEM_REG(0x208)
  125. #define NETX_SYSTEM_WDG_RES_TIMEOUT NETX_SYSTEM_REG(0x20c)
  126. /* Bits */
  127. #define NETX_SYSTEM_RES_CR_RSTIN (1<<0)
  128. #define NETX_SYSTEM_RES_CR_WDG_RES (1<<1)
  129. #define NETX_SYSTEM_RES_CR_HOST_RES (1<<2)
  130. #define NETX_SYSTEM_RES_CR_FIRMW_RES (1<<3)
  131. #define NETX_SYSTEM_RES_CR_XPEC0_RES (1<<4)
  132. #define NETX_SYSTEM_RES_CR_XPEC1_RES (1<<5)
  133. #define NETX_SYSTEM_RES_CR_XPEC2_RES (1<<6)
  134. #define NETX_SYSTEM_RES_CR_XPEC3_RES (1<<7)
  135. #define NETX_SYSTEM_RES_CR_DIS_XPEC0_RES (1<<16)
  136. #define NETX_SYSTEM_RES_CR_DIS_XPEC1_RES (1<<17)
  137. #define NETX_SYSTEM_RES_CR_DIS_XPEC2_RES (1<<18)
  138. #define NETX_SYSTEM_RES_CR_DIS_XPEC3_RES (1<<19)
  139. #define NETX_SYSTEM_RES_CR_FIRMW_FLG0 (1<<20)
  140. #define NETX_SYSTEM_RES_CR_FIRMW_FLG1 (1<<21)
  141. #define NETX_SYSTEM_RES_CR_FIRMW_FLG2 (1<<22)
  142. #define NETX_SYSTEM_RES_CR_FIRMW_FLG3 (1<<23)
  143. #define NETX_SYSTEM_RES_CR_FIRMW_RES_EN (1<<24)
  144. #define NETX_SYSTEM_RES_CR_RSTOUT (1<<25)
  145. #define NETX_SYSTEM_RES_CR_EN_RSTOUT (1<<26)
  146. #define PHY_CONTROL_RESET (1<<31)
  147. #define PHY_CONTROL_SIM_BYP (1<<30)
  148. #define PHY_CONTROL_CLK_XLATIN (1<<29)
  149. #define PHY_CONTROL_PHY1_EN (1<<21)
  150. #define PHY_CONTROL_PHY1_NP_MSG_CODE
  151. #define PHY_CONTROL_PHY1_AUTOMDIX (1<<17)
  152. #define PHY_CONTROL_PHY1_FIXMODE (1<<16)
  153. #define PHY_CONTROL_PHY1_MODE(mode) (((mode) & 0x7) << 13)
  154. #define PHY_CONTROL_PHY0_EN (1<<12)
  155. #define PHY_CONTROL_PHY0_NP_MSG_CODE
  156. #define PHY_CONTROL_PHY0_AUTOMDIX (1<<8)
  157. #define PHY_CONTROL_PHY0_FIXMODE (1<<7)
  158. #define PHY_CONTROL_PHY0_MODE(mode) (((mode) & 0x7) << 4)
  159. #define PHY_CONTROL_PHY_ADDRESS(adr) ((adr) & 0xf)
  160. #define PHY_MODE_10BASE_T_HALF 0
  161. #define PHY_MODE_10BASE_T_FULL 1
  162. #define PHY_MODE_100BASE_TX_FX_FULL 2
  163. #define PHY_MODE_100BASE_TX_FX_HALF 3
  164. #define PHY_MODE_100BASE_TX_HALF 4
  165. #define PHY_MODE_REPEATER 5
  166. #define PHY_MODE_POWER_DOWN 6
  167. #define PHY_MODE_ALL 7
  168. /* Bits */
  169. #define VECT_CNTL_ENABLE (1 << 5)
  170. /*******************************
  171. * GPIO and timer module *
  172. *******************************/
  173. /* Registers */
  174. #define NETX_GPIO_REG(ofs) IOMEM(NETX_VA_GPIO + (ofs))
  175. #define NETX_GPIO_CFG(gpio) NETX_GPIO_REG(0x0 + ((gpio)<<2))
  176. #define NETX_GPIO_THRESHOLD_CAPTURE(gpio) NETX_GPIO_REG(0x40 + ((gpio)<<2))
  177. #define NETX_GPIO_COUNTER_CTRL(counter) NETX_GPIO_REG(0x80 + ((counter)<<2))
  178. #define NETX_GPIO_COUNTER_MAX(counter) NETX_GPIO_REG(0x94 + ((counter)<<2))
  179. #define NETX_GPIO_COUNTER_CURRENT(counter) NETX_GPIO_REG(0xa8 + ((counter)<<2))
  180. #define NETX_GPIO_IRQ_ENABLE NETX_GPIO_REG(0xbc)
  181. #define NETX_GPIO_IRQ_DISABLE NETX_GPIO_REG(0xc0)
  182. #define NETX_GPIO_SYSTIME_NS_CMP NETX_GPIO_REG(0xc4)
  183. #define NETX_GPIO_LINE NETX_GPIO_REG(0xc8)
  184. #define NETX_GPIO_IRQ NETX_GPIO_REG(0xd0)
  185. /* Bits */
  186. #define NETX_GPIO_CFG_IOCFG_GP_INPUT (0x0)
  187. #define NETX_GPIO_CFG_IOCFG_GP_OUTPUT (0x1)
  188. #define NETX_GPIO_CFG_IOCFG_GP_UART (0x2)
  189. #define NETX_GPIO_CFG_INV (1<<2)
  190. #define NETX_GPIO_CFG_MODE_INPUT_READ (0<<3)
  191. #define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_CONT_RISING (1<<3)
  192. #define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_ONCE_RISING (2<<3)
  193. #define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_HIGH_LEVEL (3<<3)
  194. #define NETX_GPIO_CFG_COUNT_REF_COUNTER0 (0<<5)
  195. #define NETX_GPIO_CFG_COUNT_REF_COUNTER1 (1<<5)
  196. #define NETX_GPIO_CFG_COUNT_REF_COUNTER2 (2<<5)
  197. #define NETX_GPIO_CFG_COUNT_REF_COUNTER3 (3<<5)
  198. #define NETX_GPIO_CFG_COUNT_REF_COUNTER4 (4<<5)
  199. #define NETX_GPIO_CFG_COUNT_REF_SYSTIME (7<<5)
  200. #define NETX_GPIO_COUNTER_CTRL_RUN (1<<0)
  201. #define NETX_GPIO_COUNTER_CTRL_SYM (1<<1)
  202. #define NETX_GPIO_COUNTER_CTRL_ONCE (1<<2)
  203. #define NETX_GPIO_COUNTER_CTRL_IRQ_EN (1<<3)
  204. #define NETX_GPIO_COUNTER_CTRL_CNT_EVENT (1<<4)
  205. #define NETX_GPIO_COUNTER_CTRL_RST_EN (1<<5)
  206. #define NETX_GPIO_COUNTER_CTRL_SEL_EVENT (1<<6)
  207. #define NETX_GPIO_COUNTER_CTRL_GPIO_REF /* FIXME */
  208. #define GPIO_BIT(gpio) (1<<(gpio))
  209. #define COUNTER_BIT(counter) ((1<<16)<<(counter))
  210. /*******************************
  211. * PIO *