b53_regs.h 17 KB

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