lan78xx.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. /*
  2. * Copyright (C) 2015 Microchip Technology
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef _LAN78XX_H
  18. #define _LAN78XX_H
  19. /* USB Vendor Requests */
  20. #define USB_VENDOR_REQUEST_WRITE_REGISTER 0xA0
  21. #define USB_VENDOR_REQUEST_READ_REGISTER 0xA1
  22. #define USB_VENDOR_REQUEST_GET_STATS 0xA2
  23. /* Interrupt Endpoint status word bitfields */
  24. #define INT_ENP_EEE_START_TX_LPI_INT BIT(26)
  25. #define INT_ENP_EEE_STOP_TX_LPI_INT BIT(25)
  26. #define INT_ENP_EEE_RX_LPI_INT BIT(24)
  27. #define INT_ENP_RDFO_INT BIT(22)
  28. #define INT_ENP_TXE_INT BIT(21)
  29. #define INT_ENP_TX_DIS_INT BIT(19)
  30. #define INT_ENP_RX_DIS_INT BIT(18)
  31. #define INT_ENP_PHY_INT BIT(17)
  32. #define INT_ENP_DP_INT BIT(16)
  33. #define INT_ENP_MAC_ERR_INT BIT(15)
  34. #define INT_ENP_TDFU_INT BIT(14)
  35. #define INT_ENP_TDFO_INT BIT(13)
  36. #define INT_ENP_UTX_FP_INT BIT(12)
  37. #define TX_PKT_ALIGNMENT 4
  38. #define RX_PKT_ALIGNMENT 4
  39. /* Tx Command A */
  40. #define TX_CMD_A_IGE_ (0x20000000)
  41. #define TX_CMD_A_ICE_ (0x10000000)
  42. #define TX_CMD_A_LSO_ (0x08000000)
  43. #define TX_CMD_A_IPE_ (0x04000000)
  44. #define TX_CMD_A_TPE_ (0x02000000)
  45. #define TX_CMD_A_IVTG_ (0x01000000)
  46. #define TX_CMD_A_RVTG_ (0x00800000)
  47. #define TX_CMD_A_FCS_ (0x00400000)
  48. #define TX_CMD_A_LEN_MASK_ (0x000FFFFF)
  49. /* Tx Command B */
  50. #define TX_CMD_B_MSS_SHIFT_ (16)
  51. #define TX_CMD_B_MSS_MASK_ (0x3FFF0000)
  52. #define TX_CMD_B_MSS_MIN_ ((unsigned short)8)
  53. #define TX_CMD_B_VTAG_MASK_ (0x0000FFFF)
  54. #define TX_CMD_B_VTAG_PRI_MASK_ (0x0000E000)
  55. #define TX_CMD_B_VTAG_CFI_MASK_ (0x00001000)
  56. #define TX_CMD_B_VTAG_VID_MASK_ (0x00000FFF)
  57. /* Rx Command A */
  58. #define RX_CMD_A_ICE_ (0x80000000)
  59. #define RX_CMD_A_TCE_ (0x40000000)
  60. #define RX_CMD_A_CSE_MASK_ (0xC0000000)
  61. #define RX_CMD_A_IPV_ (0x20000000)
  62. #define RX_CMD_A_PID_MASK_ (0x18000000)
  63. #define RX_CMD_A_PID_NONE_IP_ (0x00000000)
  64. #define RX_CMD_A_PID_TCP_IP_ (0x08000000)
  65. #define RX_CMD_A_PID_UDP_IP_ (0x10000000)
  66. #define RX_CMD_A_PID_IP_ (0x18000000)
  67. #define RX_CMD_A_PFF_ (0x04000000)
  68. #define RX_CMD_A_BAM_ (0x02000000)
  69. #define RX_CMD_A_MAM_ (0x01000000)
  70. #define RX_CMD_A_FVTG_ (0x00800000)
  71. #define RX_CMD_A_RED_ (0x00400000)
  72. #define RX_CMD_A_RX_ERRS_MASK_ (0xC03F0000)
  73. #define RX_CMD_A_RWT_ (0x00200000)
  74. #define RX_CMD_A_RUNT_ (0x00100000)
  75. #define RX_CMD_A_LONG_ (0x00080000)
  76. #define RX_CMD_A_RXE_ (0x00040000)
  77. #define RX_CMD_A_DRB_ (0x00020000)
  78. #define RX_CMD_A_FCS_ (0x00010000)
  79. #define RX_CMD_A_UAM_ (0x00008000)
  80. #define RX_CMD_A_ICSM_ (0x00004000)
  81. #define RX_CMD_A_LEN_MASK_ (0x00003FFF)
  82. /* Rx Command B */
  83. #define RX_CMD_B_CSUM_SHIFT_ (16)
  84. #define RX_CMD_B_CSUM_MASK_ (0xFFFF0000)
  85. #define RX_CMD_B_VTAG_MASK_ (0x0000FFFF)
  86. #define RX_CMD_B_VTAG_PRI_MASK_ (0x0000E000)
  87. #define RX_CMD_B_VTAG_CFI_MASK_ (0x00001000)
  88. #define RX_CMD_B_VTAG_VID_MASK_ (0x00000FFF)
  89. /* Rx Command C */
  90. #define RX_CMD_C_WAKE_SHIFT_ (15)
  91. #define RX_CMD_C_WAKE_ (0x8000)
  92. #define RX_CMD_C_REF_FAIL_SHIFT_ (14)
  93. #define RX_CMD_C_REF_FAIL_ (0x4000)
  94. /* SCSRs */
  95. #define NUMBER_OF_REGS (193)
  96. #define ID_REV (0x00)
  97. #define ID_REV_CHIP_ID_MASK_ (0xFFFF0000)
  98. #define ID_REV_CHIP_REV_MASK_ (0x0000FFFF)
  99. #define ID_REV_CHIP_ID_7800_ (0x7800)
  100. #define FPGA_REV (0x04)
  101. #define FPGA_REV_MINOR_MASK_ (0x0000FF00)
  102. #define FPGA_REV_MAJOR_MASK_ (0x000000FF)
  103. #define INT_STS (0x0C)
  104. #define INT_STS_CLEAR_ALL_ (0xFFFFFFFF)
  105. #define INT_STS_EEE_TX_LPI_STRT_ (0x04000000)
  106. #define INT_STS_EEE_TX_LPI_STOP_ (0x02000000)
  107. #define INT_STS_EEE_RX_LPI_ (0x01000000)
  108. #define INT_STS_RDFO_ (0x00400000)
  109. #define INT_STS_TXE_ (0x00200000)
  110. #define INT_STS_TX_DIS_ (0x00080000)
  111. #define INT_STS_RX_DIS_ (0x00040000)
  112. #define INT_STS_PHY_INT_ (0x00020000)
  113. #define INT_STS_DP_INT_ (0x00010000)
  114. #define INT_STS_MAC_ERR_ (0x00008000)
  115. #define INT_STS_TDFU_ (0x00004000)
  116. #define INT_STS_TDFO_ (0x00002000)
  117. #define INT_STS_UFX_FP_ (0x00001000)
  118. #define INT_STS_GPIO_MASK_ (0x00000FFF)
  119. #define INT_STS_GPIO11_ (0x00000800)
  120. #define INT_STS_GPIO10_ (0x00000400)
  121. #define INT_STS_GPIO9_ (0x00000200)
  122. #define INT_STS_GPIO8_ (0x00000100)
  123. #define INT_STS_GPIO7_ (0x00000080)
  124. #define INT_STS_GPIO6_ (0x00000040)
  125. #define INT_STS_GPIO5_ (0x00000020)
  126. #define INT_STS_GPIO4_ (0x00000010)
  127. #define INT_STS_GPIO3_ (0x00000008)
  128. #define INT_STS_GPIO2_ (0x00000004)
  129. #define INT_STS_GPIO1_ (0x00000002)
  130. #define INT_STS_GPIO0_ (0x00000001)
  131. #define HW_CFG (0x010)
  132. #define HW_CFG_CLK125_EN_ (0x02000000)
  133. #define HW_CFG_REFCLK25_EN_ (0x01000000)
  134. #define HW_CFG_LED3_EN_ (0x00800000)
  135. #define HW_CFG_LED2_EN_ (0x00400000)
  136. #define HW_CFG_LED1_EN_ (0x00200000)
  137. #define HW_CFG_LED0_EN_ (0x00100000)
  138. #define HW_CFG_EEE_PHY_LUSU_ (0x00020000)
  139. #define HW_CFG_EEE_TSU_ (0x00010000)
  140. #define HW_CFG_NETDET_STS_ (0x00008000)
  141. #define HW_CFG_NETDET_EN_ (0x00004000)
  142. #define HW_CFG_EEM_ (0x00002000)
  143. #define HW_CFG_RST_PROTECT_ (0x00001000)
  144. #define HW_CFG_CONNECT_BUF_ (0x00000400)
  145. #define HW_CFG_CONNECT_EN_ (0x00000200)
  146. #define HW_CFG_CONNECT_POL_ (0x00000100)
  147. #define HW_CFG_SUSPEND_N_SEL_MASK_ (0x000000C0)
  148. #define HW_CFG_SUSPEND_N_SEL_2 (0x00000000)
  149. #define HW_CFG_SUSPEND_N_SEL_12N (0x00000040)
  150. #define HW_CFG_SUSPEND_N_SEL_012N (0x00000080)
  151. #define HW_CFG_SUSPEND_N_SEL_0123N (0x000000C0)
  152. #define HW_CFG_SUSPEND_N_POL_ (0x00000020)
  153. #define HW_CFG_MEF_ (0x00000010)
  154. #define HW_CFG_ETC_ (0x00000008)
  155. #define HW_CFG_LRST_ (0x00000002)
  156. #define HW_CFG_SRST_ (0x00000001)
  157. #define PMT_CTL (0x014)
  158. #define PMT_CTL_EEE_WAKEUP_EN_ (0x00002000)
  159. #define PMT_CTL_EEE_WUPS_ (0x00001000)
  160. #define PMT_CTL_MAC_SRST_ (0x00000800)
  161. #define PMT_CTL_PHY_PWRUP_ (0x00000400)
  162. #define PMT_CTL_RES_CLR_WKP_MASK_ (0x00000300)
  163. #define PMT_CTL_RES_CLR_WKP_STS_ (0x00000200)
  164. #define PMT_CTL_RES_CLR_WKP_EN_ (0x00000100)
  165. #define PMT_CTL_READY_ (0x00000080)
  166. #define PMT_CTL_SUS_MODE_MASK_ (0x00000060)
  167. #define PMT_CTL_SUS_MODE_0_ (0x00000000)
  168. #define PMT_CTL_SUS_MODE_1_ (0x00000020)
  169. #define PMT_CTL_SUS_MODE_2_ (0x00000040)
  170. #define PMT_CTL_SUS_MODE_3_ (0x00000060)
  171. #define PMT_CTL_PHY_RST_ (0x00000010)
  172. #define PMT_CTL_WOL_EN_ (0x00000008)
  173. #define PMT_CTL_PHY_WAKE_EN_ (0x00000004)
  174. #define PMT_CTL_WUPS_MASK_ (0x00000003)
  175. #define PMT_CTL_WUPS_MLT_ (0x00000003)
  176. #define PMT_CTL_WUPS_MAC_ (0x00000002)
  177. #define PMT_CTL_WUPS_PHY_ (0x00000001)
  178. #define GPIO_CFG0 (0x018)
  179. #define GPIO_CFG0_GPIOEN_MASK_ (0x0000F000)
  180. #define GPIO_CFG0_GPIOEN3_ (0x00008000)
  181. #define GPIO_CFG0_GPIOEN2_ (0x00004000)
  182. #define GPIO_CFG0_GPIOEN1_ (0x00002000)
  183. #define GPIO_CFG0_GPIOEN0_ (0x00001000)
  184. #define GPIO_CFG0_GPIOBUF_MASK_ (0x00000F00)
  185. #define GPIO_CFG0_GPIOBUF3_ (0x00000800)
  186. #define GPIO_CFG0_GPIOBUF2_ (0x00000400)
  187. #define GPIO_CFG0_GPIOBUF1_ (0x00000200)
  188. #define GPIO_CFG0_GPIOBUF0_ (0x00000100)
  189. #define GPIO_CFG0_GPIODIR_MASK_ (0x000000F0)
  190. #define GPIO_CFG0_GPIODIR3_ (0x00000080)
  191. #define GPIO_CFG0_GPIODIR2_ (0x00000040)
  192. #define GPIO_CFG0_GPIODIR1_ (0x00000020)
  193. #define GPIO_CFG0_GPIODIR0_ (0x00000010)
  194. #define GPIO_CFG0_GPIOD_MASK_ (0x0000000F)
  195. #define GPIO_CFG0_GPIOD3_ (0x00000008)
  196. #define GPIO_CFG0_GPIOD2_ (0x00000004)
  197. #define GPIO_CFG0_GPIOD1_ (0x00000002)
  198. #define GPIO_CFG0_GPIOD0_ (0x00000001)
  199. #define GPIO_CFG1 (0x01C)
  200. #define GPIO_CFG1_GPIOEN_MASK_ (0xFF000000)
  201. #define GPIO_CFG1_GPIOEN11_ (0x80000000)
  202. #define GPIO_CFG1_GPIOEN10_ (0x40000000)
  203. #define GPIO_CFG1_GPIOEN9_ (0x20000000)
  204. #define GPIO_CFG1_GPIOEN8_ (0x10000000)
  205. #define GPIO_CFG1_GPIOEN7_ (0x08000000)
  206. #define GPIO_CFG1_GPIOEN6_ (0x04000000)
  207. #define GPIO_CFG1_GPIOEN5_ (0x02000000)
  208. #define GPIO_CFG1_GPIOEN4_ (0x01000000)
  209. #define GPIO_CFG1_GPIOBUF_MASK_ (0x00FF0000)
  210. #define GPIO_CFG1_GPIOBUF11_ (0x00800000)
  211. #define GPIO_CFG1_GPIOBUF10_ (0x00400000)
  212. #define GPIO_CFG1_GPIOBUF9_ (0x00200000)
  213. #define GPIO_CFG1_GPIOBUF8_ (0x00100000)
  214. #define GPIO_CFG1_GPIOBUF7_ (0x00080000)
  215. #define GPIO_CFG1_GPIOBUF6_ (0x00040000)
  216. #define GPIO_CFG1_GPIOBUF5_ (0x00020000)
  217. #define GPIO_CFG1_GPIOBUF4_ (0x00010000)
  218. #define GPIO_CFG1_GPIODIR_MASK_ (0x0000FF00)
  219. #define GPIO_CFG1_GPIODIR11_ (0x00008000)
  220. #define GPIO_CFG1_GPIODIR10_ (0x00004000)
  221. #define GPIO_CFG1_GPIODIR9_ (0x00002000)
  222. #define GPIO_CFG1_GPIODIR8_ (0x00001000)
  223. #define GPIO_CFG1_GPIODIR7_ (0x00000800)
  224. #define GPIO_CFG1_GPIODIR6_ (0x00000400)
  225. #define GPIO_CFG1_GPIODIR5_ (0x00000200)
  226. #define GPIO_CFG1_GPIODIR4_ (0x00000100)
  227. #define GPIO_CFG1_GPIOD_MASK_ (0x000000FF)
  228. #define GPIO_CFG1_GPIOD11_ (0x00000080)
  229. #define GPIO_CFG1_GPIOD10_ (0x00000040)
  230. #define GPIO_CFG1_GPIOD9_ (0x00000020)
  231. #define GPIO_CFG1_GPIOD8_ (0x00000010)
  232. #define GPIO_CFG1_GPIOD7_ (0x00000008)
  233. #define GPIO_CFG1_GPIOD6_ (0x00000004)
  234. #define GPIO_CFG1_GPIOD6_ (0x00000004)
  235. #define GPIO_CFG1_GPIOD5_ (0x00000002)
  236. #define GPIO_CFG1_GPIOD4_ (0x00000001)
  237. #define GPIO_WAKE (0x020)
  238. #define GPIO_WAKE_GPIOPOL_MASK_ (0x0FFF0000)
  239. #define GPIO_WAKE_GPIOPOL11_ (0x08000000)
  240. #define GPIO_WAKE_GPIOPOL10_ (0x04000000)
  241. #define GPIO_WAKE_GPIOPOL9_ (0x02000000)
  242. #define GPIO_WAKE_GPIOPOL8_ (0x01000000)
  243. #define GPIO_WAKE_GPIOPOL7_ (0x00800000)
  244. #define GPIO_WAKE_GPIOPOL6_ (0x00400000)
  245. #define GPIO_WAKE_GPIOPOL5_ (0x00200000)
  246. #define GPIO_WAKE_GPIOPOL4_ (0x00100000)
  247. #define GPIO_WAKE_GPIOPOL3_ (0x00080000)
  248. #define GPIO_WAKE_GPIOPOL2_ (0x00040000)
  249. #define GPIO_WAKE_GPIOPOL1_ (0x00020000)
  250. #define GPIO_WAKE_GPIOPOL0_ (0x00010000)
  251. #define GPIO_WAKE_GPIOWK_MASK_ (0x00000FFF)
  252. #define GPIO_WAKE_GPIOWK11_ (0x00000800)
  253. #define GPIO_WAKE_GPIOWK10_ (0x00000400)
  254. #define GPIO_WAKE_GPIOWK9_ (0x00000200)
  255. #define GPIO_WAKE_GPIOWK8_ (0x00000100)
  256. #define GPIO_WAKE_GPIOWK7_ (0x00000080)
  257. #define GPIO_WAKE_GPIOWK6_ (0x00000040)
  258. #define GPIO_WAKE_GPIOWK5_ (0x00000020)
  259. #define GPIO_WAKE_GPIOWK4_ (0x00000010)
  260. #define GPIO_WAKE_GPIOWK3_ (0x00000008)
  261. #define GPIO_WAKE_GPIOWK2_ (0x00000004)
  262. #define GPIO_WAKE_GPIOWK1_ (0x00000002)
  263. #define GPIO_WAKE_GPIOWK0_ (0x00000001)
  264. #define DP_SEL (0x024)
  265. #define DP_SEL_DPRDY_ (0x80000000)
  266. #define DP_SEL_RSEL_MASK_ (0x0000000F)
  267. #define DP_SEL_RSEL_USB_PHY_CSRS_ (0x0000000F)
  268. #define DP_SEL_RSEL_OTP_64BIT_ (0x00000009)
  269. #define DP_SEL_RSEL_OTP_8BIT_ (0x00000008)
  270. #define DP_SEL_RSEL_UTX_BUF_RAM_ (0x00000007)
  271. #define DP_SEL_RSEL_DESC_RAM_ (0x00000005)
  272. #define DP_SEL_RSEL_TXFIFO_ (0x00000004)
  273. #define DP_SEL_RSEL_RXFIFO_ (0x00000003)
  274. #define DP_SEL_RSEL_LSO_ (0x00000002)
  275. #define DP_SEL_RSEL_VLAN_DA_ (0x00000001)
  276. #define DP_SEL_RSEL_URXBUF_ (0x00000000)
  277. #define DP_SEL_VHF_HASH_LEN (16)
  278. #define DP_SEL_VHF_VLAN_LEN (128)
  279. #define DP_CMD (0x028)
  280. #define DP_CMD_WRITE_ (0x00000001)
  281. #define DP_CMD_READ_ (0x00000000)
  282. #define DP_ADDR (0x02C)
  283. #define DP_ADDR_MASK_ (0x00003FFF)
  284. #define DP_DATA (0x030)
  285. #define E2P_CMD (0x040)
  286. #define E2P_CMD_EPC_BUSY_ (0x80000000)
  287. #define E2P_CMD_EPC_CMD_MASK_ (0x70000000)
  288. #define E2P_CMD_EPC_CMD_RELOAD_ (0x70000000)
  289. #define E2P_CMD_EPC_CMD_ERAL_ (0x60000000)
  290. #define E2P_CMD_EPC_CMD_ERASE_ (0x50000000)
  291. #define E2P_CMD_EPC_CMD_WRAL_ (0x40000000)
  292. #define E2P_CMD_EPC_CMD_WRITE_ (0x30000000)
  293. #define E2P_CMD_EPC_CMD_EWEN_ (0x20000000)
  294. #define E2P_CMD_EPC_CMD_EWDS_ (0x10000000)
  295. #define E2P_CMD_EPC_CMD_READ_ (0x00000000)
  296. #define E2P_CMD_EPC_TIMEOUT_ (0x00000400)
  297. #define E2P_CMD_EPC_DL_ (0x00000200)
  298. #define E2P_CMD_EPC_ADDR_MASK_ (0x000001FF)
  299. #define E2P_DATA (0x044)
  300. #define E2P_DATA_EEPROM_DATA_MASK_ (0x000000FF)
  301. #define BOS_ATTR (0x050)
  302. #define BOS_ATTR_BLOCK_SIZE_MASK_ (0x000000FF)
  303. #define SS_ATTR (0x054)
  304. #define SS_ATTR_POLL_INT_MASK_ (0x00FF0000)
  305. #define SS_ATTR_DEV_DESC_SIZE_MASK_ (0x0000FF00)
  306. #define SS_ATTR_CFG_BLK_SIZE_MASK_ (0x000000FF)
  307. #define HS_ATTR (0x058)
  308. #define HS_ATTR_POLL_INT_MASK_ (0x00FF0000)
  309. #define HS_ATTR_DEV_DESC_SIZE_MASK_ (0x0000FF00)
  310. #define HS_ATTR_CFG_BLK_SIZE_MASK_ (0x000000FF)
  311. #define FS_ATTR (0x05C)
  312. #define FS_ATTR_POLL_INT_MASK_ (0x00FF0000)
  313. #define FS_ATTR_DEV_DESC_SIZE_MASK_ (0x0000FF00)
  314. #define FS_ATTR_CFG_BLK_SIZE_MASK_ (0x000000FF)
  315. #define STR_ATTR0 (0x060)
  316. #define STR_ATTR0_CFGSTR_DESC_SIZE_MASK_ (0xFF000000)
  317. #define STR_ATTR0_SERSTR_DESC_SIZE_MASK_ (0x00FF0000)
  318. #define STR_ATTR0_PRODSTR_DESC_SIZE_MASK_ (0x0000FF00)
  319. #define STR_ATTR0_MANUF_DESC_SIZE_MASK_ (0x000000FF)
  320. #define STR_ATTR1 (0x064)
  321. #define STR_ATTR1_INTSTR_DESC_SIZE_MASK_ (0x000000FF)
  322. #define STR_FLAG_ATTR (0x068)
  323. #define STR_FLAG_ATTR_PME_FLAGS_MASK_ (0x000000FF)
  324. #define USB_CFG0 (0x080)
  325. #define USB_CFG_LPM_RESPONSE_ (0x80000000)
  326. #define USB_CFG_LPM_CAPABILITY_ (0x40000000)
  327. #define USB_CFG_LPM_ENBL_SLPM_ (0x20000000)
  328. #define USB_CFG_HIRD_THR_MASK_ (0x1F000000)
  329. #define USB_CFG_HIRD_THR_960_ (0x1C000000)
  330. #define USB_CFG_HIRD_THR_885_ (0x1B000000)
  331. #define USB_CFG_HIRD_THR_810_ (0x1A000000)
  332. #define USB_CFG_HIRD_THR_735_ (0x19000000)
  333. #define USB_CFG_HIRD_THR_660_ (0x18000000)
  334. #define USB_CFG_HIRD_THR_585_ (0x17000000)
  335. #define USB_CFG_HIRD_THR_510_ (0x16000000)
  336. #define USB_CFG_HIRD_THR_435_ (0x15000000)
  337. #define USB_CFG_HIRD_THR_360_ (0x14000000)
  338. #define USB_CFG_HIRD_THR_285_ (0x13000000)
  339. #define USB_CFG_HIRD_THR_210_ (0x12000000)
  340. #define USB_CFG_HIRD_THR_135_ (0x11000000)
  341. #define USB_CFG_HIRD_THR_60_ (0x10000000)
  342. #define USB_CFG_MAX_BURST_BI_MASK_ (0x00F00000)
  343. #define USB_CFG_MAX_BURST_BO_MASK_ (0x000F0000)
  344. #define USB_CFG_MAX_DEV_SPEED_MASK_ (0x0000E000)
  345. #define USB_CFG_MAX_DEV_SPEED_SS_ (0x00008000)
  346. #define USB_CFG_MAX_DEV_SPEED_HS_ (0x00000000)
  347. #define USB_CFG_MAX_DEV_SPEED_FS_ (0x00002000)
  348. #define USB_CFG_PHY_BOOST_MASK_ (0x00000180)
  349. #define USB_CFG_PHY_BOOST_PLUS_12_ (0x00000180)
  350. #define USB_CFG_PHY_BOOST_PLUS_8_ (0x00000100)
  351. #define USB_CFG_PHY_BOOST_PLUS_4_ (0x00000080)
  352. #define USB_CFG_PHY_BOOST_NORMAL_ (0x00000000)
  353. #define USB_CFG_BIR_ (0x00000040)
  354. #define USB_CFG_BCE_ (0x00000020)
  355. #define USB_CFG_PORT_SWAP_ (0x00000010)
  356. #define USB_CFG_LPM_EN_ (0x00000008)
  357. #define USB_CFG_RMT_WKP_ (0x00000004)
  358. #define USB_CFG_PWR_SEL_ (0x00000002)
  359. #define USB_CFG_STALL_BO_DIS_ (0x00000001)
  360. #define USB_CFG1 (0x084)
  361. #define USB_CFG1_U1_TIMEOUT_MASK_ (0xFF000000)
  362. #define USB_CFG1_U2_TIMEOUT_MASK_ (0x00FF0000)
  363. #define USB_CFG1_HS_TOUT_CAL_MASK_ (0x0000E000)
  364. #define USB_CFG1_DEV_U2_INIT_EN_ (0x00001000)
  365. #define USB_CFG1_DEV_U2_EN_ (0x00000800)
  366. #define USB_CFG1_DEV_U1_INIT_EN_ (0x00000400)
  367. #define USB_CFG1_DEV_U1_EN_ (0x00000200)
  368. #define USB_CFG1_LTM_ENABLE_ (0x00000100)
  369. #define USB_CFG1_FS_TOUT_CAL_MASK_ (0x00000070)
  370. #define USB_CFG1_SCALE_DOWN_MASK_ (0x00000003)
  371. #define USB_CFG1_SCALE_DOWN_MODE3_ (0x00000003)
  372. #define USB_CFG1_SCALE_DOWN_MODE2_ (0x00000002)
  373. #define USB_CFG1_SCALE_DOWN_MODE1_ (0x00000001)
  374. #define USB_CFG1_SCALE_DOWN_MODE0_ (0x00000000)
  375. #define USB_CFG2 (0x088)
  376. #define USB_CFG2_SS_DETACH_TIME_MASK_ (0xFFFF0000)
  377. #define USB_CFG2_HS_DETACH_TIME_MASK_ (0x0000FFFF)
  378. #define BURST_CAP (0x090)
  379. #define BURST_CAP_SIZE_MASK_ (0x000000FF)
  380. #define BULK_IN_DLY (0x094)
  381. #define BULK_IN_DLY_MASK_ (0x0000FFFF)
  382. #define INT_EP_CTL (0x098)
  383. #define INT_EP_INTEP_ON_ (0x80000000)
  384. #define INT_STS_EEE_TX_LPI_STRT_EN_ (0x04000000)
  385. #define INT_STS_EEE_TX_LPI_STOP_EN_ (0x02000000)
  386. #define INT_STS_EEE_RX_LPI_EN_ (0x01000000)
  387. #define INT_EP_RDFO_EN_ (0x00400000)
  388. #define INT_EP_TXE_EN_ (0x00200000)
  389. #define INT_EP_TX_DIS_EN_ (0x00080000)
  390. #define INT_EP_RX_DIS_EN_ (0x00040000)
  391. #define INT_EP_PHY_INT_EN_ (0x00020000)
  392. #define INT_EP_DP_INT_EN_ (0x00010000)
  393. #define INT_EP_MAC_ERR_EN_ (0x00008000)
  394. #define INT_EP_TDFU_EN_ (0x00004000)
  395. #define INT_EP_TDFO_EN_ (0x00002000)
  396. #define INT_EP_UTX_FP_EN_ (0x00001000)
  397. #define INT_EP_GPIO_EN_MASK_ (0x00000FFF)
  398. #define PIPE_CTL (0x09C)
  399. #define PIPE_CTL_TXSWING_ (0x00000040)
  400. #define PIPE_CTL_TXMARGIN_MASK_ (0x00000038)
  401. #define PIPE_CTL_TXDEEMPHASIS_MASK_ (0x00000006)
  402. #define PIPE_CTL_ELASTICITYBUFFERMODE_ (0x00000001)
  403. #define U1_LATENCY (0xA0)
  404. #define U2_LATENCY (0xA4)
  405. #define USB_STATUS (0x0A8)
  406. #define USB_STATUS_REMOTE_WK_ (0x00100000)
  407. #define USB_STATUS_FUNC_REMOTE_WK_ (0x00080000)
  408. #define USB_STATUS_LTM_ENABLE_ (0x00040000)
  409. #define USB_STATUS_U2_ENABLE_ (0x00020000)
  410. #define USB_STATUS_U1_ENABLE_ (0x00010000)
  411. #define USB_STATUS_SET_SEL_ (0x00000020)
  412. #define USB_STATUS_REMOTE_WK_STS_ (0x00000010)
  413. #define USB_STATUS_FUNC_REMOTE_WK_STS_ (0x00000008)
  414. #define USB_STATUS_LTM_ENABLE_STS_ (0x00000004)
  415. #define USB_STATUS_U2_ENABLE_STS_ (0x00000002)
  416. #define USB_STATUS_U1_ENABLE_STS_ (0x00000001)
  417. #define USB_CFG3 (0x0AC)
  418. #define USB_CFG3_EN_U2_LTM_ (0x40000000)
  419. #define USB_CFG3_BULK_OUT_NUMP_OVR_ (0x20000000)
  420. #define USB_CFG3_DIS_FAST_U1_EXIT_ (0x10000000)
  421. #define USB_CFG3_LPM_NYET_THR_ (0x0F000000)
  422. #define USB_CFG3_RX_DET_2_POL_LFPS_ (0x00800000)
  423. #define USB_CFG3_LFPS_FILT_ (0x00400000)
  424. #define USB_CFG3_SKIP_RX_DET_ (0x00200000)
  425. #define USB_CFG3_DELAY_P1P2P3_ (0x001C0000)
  426. #define USB_CFG3_DELAY_PHY_PWR_CHG_ (0x00020000)
  427. #define USB_CFG3_U1U2_EXIT_FR_ (0x00010000)
  428. #define USB_CFG3_REQ_P1P2P3 (0x00008000)
  429. #define USB_CFG3_HST_PRT_CMPL_ (0x00004000)
  430. #define USB_CFG3_DIS_SCRAMB_ (0x00002000)
  431. #define USB_CFG3_PWR_DN_SCALE_ (0x00001FFF)
  432. #define RFE_CTL (0x0B0)
  433. #define RFE_CTL_IGMP_COE_ (0x00004000)
  434. #define RFE_CTL_ICMP_COE_ (0x00002000)
  435. #define RFE_CTL_TCPUDP_COE_ (0x00001000)
  436. #define RFE_CTL_IP_COE_ (0x00000800)
  437. #define RFE_CTL_BCAST_EN_ (0x00000400)
  438. #define RFE_CTL_MCAST_EN_ (0x00000200)
  439. #define RFE_CTL_UCAST_EN_ (0x00000100)
  440. #define RFE_CTL_VLAN_STRIP_ (0x00000080)
  441. #define RFE_CTL_DISCARD_UNTAGGED_ (0x00000040)
  442. #define RFE_CTL_VLAN_FILTER_ (0x00000020)
  443. #define RFE_CTL_SA_FILTER_ (0x00000010)
  444. #define RFE_CTL_MCAST_HASH_ (0x00000008)
  445. #define RFE_CTL_DA_HASH_ (0x00000004)
  446. #define RFE_CTL_DA_PERFECT_ (0x00000002)
  447. #define RFE_CTL_RST_ (0x00000001)
  448. #define VLAN_TYPE (0x0B4)
  449. #define VLAN_TYPE_MASK_ (0x0000FFFF)
  450. #define FCT_RX_CTL (0x0C0)
  451. #define FCT_RX_CTL_EN_ (0x80000000)
  452. #define FCT_RX_CTL_RST_ (0x40000000)
  453. #define FCT_RX_CTL_SBF_ (0x02000000)
  454. #define FCT_RX_CTL_OVFL_ (0x01000000)
  455. #define FCT_RX_CTL_DROP_ (0x00800000)
  456. #define FCT_RX_CTL_NOT_EMPTY_ (0x00400000)
  457. #define FCT_RX_CTL_EMPTY_ (0x00200000)
  458. #define FCT_RX_CTL_DIS_ (0x00100000)
  459. #define FCT_RX_CTL_USED_MASK_ (0x0000FFFF)
  460. #define FCT_TX_CTL (0x0C4)
  461. #define FCT_TX_CTL_EN_ (0x80000000)
  462. #define FCT_TX_CTL_RST_ (0x40000000)
  463. #define FCT_TX_CTL_NOT_EMPTY_ (0x00400000)
  464. #define FCT_TX_CTL_EMPTY_ (0x00200000)
  465. #define FCT_TX_CTL_DIS_ (0x00100000)
  466. #define FCT_TX_CTL_USED_MASK_ (0x0000FFFF)
  467. #define FCT_RX_FIFO_END (0x0C8)
  468. #define FCT_RX_FIFO_END_MASK_ (0x0000007F)
  469. #define FCT_TX_FIFO_END (0x0CC)
  470. #define FCT_TX_FIFO_END_MASK_ (0x0000003F)
  471. #define FCT_FLOW (0x0D0)
  472. #define FCT_FLOW_OFF_MASK_ (0x00007F00)
  473. #define FCT_FLOW_ON_MASK_ (0x0000007F)
  474. #define RX_DP_STOR (0x0D4)
  475. #define RX_DP_STORE_TOT_RXUSED_MASK_ (0xFFFF0000)
  476. #define RX_DP_STORE_UTX_RXUSED_MASK_ (0x0000FFFF)
  477. #define TX_DP_STOR (0x0D8)
  478. #define TX_DP_STORE_TOT_TXUSED_MASK_ (0xFFFF0000)
  479. #define TX_DP_STORE_URX_TXUSED_MASK_ (0x0000FFFF)
  480. #define LTM_BELT_IDLE0 (0x0E0)
  481. #define LTM_BELT_IDLE0_IDLE1000_ (0x0FFF0000)
  482. #define LTM_BELT_IDLE0_IDLE100_ (0x00000FFF)
  483. #define LTM_BELT_IDLE1 (0x0E4)
  484. #define LTM_BELT_IDLE1_IDLE10_ (0x00000FFF)
  485. #define LTM_BELT_ACT0 (0x0E8)
  486. #define LTM_BELT_ACT0_ACT1000_ (0x0FFF0000)
  487. #define LTM_BELT_ACT0_ACT100_ (0x00000FFF)
  488. #define LTM_BELT_ACT1 (0x0EC)
  489. #define LTM_BELT_ACT1_ACT10_ (0x00000FFF)
  490. #define LTM_INACTIVE0 (0x0F0)
  491. #define LTM_INACTIVE0_TIMER1000_ (0xFFFF0000)
  492. #define LTM_INACTIVE0_TIMER100_ (0x0000FFFF)
  493. #define LTM_INACTIVE1 (0x0F4)
  494. #define LTM_INACTIVE1_TIMER10_ (0x0000FFFF)
  495. #define MAC_CR (0x100)
  496. #define MAC_CR_EEE_TX_CLK_STOP_EN_ (0x00040000)
  497. #define MAC_CR_EEE_EN_ (0x00020000)
  498. #define MAC_CR_EEE_TLAR_EN_ (0x00010000)
  499. #define MAC_CR_ADP_ (0x00002000)
  500. #define MAC_CR_AUTO_DUPLEX_ (0x00001000)
  501. #define MAC_CR_AUTO_SPEED_ (0x00000800)
  502. #define MAC_CR_LOOPBACK_ (0x00000400)
  503. #define MAC_CR_BOLMT_MASK_ (0x000000C0)
  504. #define MAC_CR_FULL_DUPLEX_ (0x00000008)
  505. #define MAC_CR_SPEED_MASK_ (0x00000006)
  506. #define MAC_CR_SPEED_1000_ (0x00000004)
  507. #define MAC_CR_SPEED_100_ (0x00000002)
  508. #define MAC_CR_SPEED_10_ (0x00000000)
  509. #define MAC_CR_RST_ (0x00000001)
  510. #define MAC_RX (0x104)
  511. #define MAC_RX_MAX_SIZE_SHIFT_ (16)
  512. #define MAC_RX_MAX_SIZE_MASK_ (0x3FFF0000)
  513. #define MAC_RX_FCS_STRIP_ (0x00000010)
  514. #define MAC_RX_VLAN_FSE_ (0x00000004)
  515. #define MAC_RX_RXD_ (0x00000002)
  516. #define MAC_RX_RXEN_ (0x00000001)
  517. #define MAC_TX (0x108)
  518. #define MAC_TX_BAD_FCS_ (0x00000004)
  519. #define MAC_TX_TXD_ (0x00000002)
  520. #define MAC_TX_TXEN_ (0x00000001)
  521. #define FLOW (0x10C)
  522. #define FLOW_CR_FORCE_FC_ (0x80000000)
  523. #define FLOW_CR_TX_FCEN_ (0x40000000)
  524. #define FLOW_CR_RX_FCEN_ (0x20000000)
  525. #define FLOW_CR_FPF_ (0x10000000)
  526. #define FLOW_CR_FCPT_MASK_ (0x0000FFFF)
  527. #define RAND_SEED (0x110)
  528. #define RAND_SEED_MASK_ (0x0000FFFF)
  529. #define ERR_STS (0x114)
  530. #define ERR_STS_FERR_ (0x00000100)
  531. #define ERR_STS_LERR_ (0x00000080)
  532. #define ERR_STS_RFERR_ (0x00000040)
  533. #define ERR_STS_ECERR_ (0x00000010)
  534. #define ERR_STS_ALERR_ (0x00000008)
  535. #define ERR_STS_URERR_ (0x00000004)
  536. #define RX_ADDRH (0x118)
  537. #define RX_ADDRH_MASK_ (0x0000FFFF)
  538. #define RX_ADDRL (0x11C)
  539. #define RX_ADDRL_MASK_ (0xFFFFFFFF)
  540. #define MII_ACC (0x120)
  541. #define MII_ACC_PHY_ADDR_SHIFT_ (11)
  542. #define MII_ACC_PHY_ADDR_MASK_ (0x0000F800)
  543. #define MII_ACC_MIIRINDA_SHIFT_ (6)
  544. #define MII_ACC_MIIRINDA_MASK_ (0x000007C0)
  545. #define MII_ACC_MII_READ_ (0x00000000)
  546. #define MII_ACC_MII_WRITE_ (0x00000002)
  547. #define MII_ACC_MII_BUSY_ (0x00000001)
  548. #define MII_DATA (0x124)
  549. #define MII_DATA_MASK_ (0x0000FFFF)
  550. #define MAC_RGMII_ID (0x128)
  551. #define MAC_RGMII_ID_TXC_DELAY_EN_ (0x00000002)
  552. #define MAC_RGMII_ID_RXC_DELAY_EN_ (0x00000001)
  553. #define EEE_TX_LPI_REQ_DLY (0x130)
  554. #define EEE_TX_LPI_REQ_DLY_CNT_MASK_ (0xFFFFFFFF)
  555. #define EEE_TW_TX_SYS (0x134)
  556. #define EEE_TW_TX_SYS_CNT1G_MASK_ (0xFFFF0000)
  557. #define EEE_TW_TX_SYS_CNT100M_MASK_ (0x0000FFFF)
  558. #define EEE_TX_LPI_REM_DLY (0x138)
  559. #define EEE_TX_LPI_REM_DLY_CNT_ (0x00FFFFFF)
  560. #define WUCSR (0x140)
  561. #define WUCSR_TESTMODE_ (0x80000000)
  562. #define WUCSR_RFE_WAKE_EN_ (0x00004000)
  563. #define WUCSR_EEE_TX_WAKE_ (0x00002000)
  564. #define WUCSR_EEE_TX_WAKE_EN_ (0x00001000)
  565. #define WUCSR_EEE_RX_WAKE_ (0x00000800)
  566. #define WUCSR_EEE_RX_WAKE_EN_ (0x00000400)
  567. #define WUCSR_RFE_WAKE_FR_ (0x00000200)
  568. #define WUCSR_STORE_WAKE_ (0x00000100)
  569. #define WUCSR_PFDA_FR_ (0x00000080)
  570. #define WUCSR_WUFR_ (0x00000040)
  571. #define WUCSR_MPR_ (0x00000020)
  572. #define WUCSR_BCST_FR_ (0x00000010)
  573. #define WUCSR_PFDA_EN_ (0x00000008)
  574. #define WUCSR_WAKE_EN_ (0x00000004)
  575. #define WUCSR_MPEN_ (0x00000002)
  576. #define WUCSR_BCST_EN_ (0x00000001)
  577. #define WK_SRC (0x144)
  578. #define WK_SRC_GPIOX_INT_WK_SHIFT_ (20)
  579. #define WK_SRC_GPIOX_INT_WK_MASK_ (0xFFF00000)
  580. #define WK_SRC_IPV6_TCPSYN_RCD_WK_ (0x00010000)
  581. #define WK_SRC_IPV4_TCPSYN_RCD_WK_ (0x00008000)
  582. #define WK_SRC_EEE_TX_WK_ (0x00004000)
  583. #define WK_SRC_EEE_RX_WK_ (0x00002000)
  584. #define WK_SRC_GOOD_FR_WK_ (0x00001000)
  585. #define WK_SRC_PFDA_FR_WK_ (0x00000800)
  586. #define WK_SRC_MP_FR_WK_ (0x00000400)
  587. #define WK_SRC_BCAST_FR_WK_ (0x00000200)
  588. #define WK_SRC_WU_FR_WK_ (0x00000100)
  589. #define WK_SRC_WUFF_MATCH_MASK_ (0x0000001F)
  590. #define WUF_CFG0 (0x150)
  591. #define NUM_OF_WUF_CFG (32)
  592. #define WUF_CFG_BEGIN (WUF_CFG0)
  593. #define WUF_CFG(index) (WUF_CFG_BEGIN + (4 * (index)))
  594. #define WUF_CFGX_EN_ (0x80000000)
  595. #define WUF_CFGX_TYPE_MASK_ (0x03000000)
  596. #define WUF_CFGX_TYPE_MCAST_ (0x02000000)
  597. #define WUF_CFGX_TYPE_ALL_ (0x01000000)
  598. #define WUF_CFGX_TYPE_UCAST_ (0x00000000)
  599. #define WUF_CFGX_OFFSET_SHIFT_ (16)
  600. #define WUF_CFGX_OFFSET_MASK_ (0x00FF0000)
  601. #define WUF_CFGX_CRC16_MASK_ (0x0000FFFF)
  602. #define WUF_MASK0_0 (0x200)
  603. #define WUF_MASK0_1 (0x204)
  604. #define WUF_MASK0_2 (0x208)
  605. #define WUF_MASK0_3 (0x20C)
  606. #define NUM_OF_WUF_MASK (32)
  607. #define WUF_MASK0_BEGIN (WUF_MASK0_0)
  608. #define WUF_MASK1_BEGIN (WUF_MASK0_1)
  609. #define WUF_MASK2_BEGIN (WUF_MASK0_2)
  610. #define WUF_MASK3_BEGIN (WUF_MASK0_3)
  611. #define WUF_MASK0(index) (WUF_MASK0_BEGIN + (0x10 * (index)))
  612. #define WUF_MASK1(index) (WUF_MASK1_BEGIN + (0x10 * (index)))
  613. #define WUF_MASK2(index) (WUF_MASK2_BEGIN + (0x10 * (index)))
  614. #define WUF_MASK3(index) (WUF_MASK3_BEGIN + (0x10 * (index)))
  615. #define MAF_BASE (0x400)
  616. #define MAF_HIX (0x00)
  617. #define MAF_LOX (0x04)
  618. #define NUM_OF_MAF (33)
  619. #define MAF_HI_BEGIN (MAF_BASE + MAF_HIX)
  620. #define MAF_LO_BEGIN (MAF_BASE + MAF_LOX)
  621. #define MAF_HI(index) (MAF_BASE + (8 * (index)) + (MAF_HIX))
  622. #define MAF_LO(index) (MAF_BASE + (8 * (index)) + (MAF_LOX))
  623. #define MAF_HI_VALID_ (0x80000000)
  624. #define MAF_HI_TYPE_MASK_ (0x40000000)
  625. #define MAF_HI_TYPE_SRC_ (0x40000000)
  626. #define MAF_HI_TYPE_DST_ (0x00000000)
  627. #define MAF_HI_ADDR_MASK (0x0000FFFF)
  628. #define MAF_LO_ADDR_MASK (0xFFFFFFFF)
  629. #define WUCSR2 (0x600)
  630. #define WUCSR2_CSUM_DISABLE_ (0x80000000)
  631. #define WUCSR2_NA_SA_SEL_ (0x00000100)
  632. #define WUCSR2_NS_RCD_ (0x00000080)
  633. #define WUCSR2_ARP_RCD_ (0x00000040)
  634. #define WUCSR2_IPV6_TCPSYN_RCD_ (0x00000020)
  635. #define WUCSR2_IPV4_TCPSYN_RCD_ (0x00000010)
  636. #define WUCSR2_NS_OFFLOAD_EN_ (0x00000008)
  637. #define WUCSR2_ARP_OFFLOAD_EN_ (0x00000004)
  638. #define WUCSR2_IPV6_TCPSYN_WAKE_EN_ (0x00000002)
  639. #define WUCSR2_IPV4_TCPSYN_WAKE_EN_ (0x00000001)
  640. #define NS1_IPV6_ADDR_DEST0 (0x610)
  641. #define NS1_IPV6_ADDR_DEST1 (0x614)
  642. #define NS1_IPV6_ADDR_DEST2 (0x618)
  643. #define NS1_IPV6_ADDR_DEST3 (0x61C)
  644. #define NS1_IPV6_ADDR_SRC0 (0x620)
  645. #define NS1_IPV6_ADDR_SRC1 (0x624)
  646. #define NS1_IPV6_ADDR_SRC2 (0x628)
  647. #define NS1_IPV6_ADDR_SRC3 (0x62C)
  648. #define NS1_ICMPV6_ADDR0_0 (0x630)
  649. #define NS1_ICMPV6_ADDR0_1 (0x634)
  650. #define NS1_ICMPV6_ADDR0_2 (0x638)
  651. #define NS1_ICMPV6_ADDR0_3 (0x63C)
  652. #define NS1_ICMPV6_ADDR1_0 (0x640)
  653. #define NS1_ICMPV6_ADDR1_1 (0x644)
  654. #define NS1_ICMPV6_ADDR1_2 (0x648)
  655. #define NS1_ICMPV6_ADDR1_3 (0x64C)
  656. #define NS2_IPV6_ADDR_DEST0 (0x650)
  657. #define NS2_IPV6_ADDR_DEST1 (0x654)
  658. #define NS2_IPV6_ADDR_DEST2 (0x658)
  659. #define NS2_IPV6_ADDR_DEST3 (0x65C)
  660. #define NS2_IPV6_ADDR_SRC0 (0x660)
  661. #define NS2_IPV6_ADDR_SRC1 (0x664)
  662. #define NS2_IPV6_ADDR_SRC2 (0x668)
  663. #define NS2_IPV6_ADDR_SRC3 (0x66C)
  664. #define NS2_ICMPV6_ADDR0_0 (0x670)
  665. #define NS2_ICMPV6_ADDR0_1 (0x674)
  666. #define NS2_ICMPV6_ADDR0_2 (0x678)
  667. #define NS2_ICMPV6_ADDR0_3 (0x67C)
  668. #define NS2_ICMPV6_ADDR1_0 (0x680)
  669. #define NS2_ICMPV6_ADDR1_1 (0x684)
  670. #define NS2_ICMPV6_ADDR1_2 (0x688)
  671. #define NS2_ICMPV6_ADDR1_3 (0x68C)
  672. #define SYN_IPV4_ADDR_SRC (0x690)
  673. #define SYN_IPV4_ADDR_DEST (0x694)
  674. #define SYN_IPV4_TCP_PORTS (0x698)
  675. #define SYN_IPV4_TCP_PORTS_IPV4_DEST_PORT_SHIFT_ (16)
  676. #define SYN_IPV4_TCP_PORTS_IPV4_DEST_PORT_MASK_ (0xFFFF0000)
  677. #define SYN_IPV4_TCP_PORTS_IPV4_SRC_PORT_MASK_ (0x0000FFFF)
  678. #define SYN_IPV6_ADDR_SRC0 (0x69C)
  679. #define SYN_IPV6_ADDR_SRC1 (0x6A0)
  680. #define SYN_IPV6_ADDR_SRC2 (0x6A4)
  681. #define SYN_IPV6_ADDR_SRC3 (0x6A8)
  682. #define SYN_IPV6_ADDR_DEST0 (0x6AC)
  683. #define SYN_IPV6_ADDR_DEST1 (0x6B0)
  684. #define SYN_IPV6_ADDR_DEST2 (0x6B4)
  685. #define SYN_IPV6_ADDR_DEST3 (0x6B8)
  686. #define SYN_IPV6_TCP_PORTS (0x6BC)
  687. #define SYN_IPV6_TCP_PORTS_IPV6_DEST_PORT_SHIFT_ (16)
  688. #define SYN_IPV6_TCP_PORTS_IPV6_DEST_PORT_MASK_ (0xFFFF0000)
  689. #define SYN_IPV6_TCP_PORTS_IPV6_SRC_PORT_MASK_ (0x0000FFFF)
  690. #define ARP_SPA (0x6C0)
  691. #define ARP_TPA (0x6C4)
  692. #define PHY_DEV_ID (0x700)
  693. #define PHY_DEV_ID_REV_SHIFT_ (28)
  694. #define PHY_DEV_ID_REV_SHIFT_ (28)
  695. #define PHY_DEV_ID_REV_MASK_ (0xF0000000)
  696. #define PHY_DEV_ID_MODEL_SHIFT_ (22)
  697. #define PHY_DEV_ID_MODEL_MASK_ (0x0FC00000)
  698. #define PHY_DEV_ID_OUI_MASK_ (0x003FFFFF)
  699. #define OTP_BASE_ADDR (0x00001000)
  700. #define OTP_ADDR_RANGE_ (0x1FF)
  701. #define OTP_PWR_DN (OTP_BASE_ADDR + 4 * 0x00)
  702. #define OTP_PWR_DN_PWRDN_N_ (0x01)
  703. #define OTP_ADDR1 (OTP_BASE_ADDR + 4 * 0x01)
  704. #define OTP_ADDR1_15_11 (0x1F)
  705. #define OTP_ADDR2 (OTP_BASE_ADDR + 4 * 0x02)
  706. #define OTP_ADDR2_10_3 (0xFF)
  707. #define OTP_ADDR3 (OTP_BASE_ADDR + 4 * 0x03)
  708. #define OTP_ADDR3_2_0 (0x03)
  709. #define OTP_PRGM_DATA (OTP_BASE_ADDR + 4 * 0x04)
  710. #define OTP_PRGM_MODE (OTP_BASE_ADDR + 4 * 0x05)
  711. #define OTP_PRGM_MODE_BYTE_ (0x01)
  712. #define OTP_RD_DATA (OTP_BASE_ADDR + 4 * 0x06)
  713. #define OTP_FUNC_CMD (OTP_BASE_ADDR + 4 * 0x08)
  714. #define OTP_FUNC_CMD_RESET_ (0x04)
  715. #define OTP_FUNC_CMD_PROGRAM_ (0x02)
  716. #define OTP_FUNC_CMD_READ_ (0x01)
  717. #define OTP_TST_CMD (OTP_BASE_ADDR + 4 * 0x09)
  718. #define OTP_TST_CMD_TEST_DEC_SEL_ (0x10)
  719. #define OTP_TST_CMD_PRGVRFY_ (0x08)
  720. #define OTP_TST_CMD_WRTEST_ (0x04)
  721. #define OTP_TST_CMD_TESTDEC_ (0x02)
  722. #define OTP_TST_CMD_BLANKCHECK_ (0x01)
  723. #define OTP_CMD_GO (OTP_BASE_ADDR + 4 * 0x0A)
  724. #define OTP_CMD_GO_GO_ (0x01)
  725. #define OTP_PASS_FAIL (OTP_BASE_ADDR + 4 * 0x0B)
  726. #define OTP_PASS_FAIL_PASS_ (0x02)
  727. #define OTP_PASS_FAIL_FAIL_ (0x01)
  728. #define OTP_STATUS (OTP_BASE_ADDR + 4 * 0x0C)
  729. #define OTP_STATUS_OTP_LOCK_ (0x10)
  730. #define OTP_STATUS_WEB_ (0x08)
  731. #define OTP_STATUS_PGMEN (0x04)
  732. #define OTP_STATUS_CPUMPEN_ (0x02)
  733. #define OTP_STATUS_BUSY_ (0x01)
  734. #define OTP_MAX_PRG (OTP_BASE_ADDR + 4 * 0x0D)
  735. #define OTP_MAX_PRG_MAX_PROG (0x1F)
  736. #define OTP_INTR_STATUS (OTP_BASE_ADDR + 4 * 0x10)
  737. #define OTP_INTR_STATUS_READY_ (0x01)
  738. #define OTP_INTR_MASK (OTP_BASE_ADDR + 4 * 0x11)
  739. #define OTP_INTR_MASK_READY_ (0x01)
  740. #define OTP_RSTB_PW1 (OTP_BASE_ADDR + 4 * 0x14)
  741. #define OTP_RSTB_PW2 (OTP_BASE_ADDR + 4 * 0x15)
  742. #define OTP_PGM_PW1 (OTP_BASE_ADDR + 4 * 0x18)
  743. #define OTP_PGM_PW2 (OTP_BASE_ADDR + 4 * 0x19)
  744. #define OTP_READ_PW1 (OTP_BASE_ADDR + 4 * 0x1C)
  745. #define OTP_READ_PW2 (OTP_BASE_ADDR + 4 * 0x1D)
  746. #define OTP_TCRST (OTP_BASE_ADDR + 4 * 0x20)
  747. #define OTP_RSRD (OTP_BASE_ADDR + 4 * 0x21)
  748. #define OTP_TREADEN_VAL (OTP_BASE_ADDR + 4 * 0x22)
  749. #define OTP_TDLES_VAL (OTP_BASE_ADDR + 4 * 0x23)
  750. #define OTP_TWWL_VAL (OTP_BASE_ADDR + 4 * 0x24)
  751. #define OTP_TDLEH_VAL (OTP_BASE_ADDR + 4 * 0x25)
  752. #define OTP_TWPED_VAL (OTP_BASE_ADDR + 4 * 0x26)
  753. #define OTP_TPES_VAL (OTP_BASE_ADDR + 4 * 0x27)
  754. #define OTP_TCPS_VAL (OTP_BASE_ADDR + 4 * 0x28)
  755. #define OTP_TCPH_VAL (OTP_BASE_ADDR + 4 * 0x29)
  756. #define OTP_TPGMVFY_VAL (OTP_BASE_ADDR + 4 * 0x2A)
  757. #define OTP_TPEH_VAL (OTP_BASE_ADDR + 4 * 0x2B)
  758. #define OTP_TPGRST_VAL (OTP_BASE_ADDR + 4 * 0x2C)
  759. #define OTP_TCLES_VAL (OTP_BASE_ADDR + 4 * 0x2D)
  760. #define OTP_TCLEH_VAL (OTP_BASE_ADDR + 4 * 0x2E)
  761. #define OTP_TRDES_VAL (OTP_BASE_ADDR + 4 * 0x2F)
  762. #define OTP_TBCACC_VAL (OTP_BASE_ADDR + 4 * 0x30)
  763. #define OTP_TAAC_VAL (OTP_BASE_ADDR + 4 * 0x31)
  764. #define OTP_TACCT_VAL (OTP_BASE_ADDR + 4 * 0x32)
  765. #define OTP_TRDEP_VAL (OTP_BASE_ADDR + 4 * 0x38)
  766. #define OTP_TPGSV_VAL (OTP_BASE_ADDR + 4 * 0x39)
  767. #define OTP_TPVSR_VAL (OTP_BASE_ADDR + 4 * 0x3A)
  768. #define OTP_TPVHR_VAL (OTP_BASE_ADDR + 4 * 0x3B)
  769. #define OTP_TPVSA_VAL (OTP_BASE_ADDR + 4 * 0x3C)
  770. #endif /* _LAN78XX_H */