IxOsalOsIxp400.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. /**
  2. * @file IxOsalOsIxp400.h
  3. *
  4. * @brief OS and platform specific definitions
  5. *
  6. * Design Notes:
  7. *
  8. * @par
  9. * IXP400 SW Release version 2.0
  10. *
  11. * -- Copyright Notice --
  12. *
  13. * @par
  14. * Copyright 2001-2005, Intel Corporation.
  15. * All rights reserved.
  16. *
  17. * @par
  18. * Redistribution and use in source and binary forms, with or without
  19. * modification, are permitted provided that the following conditions
  20. * are met:
  21. * 1. Redistributions of source code must retain the above copyright
  22. * notice, this list of conditions and the following disclaimer.
  23. * 2. Redistributions in binary form must reproduce the above copyright
  24. * notice, this list of conditions and the following disclaimer in the
  25. * documentation and/or other materials provided with the distribution.
  26. * 3. Neither the name of the Intel Corporation nor the names of its contributors
  27. * may be used to endorse or promote products derived from this software
  28. * without specific prior written permission.
  29. *
  30. * @par
  31. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
  32. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  33. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  34. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  35. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  36. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  37. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  38. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  39. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  40. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  41. * SUCH DAMAGE.
  42. *
  43. * @par
  44. * -- End of Copyright Notice --
  45. */
  46. #ifndef IxOsalOsIxp400_H
  47. #define IxOsalOsIxp400_H
  48. #define BIT(x) (1<<(x))
  49. #define IXP425_EthA_BASE 0xc8009000
  50. #define IXP425_EthB_BASE 0xc800a000
  51. #define IXP425_PSMA_BASE 0xc8006000
  52. #define IXP425_PSMB_BASE 0xc8007000
  53. #define IXP425_PSMC_BASE 0xc8008000
  54. #define IXP425_PERIPHERAL_BASE 0xc8000000
  55. #define IXP425_QMGR_BASE 0x60000000
  56. #define IXP425_OSTS 0xC8005000
  57. #define IXP425_INT_LVL_NPEA 0
  58. #define IXP425_INT_LVL_NPEB 1
  59. #define IXP425_INT_LVL_NPEC 2
  60. #define IXP425_INT_LVL_QM1 3
  61. #define IXP425_INT_LVL_QM2 4
  62. #define IXP425_EXPANSION_BUS_BASE1 0x50000000
  63. #define IXP425_EXPANSION_BUS_BASE2 0x50000000
  64. #define IXP425_EXPANSION_BUS_CS1_BASE 0x51000000
  65. #define IXP425_EXP_CONFIG_BASE 0xC4000000
  66. /* physical addresses to be used when requesting memory with IX_OSAL_MEM_MAP */
  67. #define IX_OSAL_IXP400_INTC_PHYS_BASE IXP425_INTC_BASE
  68. #define IX_OSAL_IXP400_GPIO_PHYS_BASE IXP425_GPIO_BASE
  69. #define IX_OSAL_IXP400_UART1_PHYS_BASE IXP425_UART1_BASE
  70. #define IX_OSAL_IXP400_UART2_PHYS_BASE IXP425_UART2_BASE
  71. #define IX_OSAL_IXP400_ETHA_PHYS_BASE IXP425_EthA_BASE
  72. #define IX_OSAL_IXP400_ETHB_PHYS_BASE IXP425_EthB_BASE
  73. #define IX_OSAL_IXP400_NPEA_PHYS_BASE IXP425_NPEA_BASE
  74. #define IX_OSAL_IXP400_NPEB_PHYS_BASE IXP425_NPEB_BASE
  75. #define IX_OSAL_IXP400_NPEC_PHYS_BASE IXP425_NPEC_BASE
  76. #define IX_OSAL_IXP400_PERIPHERAL_PHYS_BASE IXP425_PERIPHERAL_BASE
  77. #define IX_OSAL_IXP400_QMGR_PHYS_BASE IXP425_QMGR_BASE
  78. #define IX_OSAL_IXP400_OSTS_PHYS_BASE IXP425_TIMER_BASE
  79. #define IX_OSAL_IXP400_USB_PHYS_BASE IXP425_USB_BASE
  80. #define IX_OSAL_IXP400_EXP_CFG_PHYS_BASE IXP425_EXP_CFG_BASE
  81. #define IX_OSAL_IXP400_EXP_BUS_PHYS_BASE IXP425_EXP_BUS_BASE2
  82. #define IX_OSAL_IXP400_EXP_BUS_BOOT_PHYS_BASE IXP425_EXP_BUS_BASE1
  83. #define IX_OSAL_IXP400_EXP_BUS_CS0_PHYS_BASE IXP425_EXP_BUS_CS0_BASE
  84. #define IX_OSAL_IXP400_EXP_BUS_CS1_PHYS_BASE IXP425_EXP_BUS_CS1_BASE
  85. #define IX_OSAL_IXP400_EXP_BUS_CS4_PHYS_BASE IXP425_EXP_BUS_CS4_BASE
  86. #define IX_OSAL_IXP400_EXP_BUS_REGS_PHYS_BASE IXP425_EXP_CFG_BASE
  87. #define IX_OSAL_IXP400_PCI_CFG_PHYS_BASE IXP425_PCI_CFG_BASE
  88. /* map sizes to be used when requesting memory with IX_OSAL_MEM_MAP */
  89. #define IX_OSAL_IXP400_QMGR_MAP_SIZE (0x4000) /**< Queue Manager map size */
  90. #define IX_OSAL_IXP400_PERIPHERAL_MAP_SIZE (0xC000) /**< Peripheral space map size */
  91. #define IX_OSAL_IXP400_UART1_MAP_SIZE (0x1000) /**< UART1 map size */
  92. #define IX_OSAL_IXP400_UART2_MAP_SIZE (0x1000) /**< UART2 map size */
  93. #define IX_OSAL_IXP400_PMU_MAP_SIZE (0x1000) /**< PMU map size */
  94. #define IX_OSAL_IXP400_OSTS_MAP_SIZE (0x1000) /**< OS Timers map size */
  95. #define IX_OSAL_IXP400_NPEA_MAP_SIZE (0x1000) /**< NPE A map size */
  96. #define IX_OSAL_IXP400_NPEB_MAP_SIZE (0x1000) /**< NPE B map size */
  97. #define IX_OSAL_IXP400_NPEC_MAP_SIZE (0x1000) /**< NPE C map size */
  98. #define IX_OSAL_IXP400_ETHA_MAP_SIZE (0x1000) /**< Eth A map size */
  99. #define IX_OSAL_IXP400_ETHB_MAP_SIZE (0x1000) /**< Eth B map size */
  100. #define IX_OSAL_IXP400_USB_MAP_SIZE (0x1000) /**< USB map size */
  101. #define IX_OSAL_IXP400_GPIO_MAP_SIZE (0x1000) /**< GPIO map size */
  102. #define IX_OSAL_IXP400_EXP_REG_MAP_SIZE (0x1000) /**< Exp Bus Config Registers map size */
  103. #define IX_OSAL_IXP400_EXP_BUS_MAP_SIZE (0x08000000) /**< Expansion bus map size */
  104. #define IX_OSAL_IXP400_EXP_BUS_CS0_MAP_SIZE (0x01000000) /**< CS0 map size */
  105. #define IX_OSAL_IXP400_EXP_BUS_CS1_MAP_SIZE (0x01000000) /**< CS1 map size */
  106. #define IX_OSAL_IXP400_EXP_BUS_CS4_MAP_SIZE (0x01000000) /**< CS4 map size */
  107. #define IX_OSAL_IXP400_PCI_CFG_MAP_SIZE (0x1000) /**< PCI Bus Config Registers map size */
  108. #define IX_OSAL_IXP400_EXP_FUSE (IXP425_EXP_CONFIG_BASE + 0x28)
  109. #define IX_OSAL_IXP400_ETH_NPEA_PHYS_BASE 0xC800C000
  110. #define IX_OSAL_IXP400_ETH_NPEA_MAP_SIZE 0x1000
  111. /*
  112. * Interrupt Levels
  113. */
  114. #define IX_OSAL_IXP400_NPEA_IRQ_LVL (0)
  115. #define IX_OSAL_IXP400_NPEB_IRQ_LVL (1)
  116. #define IX_OSAL_IXP400_NPEC_IRQ_LVL (2)
  117. #define IX_OSAL_IXP400_QM1_IRQ_LVL (3)
  118. #define IX_OSAL_IXP400_QM2_IRQ_LVL (4)
  119. #define IX_OSAL_IXP400_TIMER1_IRQ_LVL (5)
  120. #define IX_OSAL_IXP400_GPIO0_IRQ_LVL (6)
  121. #define IX_OSAL_IXP400_GPIO1_IRQ_LVL (7)
  122. #define IX_OSAL_IXP400_PCI_INT_IRQ_LVL (8)
  123. #define IX_OSAL_IXP400_PCI_DMA1_IRQ_LVL (9)
  124. #define IX_OSAL_IXP400_PCI_DMA2_IRQ_LVL (10)
  125. #define IX_OSAL_IXP400_TIMER2_IRQ_LVL (11)
  126. #define IX_OSAL_IXP400_USB_IRQ_LVL (12)
  127. #define IX_OSAL_IXP400_UART2_IRQ_LVL (13)
  128. #define IX_OSAL_IXP400_TIMESTAMP_IRQ_LVL (14)
  129. #define IX_OSAL_IXP400_UART1_IRQ_LVL (15)
  130. #define IX_OSAL_IXP400_WDOG_IRQ_LVL (16)
  131. #define IX_OSAL_IXP400_AHB_PMU_IRQ_LVL (17)
  132. #define IX_OSAL_IXP400_XSCALE_PMU_IRQ_LVL (18)
  133. #define IX_OSAL_IXP400_GPIO2_IRQ_LVL (19)
  134. #define IX_OSAL_IXP400_GPIO3_IRQ_LVL (20)
  135. #define IX_OSAL_IXP400_GPIO4_IRQ_LVL (21)
  136. #define IX_OSAL_IXP400_GPIO5_IRQ_LVL (22)
  137. #define IX_OSAL_IXP400_GPIO6_IRQ_LVL (23)
  138. #define IX_OSAL_IXP400_GPIO7_IRQ_LVL (24)
  139. #define IX_OSAL_IXP400_GPIO8_IRQ_LVL (25)
  140. #define IX_OSAL_IXP400_GPIO9_IRQ_LVL (26)
  141. #define IX_OSAL_IXP400_GPIO10_IRQ_LVL (27)
  142. #define IX_OSAL_IXP400_GPIO11_IRQ_LVL (28)
  143. #define IX_OSAL_IXP400_GPIO12_IRQ_LVL (29)
  144. #define IX_OSAL_IXP400_SW_INT1_IRQ_LVL (30)
  145. #define IX_OSAL_IXP400_SW_INT2_IRQ_LVL (31)
  146. /* USB interrupt level mask */
  147. #define IX_OSAL_IXP400_INT_LVL_USB IRQ_IXP425_USB
  148. /* USB IRQ */
  149. #define IX_OSAL_IXP400_USB_IRQ IRQ_IXP425_USB
  150. /*
  151. * OS name retrieval
  152. */
  153. #define IX_OSAL_OEM_OS_NAME_GET(name, limit) \
  154. ixOsalOsIxp400NameGet((INT8*)(name), (INT32) (limit))
  155. /*
  156. * OS version retrieval
  157. */
  158. #define IX_OSAL_OEM_OS_VERSION_GET(version, limit) \
  159. ixOsalOsIxp400VersionGet((INT8*)(version), (INT32) (limit))
  160. /*
  161. * Function to retrieve the OS name
  162. */
  163. PUBLIC IX_STATUS ixOsalOsIxp400NameGet(INT8* osName, INT32 maxSize);
  164. /*
  165. * Function to retrieve the OS version
  166. */
  167. PUBLIC IX_STATUS ixOsalOsIxp400VersionGet(INT8* osVersion, INT32 maxSize);
  168. /*
  169. * TimestampGet
  170. */
  171. PUBLIC UINT32 ixOsalOsIxp400TimestampGet (void);
  172. /*
  173. * Timestamp
  174. */
  175. #define IX_OSAL_OEM_TIMESTAMP_GET ixOsalOsIxp400TimestampGet
  176. /*
  177. * Timestamp resolution
  178. */
  179. PUBLIC UINT32 ixOsalOsIxp400TimestampResolutionGet (void);
  180. #define IX_OSAL_OEM_TIMESTAMP_RESOLUTION_GET ixOsalOsIxp400TimestampResolutionGet
  181. /*
  182. * Retrieves the system clock rate
  183. */
  184. PUBLIC UINT32 ixOsalOsIxp400SysClockRateGet (void);
  185. #define IX_OSAL_OEM_SYS_CLOCK_RATE_GET ixOsalOsIxp400SysClockRateGet
  186. /*
  187. * required by FS but is not really platform-specific.
  188. */
  189. #define IX_OSAL_OEM_TIME_GET(pTv) ixOsalTimeGet(pTv)
  190. /* linux map/unmap functions */
  191. PUBLIC void ixOsalLinuxMemMap (IxOsalMemoryMap * map);
  192. PUBLIC void ixOsalLinuxMemUnmap (IxOsalMemoryMap * map);
  193. /*********************
  194. * Memory map
  195. ********************/
  196. /* Global memmap only visible to IO MEM module */
  197. #ifdef IxOsalIoMem_C
  198. IxOsalMemoryMap ixOsalGlobalMemoryMap[] = {
  199. {
  200. /* Global BE and LE_AC map */
  201. IX_OSAL_STATIC_MAP, /* type */
  202. 0x00000000, /* physicalAddress */
  203. 0x30000000, /* size */
  204. 0x00000000, /* virtualAddress */
  205. NULL, /* mapFunction */
  206. NULL, /* unmapFunction */
  207. 0, /* refCount */
  208. IX_OSAL_BE | IX_OSAL_LE_AC,/* endianType */
  209. "global_low" /* name */
  210. },
  211. /* SDRAM LE_DC alias */
  212. {
  213. IX_OSAL_STATIC_MAP, /* type */
  214. 0x00000000, /* physicalAddress */
  215. 0x10000000, /* size */
  216. 0x30000000, /* virtualAddress */
  217. NULL, /* mapFunction */
  218. NULL, /* unmapFunction */
  219. 0, /* refCount */
  220. IX_OSAL_LE_DC, /* endianType */
  221. "sdram_dc" /* name */
  222. },
  223. /* QMGR LE_DC alias */
  224. {
  225. IX_OSAL_STATIC_MAP, /* type */
  226. 0x60000000, /* physicalAddress */
  227. 0x00100000, /* size */
  228. 0x60000000, /* virtualAddress */
  229. NULL, /* mapFunction */
  230. NULL, /* unmapFunction */
  231. 0, /* refCount */
  232. IX_OSAL_LE_DC, /* endianType */
  233. "qmgr_dc" /* name */
  234. },
  235. /* QMGR BE alias */
  236. {
  237. IX_OSAL_STATIC_MAP, /* type */
  238. 0x60000000, /* physicalAddress */
  239. 0x00100000, /* size */
  240. 0x60000000, /* virtualAddress */
  241. NULL, /* mapFunction */
  242. NULL, /* unmapFunction */
  243. 0, /* refCount */
  244. IX_OSAL_BE | IX_OSAL_LE_AC,/* endianType */
  245. "qmgr_be" /* name */
  246. },
  247. /* Global BE and LE_AC map */
  248. {
  249. IX_OSAL_STATIC_MAP, /* type */
  250. 0x40000000, /* physicalAddress */
  251. 0x20000000, /* size */
  252. 0x40000000, /* virtualAddress */
  253. NULL, /* mapFunction */
  254. NULL, /* unmapFunction */
  255. 0, /* refCount */
  256. IX_OSAL_BE | IX_OSAL_LE_AC,/* endianType */
  257. "Misc Cfg" /* name */
  258. },
  259. /* Global BE and LE_AC map */
  260. {
  261. IX_OSAL_STATIC_MAP, /* type */
  262. 0x70000000, /* physicalAddress */
  263. 0x8FFFFFFF, /* size */
  264. 0x70000000, /* virtualAddress */
  265. NULL, /* mapFunction */
  266. NULL, /* unmapFunction */
  267. 0, /* refCount */
  268. IX_OSAL_BE | IX_OSAL_LE_AC,/* endianType */
  269. "Exp Cfg" /* name */
  270. },
  271. };
  272. #endif /* IxOsalIoMem_C */
  273. #endif /* #define IxOsalOsIxp400_H */