b53_regs.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. /*
  2. * B53 register definitions
  3. *
  4. * Copyright (C) 2004 Broadcom Corporation
  5. * Copyright (C) 2011-2013 Jonas Gorski <jogo@openwrt.org>
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for any
  8. * purpose with or without fee is hereby granted, provided that the above
  9. * copyright notice and this permission notice appear in all copies.
  10. *
  11. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  12. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  13. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  14. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  15. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  16. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  17. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef __B53_REGS_H
  20. #define __B53_REGS_H
  21. /* Management Port (SMP) Page offsets */
  22. #define B53_CTRL_PAGE 0x00 /* Control */
  23. #define B53_STAT_PAGE 0x01 /* Status */
  24. #define B53_MGMT_PAGE 0x02 /* Management Mode */
  25. #define B53_MIB_AC_PAGE 0x03 /* MIB Autocast */
  26. #define B53_ARLCTRL_PAGE 0x04 /* ARL Control */
  27. #define B53_ARLIO_PAGE 0x05 /* ARL Access */
  28. #define B53_FRAMEBUF_PAGE 0x06 /* Management frame access */
  29. #define B53_MEM_ACCESS_PAGE 0x08 /* Memory access */
  30. /* PHY Registers */
  31. #define B53_PORT_MII_PAGE(i) (0x10 + (i)) /* Port i MII Registers */
  32. #define B53_IM_PORT_PAGE 0x18 /* Inverse MII Port (to EMAC) */
  33. #define B53_ALL_PORT_PAGE 0x19 /* All ports MII (broadcast) */
  34. /* MIB registers */
  35. #define B53_MIB_PAGE(i) (0x20 + (i))
  36. /* Quality of Service (QoS) Registers */
  37. #define B53_QOS_PAGE 0x30
  38. /* Port VLAN Page */
  39. #define B53_PVLAN_PAGE 0x31
  40. /* VLAN Registers */
  41. #define B53_VLAN_PAGE 0x34
  42. /* Jumbo Frame Registers */
  43. #define B53_JUMBO_PAGE 0x40
  44. /* EAP Registers */
  45. #define B53_EAP_PAGE 0x42
  46. /* EEE Control Registers Page */
  47. #define B53_EEE_PAGE 0x92
  48. /* CFP Configuration Registers Page */
  49. #define B53_CFP_PAGE 0xa1
  50. /*************************************************************************
  51. * Control Page registers
  52. *************************************************************************/
  53. /* Port Control Register (8 bit) */
  54. #define B53_PORT_CTRL(i) (0x00 + (i))
  55. #define PORT_CTRL_RX_DISABLE BIT(0)
  56. #define PORT_CTRL_TX_DISABLE BIT(1)
  57. #define PORT_CTRL_RX_BCST_EN BIT(2) /* Broadcast RX (P8 only) */
  58. #define PORT_CTRL_RX_MCST_EN BIT(3) /* Multicast RX (P8 only) */
  59. #define PORT_CTRL_RX_UCST_EN BIT(4) /* Unicast RX (P8 only) */
  60. #define PORT_CTRL_STP_STATE_S 5
  61. #define PORT_CTRL_NO_STP (0 << PORT_CTRL_STP_STATE_S)
  62. #define PORT_CTRL_DIS_STATE (1 << PORT_CTRL_STP_STATE_S)
  63. #define PORT_CTRL_BLOCK_STATE (2 << PORT_CTRL_STP_STATE_S)
  64. #define PORT_CTRL_LISTEN_STATE (3 << PORT_CTRL_STP_STATE_S)
  65. #define PORT_CTRL_LEARN_STATE (4 << PORT_CTRL_STP_STATE_S)
  66. #define PORT_CTRL_FWD_STATE (5 << PORT_CTRL_STP_STATE_S)
  67. #define PORT_CTRL_STP_STATE_MASK (0x7 << PORT_CTRL_STP_STATE_S)
  68. /* SMP Control Register (8 bit) */
  69. #define B53_SMP_CTRL 0x0a
  70. /* Switch Mode Control Register (8 bit) */
  71. #define B53_SWITCH_MODE 0x0b
  72. #define SM_SW_FWD_MODE BIT(0) /* 1 = Managed Mode */
  73. #define SM_SW_FWD_EN BIT(1) /* Forwarding Enable */
  74. /* IMP Port state override register (8 bit) */
  75. #define B53_PORT_OVERRIDE_CTRL 0x0e
  76. #define PORT_OVERRIDE_LINK BIT(0)
  77. #define PORT_OVERRIDE_FULL_DUPLEX BIT(1) /* 0 = Half Duplex */
  78. #define PORT_OVERRIDE_SPEED_S 2
  79. #define PORT_OVERRIDE_SPEED_10M (0 << PORT_OVERRIDE_SPEED_S)
  80. #define PORT_OVERRIDE_SPEED_100M (1 << PORT_OVERRIDE_SPEED_S)
  81. #define PORT_OVERRIDE_SPEED_1000M (2 << PORT_OVERRIDE_SPEED_S)
  82. #define PORT_OVERRIDE_LP_FLOW_25 BIT(3) /* BCM5325 only */
  83. #define PORT_OVERRIDE_RV_MII_25 BIT(4) /* BCM5325 only */
  84. #define PORT_OVERRIDE_RX_FLOW BIT(4)
  85. #define PORT_OVERRIDE_TX_FLOW BIT(5)
  86. #define PORT_OVERRIDE_SPEED_2000M BIT(6) /* BCM5301X only, requires setting 1000M */
  87. #define PORT_OVERRIDE_EN BIT(7) /* Use the register contents */
  88. /* Power-down mode control (8 bit) */
  89. #define B53_PD_MODE_CTRL_25 0x0f
  90. #define PD_MODE_PORT_MASK 0x1f
  91. /* Bit 0 also powers down the switch. */
  92. #define PD_MODE_POWER_DOWN_PORT(i) BIT(i)
  93. /* IP Multicast control (8 bit) */
  94. #define B53_IP_MULTICAST_CTRL 0x21
  95. #define B53_IP_MCAST_25 BIT(0)
  96. #define B53_IPMC_FWD_EN BIT(1)
  97. #define B53_UC_FWD_EN BIT(6)
  98. #define B53_MC_FWD_EN BIT(7)
  99. /* Switch control (8 bit) */
  100. #define B53_SWITCH_CTRL 0x22
  101. #define B53_MII_DUMB_FWDG_EN BIT(6)
  102. /* (16 bit) */
  103. #define B53_UC_FLOOD_MASK 0x32
  104. #define B53_MC_FLOOD_MASK 0x34
  105. #define B53_IPMC_FLOOD_MASK 0x36
  106. #define B53_DIS_LEARNING 0x3c
  107. /*
  108. * Override Ports 0-7 State on devices with xMII interfaces (8 bit)
  109. *
  110. * For port 8 still use B53_PORT_OVERRIDE_CTRL
  111. * Please note that not all ports are available on every hardware, e.g. BCM5301X
  112. * don't include overriding port 6, BCM63xx also have some limitations.
  113. */
  114. #define B53_GMII_PORT_OVERRIDE_CTRL(i) (0x58 + (i))
  115. #define GMII_PO_LINK BIT(0)
  116. #define GMII_PO_FULL_DUPLEX BIT(1) /* 0 = Half Duplex */
  117. #define GMII_PO_SPEED_S 2
  118. #define GMII_PO_SPEED_10M (0 << GMII_PO_SPEED_S)
  119. #define GMII_PO_SPEED_100M (1 << GMII_PO_SPEED_S)
  120. #define GMII_PO_SPEED_1000M (2 << GMII_PO_SPEED_S)
  121. #define GMII_PO_RX_FLOW BIT(4)
  122. #define GMII_PO_TX_FLOW BIT(5)
  123. #define GMII_PO_EN BIT(6) /* Use the register contents */
  124. #define GMII_PO_SPEED_2000M BIT(7) /* BCM5301X only, requires setting 1000M */
  125. #define B53_RGMII_CTRL_IMP 0x60
  126. #define RGMII_CTRL_ENABLE_GMII BIT(7)
  127. #define RGMII_CTRL_MII_OVERRIDE BIT(6)
  128. #define RGMII_CTRL_TIMING_SEL BIT(2)
  129. #define RGMII_CTRL_DLL_RXC BIT(1)
  130. #define RGMII_CTRL_DLL_TXC BIT(0)
  131. #define B53_RGMII_CTRL_P(i) (B53_RGMII_CTRL_IMP + (i))
  132. /* Software reset register (8 bit) */
  133. #define B53_SOFTRESET 0x79
  134. #define SW_RST BIT(7)
  135. #define EN_CH_RST BIT(6)
  136. #define EN_SW_RST BIT(4)
  137. /* Fast Aging Control register (8 bit) */
  138. #define B53_FAST_AGE_CTRL 0x88
  139. #define FAST_AGE_STATIC BIT(0)
  140. #define FAST_AGE_DYNAMIC BIT(1)
  141. #define FAST_AGE_PORT BIT(2)
  142. #define FAST_AGE_VLAN BIT(3)
  143. #define FAST_AGE_STP BIT(4)
  144. #define FAST_AGE_MC BIT(5)
  145. #define FAST_AGE_DONE BIT(7)
  146. /* Fast Aging Port Control register (8 bit) */
  147. #define B53_FAST_AGE_PORT_CTRL 0x89
  148. /* Fast Aging VID Control register (16 bit) */
  149. #define B53_FAST_AGE_VID_CTRL 0x8a
  150. /*************************************************************************
  151. * Status Page registers
  152. *************************************************************************/
  153. /* Link Status Summary Register (16bit) */
  154. #define B53_LINK_STAT 0x00
  155. /* Link Status Change Register (16 bit) */
  156. #define B53_LINK_STAT_CHANGE 0x02
  157. /* Port Speed Summary Register (16 bit for FE, 32 bit for GE) */
  158. #define B53_SPEED_STAT 0x04
  159. #define SPEED_PORT_FE(reg, port) (((reg) >> (port)) & 1)
  160. #define SPEED_PORT_GE(reg, port) (((reg) >> 2 * (port)) & 3)
  161. #define SPEED_STAT_10M 0
  162. #define SPEED_STAT_100M 1
  163. #define SPEED_STAT_1000M 2
  164. /* Duplex Status Summary (16 bit) */
  165. #define B53_DUPLEX_STAT_FE 0x06
  166. #define B53_DUPLEX_STAT_GE 0x08
  167. #define B53_DUPLEX_STAT_63XX 0x0c
  168. /* Revision ID register for BCM5325 */
  169. #define B53_REV_ID_25 0x50
  170. /* Strap Value (48 bit) */
  171. #define B53_STRAP_VALUE 0x70
  172. #define SV_GMII_CTRL_115 BIT(27)
  173. /*************************************************************************
  174. * Management Mode Page Registers
  175. *************************************************************************/
  176. /* Global Management Config Register (8 bit) */
  177. #define B53_GLOBAL_CONFIG 0x00
  178. #define GC_RESET_MIB 0x01
  179. #define GC_RX_BPDU_EN 0x02
  180. #define GC_MIB_AC_HDR_EN 0x10
  181. #define GC_MIB_AC_EN 0x20
  182. #define GC_FRM_MGMT_PORT_M 0xC0
  183. #define GC_FRM_MGMT_PORT_04 0x00
  184. #define GC_FRM_MGMT_PORT_MII 0x80
  185. /* Broadcom Header control register (8 bit) */
  186. #define B53_BRCM_HDR 0x03
  187. #define BRCM_HDR_P8_EN BIT(0) /* Enable tagging on port 8 */
  188. #define BRCM_HDR_P5_EN BIT(1) /* Enable tagging on port 5 */
  189. #define BRCM_HDR_P7_EN BIT(2) /* Enable tagging on port 7 */
  190. /* Mirror capture control register (16 bit) */
  191. #define B53_MIR_CAP_CTL 0x10
  192. #define CAP_PORT_MASK 0xf
  193. #define BLK_NOT_MIR BIT(14)
  194. #define MIRROR_EN BIT(15)
  195. /* Ingress mirror control register (16 bit) */
  196. #define B53_IG_MIR_CTL 0x12
  197. #define MIRROR_MASK 0x1ff
  198. #define DIV_EN BIT(13)
  199. #define MIRROR_FILTER_MASK 0x3
  200. #define MIRROR_FILTER_SHIFT 14
  201. #define MIRROR_ALL 0
  202. #define MIRROR_DA 1
  203. #define MIRROR_SA 2
  204. /* Ingress mirror divider register (16 bit) */
  205. #define B53_IG_MIR_DIV 0x14
  206. #define IN_MIRROR_DIV_MASK 0x3ff
  207. /* Ingress mirror MAC address register (48 bit) */
  208. #define B53_IG_MIR_MAC 0x16
  209. /* Egress mirror control register (16 bit) */
  210. #define B53_EG_MIR_CTL 0x1C
  211. /* Egress mirror divider register (16 bit) */
  212. #define B53_EG_MIR_DIV 0x1E
  213. /* Egress mirror MAC address register (48 bit) */
  214. #define B53_EG_MIR_MAC 0x20
  215. /* Device ID register (8 or 32 bit) */
  216. #define B53_DEVICE_ID 0x30
  217. /* Revision ID register (8 bit) */
  218. #define B53_REV_ID 0x40
  219. /* Broadcom header RX control (16 bit) */
  220. #define B53_BRCM_HDR_RX_DIS 0x60
  221. /* Broadcom header TX control (16 bit) */
  222. #define B53_BRCM_HDR_TX_DIS 0x62
  223. /*************************************************************************
  224. * ARL Access Page Registers
  225. *************************************************************************/
  226. /* VLAN Table Access Register (8 bit) */
  227. #define B53_VT_ACCESS 0x80
  228. #define B53_VT_ACCESS_9798 0x60 /* for BCM5397/BCM5398 */
  229. #define B53_VT_ACCESS_63XX 0x60 /* for BCM6328/62/68 */
  230. #define VTA_CMD_WRITE 0
  231. #define VTA_CMD_READ 1
  232. #define VTA_CMD_CLEAR 2
  233. #define VTA_START_CMD BIT(7)
  234. /* VLAN Table Index Register (16 bit) */
  235. #define B53_VT_INDEX 0x81
  236. #define B53_VT_INDEX_9798 0x61
  237. #define B53_VT_INDEX_63XX 0x62
  238. /* VLAN Table Entry Register (32 bit) */
  239. #define B53_VT_ENTRY 0x83
  240. #define B53_VT_ENTRY_9798 0x63
  241. #define B53_VT_ENTRY_63XX 0x64
  242. #define VTE_MEMBERS 0x1ff
  243. #define VTE_UNTAG_S 9
  244. #define VTE_UNTAG (0x1ff << 9)
  245. /*************************************************************************
  246. * ARL I/O Registers
  247. *************************************************************************/
  248. /* ARL Table Read/Write Register (8 bit) */
  249. #define B53_ARLTBL_RW_CTRL 0x00
  250. #define ARLTBL_RW BIT(0)
  251. #define ARLTBL_IVL_SVL_SELECT BIT(6)
  252. #define ARLTBL_START_DONE BIT(7)
  253. /* MAC Address Index Register (48 bit) */
  254. #define B53_MAC_ADDR_IDX 0x02
  255. /* VLAN ID Index Register (16 bit) */
  256. #define B53_VLAN_ID_IDX 0x08
  257. /* ARL Table MAC/VID Entry N Registers (64 bit)
  258. *
  259. * BCM5325 and BCM5365 share most definitions below
  260. */
  261. #define B53_ARLTBL_MAC_VID_ENTRY(n) ((0x10 * (n)) + 0x10)
  262. #define ARLTBL_MAC_MASK 0xffffffffffffULL
  263. #define ARLTBL_VID_S 48
  264. #define ARLTBL_VID_MASK_25 0xff
  265. #define ARLTBL_VID_MASK 0xfff
  266. #define ARLTBL_DATA_PORT_ID_S_25 48
  267. #define ARLTBL_DATA_PORT_ID_MASK_25 0xf
  268. #define ARLTBL_AGE_25 BIT(61)
  269. #define ARLTBL_STATIC_25 BIT(62)
  270. #define ARLTBL_VALID_25 BIT(63)
  271. /* ARL Table Data Entry N Registers (32 bit) */
  272. #define B53_ARLTBL_DATA_ENTRY(n) ((0x10 * (n)) + 0x18)
  273. #define ARLTBL_DATA_PORT_ID_MASK 0x1ff
  274. #define ARLTBL_TC(tc) ((3 & tc) << 11)
  275. #define ARLTBL_AGE BIT(14)
  276. #define ARLTBL_STATIC BIT(15)
  277. #define ARLTBL_VALID BIT(16)
  278. /* Maximum number of bin entries in the ARL for all switches */
  279. #define B53_ARLTBL_MAX_BIN_ENTRIES 4
  280. /* ARL Search Control Register (8 bit) */
  281. #define B53_ARL_SRCH_CTL 0x50
  282. #define B53_ARL_SRCH_CTL_25 0x20
  283. #define ARL_SRCH_VLID BIT(0)
  284. #define ARL_SRCH_STDN BIT(7)
  285. /* ARL Search Address Register (16 bit) */
  286. #define B53_ARL_SRCH_ADDR 0x51
  287. #define B53_ARL_SRCH_ADDR_25 0x22
  288. #define B53_ARL_SRCH_ADDR_65 0x24
  289. #define ARL_ADDR_MASK GENMASK(14, 0)
  290. /* ARL Search MAC/VID Result (64 bit) */
  291. #define B53_ARL_SRCH_RSTL_0_MACVID 0x60
  292. /* Single register search result on 5325 */
  293. #define B53_ARL_SRCH_RSTL_0_MACVID_25 0x24
  294. /* Single register search result on 5365 */
  295. #define B53_ARL_SRCH_RSTL_0_MACVID_65 0x30
  296. /* ARL Search Data Result (32 bit) */
  297. #define B53_ARL_SRCH_RSTL_0 0x68
  298. #define B53_ARL_SRCH_RSTL_MACVID(x) (B53_ARL_SRCH_RSTL_0_MACVID + ((x) * 0x10))
  299. #define B53_ARL_SRCH_RSTL(x) (B53_ARL_SRCH_RSTL_0 + ((x) * 0x10))
  300. /*************************************************************************
  301. * Port VLAN Registers
  302. *************************************************************************/
  303. /* Port VLAN mask (16 bit) IMP port is always 8, also on 5325 & co */
  304. #define B53_PVLAN_PORT_MASK(i) ((i) * 2)
  305. /* Join all VLANs register (16 bit) */
  306. #define B53_JOIN_ALL_VLAN_EN 0x50
  307. /*************************************************************************
  308. * 802.1Q Page Registers
  309. *************************************************************************/
  310. /* Global QoS Control (8 bit) */
  311. #define B53_QOS_GLOBAL_CTL 0x00
  312. /* Enable 802.1Q for individual Ports (16 bit) */
  313. #define B53_802_1P_EN 0x04
  314. /*************************************************************************
  315. * VLAN Page Registers
  316. *************************************************************************/
  317. /* VLAN Control 0 (8 bit) */
  318. #define B53_VLAN_CTRL0 0x00
  319. #define VC0_8021PF_CTRL_MASK 0x3
  320. #define VC0_8021PF_CTRL_NONE 0x0
  321. #define VC0_8021PF_CTRL_CHANGE_PRI 0x1
  322. #define VC0_8021PF_CTRL_CHANGE_VID 0x2
  323. #define VC0_8021PF_CTRL_CHANGE_BOTH 0x3
  324. #define VC0_8021QF_CTRL_MASK 0xc
  325. #define VC0_8021QF_CTRL_CHANGE_PRI 0x1
  326. #define VC0_8021QF_CTRL_CHANGE_VID 0x2
  327. #define VC0_8021QF_CTRL_CHANGE_BOTH 0x3
  328. #define VC0_RESERVED_1 BIT(1)
  329. #define VC0_DROP_VID_MISS BIT(4)
  330. #define VC0_VID_HASH_VID BIT(5)
  331. #define VC0_VID_CHK_EN BIT(6) /* Use VID,DA or VID,SA */
  332. #define VC0_VLAN_EN BIT(7) /* 802.1Q VLAN Enabled */
  333. /* VLAN Control 1 (8 bit) */
  334. #define B53_VLAN_CTRL1 0x01
  335. #define VC1_RX_MCST_TAG_EN BIT(1)
  336. #define VC1_RX_MCST_FWD_EN BIT(2)
  337. #define VC1_RX_MCST_UNTAG_EN BIT(3)
  338. /* VLAN Control 2 (8 bit) */
  339. #define B53_VLAN_CTRL2 0x02
  340. /* VLAN Control 3 (8 bit when BCM5325, 16 bit else) */
  341. #define B53_VLAN_CTRL3 0x03
  342. #define B53_VLAN_CTRL3_63XX 0x04
  343. #define VC3_MAXSIZE_1532 BIT(6) /* 5325 only */
  344. #define VC3_HIGH_8BIT_EN BIT(7) /* 5325 only */
  345. /* VLAN Control 4 (8 bit) */
  346. #define B53_VLAN_CTRL4 0x05
  347. #define B53_VLAN_CTRL4_25 0x04
  348. #define B53_VLAN_CTRL4_63XX 0x06
  349. #define VC4_ING_VID_CHECK_S 6
  350. #define VC4_ING_VID_CHECK_MASK (0x3 << VC4_ING_VID_CHECK_S)
  351. #define VC4_ING_VID_VIO_FWD 0 /* forward, but do not learn */
  352. #define VC4_ING_VID_VIO_DROP 1 /* drop VID violations */
  353. #define VC4_NO_ING_VID_CHK 2 /* do not check */
  354. #define VC4_ING_VID_VIO_TO_IMP 3 /* redirect to MII port */
  355. /* VLAN Control 5 (8 bit) */
  356. #define B53_VLAN_CTRL5 0x06
  357. #define B53_VLAN_CTRL5_25 0x05
  358. #define B53_VLAN_CTRL5_63XX 0x07
  359. #define VC5_VID_FFF_EN BIT(2)
  360. #define VC5_DROP_VTABLE_MISS BIT(3)
  361. /* VLAN Control 6 (8 bit) */
  362. #define B53_VLAN_CTRL6 0x07
  363. #define B53_VLAN_CTRL6_63XX 0x08
  364. /* VLAN Table Access Register (16 bit) */
  365. #define B53_VLAN_TABLE_ACCESS_25 0x06 /* BCM5325E/5350 */
  366. #define B53_VLAN_TABLE_ACCESS_65 0x08 /* BCM5365 */
  367. #define VTA_VID_LOW_MASK_25 0xf
  368. #define VTA_VID_LOW_MASK_65 0xff
  369. #define VTA_VID_HIGH_S_25 4
  370. #define VTA_VID_HIGH_S_65 8
  371. #define VTA_VID_HIGH_MASK_25 (0xff << VTA_VID_HIGH_S_25E)
  372. #define VTA_VID_HIGH_MASK_65 (0xf << VTA_VID_HIGH_S_65)
  373. #define VTA_RW_STATE BIT(12)
  374. #define VTA_RW_STATE_RD 0
  375. #define VTA_RW_STATE_WR BIT(12)
  376. #define VTA_RW_OP_EN BIT(13)
  377. /* VLAN Read/Write Registers for (16/32 bit) */
  378. #define B53_VLAN_WRITE_25 0x08
  379. #define B53_VLAN_WRITE_65 0x0a
  380. #define B53_VLAN_READ 0x0c
  381. #define VA_MEMBER_MASK 0x3f
  382. #define VA_UNTAG_S_25 6
  383. #define VA_UNTAG_MASK_25 0x3f
  384. #define VA_UNTAG_S_65 7
  385. #define VA_UNTAG_MASK_65 0x1f
  386. #define VA_VID_HIGH_S 12
  387. #define VA_VID_HIGH_MASK (0xffff << VA_VID_HIGH_S)
  388. #define VA_VALID_25 BIT(20)
  389. #define VA_VALID_25_R4 BIT(24)
  390. #define VA_VALID_65 BIT(14)
  391. /* VLAN Port Default Tag (16 bit) */
  392. #define B53_VLAN_PORT_DEF_TAG(i) (0x10 + 2 * (i))
  393. /*************************************************************************
  394. * Jumbo Frame Page Registers
  395. *************************************************************************/
  396. /* Jumbo Enable Port Mask (bit i == port i enabled) (32 bit) */
  397. #define B53_JUMBO_PORT_MASK 0x01
  398. #define B53_JUMBO_PORT_MASK_63XX 0x04
  399. #define JPM_10_100_JUMBO_EN BIT(24) /* GigE always enabled */
  400. /* Good Frame Max Size without 802.1Q TAG (16 bit) */
  401. #define B53_JUMBO_MAX_SIZE 0x05
  402. #define B53_JUMBO_MAX_SIZE_63XX 0x08
  403. #define JMS_MIN_SIZE 1518
  404. #define JMS_MAX_SIZE 9724
  405. /*************************************************************************
  406. * EAP Page Registers
  407. *************************************************************************/
  408. #define B53_PORT_EAP_CONF(i) (0x20 + 8 * (i))
  409. #define EAP_MODE_SHIFT 51
  410. #define EAP_MODE_SHIFT_63XX 50
  411. #define EAP_MODE_MASK (0x3ull << EAP_MODE_SHIFT)
  412. #define EAP_MODE_MASK_63XX (0x3ull << EAP_MODE_SHIFT_63XX)
  413. #define EAP_MODE_BASIC 0
  414. #define EAP_MODE_SIMPLIFIED 3
  415. /*************************************************************************
  416. * EEE Configuration Page Registers
  417. *************************************************************************/
  418. /* EEE Enable control register (16 bit) */
  419. #define B53_EEE_EN_CTRL 0x00
  420. /* EEE LPI assert status register (16 bit) */
  421. #define B53_EEE_LPI_ASSERT_STS 0x02
  422. /* EEE LPI indicate status register (16 bit) */
  423. #define B53_EEE_LPI_INDICATE 0x4
  424. /* EEE Receiving idle symbols status register (16 bit) */
  425. #define B53_EEE_RX_IDLE_SYM_STS 0x6
  426. /* EEE Pipeline timer register (32 bit) */
  427. #define B53_EEE_PIP_TIMER 0xC
  428. /* EEE Sleep timer Gig register (32 bit) */
  429. #define B53_EEE_SLEEP_TIMER_GIG(i) (0x10 + 4 * (i))
  430. /* EEE Sleep timer FE register (32 bit) */
  431. #define B53_EEE_SLEEP_TIMER_FE(i) (0x34 + 4 * (i))
  432. /* EEE Minimum LP timer Gig register (32 bit) */
  433. #define B53_EEE_MIN_LP_TIMER_GIG(i) (0x58 + 4 * (i))
  434. /* EEE Minimum LP timer FE register (32 bit) */
  435. #define B53_EEE_MIN_LP_TIMER_FE(i) (0x7c + 4 * (i))
  436. /* EEE Wake timer Gig register (16 bit) */
  437. #define B53_EEE_WAKE_TIMER_GIG(i) (0xa0 + 2 * (i))
  438. /* EEE Wake timer FE register (16 bit) */
  439. #define B53_EEE_WAKE_TIMER_FE(i) (0xb2 + 2 * (i))
  440. /*************************************************************************
  441. * CFP Configuration Page Registers
  442. *************************************************************************/
  443. /* CFP Control Register with ports map (8 bit) */
  444. #define B53_CFP_CTRL 0x00
  445. #endif /* !__B53_REGS_H */