stb.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. /*----------------------------------------------------------------------------+
  2. | This source code has been made available to you by IBM on an AS-IS
  3. | basis. Anyone receiving this source is licensed under IBM
  4. | copyrights to use it in any way he or she deems fit, including
  5. | copying it, modifying it, compiling it, and redistributing it either
  6. | with or without modifications. No license under IBM patents or
  7. | patent applications is to be implied by the copyright license.
  8. |
  9. | Any user of this software should understand that IBM cannot provide
  10. | technical support for this software and will not be responsible for
  11. | any consequences resulting from the use of this software.
  12. |
  13. | Any person who transfers this source code or any derivative work
  14. | must include the IBM copyright notice, this paragraph, and the
  15. | preceding two paragraphs in the transferred software.
  16. |
  17. | COPYRIGHT I B M CORPORATION 1999
  18. | LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
  19. +----------------------------------------------------------------------------*/
  20. /*----------------------------------------------------------------------------+
  21. | Author: Maciej P. Tyrlik
  22. | Component: Include file.
  23. | File: stb.h
  24. | Purpose: Common Set-tob-box definitions.
  25. | Changes:
  26. | Date: Comment:
  27. | ----- --------
  28. | 14-Jan-97 Created for ElPaso pass 1 MPT
  29. | 13-May-97 Added function prototype and global variables MPT
  30. | 08-Dec-98 Added RAW IR task information MPT
  31. | 19-Jan-99 Port to Romeo MPT
  32. | 19-May-00 Changed SDRAM to 32MB contiguous 0x1F000000 - 0x20FFFFFF RLB
  33. +----------------------------------------------------------------------------*/
  34. #ifndef _stb_h_
  35. #define _stb_h_
  36. /*----------------------------------------------------------------------------+
  37. | Read/write from I/O macros.
  38. +----------------------------------------------------------------------------*/
  39. #define inbyte(port) (*((unsigned char volatile *)(port)))
  40. #define outbyte(port,data) *(unsigned char volatile *)(port)=\
  41. (unsigned char)(data)
  42. #define inshort(port) (*((unsigned short volatile *)(port)))
  43. #define outshort(port,data) *(unsigned short volatile *)(port)=\
  44. (unsigned short)(data)
  45. #define inword(port) (*((unsigned long volatile *)(port)))
  46. #define outword(port,data) *(unsigned long volatile *)(port)=\
  47. (unsigned long)(data)
  48. /*----------------------------------------------------------------------------+
  49. | STB interrupts.
  50. +----------------------------------------------------------------------------*/
  51. #define STB_XP_TP_INT 0
  52. #define STB_XP_APP_INT 1
  53. #define STB_AUD_INT 2
  54. #define STB_VID_INT 3
  55. #define STB_DMA0_INT 4
  56. #define STB_DMA1_INT 5
  57. #define STB_DMA2_INT 6
  58. #define STB_DMA3_INT 7
  59. #define STB_SCI_INT 8
  60. #define STB_I2C1_INT 9
  61. #define STB_I2C2_INT 10
  62. #define STB_GPT_PWM0 11
  63. #define STB_GPT_PWM1 12
  64. #define STB_SCP_INT 13
  65. #define STB_SSP_INT 14
  66. #define STB_GPT_PWM2 15
  67. #define STB_EXT5_INT 16
  68. #define STB_EXT6_INT 17
  69. #define STB_EXT7_INT 18
  70. #define STB_EXT8_INT 19
  71. #define STB_SCC_INT 20
  72. #define STB_SICC_RECV_INT 21
  73. #define STB_SICC_TRAN_INT 22
  74. #define STB_PPU_INT 23
  75. #define STB_DCRX_INT 24
  76. #define STB_EXT0_INT 25
  77. #define STB_EXT1_INT 26
  78. #define STB_EXT2_INT 27
  79. #define STB_EXT3_INT 28
  80. #define STB_EXT4_INT 29
  81. #define STB_REDWOOD_ENET_INT STB_EXT1_INT
  82. /*----------------------------------------------------------------------------+
  83. | STB tasks, task stack sizes, and task priorities. The actual task priority
  84. | is 1 more than the specified number since priority 0 is reserved (system
  85. | internaly adds 1 to supplied priority number).
  86. +----------------------------------------------------------------------------*/
  87. #define STB_IDLE_TASK_SS (5* 1024)
  88. #define STB_IDLE_TASK_PRIO 0
  89. #define STB_LEDTEST_SS (2* 1024)
  90. #define STB_LEDTEST_PRIO 0
  91. #define STB_CURSOR_TASK_SS (10* 1024)
  92. #define STB_CURSOR_TASK_PRIO 7
  93. #define STB_MPEG_TASK_SS (10* 1024)
  94. #define STB_MPEG_TASK_PRIO 9
  95. #define STB_DEMUX_TASK_SS (10* 1024)
  96. #define STB_DEMUX_TASK_PRIO 20
  97. #define RAW_STB_IR_TASK_SS (10* 1024)
  98. #define RAW_STB_IR_TASK_PRIO 20
  99. #define STB_SERIAL_ER_TASK_SS (10* 1024)
  100. #define STB_SERIAL_ER_TASK_PRIO 1
  101. #define STB_CA_TASK_SS (10* 1024)
  102. #define STB_CA_TASK_PRIO 8
  103. #define INIT_DEFAULT_VIDEO_SS (10* 1024)
  104. #define INIT_DEFAULT_VIDEO_PRIO 8
  105. #define INIT_DEFAULT_SERVI_SS (10* 1024)
  106. #define INIT_DEFAULT_SERVI_PRIO 8
  107. #define INIT_DEFAULT_POST_SS (10* 1024)
  108. #define INIT_DEFAULT_POST_PRIO 8
  109. #define INIT_DEFAULT_INTER_SS (10* 1024)
  110. #define INIT_DEFAULT_INTER_PRIO 8
  111. #define INIT_DEFAULT_BR_SS (10* 1024)
  112. #define INIT_DEFAULT_BR_PRIO 8
  113. #define INITIAL_TASK_STACK_SIZE (32* 1024)
  114. #ifdef VESTA
  115. /*----------------------------------------------------------------------------+
  116. | Vesta Overall Address Map (all addresses are double mapped, bit 0 of the
  117. | address is not decoded. Numbers below are dependent on board configuration.
  118. | FLASH, SDRAM, DRAM numbers can be affected by actual board setup.
  119. |
  120. | FFE0,0000 - FFFF,FFFF FLASH
  121. | F200,0000 - F210,FFFF FPGA logic
  122. | Ethernet = F200,0000
  123. | LED Display = F200,0100
  124. | Xilinx #1 Regs = F204,0000
  125. | Xilinx #2 Regs = F208,0000
  126. | Spare = F20C,0000
  127. | IDE CS0 = F210,0000
  128. | F410,0000 - F410,FFFF IDE CS1
  129. | C000,0000 - C7FF,FFFF OBP
  130. | C000,0000 - C000,0014 SICC (16550 + infra red)
  131. | C001,0000 - C001,0018 PPU (Parallel Port)
  132. | C002,0000 - C002,001B SC0 (Smart Card 0)
  133. | C003,0000 - C003,000F I2C0
  134. | C004,0000 - C004,0009 SCC (16550 UART)
  135. | C005,0000 - C005,0124 GPT (Timers)
  136. | C006,0000 - C006,0058 GPIO0
  137. | C007,0000 - C007,001b SC1 (Smart Card 1)
  138. | C008,0000 - C008,FFFF Unused
  139. | C009,0000 - C009,FFFF Unused
  140. | C00A,0000 - C00A,FFFF Unused
  141. | C00B,0000 - C00B,000F I2C1
  142. | C00C,0000 - C00C,0006 SCP
  143. | C00D,0000 - C00D,0010 SSP
  144. | A000,0000 - A0FF,FFFF SDRAM1 (16M)
  145. | 0000,0000 - 00FF,FFFF SDRAM0 (16M)
  146. +----------------------------------------------------------------------------*/
  147. #define STB_FLASH_BASE_ADDRESS 0xFFE00000
  148. #define STB_FPGA_BASE_ADDRESS 0xF2000000
  149. #define STB_SICC_BASE_ADDRESS 0xC0000000
  150. #define STB_PPU_BASE_ADDR 0xC0010000
  151. #define STB_SC0_BASE_ADDRESS 0xC0020000
  152. #define STB_I2C1_BASE_ADDRESS 0xC0030000
  153. #define STB_SCC_BASE_ADDRESS 0xC0040000
  154. #define STB_TIMERS_BASE_ADDRESS 0xC0050000
  155. #define STB_GPIO0_BASE_ADDRESS 0xC0060000
  156. #define STB_SC1_BASE_ADDRESS 0xC0070000
  157. #define STB_I2C2_BASE_ADDRESS 0xC00B0000
  158. #define STB_SCP_BASE_ADDRESS 0xC00C0000
  159. #define STB_SSP_BASE_ADDRESS 0xC00D0000
  160. /*----------------------------------------------------------------------------+
  161. |The following are used by the IBM RTOS SW.
  162. |15-May-00 Changed these values to reflect movement of base addresses in
  163. |order to support 32MB of contiguous SDRAM space.
  164. |Points to the cacheable region since these values are used in IBM RTOS
  165. |to establish the vector address.
  166. +----------------------------------------------------------------------------*/
  167. #define STB_SDRAM1_BASE_ADDRESS 0x20000000
  168. #define STB_SDRAM1_SIZE 0x01000000
  169. #define STB_SDRAM0_BASE_ADDRESS 0x1F000000
  170. #define STB_SDRAM0_SIZE 0x01000000
  171. #else
  172. /*----------------------------------------------------------------------------+
  173. | ElPaso Overall Address Map (all addresses are double mapped, bit 0 of the
  174. | address is not decoded. Numbers below are dependent on board configuration.
  175. | FLASH, SDRAM, DRAM numbers can be affected by actual board setup. OPB
  176. | devices are inside the ElPaso chip.
  177. | FFE0,0000 - FFFF,FFFF FLASH
  178. | F144,0000 - F104,FFFF FPGA logic
  179. | F140,0000 - F100,0000 ethernet (through FPGA logic)
  180. | C000,0000 - C7FF,FFFF OBP
  181. | C000,0000 - C000,0014 SICC (16550+ infra red)
  182. | C001,0000 - C001,0016 PPU (parallel port)
  183. | C002,0000 - C002,001B SC (smart card)
  184. | C003,0000 - C003,000F I2C 1
  185. | C004,0000 - C004,0009 SCC (16550 UART)
  186. | C005,0000 - C005,0124 Timers
  187. | C006,0000 - C006,0058 GPIO0
  188. | C007,0000 - C007,0058 GPIO1
  189. | C008,0000 - C008,0058 GPIO2
  190. | C009,0000 - C009,0058 GPIO3
  191. | C00A,0000 - C00A,0058 GPIO4
  192. | C00B,0000 - C00B,000F I2C 2
  193. | C00C,0000 - C00C,0006 SCP
  194. | C00D,0000 - C00D,0006 SSP
  195. | A000,0000 - A0FF,FFFF SDRAM 16M
  196. | 0000,0000 - 00FF,FFFF DRAM 16M
  197. +----------------------------------------------------------------------------*/
  198. #define STB_FLASH_BASE_ADDRESS 0xFFE00000
  199. #define STB_FPGA_BASE_ADDRESS 0xF1440000
  200. #define STB_ENET_BASE_ADDRESS 0xF1400000
  201. #define STB_SICC_BASE_ADDRESS 0xC0000000
  202. #define STB_PPU_BASE_ADDR 0xC0010000
  203. #define STB_SC_BASE_ADDRESS 0xC0020000
  204. #define STB_I2C1_BASE_ADDRESS 0xC0030000
  205. #define STB_SCC_BASE_ADDRESS 0xC0040000
  206. #define STB_TIMERS_BASE_ADDRESS 0xC0050000
  207. #define STB_GPIO0_BASE_ADDRESS 0xC0060000
  208. #define STB_GPIO1_BASE_ADDRESS 0xC0070000
  209. #define STB_GPIO2_BASE_ADDRESS 0xC0080000
  210. #define STB_GPIO3_BASE_ADDRESS 0xC0090000
  211. #define STB_GPIO4_BASE_ADDRESS 0xC00A0000
  212. #define STB_I2C2_BASE_ADDRESS 0xC00B0000
  213. #define STB_SCP_BASE_ADDRESS 0xC00C0000
  214. #define STB_SSP_BASE_ADDRESS 0xC00D0000
  215. #define STB_SDRAM_BASE_ADDRESS 0xA0000000
  216. #endif
  217. /*----------------------------------------------------------------------------+
  218. | Other common defines.
  219. +----------------------------------------------------------------------------*/
  220. #ifndef TRUE
  221. #define TRUE 1
  222. #endif
  223. #ifndef FALSE
  224. #define FALSE 0
  225. #endif
  226. #endif /* _stb_h_ */