soc3210.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #ifndef __SOC3210_H__
  2. #define __SOC3210_H__
  3. #include "../common/mipsregs.h"
  4. /* registers */
  5. #define __REG8(addr) *((volatile unsigned char *)(addr))
  6. #define __REG16(addr) *((volatile unsigned short *)(addr))
  7. #define __REG32(addr) *((volatile unsigned int *)(addr))
  8. #define EMI_BASE 0xBF000000
  9. #define NN_BASE 0xBF000040
  10. #define LCD_BASE 0xBF001000
  11. #define HSB_MISC_BASE 0xBF003200
  12. #define SPI_BASE 0xBF004000
  13. #define PS2_BASE 0xBF004040
  14. #define UART0_BASE 0xBF004080
  15. #define UART1_BASE 0xBF004090
  16. #define I2C_BASE 0xBF0040D0
  17. #define LPB_MISC_BASE 0xBF004100
  18. #define AC97_BASE 0xBF004200
  19. #define AC97_DMA_BASE 0xBF004280
  20. #define CAN1_BASE 0xBF004300
  21. #define CAN0_BASE 0xBF004400
  22. #define MAC0_BASE 0xBF005200
  23. #define MAC1_BASE 0xBF005300
  24. /* LCD registers */
  25. #define LCD_CTRL __REG32(LCD_BASE + 0x000)
  26. #define LCD_STAT __REG32(LCD_BASE + 0x004)
  27. #define LCD_HTIM __REG32(LCD_BASE + 0x008)
  28. #define LCD_VTIM __REG32(LCD_BASE + 0x00C)
  29. #define LCD_HVLEN __REG32(LCD_BASE + 0x010)
  30. #define LCD_VBARA __REG32(LCD_BASE + 0x014)
  31. #define LCD_VBARB __REG32(LCD_BASE + 0x018)
  32. #define LCD_PCLT __REG32(LCD_BASE + 0x800)
  33. /* HSB misc registers */
  34. #define HSB_MISC_REG __REG32(HSB_MISC_BASE + 0x00)
  35. #define INT_EDGE __REG32(HSB_MISC_BASE + 0x04)
  36. #define INT_STEER __REG32(HSB_MISC_BASE + 0x08)
  37. #define INT_POL __REG32(HSB_MISC_BASE + 0x0C)
  38. #define INT_SET __REG32(HSB_MISC_BASE + 0x10)
  39. #define INT_CLR __REG32(HSB_MISC_BASE + 0x14)
  40. #define INT_EN __REG32(HSB_MISC_BASE + 0x18)
  41. #define INT_ISR __REG32(HSB_MISC_BASE + 0x1C)
  42. #define GPIO_OE_60_29 __REG32(HSB_MISC_BASE + 0x20)
  43. #define GPIO_I_60_29 __REG32(HSB_MISC_BASE + 0x24)
  44. #define GPIO_O_60_29 __REG32(HSB_MISC_BASE + 0x28)
  45. #define HSB_ARB_CFG __REG32(HSB_MISC_BASE + 0x2C)
  46. #define WD_TIMER __REG32(HSB_MISC_BASE + 0x30)
  47. #define WD_CTRL __REG32(HSB_MISC_BASE + 0x34)
  48. /* SPI registers */
  49. #define SPI_SPCR __REG8(SPI_BASE + 0x00)
  50. #define SPI_SPSR __REG8(SPI_BASE + 0x01)
  51. #define SPI_TX_FIFO __REG8(SPI_BASE + 0x02)
  52. #define SPI_SPER __REG8(SPI_BASE + 0x03)
  53. /* PS/2 registers */
  54. #define PS2_RIBUF __REG8(PS2_BASE + 0x00)
  55. #define PS2_WOBUF __REG8(PS2_BASE + 0x00)
  56. #define PS2_RSR __REG8(PS2_BASE + 0x04)
  57. #define PS2_WSC __REG8(PS2_BASE + 0x04)
  58. #define PS2_DLL __REG8(PS2_BASE + 0x08)
  59. #define PS2_DLH __REG8(PS2_BASE + 0x09)
  60. #define PS2_DL_KBD __REG8(PS2_BASE + 0x0A)
  61. #define PS2_DL_AUX __REG8(PS2_BASE + 0x0B)
  62. /* UART registers */
  63. #define UART_DAT(base) __REG8(base + 0x00)
  64. #define UART_IER(base) __REG8(base + 0x01)
  65. #define UART_IIR(base) __REG8(base + 0x02)
  66. #define UART_FCR(base) __REG8(base + 0x02)
  67. #define UART_LCR(base) __REG8(base + 0x03)
  68. #define UART_MCR(base) __REG8(base + 0x04)
  69. #define UART_LSR(base) __REG8(base + 0x05)
  70. #define UART_MSR(base) __REG8(base + 0x06)
  71. #define UART_LSB(base) __REG8(base + 0x00)
  72. #define UART_MSB(base) __REG8(base + 0x01)
  73. /* UART0 registers */
  74. #define UART0_DAT __REG8(UART0_BASE + 0x00)
  75. #define UART0_IER __REG8(UART0_BASE + 0x01)
  76. #define UART0_IIR __REG8(UART0_BASE + 0x02)
  77. #define UART0_FCR __REG8(UART0_BASE + 0x02)
  78. #define UART0_LCR __REG8(UART0_BASE + 0x03)
  79. #define UART0_MCR __REG8(UART0_BASE + 0x04)
  80. #define UART0_LSR __REG8(UART0_BASE + 0x05)
  81. #define UART0_MSR __REG8(UART0_BASE + 0x06)
  82. #define UART0_LSB __REG8(UART0_BASE + 0x00)
  83. #define UART0_MSB __REG8(UART0_BASE + 0x01)
  84. /* UART1 registers */
  85. #define UART1_DAT __REG8(UART1_BASE + 0x00)
  86. #define UART1_IER __REG8(UART1_BASE + 0x01)
  87. #define UART1_IIR __REG8(UART1_BASE + 0x02)
  88. #define UART1_FCR __REG8(UART1_BASE + 0x02)
  89. #define UART1_LCR __REG8(UART1_BASE + 0x03)
  90. #define UART1_MCR __REG8(UART1_BASE + 0x04)
  91. #define UART1_LSR __REG8(UART1_BASE + 0x05)
  92. #define UART1_MSR __REG8(UART1_BASE + 0x06)
  93. #define UART1_LSB __REG8(UART1_BASE + 0x00)
  94. #define UART1_MSB __REG8(UART1_BASE + 0x01)
  95. /* LPB misc registers */
  96. #define GPIO_OE_7_0 __REG8(LPB_MISC_BASE + 0x00)
  97. #define GPIO_OE_15_8 __REG8(LPB_MISC_BASE + 0x01)
  98. #define GPIO_OE_23_16 __REG8(LPB_MISC_BASE + 0x02)
  99. #define GPIO_OE_28_24 __REG8(LPB_MISC_BASE + 0x03)
  100. #define GPIO_I_7_0 __REG8(LPB_MISC_BASE + 0x10)
  101. #define GPIO_I_15_8 __REG8(LPB_MISC_BASE + 0x11)
  102. #define GPIO_I_23_16 __REG8(LPB_MISC_BASE + 0x12)
  103. #define GPIO_I_28_24 __REG8(LPB_MISC_BASE + 0x13)
  104. #define GPIO_O_7_0 __REG8(LPB_MISC_BASE + 0x20)
  105. #define GPIO_O_15_8 __REG8(LPB_MISC_BASE + 0x21)
  106. #define GPIO_O_23_16 __REG8(LPB_MISC_BASE + 0x22)
  107. #define GPIO_O_28_24 __REG8(LPB_MISC_BASE + 0x23)
  108. #define LPB_MISC_CFG __REG8(LPB_MISC_BASE + 0x40)
  109. /* MAC0 registers */
  110. #define MAC0_BUS_MODE __REG32(MAC0_BASE + 0x00)
  111. #define MAC0_TX_POLL_REQ __REG32(MAC0_BASE + 0x08)
  112. #define MAC0_RX_POLL_REQ __REG32(MAC0_BASE + 0x10)
  113. #define MAC0_RX_LIST_BASE_ADDR __REG32(MAC0_BASE + 0x18)
  114. #define MAC0_TX_LIST_BASE_ADDR __REG32(MAC0_BASE + 0x20)
  115. #define MAC0_STATUS __REG32(MAC0_BASE + 0x28)
  116. #define MAC0_OP_MODE __REG32(MAC0_BASE + 0x30)
  117. #define MAC0_INTERRUPT_EN __REG32(MAC0_BASE + 0x38)
  118. #define MAC0_MISSED_FRAME_STATISTIC __REG32(MAC0_BASE + 0x40)
  119. #define MAC0_SMI_EEPROM_CTL __REG32(MAC0_BASE + 0x48)
  120. #define MAC0_BYTE_ALIGN __REG32(MAC0_BASE + 0x50)
  121. #define MAC0_GPT_IM_CTL __REG32(MAC0_BASE + 0x58)
  122. /* MAC1 registers */
  123. #define MAC1_BUS_MODE __REG32(MAC1_BASE + 0x00)
  124. #define MAC1_TX_POLL_REQ __REG32(MAC1_BASE + 0x08)
  125. #define MAC1_RX_POLL_REQ __REG32(MAC1_BASE + 0x10)
  126. #define MAC1_RX_LIST_BASE_ADDR __REG32(MAC1_BASE + 0x18)
  127. #define MAC1_TX_LIST_BASE_ADDR __REG32(MAC1_BASE + 0x20)
  128. #define MAC1_STATUS __REG32(MAC1_BASE + 0x28)
  129. #define MAC1_OP_MODE __REG32(MAC1_BASE + 0x30)
  130. #define MAC1_INTERRUPT_EN __REG32(MAC1_BASE + 0x38)
  131. #define MAC1_MISSED_FRAME_STATISTIC __REG32(MAC1_BASE + 0x40)
  132. #define MAC1_SMI_EEPROM_CTL __REG32(MAC1_BASE + 0x48)
  133. #define MAC1_BYTE_ALIGN __REG32(MAC1_BASE + 0x50)
  134. #define MAC1_GPT_IM_CTL __REG32(MAC1_BASE + 0x58)
  135. /* Peripheral Interrupt Number */
  136. #define IRQ_LCD 0
  137. #define IRQ_MAC1 1
  138. #define IRQ_MAC2 2
  139. #define IRQ_AC97 3
  140. #define IRQ_SPI 8
  141. #define IRQ_KEY 9
  142. #define IRQ_MOUSE 10
  143. #define IRQ_UART0 11
  144. #define IRQ_UART1 12
  145. #define IRQ_I2C 13
  146. #define IRQ_CAN0 14
  147. #define IRQ_CAN1 15
  148. #define IRQ_GPIO15 20
  149. #define IRQ_GPIO14 21
  150. #define IRQ_GPIO13 22
  151. #define IRQ_GPIO12 23
  152. #define SYSTEM_STACK 0x80003fe8 /* the kernel system stack address */
  153. #endif