platform.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License as published by
  4. * the Free Software Foundation; either version 2 of the License, or
  5. * (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software
  14. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. */
  16. #ifndef __address_h
  17. #define __address_h 1
  18. #define KS8695_SDRAM_START 0x00000000
  19. #define KS8695_SDRAM_SIZE 0x01000000
  20. #define KS8695_MEM_SIZE KS8695_SDRAM_SIZE
  21. #define KS8695_MEM_START KS8695_SDRAM_START
  22. #define KS8695_PCMCIA_IO_BASE 0x03800000
  23. #define KS8695_PCMCIA_IO_SIZE 0x00040000
  24. #define KS8695_IO_BASE 0x03FF0000
  25. #define KS8695_IO_SIZE 0x00010000
  26. #define KS8695_SYSTEN_CONFIG 0x00
  27. #define KS8695_SYSTEN_BUS_CLOCK 0x04
  28. #define KS8695_FLASH_START 0x02800000
  29. #define KS8695_FLASH_SIZE 0x00400000
  30. /*i/o control registers offset difinitions*/
  31. #define KS8695_IO_CTRL0 0x4000
  32. #define KS8695_IO_CTRL1 0x4004
  33. #define KS8695_IO_CTRL2 0x4008
  34. #define KS8695_IO_CTRL3 0x400C
  35. /*memory control registers offset difinitions*/
  36. #define KS8695_MEM_CTRL0 0x4010
  37. #define KS8695_MEM_CTRL1 0x4014
  38. #define KS8695_MEM_CTRL2 0x4018
  39. #define KS8695_MEM_CTRL3 0x401C
  40. #define KS8695_MEM_GENERAL 0x4020
  41. #define KS8695_SDRAM_CTRL0 0x4030
  42. #define KS8695_SDRAM_CTRL1 0x4034
  43. #define KS8695_SDRAM_GENERAL 0x4038
  44. #define KS8695_SDRAM_BUFFER 0x403C
  45. #define KS8695_SDRAM_REFRESH 0x4040
  46. /*WAN control registers offset difinitions*/
  47. #define KS8695_WAN_DMA_TX 0x6000
  48. #define KS8695_WAN_DMA_RX 0x6004
  49. #define KS8695_WAN_DMA_TX_START 0x6008
  50. #define KS8695_WAN_DMA_RX_START 0x600C
  51. #define KS8695_WAN_TX_LIST 0x6010
  52. #define KS8695_WAN_RX_LIST 0x6014
  53. #define KS8695_WAN_MAC_LOW 0x6018
  54. #define KS8695_WAN_MAC_HIGH 0x601C
  55. #define KS8695_WAN_MAC_ELOW 0x6080
  56. #define KS8695_WAN_MAC_EHIGH 0x6084
  57. /*LAN control registers offset difinitions*/
  58. #define KS8695_LAN_DMA_TX 0x8000
  59. #define KS8695_LAN_DMA_RX 0x8004
  60. #define KS8695_LAN_DMA_TX_START 0x8008
  61. #define KS8695_LAN_DMA_RX_START 0x800C
  62. #define KS8695_LAN_TX_LIST 0x8010
  63. #define KS8695_LAN_RX_LIST 0x8014
  64. #define KS8695_LAN_MAC_LOW 0x8018
  65. #define KS8695_LAN_MAC_HIGH 0x801C
  66. #define KS8695_LAN_MAC_ELOW 0X8080
  67. #define KS8695_LAN_MAC_EHIGH 0X8084
  68. /*HPNA control registers offset difinitions*/
  69. #define KS8695_HPNA_DMA_TX 0xA000
  70. #define KS8695_HPNA_DMA_RX 0xA004
  71. #define KS8695_HPNA_DMA_TX_START 0xA008
  72. #define KS8695_HPNA_DMA_RX_START 0xA00C
  73. #define KS8695_HPNA_TX_LIST 0xA010
  74. #define KS8695_HPNA_RX_LIST 0xA014
  75. #define KS8695_HPNA_MAC_LOW 0xA018
  76. #define KS8695_HPNA_MAC_HIGH 0xA01C
  77. #define KS8695_HPNA_MAC_ELOW 0xA080
  78. #define KS8695_HPNA_MAC_EHIGH 0xA084
  79. /*UART control registers offset difinitions*/
  80. #define KS8695_UART_RX_BUFFER 0xE000
  81. #define KS8695_UART_TX_HOLDING 0xE004
  82. #define KS8695_UART_FIFO_CTRL 0xE008
  83. #define KS8695_UART_FIFO_TRIG01 0x00
  84. #define KS8695_UART_FIFO_TRIG04 0x80
  85. #define KS8695_UART_FIFO_TXRST 0x03
  86. #define KS8695_UART_FIFO_RXRST 0x02
  87. #define KS8695_UART_FIFO_FEN 0x01
  88. #define KS8695_UART_LINE_CTRL 0xE00C
  89. #define KS8695_UART_LINEC_BRK 0x40
  90. #define KS8695_UART_LINEC_EPS 0x10
  91. #define KS8695_UART_LINEC_PEN 0x08
  92. #define KS8695_UART_LINEC_STP2 0x04
  93. #define KS8695_UART_LINEC_WLEN8 0x03
  94. #define KS8695_UART_LINEC_WLEN7 0x02
  95. #define KS8695_UART_LINEC_WLEN6 0x01
  96. #define KS8695_UART_LINEC_WLEN5 0x00
  97. #define KS8695_UART_MODEM_CTRL 0xE010
  98. #define KS8695_UART_MODEMC_RTS 0x02
  99. #define KS8695_UART_MODEMC_DTR 0x01
  100. #define KS8695_UART_LINE_STATUS 0xE014
  101. #define KS8695_UART_LINES_TXFE 0x20
  102. #define KS8695_UART_LINES_BE 0x10
  103. #define KS8695_UART_LINES_FE 0x08
  104. #define KS8695_UART_LINES_PE 0x04
  105. #define KS8695_UART_LINES_OE 0x02
  106. #define KS8695_UART_LINES_RXFE 0x01
  107. #define KS8695_UART_LINES_ANY (KS8695_UART_LINES_OE|KS8695_UART_LINES_BE|KS8695_UART_LINES_PE|KS8695_UART_LINES_FE)
  108. #define KS8695_UART_MODEM_STATUS 0xE018
  109. #define KS8695_UART_MODEM_DCD 0x80
  110. #define KS8695_UART_MODEM_DSR 0x20
  111. #define KS8695_UART_MODEM_CTS 0x10
  112. #define KS8695_UART_MODEM_DDCD 0x08
  113. #define KS8695_UART_MODEM_DDSR 0x02
  114. #define KS8695_UART_MODEM_DCTS 0x01
  115. #define UART8695_MODEM_ANY 0xFF
  116. #define KS8695_UART_DIVISOR 0xE01C
  117. #define KS8695_UART_STATUS 0xE020
  118. /*Interrupt controlller registers offset difinitions*/
  119. #define KS8695_INT_CONTL 0xE200
  120. #define KS8695_INT_ENABLE 0xE204
  121. #define KS8695_INT_ENABLE_MODEM 0x0800
  122. #define KS8695_INT_ENABLE_ERR 0x0400
  123. #define KS8695_INT_ENABLE_RX 0x0200
  124. #define KS8695_INT_ENABLE_TX 0x0100
  125. #define KS8695_INT_STATUS 0xE208
  126. #define KS8695_INT_WAN_PRIORITY 0xE20C
  127. #define KS8695_INT_HPNA_PRIORITY 0xE210
  128. #define KS8695_INT_LAN_PRIORITY 0xE214
  129. #define KS8695_INT_TIMER_PRIORITY 0xE218
  130. #define KS8695_INT_UART_PRIORITY 0xE21C
  131. #define KS8695_INT_EXT_PRIORITY 0xE220
  132. #define KS8695_INT_CHAN_PRIORITY 0xE224
  133. #define KS8695_INT_BUSERROR_PRO 0xE228
  134. #define KS8695_INT_MASK_STATUS 0xE22C
  135. #define KS8695_FIQ_PEND_PRIORITY 0xE230
  136. #define KS8695_IRQ_PEND_PRIORITY 0xE234
  137. /*timer registers offset difinitions*/
  138. #define KS8695_TIMER_CTRL 0xE400
  139. #define KS8695_TIMER1 0xE404
  140. #define KS8695_TIMER0 0xE408
  141. #define KS8695_TIMER1_PCOUNT 0xE40C
  142. #define KS8695_TIMER0_PCOUNT 0xE410
  143. /*GPIO registers offset difinitions*/
  144. #define KS8695_GPIO_MODE 0xE600
  145. #define KS8695_GPIO_CTRL 0xE604
  146. #define KS8695_GPIO_DATA 0xE608
  147. /*SWITCH registers offset difinitions*/
  148. #define KS8695_SWITCH_CTRL0 0xE800
  149. #define KS8695_SWITCH_CTRL1 0xE804
  150. #define KS8695_SWITCH_PORT1 0xE808
  151. #define KS8695_SWITCH_PORT2 0xE80C
  152. #define KS8695_SWITCH_PORT3 0xE810
  153. #define KS8695_SWITCH_PORT4 0xE814
  154. #define KS8695_SWITCH_PORT5 0xE818
  155. #define KS8695_SWITCH_AUTO0 0xE81C
  156. #define KS8695_SWITCH_AUTO1 0xE820
  157. #define KS8695_SWITCH_LUE_CTRL 0xE824
  158. #define KS8695_SWITCH_LUE_HIGH 0xE828
  159. #define KS8695_SWITCH_LUE_LOW 0xE82C
  160. #define KS8695_SWITCH_ADVANCED 0xE830
  161. #define KS8695_SWITCH_LPPM12 0xE874
  162. #define KS8695_SWITCH_LPPM34 0xE878
  163. /*host communication registers difinitions*/
  164. #define KS8695_DSCP_HIGH 0xE834
  165. #define KS8695_DSCP_LOW 0xE838
  166. #define KS8695_SWITCH_MAC_HIGH 0xE83C
  167. #define KS8695_SWITCH_MAC_LOW 0xE840
  168. /*miscellaneours registers difinitions*/
  169. #define KS8695_MANAGE_COUNTER 0xE844
  170. #define KS8695_MANAGE_DATA 0xE848
  171. #define KS8695_LAN12_POWERMAGR 0xE84C
  172. #define KS8695_LAN34_POWERMAGR 0xE850
  173. #define KS8695_DEVICE_ID 0xEA00
  174. #define KS8695_REVISION_ID 0xEA04
  175. #define KS8695_MISC_CONTROL 0xEA08
  176. #define KS8695_WAN_CONTROL 0xEA0C
  177. #define KS8695_WAN_POWERMAGR 0xEA10
  178. #define KS8695_WAN_PHY_CONTROL 0xEA14
  179. #define KS8695_WAN_PHY_STATUS 0xEA18
  180. /* bus clock definitions*/
  181. #define KS8695_BUS_CLOCK_125MHZ 0x0
  182. #define KS8695_BUS_CLOCK_100MHZ 0x1
  183. #define KS8695_BUS_CLOCK_62MHZ 0x2
  184. #define KS8695_BUS_CLOCK_50MHZ 0x3
  185. #define KS8695_BUS_CLOCK_41MHZ 0x4
  186. #define KS8695_BUS_CLOCK_33MHZ 0x5
  187. #define KS8695_BUS_CLOCK_31MHZ 0x6
  188. #define KS8695_BUS_CLOCK_25MHZ 0x7
  189. /* -------------------------------------------------------------------------------
  190. * definations for IRQ
  191. * -------------------------------------------------------------------------------*/
  192. #define KS8695_INT_EXT_INT0 2
  193. #define KS8695_INT_EXT_INT1 3
  194. #define KS8695_INT_EXT_INT2 4
  195. #define KS8695_INT_EXT_INT3 5
  196. #define KS8695_INT_TIMERINT0 6
  197. #define KS8695_INT_TIMERINT1 7
  198. #define KS8695_INT_UART_TX 8
  199. #define KS8695_INT_UART_RX 9
  200. #define KS8695_INT_UART_LINE_ERR 10
  201. #define KS8695_INT_UART_MODEMS 11
  202. #define KS8695_INT_LAN_STOP_RX 12
  203. #define KS8695_INT_LAN_STOP_TX 13
  204. #define KS8695_INT_LAN_BUF_RX_STATUS 14
  205. #define KS8695_INT_LAN_BUF_TX_STATUS 15
  206. #define KS8695_INT_LAN_RX_STATUS 16
  207. #define KS8695_INT_LAN_TX_STATUS 17
  208. #define KS8695_INT_HPAN_STOP_RX 18
  209. #define KS8695_INT_HPNA_STOP_TX 19
  210. #define KS8695_INT_HPNA_BUF_RX_STATUS 20
  211. #define KS8695_INT_HPNA_BUF_TX_STATUS 21
  212. #define KS8695_INT_HPNA_RX_STATUS 22
  213. #define KS8695_INT_HPNA_TX_STATUS 23
  214. #define KS8695_INT_BUS_ERROR 24
  215. #define KS8695_INT_WAN_STOP_RX 25
  216. #define KS8695_INT_WAN_STOP_TX 26
  217. #define KS8695_INT_WAN_BUF_RX_STATUS 27
  218. #define KS8695_INT_WAN_BUF_TX_STATUS 28
  219. #define KS8695_INT_WAN_RX_STATUS 29
  220. #define KS8695_INT_WAN_TX_STATUS 30
  221. #define KS8695_INT_UART KS8695_INT_UART_TX
  222. /* -------------------------------------------------------------------------------
  223. * Interrupt bit positions
  224. *
  225. * -------------------------------------------------------------------------------
  226. */
  227. #define KS8695_INTMASK_EXT_INT0 ( 1 << KS8695_INT_EXT_INT0 )
  228. #define KS8695_INTMASK_EXT_INT1 ( 1 << KS8695_INT_EXT_INT1 )
  229. #define KS8695_INTMASK_EXT_INT2 ( 1 << KS8695_INT_EXT_INT2 )
  230. #define KS8695_INTMASK_EXT_INT3 ( 1 << KS8695_INT_EXT_INT3 )
  231. #define KS8695_INTMASK_TIMERINT0 ( 1 << KS8695_INT_TIMERINT0 )
  232. #define KS8695_INTMASK_TIMERINT1 ( 1 << KS8695_INT_TIMERINT1 )
  233. #define KS8695_INTMASK_UART_TX ( 1 << KS8695_INT_UART_TX )
  234. #define KS8695_INTMASK_UART_RX ( 1 << KS8695_INT_UART_RX )
  235. #define KS8695_INTMASK_UART_LINE_ERR ( 1 << KS8695_INT_UART_LINE_ERR )
  236. #define KS8695_INTMASK_UART_MODEMS ( 1 << KS8695_INT_UART_MODEMS )
  237. #define KS8695_INTMASK_LAN_STOP_RX ( 1 << KS8695_INT_LAN_STOP_RX )
  238. #define KS8695_INTMASK_LAN_STOP_TX ( 1 << KS8695_INT_LAN_STOP_TX )
  239. #define KS8695_INTMASK_LAN_BUF_RX_STATUS ( 1 << KS8695_INT_LAN_BUF_RX_STATUS )
  240. #define KS8695_INTMASK_LAN_BUF_TX_STATUS ( 1 << KS8695_INT_LAN_BUF_TX_STATUS )
  241. #define KS8695_INTMASK_LAN_RX_STATUS ( 1 << KS8695_INT_LAN_RX_STATUS )
  242. #define KS8695_INTMASK_LAN_TX_STATUS ( 1 << KS8695_INT_LAN_RX_STATUS )
  243. #define KS8695_INTMASK_HPAN_STOP_RX ( 1 << KS8695_INT_HPAN_STOP_RX )
  244. #define KS8695_INTMASK_HPNA_STOP_TX ( 1 << KS8695_INT_HPNA_STOP_TX )
  245. #define KS8695_INTMASK_HPNA_BUF_RX_STATUS ( 1 << KS8695_INT_HPNA_BUF_RX_STATUS )
  246. #define KS8695_INTMAKS_HPNA_BUF_TX_STATUS ( 1 << KS8695_INT_HPNA_BUF_TX_STATUS
  247. #define KS8695_INTMASK_HPNA_RX_STATUS ( 1 << KS8695_INT_HPNA_RX_STATUS )
  248. #define KS8695_INTMASK_HPNA_TX_STATUS ( 1 << KS8695_INT_HPNA_TX_STATUS )
  249. #define KS8695_INTMASK_BUS_ERROR ( 1 << KS8695_INT_BUS_ERROR )
  250. #define KS8695_INTMASK_WAN_STOP_RX ( 1 << KS8695_INT_WAN_STOP_RX )
  251. #define KS8695_INTMASK_WAN_STOP_TX ( 1 << KS8695_INT_WAN_STOP_TX )
  252. #define KS8695_INTMASK_WAN_BUF_RX_STATUS ( 1 << KS8695_INT_WAN_BUF_RX_STATUS )
  253. #define KS8695_INTMASK_WAN_BUF_TX_STATUS ( 1 << KS8695_INT_WAN_BUF_TX_STATUS )
  254. #define KS8695_INTMASK_WAN_RX_STATUS ( 1 << KS8695_INT_WAN_RX_STATUS )
  255. #define KS8695_INTMASK_WAN_TX_STATUS ( 1 << KS8695_INT_WAN_TX_STATUS )
  256. #define KS8695_SC_VALID_INT 0xFFFFFFFF
  257. #define MAXIRQNUM 31
  258. /*
  259. * Timer definitions
  260. *
  261. * Use timer 1 & 2
  262. * (both run at 25MHz).
  263. *
  264. */
  265. #define TICKS_PER_uSEC 25
  266. #define mSEC_1 1000
  267. #define mSEC_10 (mSEC_1 * 10)
  268. #endif
  269. /* END */