regs-umal.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. /*
  2. * PKUnity Ultra Media Access Layer (UMAL) Ethernet MAC Registers
  3. */
  4. /* MAC module of UMAL */
  5. /* UMAL's MAC module includes G/MII interface, several additional PHY
  6. * interfaces, and MAC control sub-layer, which provides support for control
  7. * frames (e.g. PAUSE frames).
  8. */
  9. /*
  10. * TX/RX reset and control UMAL_CFG1
  11. */
  12. #define UMAL_CFG1 (PKUNITY_UMAL_BASE + 0x0000)
  13. /*
  14. * MAC interface mode control UMAL_CFG2
  15. */
  16. #define UMAL_CFG2 (PKUNITY_UMAL_BASE + 0x0004)
  17. /*
  18. * Inter Packet/Frame Gap UMAL_IPGIFG
  19. */
  20. #define UMAL_IPGIFG (PKUNITY_UMAL_BASE + 0x0008)
  21. /*
  22. * Collision retry or backoff UMAL_HALFDUPLEX
  23. */
  24. #define UMAL_HALFDUPLEX (PKUNITY_UMAL_BASE + 0x000c)
  25. /*
  26. * Maximum Frame Length UMAL_MAXFRAME
  27. */
  28. #define UMAL_MAXFRAME (PKUNITY_UMAL_BASE + 0x0010)
  29. /*
  30. * Test Regsiter UMAL_TESTREG
  31. */
  32. #define UMAL_TESTREG (PKUNITY_UMAL_BASE + 0x001c)
  33. /*
  34. * MII Management Configure UMAL_MIICFG
  35. */
  36. #define UMAL_MIICFG (PKUNITY_UMAL_BASE + 0x0020)
  37. /*
  38. * MII Management Command UMAL_MIICMD
  39. */
  40. #define UMAL_MIICMD (PKUNITY_UMAL_BASE + 0x0024)
  41. /*
  42. * MII Management Address UMAL_MIIADDR
  43. */
  44. #define UMAL_MIIADDR (PKUNITY_UMAL_BASE + 0x0028)
  45. /*
  46. * MII Management Control UMAL_MIICTRL
  47. */
  48. #define UMAL_MIICTRL (PKUNITY_UMAL_BASE + 0x002c)
  49. /*
  50. * MII Management Status UMAL_MIISTATUS
  51. */
  52. #define UMAL_MIISTATUS (PKUNITY_UMAL_BASE + 0x0030)
  53. /*
  54. * MII Management Indicator UMAL_MIIIDCT
  55. */
  56. #define UMAL_MIIIDCT (PKUNITY_UMAL_BASE + 0x0034)
  57. /*
  58. * Interface Control UMAL_IFCTRL
  59. */
  60. #define UMAL_IFCTRL (PKUNITY_UMAL_BASE + 0x0038)
  61. /*
  62. * Interface Status UMAL_IFSTATUS
  63. */
  64. #define UMAL_IFSTATUS (PKUNITY_UMAL_BASE + 0x003c)
  65. /*
  66. * MAC address (high 4 bytes) UMAL_STADDR1
  67. */
  68. #define UMAL_STADDR1 (PKUNITY_UMAL_BASE + 0x0040)
  69. /*
  70. * MAC address (low 2 bytes) UMAL_STADDR2
  71. */
  72. #define UMAL_STADDR2 (PKUNITY_UMAL_BASE + 0x0044)
  73. /* FIFO MODULE OF UMAL */
  74. /* UMAL's FIFO module provides data queuing for increased system level
  75. * throughput
  76. */
  77. #define UMAL_FIFOCFG0 (PKUNITY_UMAL_BASE + 0x0048)
  78. #define UMAL_FIFOCFG1 (PKUNITY_UMAL_BASE + 0x004c)
  79. #define UMAL_FIFOCFG2 (PKUNITY_UMAL_BASE + 0x0050)
  80. #define UMAL_FIFOCFG3 (PKUNITY_UMAL_BASE + 0x0054)
  81. #define UMAL_FIFOCFG4 (PKUNITY_UMAL_BASE + 0x0058)
  82. #define UMAL_FIFOCFG5 (PKUNITY_UMAL_BASE + 0x005c)
  83. #define UMAL_FIFORAM0 (PKUNITY_UMAL_BASE + 0x0060)
  84. #define UMAL_FIFORAM1 (PKUNITY_UMAL_BASE + 0x0064)
  85. #define UMAL_FIFORAM2 (PKUNITY_UMAL_BASE + 0x0068)
  86. #define UMAL_FIFORAM3 (PKUNITY_UMAL_BASE + 0x006c)
  87. #define UMAL_FIFORAM4 (PKUNITY_UMAL_BASE + 0x0070)
  88. #define UMAL_FIFORAM5 (PKUNITY_UMAL_BASE + 0x0074)
  89. #define UMAL_FIFORAM6 (PKUNITY_UMAL_BASE + 0x0078)
  90. #define UMAL_FIFORAM7 (PKUNITY_UMAL_BASE + 0x007c)
  91. /* MAHBE MODULE OF UMAL */
  92. /* UMAL's MAHBE module interfaces to the host system through 32-bit AHB Master
  93. * and Slave ports.Registers within the M-AHBE provide Control and Status
  94. * information concerning these transfers.
  95. */
  96. /*
  97. * Transmit Control UMAL_DMATxCtrl
  98. */
  99. #define UMAL_DMATxCtrl (PKUNITY_UMAL_BASE + 0x0180)
  100. /*
  101. * Pointer to TX Descripter UMAL_DMATxDescriptor
  102. */
  103. #define UMAL_DMATxDescriptor (PKUNITY_UMAL_BASE + 0x0184)
  104. /*
  105. * Status of Tx Packet Transfers UMAL_DMATxStatus
  106. */
  107. #define UMAL_DMATxStatus (PKUNITY_UMAL_BASE + 0x0188)
  108. /*
  109. * Receive Control UMAL_DMARxCtrl
  110. */
  111. #define UMAL_DMARxCtrl (PKUNITY_UMAL_BASE + 0x018c)
  112. /*
  113. * Pointer to Rx Descriptor UMAL_DMARxDescriptor
  114. */
  115. #define UMAL_DMARxDescriptor (PKUNITY_UMAL_BASE + 0x0190)
  116. /*
  117. * Status of Rx Packet Transfers UMAL_DMARxStatus
  118. */
  119. #define UMAL_DMARxStatus (PKUNITY_UMAL_BASE + 0x0194)
  120. /*
  121. * Interrupt Mask UMAL_DMAIntrMask
  122. */
  123. #define UMAL_DMAIntrMask (PKUNITY_UMAL_BASE + 0x0198)
  124. /*
  125. * Interrupts, read only UMAL_DMAInterrupt
  126. */
  127. #define UMAL_DMAInterrupt (PKUNITY_UMAL_BASE + 0x019c)
  128. /*
  129. * Commands for UMAL_CFG1 register
  130. */
  131. #define UMAL_CFG1_TXENABLE FIELD(1, 1, 0)
  132. #define UMAL_CFG1_RXENABLE FIELD(1, 1, 2)
  133. #define UMAL_CFG1_TXFLOWCTL FIELD(1, 1, 4)
  134. #define UMAL_CFG1_RXFLOWCTL FIELD(1, 1, 5)
  135. #define UMAL_CFG1_CONFLPBK FIELD(1, 1, 8)
  136. #define UMAL_CFG1_RESET FIELD(1, 1, 31)
  137. #define UMAL_CFG1_CONFFLCTL (MAC_TX_FLOW_CTL | MAC_RX_FLOW_CTL)
  138. /*
  139. * Commands for UMAL_CFG2 register
  140. */
  141. #define UMAL_CFG2_FULLDUPLEX FIELD(1, 1, 0)
  142. #define UMAL_CFG2_CRCENABLE FIELD(1, 1, 1)
  143. #define UMAL_CFG2_PADCRC FIELD(1, 1, 2)
  144. #define UMAL_CFG2_LENGTHCHECK FIELD(1, 1, 4)
  145. #define UMAL_CFG2_MODEMASK FMASK(2, 8)
  146. #define UMAL_CFG2_NIBBLEMODE FIELD(1, 2, 8)
  147. #define UMAL_CFG2_BYTEMODE FIELD(2, 2, 8)
  148. #define UMAL_CFG2_PREAMBLENMASK FMASK(4, 12)
  149. #define UMAL_CFG2_DEFPREAMBLEN FIELD(7, 4, 12)
  150. #define UMAL_CFG2_FD100 (UMAL_CFG2_DEFPREAMBLEN | UMAL_CFG2_NIBBLEMODE \
  151. | UMAL_CFG2_LENGTHCHECK | UMAL_CFG2_PADCRC \
  152. | UMAL_CFG2_CRCENABLE | UMAL_CFG2_FULLDUPLEX)
  153. #define UMAL_CFG2_FD1000 (UMAL_CFG2_DEFPREAMBLEN | UMAL_CFG2_BYTEMODE \
  154. | UMAL_CFG2_LENGTHCHECK | UMAL_CFG2_PADCRC \
  155. | UMAL_CFG2_CRCENABLE | UMAL_CFG2_FULLDUPLEX)
  156. #define UMAL_CFG2_HD100 (UMAL_CFG2_DEFPREAMBLEN | UMAL_CFG2_NIBBLEMODE \
  157. | UMAL_CFG2_LENGTHCHECK | UMAL_CFG2_PADCRC \
  158. | UMAL_CFG2_CRCENABLE)
  159. /*
  160. * Command for UMAL_IFCTRL register
  161. */
  162. #define UMAL_IFCTRL_RESET FIELD(1, 1, 31)
  163. /*
  164. * Command for UMAL_MIICFG register
  165. */
  166. #define UMAL_MIICFG_RESET FIELD(1, 1, 31)
  167. /*
  168. * Command for UMAL_MIICMD register
  169. */
  170. #define UMAL_MIICMD_READ FIELD(1, 1, 0)
  171. /*
  172. * Command for UMAL_MIIIDCT register
  173. */
  174. #define UMAL_MIIIDCT_BUSY FIELD(1, 1, 0)
  175. #define UMAL_MIIIDCT_NOTVALID FIELD(1, 1, 2)
  176. /*
  177. * Commands for DMATxCtrl regesters
  178. */
  179. #define UMAL_DMA_Enable FIELD(1, 1, 0)
  180. /*
  181. * Commands for DMARxCtrl regesters
  182. */
  183. #define UMAL_DMAIntrMask_ENABLEHALFWORD FIELD(1, 1, 16)
  184. /*
  185. * Command for DMARxStatus
  186. */
  187. #define CLR_RX_BUS_ERR FIELD(1, 1, 3)
  188. #define CLR_RX_OVERFLOW FIELD(1, 1, 2)
  189. #define CLR_RX_PKT FIELD(1, 1, 0)
  190. /*
  191. * Command for DMATxStatus
  192. */
  193. #define CLR_TX_BUS_ERR FIELD(1, 1, 3)
  194. #define CLR_TX_UNDERRUN FIELD(1, 1, 1)
  195. #define CLR_TX_PKT FIELD(1, 1, 0)
  196. /*
  197. * Commands for DMAIntrMask and DMAInterrupt register
  198. */
  199. #define INT_RX_MASK FIELD(0xd, 4, 4)
  200. #define INT_TX_MASK FIELD(0xb, 4, 0)
  201. #define INT_RX_BUS_ERR FIELD(1, 1, 7)
  202. #define INT_RX_OVERFLOW FIELD(1, 1, 6)
  203. #define INT_RX_PKT FIELD(1, 1, 4)
  204. #define INT_TX_BUS_ERR FIELD(1, 1, 3)
  205. #define INT_TX_UNDERRUN FIELD(1, 1, 1)
  206. #define INT_TX_PKT FIELD(1, 1, 0)
  207. /*
  208. * MARCOS of UMAL's descriptors
  209. */
  210. #define UMAL_DESC_PACKETSIZE_EMPTY FIELD(1, 1, 31)
  211. #define UMAL_DESC_PACKETSIZE_NONEMPTY FIELD(0, 1, 31)
  212. #define UMAL_DESC_PACKETSIZE_SIZEMASK FMASK(12, 0)