rbtx4938.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /*
  2. * linux/include/asm-mips/tx4938/rbtx4938.h
  3. * Definitions for TX4937/TX4938
  4. *
  5. * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
  6. * terms of the GNU General Public License version 2. This program is
  7. * licensed "as is" without any warranty of any kind, whether express
  8. * or implied.
  9. *
  10. * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
  11. */
  12. #ifndef __ASM_TX_BOARDS_RBTX4938_H
  13. #define __ASM_TX_BOARDS_RBTX4938_H
  14. #include <asm/addrspace.h>
  15. #include <asm/tx4938/tx4938.h>
  16. #include <asm/txx9irq.h>
  17. /* CS */
  18. #define RBTX4938_CE0 0x1c000000 /* 64M */
  19. #define RBTX4938_CE2 0x17f00000 /* 1M */
  20. /* Address map */
  21. #define RBTX4938_FPGA_REG_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000000)
  22. #define RBTX4938_FPGA_REV_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000002)
  23. #define RBTX4938_CONFIG1_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000004)
  24. #define RBTX4938_CONFIG2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000006)
  25. #define RBTX4938_CONFIG3_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000008)
  26. #define RBTX4938_LED_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001000)
  27. #define RBTX4938_DIPSW_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001002)
  28. #define RBTX4938_BDIPSW_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001004)
  29. #define RBTX4938_IMASK_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002000)
  30. #define RBTX4938_IMASK2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002002)
  31. #define RBTX4938_INTPOL_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002004)
  32. #define RBTX4938_ISTAT_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002006)
  33. #define RBTX4938_ISTAT2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002008)
  34. #define RBTX4938_IMSTAT_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000200a)
  35. #define RBTX4938_IMSTAT2_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000200c)
  36. #define RBTX4938_SOFTINT_ADDR (KSEG1 + RBTX4938_CE2 + 0x00003000)
  37. #define RBTX4938_PIOSEL_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005000)
  38. #define RBTX4938_SPICS_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005002)
  39. #define RBTX4938_SFPWR_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005008)
  40. #define RBTX4938_SFVOL_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000500a)
  41. #define RBTX4938_SOFTRESET_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007000)
  42. #define RBTX4938_SOFTRESETLOCK_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007002)
  43. #define RBTX4938_PCIRESET_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007004)
  44. #define RBTX4938_ETHER_BASE (KSEG1 + RBTX4938_CE2 + 0x00020000)
  45. /* Ethernet port address (Jumperless Mode (W12:Open)) */
  46. #define RBTX4938_ETHER_ADDR (RBTX4938_ETHER_BASE + 0x280)
  47. /* bits for ISTAT/IMASK/IMSTAT */
  48. #define RBTX4938_INTB_PCID 0
  49. #define RBTX4938_INTB_PCIC 1
  50. #define RBTX4938_INTB_PCIB 2
  51. #define RBTX4938_INTB_PCIA 3
  52. #define RBTX4938_INTB_RTC 4
  53. #define RBTX4938_INTB_ATA 5
  54. #define RBTX4938_INTB_MODEM 6
  55. #define RBTX4938_INTB_SWINT 7
  56. #define RBTX4938_INTF_PCID (1 << RBTX4938_INTB_PCID)
  57. #define RBTX4938_INTF_PCIC (1 << RBTX4938_INTB_PCIC)
  58. #define RBTX4938_INTF_PCIB (1 << RBTX4938_INTB_PCIB)
  59. #define RBTX4938_INTF_PCIA (1 << RBTX4938_INTB_PCIA)
  60. #define RBTX4938_INTF_RTC (1 << RBTX4938_INTB_RTC)
  61. #define RBTX4938_INTF_ATA (1 << RBTX4938_INTB_ATA)
  62. #define RBTX4938_INTF_MODEM (1 << RBTX4938_INTB_MODEM)
  63. #define RBTX4938_INTF_SWINT (1 << RBTX4938_INTB_SWINT)
  64. #define rbtx4938_fpga_rev_ptr \
  65. ((volatile unsigned char *)RBTX4938_FPGA_REV_ADDR)
  66. #define rbtx4938_led_ptr \
  67. ((volatile unsigned char *)RBTX4938_LED_ADDR)
  68. #define rbtx4938_dipsw_ptr \
  69. ((volatile unsigned char *)RBTX4938_DIPSW_ADDR)
  70. #define rbtx4938_bdipsw_ptr \
  71. ((volatile unsigned char *)RBTX4938_BDIPSW_ADDR)
  72. #define rbtx4938_imask_ptr \
  73. ((volatile unsigned char *)RBTX4938_IMASK_ADDR)
  74. #define rbtx4938_imask2_ptr \
  75. ((volatile unsigned char *)RBTX4938_IMASK2_ADDR)
  76. #define rbtx4938_intpol_ptr \
  77. ((volatile unsigned char *)RBTX4938_INTPOL_ADDR)
  78. #define rbtx4938_istat_ptr \
  79. ((volatile unsigned char *)RBTX4938_ISTAT_ADDR)
  80. #define rbtx4938_istat2_ptr \
  81. ((volatile unsigned char *)RBTX4938_ISTAT2_ADDR)
  82. #define rbtx4938_imstat_ptr \
  83. ((volatile unsigned char *)RBTX4938_IMSTAT_ADDR)
  84. #define rbtx4938_imstat2_ptr \
  85. ((volatile unsigned char *)RBTX4938_IMSTAT2_ADDR)
  86. #define rbtx4938_softint_ptr \
  87. ((volatile unsigned char *)RBTX4938_SOFTINT_ADDR)
  88. #define rbtx4938_piosel_ptr \
  89. ((volatile unsigned char *)RBTX4938_PIOSEL_ADDR)
  90. #define rbtx4938_spics_ptr \
  91. ((volatile unsigned char *)RBTX4938_SPICS_ADDR)
  92. #define rbtx4938_sfpwr_ptr \
  93. ((volatile unsigned char *)RBTX4938_SFPWR_ADDR)
  94. #define rbtx4938_sfvol_ptr \
  95. ((volatile unsigned char *)RBTX4938_SFVOL_ADDR)
  96. #define rbtx4938_softreset_ptr \
  97. ((volatile unsigned char *)RBTX4938_SOFTRESET_ADDR)
  98. #define rbtx4938_softresetlock_ptr \
  99. ((volatile unsigned char *)RBTX4938_SOFTRESETLOCK_ADDR)
  100. #define rbtx4938_pcireset_ptr \
  101. ((volatile unsigned char *)RBTX4938_PCIRESET_ADDR)
  102. /*
  103. * IRQ mappings
  104. */
  105. #define RBTX4938_SOFT_INT0 0 /* not used */
  106. #define RBTX4938_SOFT_INT1 1 /* not used */
  107. #define RBTX4938_IRC_INT 2
  108. #define RBTX4938_TIMER_INT 7
  109. /* These are the virtual IRQ numbers, we divide all IRQ's into
  110. * 'spaces', the 'space' determines where and how to enable/disable
  111. * that particular IRQ on an RBTX4938 machine. Add new 'spaces' as new
  112. * IRQ hardware is supported.
  113. */
  114. #define RBTX4938_NR_IRQ_LOCAL 8
  115. #define RBTX4938_NR_IRQ_IRC 32 /* On-Chip IRC */
  116. #define RBTX4938_NR_IRQ_IOC 8
  117. #define TX4938_IRQ_CP0_BEG MIPS_CPU_IRQ_BASE
  118. #define TX4938_IRQ_CP0_END (MIPS_CPU_IRQ_BASE + 8 - 1)
  119. #define TX4938_IRQ_PIC_BEG TXX9_IRQ_BASE
  120. #define TX4938_IRQ_PIC_END (TXX9_IRQ_BASE + TXx9_MAX_IR - 1)
  121. #define TX4938_IRQ_NEST_EXT_ON_PIC (TX4938_IRQ_PIC_BEG+2)
  122. #define TX4938_IRQ_NEST_PIC_ON_CP0 (TX4938_IRQ_CP0_BEG+2)
  123. #define TX4938_IRQ_USER0 (TX4938_IRQ_CP0_BEG+0)
  124. #define TX4938_IRQ_USER1 (TX4938_IRQ_CP0_BEG+1)
  125. #define TX4938_IRQ_CPU_TIMER (TX4938_IRQ_CP0_BEG+7)
  126. #define TOSHIBA_RBTX4938_IRQ_IOC_RAW_BEG 0
  127. #define TOSHIBA_RBTX4938_IRQ_IOC_RAW_END 7
  128. #define TOSHIBA_RBTX4938_IRQ_IOC_BEG ((TX4938_IRQ_PIC_END+1)+TOSHIBA_RBTX4938_IRQ_IOC_RAW_BEG) /* 56 */
  129. #define TOSHIBA_RBTX4938_IRQ_IOC_END ((TX4938_IRQ_PIC_END+1)+TOSHIBA_RBTX4938_IRQ_IOC_RAW_END) /* 63 */
  130. #define RBTX4938_IRQ_LOCAL TX4938_IRQ_CP0_BEG
  131. #define RBTX4938_IRQ_IRC (RBTX4938_IRQ_LOCAL + RBTX4938_NR_IRQ_LOCAL)
  132. #define RBTX4938_IRQ_IOC (RBTX4938_IRQ_IRC + RBTX4938_NR_IRQ_IRC)
  133. #define RBTX4938_IRQ_END (RBTX4938_IRQ_IOC + RBTX4938_NR_IRQ_IOC)
  134. #define RBTX4938_IRQ_LOCAL_SOFT0 (RBTX4938_IRQ_LOCAL + RBTX4938_SOFT_INT0)
  135. #define RBTX4938_IRQ_LOCAL_SOFT1 (RBTX4938_IRQ_LOCAL + RBTX4938_SOFT_INT1)
  136. #define RBTX4938_IRQ_LOCAL_IRC (RBTX4938_IRQ_LOCAL + RBTX4938_IRC_INT)
  137. #define RBTX4938_IRQ_LOCAL_TIMER (RBTX4938_IRQ_LOCAL + RBTX4938_TIMER_INT)
  138. #define RBTX4938_IRQ_IRC_ECCERR (RBTX4938_IRQ_IRC + TX4938_IR_ECCERR)
  139. #define RBTX4938_IRQ_IRC_WTOERR (RBTX4938_IRQ_IRC + TX4938_IR_WTOERR)
  140. #define RBTX4938_IRQ_IRC_INT(n) (RBTX4938_IRQ_IRC + TX4938_IR_INT(n))
  141. #define RBTX4938_IRQ_IRC_SIO(n) (RBTX4938_IRQ_IRC + TX4938_IR_SIO(n))
  142. #define RBTX4938_IRQ_IRC_DMA(ch,n) (RBTX4938_IRQ_IRC + TX4938_IR_DMA(ch,n))
  143. #define RBTX4938_IRQ_IRC_PIO (RBTX4938_IRQ_IRC + TX4938_IR_PIO)
  144. #define RBTX4938_IRQ_IRC_PDMAC (RBTX4938_IRQ_IRC + TX4938_IR_PDMAC)
  145. #define RBTX4938_IRQ_IRC_PCIC (RBTX4938_IRQ_IRC + TX4938_IR_PCIC)
  146. #define RBTX4938_IRQ_IRC_TMR(n) (RBTX4938_IRQ_IRC + TX4938_IR_TMR(n))
  147. #define RBTX4938_IRQ_IRC_NDFMC (RBTX4938_IRQ_IRC + TX4938_IR_NDFMC)
  148. #define RBTX4938_IRQ_IRC_PCIERR (RBTX4938_IRQ_IRC + TX4938_IR_PCIERR)
  149. #define RBTX4938_IRQ_IRC_PCIPME (RBTX4938_IRQ_IRC + TX4938_IR_PCIPME)
  150. #define RBTX4938_IRQ_IRC_ACLC (RBTX4938_IRQ_IRC + TX4938_IR_ACLC)
  151. #define RBTX4938_IRQ_IRC_ACLCPME (RBTX4938_IRQ_IRC + TX4938_IR_ACLCPME)
  152. #define RBTX4938_IRQ_IRC_PCIC1 (RBTX4938_IRQ_IRC + TX4938_IR_PCIC1)
  153. #define RBTX4938_IRQ_IRC_SPI (RBTX4938_IRQ_IRC + TX4938_IR_SPI)
  154. #define RBTX4938_IRQ_IOC_PCID (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCID)
  155. #define RBTX4938_IRQ_IOC_PCIC (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIC)
  156. #define RBTX4938_IRQ_IOC_PCIB (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIB)
  157. #define RBTX4938_IRQ_IOC_PCIA (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIA)
  158. #define RBTX4938_IRQ_IOC_RTC (RBTX4938_IRQ_IOC + RBTX4938_INTB_RTC)
  159. #define RBTX4938_IRQ_IOC_ATA (RBTX4938_IRQ_IOC + RBTX4938_INTB_ATA)
  160. #define RBTX4938_IRQ_IOC_MODEM (RBTX4938_IRQ_IOC + RBTX4938_INTB_MODEM)
  161. #define RBTX4938_IRQ_IOC_SWINT (RBTX4938_IRQ_IOC + RBTX4938_INTB_SWINT)
  162. /* IOC (PCI, etc) */
  163. #define RBTX4938_IRQ_IOCINT (TX4938_IRQ_NEST_EXT_ON_PIC)
  164. /* Onboard 10M Ether */
  165. #define RBTX4938_IRQ_ETHER (TX4938_IRQ_NEST_EXT_ON_PIC + 1)
  166. #define RBTX4938_RTL_8019_BASE (RBTX4938_ETHER_ADDR - mips_io_port_base)
  167. #define RBTX4938_RTL_8019_IRQ (RBTX4938_IRQ_ETHER)
  168. #endif /* __ASM_TX_BOARDS_RBTX4938_H */