ocelot_ana.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
  2. /*
  3. * Microsemi Ocelot Switch driver
  4. *
  5. * Copyright (c) 2017 Microsemi Corporation
  6. */
  7. #ifndef _MSCC_OCELOT_ANA_H_
  8. #define _MSCC_OCELOT_ANA_H_
  9. #define ANA_ANAGEFIL_B_DOM_EN BIT(22)
  10. #define ANA_ANAGEFIL_B_DOM_VAL BIT(21)
  11. #define ANA_ANAGEFIL_AGE_LOCKED BIT(20)
  12. #define ANA_ANAGEFIL_PID_EN BIT(19)
  13. #define ANA_ANAGEFIL_PID_VAL(x) (((x) << 14) & GENMASK(18, 14))
  14. #define ANA_ANAGEFIL_PID_VAL_M GENMASK(18, 14)
  15. #define ANA_ANAGEFIL_PID_VAL_X(x) (((x) & GENMASK(18, 14)) >> 14)
  16. #define ANA_ANAGEFIL_VID_EN BIT(13)
  17. #define ANA_ANAGEFIL_VID_VAL(x) ((x) & GENMASK(12, 0))
  18. #define ANA_ANAGEFIL_VID_VAL_M GENMASK(12, 0)
  19. #define ANA_STORMLIMIT_CFG_RSZ 0x4
  20. #define ANA_STORMLIMIT_CFG_STORM_RATE(x) (((x) << 3) & GENMASK(6, 3))
  21. #define ANA_STORMLIMIT_CFG_STORM_RATE_M GENMASK(6, 3)
  22. #define ANA_STORMLIMIT_CFG_STORM_RATE_X(x) (((x) & GENMASK(6, 3)) >> 3)
  23. #define ANA_STORMLIMIT_CFG_STORM_UNIT BIT(2)
  24. #define ANA_STORMLIMIT_CFG_STORM_MODE(x) ((x) & GENMASK(1, 0))
  25. #define ANA_STORMLIMIT_CFG_STORM_MODE_M GENMASK(1, 0)
  26. #define ANA_AUTOAGE_AGE_FAST BIT(21)
  27. #define ANA_AUTOAGE_AGE_PERIOD(x) (((x) << 1) & GENMASK(20, 1))
  28. #define ANA_AUTOAGE_AGE_PERIOD_M GENMASK(20, 1)
  29. #define ANA_AUTOAGE_AGE_PERIOD_X(x) (((x) & GENMASK(20, 1)) >> 1)
  30. #define ANA_AUTOAGE_AUTOAGE_LOCKED BIT(0)
  31. #define ANA_MACTOPTIONS_REDUCED_TABLE BIT(1)
  32. #define ANA_MACTOPTIONS_SHADOW BIT(0)
  33. #define ANA_AGENCTRL_FID_MASK(x) (((x) << 12) & GENMASK(23, 12))
  34. #define ANA_AGENCTRL_FID_MASK_M GENMASK(23, 12)
  35. #define ANA_AGENCTRL_FID_MASK_X(x) (((x) & GENMASK(23, 12)) >> 12)
  36. #define ANA_AGENCTRL_IGNORE_DMAC_FLAGS BIT(11)
  37. #define ANA_AGENCTRL_IGNORE_SMAC_FLAGS BIT(10)
  38. #define ANA_AGENCTRL_FLOOD_SPECIAL BIT(9)
  39. #define ANA_AGENCTRL_FLOOD_IGNORE_VLAN BIT(8)
  40. #define ANA_AGENCTRL_MIRROR_CPU BIT(7)
  41. #define ANA_AGENCTRL_LEARN_CPU_COPY BIT(6)
  42. #define ANA_AGENCTRL_LEARN_FWD_KILL BIT(5)
  43. #define ANA_AGENCTRL_LEARN_IGNORE_VLAN BIT(4)
  44. #define ANA_AGENCTRL_CPU_CPU_KILL_ENA BIT(3)
  45. #define ANA_AGENCTRL_GREEN_COUNT_MODE BIT(2)
  46. #define ANA_AGENCTRL_YELLOW_COUNT_MODE BIT(1)
  47. #define ANA_AGENCTRL_RED_COUNT_MODE BIT(0)
  48. #define ANA_FLOODING_RSZ 0x4
  49. #define ANA_FLOODING_FLD_UNICAST(x) (((x) << 12) & GENMASK(17, 12))
  50. #define ANA_FLOODING_FLD_UNICAST_M GENMASK(17, 12)
  51. #define ANA_FLOODING_FLD_UNICAST_X(x) (((x) & GENMASK(17, 12)) >> 12)
  52. #define ANA_FLOODING_FLD_BROADCAST(x) (((x) << 6) & GENMASK(11, 6))
  53. #define ANA_FLOODING_FLD_BROADCAST_M GENMASK(11, 6)
  54. #define ANA_FLOODING_FLD_BROADCAST_X(x) (((x) & GENMASK(11, 6)) >> 6)
  55. #define ANA_FLOODING_FLD_MULTICAST(x) ((x) & GENMASK(5, 0))
  56. #define ANA_FLOODING_FLD_MULTICAST_M GENMASK(5, 0)
  57. #define ANA_FLOODING_IPMC_FLD_MC4_CTRL(x) (((x) << 18) & GENMASK(23, 18))
  58. #define ANA_FLOODING_IPMC_FLD_MC4_CTRL_M GENMASK(23, 18)
  59. #define ANA_FLOODING_IPMC_FLD_MC4_CTRL_X(x) (((x) & GENMASK(23, 18)) >> 18)
  60. #define ANA_FLOODING_IPMC_FLD_MC4_DATA(x) (((x) << 12) & GENMASK(17, 12))
  61. #define ANA_FLOODING_IPMC_FLD_MC4_DATA_M GENMASK(17, 12)
  62. #define ANA_FLOODING_IPMC_FLD_MC4_DATA_X(x) (((x) & GENMASK(17, 12)) >> 12)
  63. #define ANA_FLOODING_IPMC_FLD_MC6_CTRL(x) (((x) << 6) & GENMASK(11, 6))
  64. #define ANA_FLOODING_IPMC_FLD_MC6_CTRL_M GENMASK(11, 6)
  65. #define ANA_FLOODING_IPMC_FLD_MC6_CTRL_X(x) (((x) & GENMASK(11, 6)) >> 6)
  66. #define ANA_FLOODING_IPMC_FLD_MC6_DATA(x) ((x) & GENMASK(5, 0))
  67. #define ANA_FLOODING_IPMC_FLD_MC6_DATA_M GENMASK(5, 0)
  68. #define ANA_SFLOW_CFG_RSZ 0x4
  69. #define ANA_SFLOW_CFG_SF_RATE(x) (((x) << 2) & GENMASK(13, 2))
  70. #define ANA_SFLOW_CFG_SF_RATE_M GENMASK(13, 2)
  71. #define ANA_SFLOW_CFG_SF_RATE_X(x) (((x) & GENMASK(13, 2)) >> 2)
  72. #define ANA_SFLOW_CFG_SF_SAMPLE_RX BIT(1)
  73. #define ANA_SFLOW_CFG_SF_SAMPLE_TX BIT(0)
  74. #define ANA_PORT_MODE_RSZ 0x4
  75. #define ANA_PORT_MODE_REDTAG_PARSE_CFG BIT(3)
  76. #define ANA_PORT_MODE_VLAN_PARSE_CFG(x) (((x) << 1) & GENMASK(2, 1))
  77. #define ANA_PORT_MODE_VLAN_PARSE_CFG_M GENMASK(2, 1)
  78. #define ANA_PORT_MODE_VLAN_PARSE_CFG_X(x) (((x) & GENMASK(2, 1)) >> 1)
  79. #define ANA_PORT_MODE_L3_PARSE_CFG BIT(0)
  80. #define ANA_CUT_THRU_CFG_RSZ 0x4
  81. #define ANA_PGID_PGID_RSZ 0x4
  82. #define ANA_PGID_PGID_PGID(x) ((x) & GENMASK(11, 0))
  83. #define ANA_PGID_PGID_PGID_M GENMASK(11, 0)
  84. #define ANA_PGID_PGID_CPUQ_DST_PGID(x) (((x) << 27) & GENMASK(29, 27))
  85. #define ANA_PGID_PGID_CPUQ_DST_PGID_M GENMASK(29, 27)
  86. #define ANA_PGID_PGID_CPUQ_DST_PGID_X(x) (((x) & GENMASK(29, 27)) >> 27)
  87. #define ANA_TABLES_MACHDATA_VID(x) (((x) << 16) & GENMASK(28, 16))
  88. #define ANA_TABLES_MACHDATA_VID_M GENMASK(28, 16)
  89. #define ANA_TABLES_MACHDATA_VID_X(x) (((x) & GENMASK(28, 16)) >> 16)
  90. #define ANA_TABLES_MACHDATA_MACHDATA(x) ((x) & GENMASK(15, 0))
  91. #define ANA_TABLES_MACHDATA_MACHDATA_M GENMASK(15, 0)
  92. #define ANA_TABLES_STREAMDATA_SSID_VALID BIT(16)
  93. #define ANA_TABLES_STREAMDATA_SSID(x) (((x) << 9) & GENMASK(15, 9))
  94. #define ANA_TABLES_STREAMDATA_SSID_M GENMASK(15, 9)
  95. #define ANA_TABLES_STREAMDATA_SSID_X(x) (((x) & GENMASK(15, 9)) >> 9)
  96. #define ANA_TABLES_STREAMDATA_SFID_VALID BIT(8)
  97. #define ANA_TABLES_STREAMDATA_SFID(x) ((x) & GENMASK(7, 0))
  98. #define ANA_TABLES_STREAMDATA_SFID_M GENMASK(7, 0)
  99. #define ANA_TABLES_MACACCESS_MAC_CPU_COPY BIT(15)
  100. #define ANA_TABLES_MACACCESS_SRC_KILL BIT(14)
  101. #define ANA_TABLES_MACACCESS_IGNORE_VLAN BIT(13)
  102. #define ANA_TABLES_MACACCESS_AGED_FLAG BIT(12)
  103. #define ANA_TABLES_MACACCESS_VALID BIT(11)
  104. #define ANA_TABLES_MACACCESS_ENTRYTYPE(x) (((x) << 9) & GENMASK(10, 9))
  105. #define ANA_TABLES_MACACCESS_ENTRYTYPE_M GENMASK(10, 9)
  106. #define ANA_TABLES_MACACCESS_ENTRYTYPE_X(x) (((x) & GENMASK(10, 9)) >> 9)
  107. #define ANA_TABLES_MACACCESS_DEST_IDX(x) (((x) << 3) & GENMASK(8, 3))
  108. #define ANA_TABLES_MACACCESS_DEST_IDX_M GENMASK(8, 3)
  109. #define ANA_TABLES_MACACCESS_DEST_IDX_X(x) (((x) & GENMASK(8, 3)) >> 3)
  110. #define ANA_TABLES_MACACCESS_MAC_TABLE_CMD(x) ((x) & GENMASK(2, 0))
  111. #define ANA_TABLES_MACACCESS_MAC_TABLE_CMD_M GENMASK(2, 0)
  112. #define MACACCESS_CMD_IDLE 0
  113. #define MACACCESS_CMD_LEARN 1
  114. #define MACACCESS_CMD_FORGET 2
  115. #define MACACCESS_CMD_AGE 3
  116. #define MACACCESS_CMD_GET_NEXT 4
  117. #define MACACCESS_CMD_INIT 5
  118. #define MACACCESS_CMD_READ 6
  119. #define MACACCESS_CMD_WRITE 7
  120. #define ANA_TABLES_VLANACCESS_VLAN_PORT_MASK(x) (((x) << 2) & GENMASK(13, 2))
  121. #define ANA_TABLES_VLANACCESS_VLAN_PORT_MASK_M GENMASK(13, 2)
  122. #define ANA_TABLES_VLANACCESS_VLAN_PORT_MASK_X(x) (((x) & GENMASK(13, 2)) >> 2)
  123. #define ANA_TABLES_VLANACCESS_VLAN_TBL_CMD(x) ((x) & GENMASK(1, 0))
  124. #define ANA_TABLES_VLANACCESS_VLAN_TBL_CMD_M GENMASK(1, 0)
  125. #define ANA_TABLES_VLANACCESS_CMD_IDLE 0x0
  126. #define ANA_TABLES_VLANACCESS_CMD_WRITE 0x2
  127. #define ANA_TABLES_VLANACCESS_CMD_INIT 0x3
  128. #define ANA_TABLES_VLANTIDX_VLAN_SEC_FWD_ENA BIT(17)
  129. #define ANA_TABLES_VLANTIDX_VLAN_FLOOD_DIS BIT(16)
  130. #define ANA_TABLES_VLANTIDX_VLAN_PRIV_VLAN BIT(15)
  131. #define ANA_TABLES_VLANTIDX_VLAN_LEARN_DISABLED BIT(14)
  132. #define ANA_TABLES_VLANTIDX_VLAN_MIRROR BIT(13)
  133. #define ANA_TABLES_VLANTIDX_VLAN_SRC_CHK BIT(12)
  134. #define ANA_TABLES_VLANTIDX_V_INDEX(x) ((x) & GENMASK(11, 0))
  135. #define ANA_TABLES_VLANTIDX_V_INDEX_M GENMASK(11, 0)
  136. #define ANA_TABLES_ISDXACCESS_ISDX_PORT_MASK(x) (((x) << 2) & GENMASK(8, 2))
  137. #define ANA_TABLES_ISDXACCESS_ISDX_PORT_MASK_M GENMASK(8, 2)
  138. #define ANA_TABLES_ISDXACCESS_ISDX_PORT_MASK_X(x) (((x) & GENMASK(8, 2)) >> 2)
  139. #define ANA_TABLES_ISDXACCESS_ISDX_TBL_CMD(x) ((x) & GENMASK(1, 0))
  140. #define ANA_TABLES_ISDXACCESS_ISDX_TBL_CMD_M GENMASK(1, 0)
  141. #define ANA_TABLES_ISDXTIDX_ISDX_SDLBI(x) (((x) << 21) & GENMASK(28, 21))
  142. #define ANA_TABLES_ISDXTIDX_ISDX_SDLBI_M GENMASK(28, 21)
  143. #define ANA_TABLES_ISDXTIDX_ISDX_SDLBI_X(x) (((x) & GENMASK(28, 21)) >> 21)
  144. #define ANA_TABLES_ISDXTIDX_ISDX_MSTI(x) (((x) << 15) & GENMASK(20, 15))
  145. #define ANA_TABLES_ISDXTIDX_ISDX_MSTI_M GENMASK(20, 15)
  146. #define ANA_TABLES_ISDXTIDX_ISDX_MSTI_X(x) (((x) & GENMASK(20, 15)) >> 15)
  147. #define ANA_TABLES_ISDXTIDX_ISDX_ES0_KEY_ENA BIT(14)
  148. #define ANA_TABLES_ISDXTIDX_ISDX_FORCE_ENA BIT(10)
  149. #define ANA_TABLES_ISDXTIDX_ISDX_INDEX(x) ((x) & GENMASK(7, 0))
  150. #define ANA_TABLES_ISDXTIDX_ISDX_INDEX_M GENMASK(7, 0)
  151. #define ANA_TABLES_ENTRYLIM_RSZ 0x4
  152. #define ANA_TABLES_ENTRYLIM_ENTRYLIM(x) (((x) << 14) & GENMASK(17, 14))
  153. #define ANA_TABLES_ENTRYLIM_ENTRYLIM_M GENMASK(17, 14)
  154. #define ANA_TABLES_ENTRYLIM_ENTRYLIM_X(x) (((x) & GENMASK(17, 14)) >> 14)
  155. #define ANA_TABLES_ENTRYLIM_ENTRYSTAT(x) ((x) & GENMASK(13, 0))
  156. #define ANA_TABLES_ENTRYLIM_ENTRYSTAT_M GENMASK(13, 0)
  157. #define ANA_TABLES_STREAMACCESS_GEN_REC_SEQ_NUM(x) (((x) << 4) & GENMASK(31, 4))
  158. #define ANA_TABLES_STREAMACCESS_GEN_REC_SEQ_NUM_M GENMASK(31, 4)
  159. #define ANA_TABLES_STREAMACCESS_GEN_REC_SEQ_NUM_X(x) (((x) & GENMASK(31, 4)) >> 4)
  160. #define ANA_TABLES_STREAMACCESS_SEQ_GEN_REC_ENA BIT(3)
  161. #define ANA_TABLES_STREAMACCESS_GEN_REC_TYPE BIT(2)
  162. #define ANA_TABLES_STREAMACCESS_STREAM_TBL_CMD(x) ((x) & GENMASK(1, 0))
  163. #define ANA_TABLES_STREAMACCESS_STREAM_TBL_CMD_M GENMASK(1, 0)
  164. #define ANA_TABLES_STREAMTIDX_SEQ_GEN_ERR_STATUS(x) (((x) << 30) & GENMASK(31, 30))
  165. #define ANA_TABLES_STREAMTIDX_SEQ_GEN_ERR_STATUS_M GENMASK(31, 30)
  166. #define ANA_TABLES_STREAMTIDX_SEQ_GEN_ERR_STATUS_X(x) (((x) & GENMASK(31, 30)) >> 30)
  167. #define ANA_TABLES_STREAMTIDX_S_INDEX(x) (((x) << 16) & GENMASK(22, 16))
  168. #define ANA_TABLES_STREAMTIDX_S_INDEX_M GENMASK(22, 16)
  169. #define ANA_TABLES_STREAMTIDX_S_INDEX_X(x) (((x) & GENMASK(22, 16)) >> 16)
  170. #define ANA_TABLES_STREAMTIDX_FORCE_SF_BEHAVIOUR BIT(14)
  171. #define ANA_TABLES_STREAMTIDX_SEQ_HISTORY_LEN(x) (((x) << 8) & GENMASK(13, 8))
  172. #define ANA_TABLES_STREAMTIDX_SEQ_HISTORY_LEN_M GENMASK(13, 8)
  173. #define ANA_TABLES_STREAMTIDX_SEQ_HISTORY_LEN_X(x) (((x) & GENMASK(13, 8)) >> 8)
  174. #define ANA_TABLES_STREAMTIDX_RESET_ON_ROGUE BIT(7)
  175. #define ANA_TABLES_STREAMTIDX_REDTAG_POP BIT(6)
  176. #define ANA_TABLES_STREAMTIDX_STREAM_SPLIT BIT(5)
  177. #define ANA_TABLES_STREAMTIDX_SEQ_SPACE_LOG2(x) ((x) & GENMASK(4, 0))
  178. #define ANA_TABLES_STREAMTIDX_SEQ_SPACE_LOG2_M GENMASK(4, 0)
  179. #define ANA_TABLES_SEQ_MASK_SPLIT_MASK(x) (((x) << 16) & GENMASK(22, 16))
  180. #define ANA_TABLES_SEQ_MASK_SPLIT_MASK_M GENMASK(22, 16)
  181. #define ANA_TABLES_SEQ_MASK_SPLIT_MASK_X(x) (((x) & GENMASK(22, 16)) >> 16)
  182. #define ANA_TABLES_SEQ_MASK_INPUT_PORT_MASK(x) ((x) & GENMASK(6, 0))
  183. #define ANA_TABLES_SEQ_MASK_INPUT_PORT_MASK_M GENMASK(6, 0)
  184. #define ANA_TABLES_SFID_MASK_IGR_PORT_MASK(x) (((x) << 1) & GENMASK(7, 1))
  185. #define ANA_TABLES_SFID_MASK_IGR_PORT_MASK_M GENMASK(7, 1)
  186. #define ANA_TABLES_SFID_MASK_IGR_PORT_MASK_X(x) (((x) & GENMASK(7, 1)) >> 1)
  187. #define ANA_TABLES_SFID_MASK_IGR_SRCPORT_MATCH_ENA BIT(0)
  188. #define ANA_TABLES_SFIDACCESS_IGR_PRIO_MATCH_ENA BIT(22)
  189. #define ANA_TABLES_SFIDACCESS_IGR_PRIO(x) (((x) << 19) & GENMASK(21, 19))
  190. #define ANA_TABLES_SFIDACCESS_IGR_PRIO_M GENMASK(21, 19)
  191. #define ANA_TABLES_SFIDACCESS_IGR_PRIO_X(x) (((x) & GENMASK(21, 19)) >> 19)
  192. #define ANA_TABLES_SFIDACCESS_FORCE_BLOCK BIT(18)
  193. #define ANA_TABLES_SFIDACCESS_MAX_SDU_LEN(x) (((x) << 2) & GENMASK(17, 2))
  194. #define ANA_TABLES_SFIDACCESS_MAX_SDU_LEN_M GENMASK(17, 2)
  195. #define ANA_TABLES_SFIDACCESS_MAX_SDU_LEN_X(x) (((x) & GENMASK(17, 2)) >> 2)
  196. #define ANA_TABLES_SFIDACCESS_SFID_TBL_CMD(x) ((x) & GENMASK(1, 0))
  197. #define ANA_TABLES_SFIDACCESS_SFID_TBL_CMD_M GENMASK(1, 0)
  198. #define ANA_TABLES_SFIDTIDX_SGID_VALID BIT(26)
  199. #define ANA_TABLES_SFIDTIDX_SGID(x) (((x) << 18) & GENMASK(25, 18))
  200. #define ANA_TABLES_SFIDTIDX_SGID_M GENMASK(25, 18)
  201. #define ANA_TABLES_SFIDTIDX_SGID_X(x) (((x) & GENMASK(25, 18)) >> 18)
  202. #define ANA_TABLES_SFIDTIDX_POL_ENA BIT(17)
  203. #define ANA_TABLES_SFIDTIDX_POL_IDX(x) (((x) << 8) & GENMASK(16, 8))
  204. #define ANA_TABLES_SFIDTIDX_POL_IDX_M GENMASK(16, 8)
  205. #define ANA_TABLES_SFIDTIDX_POL_IDX_X(x) (((x) & GENMASK(16, 8)) >> 8)
  206. #define ANA_TABLES_SFIDTIDX_SFID_INDEX(x) ((x) & GENMASK(7, 0))
  207. #define ANA_TABLES_SFIDTIDX_SFID_INDEX_M GENMASK(7, 0)
  208. #define ANA_MSTI_STATE_RSZ 0x4
  209. #define ANA_OAM_UPM_LM_CNT_RSZ 0x4
  210. #define ANA_SG_ACCESS_CTRL_SGID(x) ((x) & GENMASK(7, 0))
  211. #define ANA_SG_ACCESS_CTRL_SGID_M GENMASK(7, 0)
  212. #define ANA_SG_ACCESS_CTRL_CONFIG_CHANGE BIT(28)
  213. #define ANA_SG_CONFIG_REG_3_BASE_TIME_SEC_MSB(x) ((x) & GENMASK(15, 0))
  214. #define ANA_SG_CONFIG_REG_3_BASE_TIME_SEC_MSB_M GENMASK(15, 0)
  215. #define ANA_SG_CONFIG_REG_3_LIST_LENGTH(x) (((x) << 16) & GENMASK(18, 16))
  216. #define ANA_SG_CONFIG_REG_3_LIST_LENGTH_M GENMASK(18, 16)
  217. #define ANA_SG_CONFIG_REG_3_LIST_LENGTH_X(x) (((x) & GENMASK(18, 16)) >> 16)
  218. #define ANA_SG_CONFIG_REG_3_GATE_ENABLE BIT(20)
  219. #define ANA_SG_CONFIG_REG_3_INIT_IPS(x) (((x) << 24) & GENMASK(27, 24))
  220. #define ANA_SG_CONFIG_REG_3_INIT_IPS_M GENMASK(27, 24)
  221. #define ANA_SG_CONFIG_REG_3_INIT_IPS_X(x) (((x) & GENMASK(27, 24)) >> 24)
  222. #define ANA_SG_CONFIG_REG_3_INIT_GATE_STATE BIT(28)
  223. #define ANA_SG_GCL_GS_CONFIG_RSZ 0x4
  224. #define ANA_SG_GCL_GS_CONFIG_IPS(x) ((x) & GENMASK(3, 0))
  225. #define ANA_SG_GCL_GS_CONFIG_IPS_M GENMASK(3, 0)
  226. #define ANA_SG_GCL_GS_CONFIG_GATE_STATE BIT(4)
  227. #define ANA_SG_GCL_TI_CONFIG_RSZ 0x4
  228. #define ANA_SG_STATUS_REG_3_CFG_CHG_TIME_SEC_MSB(x) ((x) & GENMASK(15, 0))
  229. #define ANA_SG_STATUS_REG_3_CFG_CHG_TIME_SEC_MSB_M GENMASK(15, 0)
  230. #define ANA_SG_STATUS_REG_3_GATE_STATE BIT(16)
  231. #define ANA_SG_STATUS_REG_3_IPS(x) (((x) << 20) & GENMASK(23, 20))
  232. #define ANA_SG_STATUS_REG_3_IPS_M GENMASK(23, 20)
  233. #define ANA_SG_STATUS_REG_3_IPS_X(x) (((x) & GENMASK(23, 20)) >> 20)
  234. #define ANA_SG_STATUS_REG_3_CONFIG_PENDING BIT(24)
  235. #define ANA_PORT_VLAN_CFG_GSZ 0x100
  236. #define ANA_PORT_VLAN_CFG_VLAN_VID_AS_ISDX BIT(21)
  237. #define ANA_PORT_VLAN_CFG_VLAN_AWARE_ENA BIT(20)
  238. #define ANA_PORT_VLAN_CFG_VLAN_POP_CNT(x) (((x) << 18) & GENMASK(19, 18))
  239. #define ANA_PORT_VLAN_CFG_VLAN_POP_CNT_M GENMASK(19, 18)
  240. #define ANA_PORT_VLAN_CFG_VLAN_POP_CNT_X(x) (((x) & GENMASK(19, 18)) >> 18)
  241. #define ANA_PORT_VLAN_CFG_VLAN_INNER_TAG_ENA BIT(17)
  242. #define ANA_PORT_VLAN_CFG_VLAN_TAG_TYPE BIT(16)
  243. #define ANA_PORT_VLAN_CFG_VLAN_DEI BIT(15)
  244. #define ANA_PORT_VLAN_CFG_VLAN_PCP(x) (((x) << 12) & GENMASK(14, 12))
  245. #define ANA_PORT_VLAN_CFG_VLAN_PCP_M GENMASK(14, 12)
  246. #define ANA_PORT_VLAN_CFG_VLAN_PCP_X(x) (((x) & GENMASK(14, 12)) >> 12)
  247. #define ANA_PORT_VLAN_CFG_VLAN_VID(x) ((x) & GENMASK(11, 0))
  248. #define ANA_PORT_VLAN_CFG_VLAN_VID_M GENMASK(11, 0)
  249. #define ANA_PORT_DROP_CFG_GSZ 0x100
  250. #define ANA_PORT_DROP_CFG_DROP_UNTAGGED_ENA BIT(6)
  251. #define ANA_PORT_DROP_CFG_DROP_S_TAGGED_ENA BIT(5)
  252. #define ANA_PORT_DROP_CFG_DROP_C_TAGGED_ENA BIT(4)
  253. #define ANA_PORT_DROP_CFG_DROP_PRIO_S_TAGGED_ENA BIT(3)
  254. #define ANA_PORT_DROP_CFG_DROP_PRIO_C_TAGGED_ENA BIT(2)
  255. #define ANA_PORT_DROP_CFG_DROP_NULL_MAC_ENA BIT(1)
  256. #define ANA_PORT_DROP_CFG_DROP_MC_SMAC_ENA BIT(0)
  257. #define ANA_PORT_QOS_CFG_GSZ 0x100
  258. #define ANA_PORT_QOS_CFG_DP_DEFAULT_VAL BIT(8)
  259. #define ANA_PORT_QOS_CFG_QOS_DEFAULT_VAL(x) (((x) << 5) & GENMASK(7, 5))
  260. #define ANA_PORT_QOS_CFG_QOS_DEFAULT_VAL_M GENMASK(7, 5)
  261. #define ANA_PORT_QOS_CFG_QOS_DEFAULT_VAL_X(x) (((x) & GENMASK(7, 5)) >> 5)
  262. #define ANA_PORT_QOS_CFG_QOS_DSCP_ENA BIT(4)
  263. #define ANA_PORT_QOS_CFG_QOS_PCP_ENA BIT(3)
  264. #define ANA_PORT_QOS_CFG_DSCP_TRANSLATE_ENA BIT(2)
  265. #define ANA_PORT_QOS_CFG_DSCP_REWR_CFG(x) ((x) & GENMASK(1, 0))
  266. #define ANA_PORT_QOS_CFG_DSCP_REWR_CFG_M GENMASK(1, 0)
  267. #define ANA_PORT_VCAP_CFG_GSZ 0x100
  268. #define ANA_PORT_VCAP_CFG_S1_ENA BIT(14)
  269. #define ANA_PORT_VCAP_CFG_S1_DMAC_DIP_ENA(x) (((x) << 11) & GENMASK(13, 11))
  270. #define ANA_PORT_VCAP_CFG_S1_DMAC_DIP_ENA_M GENMASK(13, 11)
  271. #define ANA_PORT_VCAP_CFG_S1_DMAC_DIP_ENA_X(x) (((x) & GENMASK(13, 11)) >> 11)
  272. #define ANA_PORT_VCAP_CFG_S1_VLAN_INNER_TAG_ENA(x) (((x) << 8) & GENMASK(10, 8))
  273. #define ANA_PORT_VCAP_CFG_S1_VLAN_INNER_TAG_ENA_M GENMASK(10, 8)
  274. #define ANA_PORT_VCAP_CFG_S1_VLAN_INNER_TAG_ENA_X(x) (((x) & GENMASK(10, 8)) >> 8)
  275. #define ANA_PORT_VCAP_CFG_PAG_VAL(x) ((x) & GENMASK(7, 0))
  276. #define ANA_PORT_VCAP_CFG_PAG_VAL_M GENMASK(7, 0)
  277. #define ANA_PORT_VCAP_S1_KEY_CFG_GSZ 0x100
  278. #define ANA_PORT_VCAP_S1_KEY_CFG_RSZ 0x4
  279. #define ANA_PORT_VCAP_S1_KEY_CFG_S1_KEY_IP6_CFG(x) (((x) << 4) & GENMASK(6, 4))
  280. #define ANA_PORT_VCAP_S1_KEY_CFG_S1_KEY_IP6_CFG_M GENMASK(6, 4)
  281. #define ANA_PORT_VCAP_S1_KEY_CFG_S1_KEY_IP6_CFG_X(x) (((x) & GENMASK(6, 4)) >> 4)
  282. #define ANA_PORT_VCAP_S1_KEY_CFG_S1_KEY_IP4_CFG(x) (((x) << 2) & GENMASK(3, 2))
  283. #define ANA_PORT_VCAP_S1_KEY_CFG_S1_KEY_IP4_CFG_M GENMASK(3, 2)
  284. #define ANA_PORT_VCAP_S1_KEY_CFG_S1_KEY_IP4_CFG_X(x) (((x) & GENMASK(3, 2)) >> 2)
  285. #define ANA_PORT_VCAP_S1_KEY_CFG_S1_KEY_OTHER_CFG(x) ((x) & GENMASK(1, 0))
  286. #define ANA_PORT_VCAP_S1_KEY_CFG_S1_KEY_OTHER_CFG_M GENMASK(1, 0)
  287. #define ANA_PORT_VCAP_S2_CFG_GSZ 0x100
  288. #define ANA_PORT_VCAP_S2_CFG_S2_UDP_PAYLOAD_ENA(x) (((x) << 17) & GENMASK(18, 17))
  289. #define ANA_PORT_VCAP_S2_CFG_S2_UDP_PAYLOAD_ENA_M GENMASK(18, 17)
  290. #define ANA_PORT_VCAP_S2_CFG_S2_UDP_PAYLOAD_ENA_X(x) (((x) & GENMASK(18, 17)) >> 17)
  291. #define ANA_PORT_VCAP_S2_CFG_S2_ETYPE_PAYLOAD_ENA(x) (((x) << 15) & GENMASK(16, 15))
  292. #define ANA_PORT_VCAP_S2_CFG_S2_ETYPE_PAYLOAD_ENA_M GENMASK(16, 15)
  293. #define ANA_PORT_VCAP_S2_CFG_S2_ETYPE_PAYLOAD_ENA_X(x) (((x) & GENMASK(16, 15)) >> 15)
  294. #define ANA_PORT_VCAP_S2_CFG_S2_ENA BIT(14)
  295. #define ANA_PORT_VCAP_S2_CFG_S2_SNAP_DIS(x) (((x) << 12) & GENMASK(13, 12))
  296. #define ANA_PORT_VCAP_S2_CFG_S2_SNAP_DIS_M GENMASK(13, 12)
  297. #define ANA_PORT_VCAP_S2_CFG_S2_SNAP_DIS_X(x) (((x) & GENMASK(13, 12)) >> 12)
  298. #define ANA_PORT_VCAP_S2_CFG_S2_ARP_DIS(x) (((x) << 10) & GENMASK(11, 10))
  299. #define ANA_PORT_VCAP_S2_CFG_S2_ARP_DIS_M GENMASK(11, 10)
  300. #define ANA_PORT_VCAP_S2_CFG_S2_ARP_DIS_X(x) (((x) & GENMASK(11, 10)) >> 10)
  301. #define ANA_PORT_VCAP_S2_CFG_S2_IP_TCPUDP_DIS(x) (((x) << 8) & GENMASK(9, 8))
  302. #define ANA_PORT_VCAP_S2_CFG_S2_IP_TCPUDP_DIS_M GENMASK(9, 8)
  303. #define ANA_PORT_VCAP_S2_CFG_S2_IP_TCPUDP_DIS_X(x) (((x) & GENMASK(9, 8)) >> 8)
  304. #define ANA_PORT_VCAP_S2_CFG_S2_IP_OTHER_DIS(x) (((x) << 6) & GENMASK(7, 6))
  305. #define ANA_PORT_VCAP_S2_CFG_S2_IP_OTHER_DIS_M GENMASK(7, 6)
  306. #define ANA_PORT_VCAP_S2_CFG_S2_IP_OTHER_DIS_X(x) (((x) & GENMASK(7, 6)) >> 6)
  307. #define ANA_PORT_VCAP_S2_CFG_S2_IP6_CFG(x) (((x) << 2) & GENMASK(5, 2))
  308. #define ANA_PORT_VCAP_S2_CFG_S2_IP6_CFG_M GENMASK(5, 2)
  309. #define ANA_PORT_VCAP_S2_CFG_S2_IP6_CFG_X(x) (((x) & GENMASK(5, 2)) >> 2)
  310. #define ANA_PORT_VCAP_S2_CFG_S2_OAM_DIS(x) ((x) & GENMASK(1, 0))
  311. #define ANA_PORT_VCAP_S2_CFG_S2_OAM_DIS_M GENMASK(1, 0)
  312. #define ANA_PORT_PCP_DEI_MAP_GSZ 0x100
  313. #define ANA_PORT_PCP_DEI_MAP_RSZ 0x4
  314. #define ANA_PORT_PCP_DEI_MAP_DP_PCP_DEI_VAL BIT(3)
  315. #define ANA_PORT_PCP_DEI_MAP_QOS_PCP_DEI_VAL(x) ((x) & GENMASK(2, 0))
  316. #define ANA_PORT_PCP_DEI_MAP_QOS_PCP_DEI_VAL_M GENMASK(2, 0)
  317. #define ANA_PORT_CPU_FWD_CFG_GSZ 0x100
  318. #define ANA_PORT_CPU_FWD_CFG_CPU_VRAP_REDIR_ENA BIT(7)
  319. #define ANA_PORT_CPU_FWD_CFG_CPU_MLD_REDIR_ENA BIT(6)
  320. #define ANA_PORT_CPU_FWD_CFG_CPU_IGMP_REDIR_ENA BIT(5)
  321. #define ANA_PORT_CPU_FWD_CFG_CPU_IPMC_CTRL_COPY_ENA BIT(4)
  322. #define ANA_PORT_CPU_FWD_CFG_CPU_SRC_COPY_ENA BIT(3)
  323. #define ANA_PORT_CPU_FWD_CFG_CPU_ALLBRIDGE_DROP_ENA BIT(2)
  324. #define ANA_PORT_CPU_FWD_CFG_CPU_ALLBRIDGE_REDIR_ENA BIT(1)
  325. #define ANA_PORT_CPU_FWD_CFG_CPU_OAM_ENA BIT(0)
  326. #define ANA_PORT_CPU_FWD_BPDU_CFG_GSZ 0x100
  327. #define ANA_PORT_CPU_FWD_BPDU_CFG_BPDU_DROP_ENA(x) (((x) << 16) & GENMASK(31, 16))
  328. #define ANA_PORT_CPU_FWD_BPDU_CFG_BPDU_DROP_ENA_M GENMASK(31, 16)
  329. #define ANA_PORT_CPU_FWD_BPDU_CFG_BPDU_DROP_ENA_X(x) (((x) & GENMASK(31, 16)) >> 16)
  330. #define ANA_PORT_CPU_FWD_BPDU_CFG_BPDU_REDIR_ENA(x) ((x) & GENMASK(15, 0))
  331. #define ANA_PORT_CPU_FWD_BPDU_CFG_BPDU_REDIR_ENA_M GENMASK(15, 0)
  332. #define ANA_PORT_CPU_FWD_GARP_CFG_GSZ 0x100
  333. #define ANA_PORT_CPU_FWD_GARP_CFG_GARP_DROP_ENA(x) (((x) << 16) & GENMASK(31, 16))
  334. #define ANA_PORT_CPU_FWD_GARP_CFG_GARP_DROP_ENA_M GENMASK(31, 16)
  335. #define ANA_PORT_CPU_FWD_GARP_CFG_GARP_DROP_ENA_X(x) (((x) & GENMASK(31, 16)) >> 16)
  336. #define ANA_PORT_CPU_FWD_GARP_CFG_GARP_REDIR_ENA(x) ((x) & GENMASK(15, 0))
  337. #define ANA_PORT_CPU_FWD_GARP_CFG_GARP_REDIR_ENA_M GENMASK(15, 0)
  338. #define ANA_PORT_CPU_FWD_CCM_CFG_GSZ 0x100
  339. #define ANA_PORT_CPU_FWD_CCM_CFG_CCM_DROP_ENA(x) (((x) << 16) & GENMASK(31, 16))
  340. #define ANA_PORT_CPU_FWD_CCM_CFG_CCM_DROP_ENA_M GENMASK(31, 16)
  341. #define ANA_PORT_CPU_FWD_CCM_CFG_CCM_DROP_ENA_X(x) (((x) & GENMASK(31, 16)) >> 16)
  342. #define ANA_PORT_CPU_FWD_CCM_CFG_CCM_REDIR_ENA(x) ((x) & GENMASK(15, 0))
  343. #define ANA_PORT_CPU_FWD_CCM_CFG_CCM_REDIR_ENA_M GENMASK(15, 0)
  344. #define ANA_PORT_PORT_CFG_GSZ 0x100
  345. #define ANA_PORT_PORT_CFG_SRC_MIRROR_ENA BIT(15)
  346. #define ANA_PORT_PORT_CFG_LIMIT_DROP BIT(14)
  347. #define ANA_PORT_PORT_CFG_LIMIT_CPU BIT(13)
  348. #define ANA_PORT_PORT_CFG_LOCKED_PORTMOVE_DROP BIT(12)
  349. #define ANA_PORT_PORT_CFG_LOCKED_PORTMOVE_CPU BIT(11)
  350. #define ANA_PORT_PORT_CFG_LEARNDROP BIT(10)
  351. #define ANA_PORT_PORT_CFG_LEARNCPU BIT(9)
  352. #define ANA_PORT_PORT_CFG_LEARNAUTO BIT(8)
  353. #define ANA_PORT_PORT_CFG_LEARN_ENA BIT(7)
  354. #define ANA_PORT_PORT_CFG_RECV_ENA BIT(6)
  355. #define ANA_PORT_PORT_CFG_PORTID_VAL(x) (((x) << 2) & GENMASK(5, 2))
  356. #define ANA_PORT_PORT_CFG_PORTID_VAL_M GENMASK(5, 2)
  357. #define ANA_PORT_PORT_CFG_PORTID_VAL_X(x) (((x) & GENMASK(5, 2)) >> 2)
  358. #define ANA_PORT_PORT_CFG_USE_B_DOM_TBL BIT(1)
  359. #define ANA_PORT_PORT_CFG_LSR_MODE BIT(0)
  360. #define ANA_PORT_POL_CFG_GSZ 0x100
  361. #define ANA_PORT_POL_CFG_POL_CPU_REDIR_8021 BIT(19)
  362. #define ANA_PORT_POL_CFG_POL_CPU_REDIR_IP BIT(18)
  363. #define ANA_PORT_POL_CFG_PORT_POL_ENA BIT(17)
  364. #define ANA_PORT_POL_CFG_QUEUE_POL_ENA(x) (((x) << 9) & GENMASK(16, 9))
  365. #define ANA_PORT_POL_CFG_QUEUE_POL_ENA_M GENMASK(16, 9)
  366. #define ANA_PORT_POL_CFG_QUEUE_POL_ENA_X(x) (((x) & GENMASK(16, 9)) >> 9)
  367. #define ANA_PORT_POL_CFG_POL_ORDER(x) ((x) & GENMASK(8, 0))
  368. #define ANA_PORT_POL_CFG_POL_ORDER_M GENMASK(8, 0)
  369. #define ANA_PORT_PTP_CFG_GSZ 0x100
  370. #define ANA_PORT_PTP_CFG_PTP_BACKPLANE_MODE BIT(0)
  371. #define ANA_PORT_PTP_DLY1_CFG_GSZ 0x100
  372. #define ANA_PORT_PTP_DLY2_CFG_GSZ 0x100
  373. #define ANA_PORT_SFID_CFG_GSZ 0x100
  374. #define ANA_PORT_SFID_CFG_RSZ 0x4
  375. #define ANA_PORT_SFID_CFG_SFID_VALID BIT(8)
  376. #define ANA_PORT_SFID_CFG_SFID(x) ((x) & GENMASK(7, 0))
  377. #define ANA_PORT_SFID_CFG_SFID_M GENMASK(7, 0)
  378. #define ANA_PFC_PFC_CFG_GSZ 0x40
  379. #define ANA_PFC_PFC_CFG_RX_PFC_ENA(x) (((x) << 2) & GENMASK(9, 2))
  380. #define ANA_PFC_PFC_CFG_RX_PFC_ENA_M GENMASK(9, 2)
  381. #define ANA_PFC_PFC_CFG_RX_PFC_ENA_X(x) (((x) & GENMASK(9, 2)) >> 2)
  382. #define ANA_PFC_PFC_CFG_FC_LINK_SPEED(x) ((x) & GENMASK(1, 0))
  383. #define ANA_PFC_PFC_CFG_FC_LINK_SPEED_M GENMASK(1, 0)
  384. #define ANA_PFC_PFC_TIMER_GSZ 0x40
  385. #define ANA_PFC_PFC_TIMER_RSZ 0x4
  386. #define ANA_IPT_OAM_MEP_CFG_GSZ 0x8
  387. #define ANA_IPT_OAM_MEP_CFG_MEP_IDX_P(x) (((x) << 6) & GENMASK(10, 6))
  388. #define ANA_IPT_OAM_MEP_CFG_MEP_IDX_P_M GENMASK(10, 6)
  389. #define ANA_IPT_OAM_MEP_CFG_MEP_IDX_P_X(x) (((x) & GENMASK(10, 6)) >> 6)
  390. #define ANA_IPT_OAM_MEP_CFG_MEP_IDX(x) (((x) << 1) & GENMASK(5, 1))
  391. #define ANA_IPT_OAM_MEP_CFG_MEP_IDX_M GENMASK(5, 1)
  392. #define ANA_IPT_OAM_MEP_CFG_MEP_IDX_X(x) (((x) & GENMASK(5, 1)) >> 1)
  393. #define ANA_IPT_OAM_MEP_CFG_MEP_IDX_ENA BIT(0)
  394. #define ANA_IPT_IPT_GSZ 0x8
  395. #define ANA_IPT_IPT_IPT_CFG(x) (((x) << 15) & GENMASK(16, 15))
  396. #define ANA_IPT_IPT_IPT_CFG_M GENMASK(16, 15)
  397. #define ANA_IPT_IPT_IPT_CFG_X(x) (((x) & GENMASK(16, 15)) >> 15)
  398. #define ANA_IPT_IPT_ISDX_P(x) (((x) << 7) & GENMASK(14, 7))
  399. #define ANA_IPT_IPT_ISDX_P_M GENMASK(14, 7)
  400. #define ANA_IPT_IPT_ISDX_P_X(x) (((x) & GENMASK(14, 7)) >> 7)
  401. #define ANA_IPT_IPT_PPT_IDX(x) ((x) & GENMASK(6, 0))
  402. #define ANA_IPT_IPT_PPT_IDX_M GENMASK(6, 0)
  403. #define ANA_PPT_PPT_RSZ 0x4
  404. #define ANA_FID_MAP_FID_MAP_RSZ 0x4
  405. #define ANA_FID_MAP_FID_MAP_FID_C_VAL(x) (((x) << 6) & GENMASK(11, 6))
  406. #define ANA_FID_MAP_FID_MAP_FID_C_VAL_M GENMASK(11, 6)
  407. #define ANA_FID_MAP_FID_MAP_FID_C_VAL_X(x) (((x) & GENMASK(11, 6)) >> 6)
  408. #define ANA_FID_MAP_FID_MAP_FID_B_VAL(x) ((x) & GENMASK(5, 0))
  409. #define ANA_FID_MAP_FID_MAP_FID_B_VAL_M GENMASK(5, 0)
  410. #define ANA_AGGR_CFG_AC_RND_ENA BIT(7)
  411. #define ANA_AGGR_CFG_AC_DMAC_ENA BIT(6)
  412. #define ANA_AGGR_CFG_AC_SMAC_ENA BIT(5)
  413. #define ANA_AGGR_CFG_AC_IP6_FLOW_LBL_ENA BIT(4)
  414. #define ANA_AGGR_CFG_AC_IP6_TCPUDP_ENA BIT(3)
  415. #define ANA_AGGR_CFG_AC_IP4_SIPDIP_ENA BIT(2)
  416. #define ANA_AGGR_CFG_AC_IP4_TCPUDP_ENA BIT(1)
  417. #define ANA_AGGR_CFG_AC_ISDX_ENA BIT(0)
  418. #define ANA_CPUQ_CFG_CPUQ_MLD(x) (((x) << 27) & GENMASK(29, 27))
  419. #define ANA_CPUQ_CFG_CPUQ_MLD_M GENMASK(29, 27)
  420. #define ANA_CPUQ_CFG_CPUQ_MLD_X(x) (((x) & GENMASK(29, 27)) >> 27)
  421. #define ANA_CPUQ_CFG_CPUQ_IGMP(x) (((x) << 24) & GENMASK(26, 24))
  422. #define ANA_CPUQ_CFG_CPUQ_IGMP_M GENMASK(26, 24)
  423. #define ANA_CPUQ_CFG_CPUQ_IGMP_X(x) (((x) & GENMASK(26, 24)) >> 24)
  424. #define ANA_CPUQ_CFG_CPUQ_IPMC_CTRL(x) (((x) << 21) & GENMASK(23, 21))
  425. #define ANA_CPUQ_CFG_CPUQ_IPMC_CTRL_M GENMASK(23, 21)
  426. #define ANA_CPUQ_CFG_CPUQ_IPMC_CTRL_X(x) (((x) & GENMASK(23, 21)) >> 21)
  427. #define ANA_CPUQ_CFG_CPUQ_ALLBRIDGE(x) (((x) << 18) & GENMASK(20, 18))
  428. #define ANA_CPUQ_CFG_CPUQ_ALLBRIDGE_M GENMASK(20, 18)
  429. #define ANA_CPUQ_CFG_CPUQ_ALLBRIDGE_X(x) (((x) & GENMASK(20, 18)) >> 18)
  430. #define ANA_CPUQ_CFG_CPUQ_LOCKED_PORTMOVE(x) (((x) << 15) & GENMASK(17, 15))
  431. #define ANA_CPUQ_CFG_CPUQ_LOCKED_PORTMOVE_M GENMASK(17, 15)
  432. #define ANA_CPUQ_CFG_CPUQ_LOCKED_PORTMOVE_X(x) (((x) & GENMASK(17, 15)) >> 15)
  433. #define ANA_CPUQ_CFG_CPUQ_SRC_COPY(x) (((x) << 12) & GENMASK(14, 12))
  434. #define ANA_CPUQ_CFG_CPUQ_SRC_COPY_M GENMASK(14, 12)
  435. #define ANA_CPUQ_CFG_CPUQ_SRC_COPY_X(x) (((x) & GENMASK(14, 12)) >> 12)
  436. #define ANA_CPUQ_CFG_CPUQ_MAC_COPY(x) (((x) << 9) & GENMASK(11, 9))
  437. #define ANA_CPUQ_CFG_CPUQ_MAC_COPY_M GENMASK(11, 9)
  438. #define ANA_CPUQ_CFG_CPUQ_MAC_COPY_X(x) (((x) & GENMASK(11, 9)) >> 9)
  439. #define ANA_CPUQ_CFG_CPUQ_LRN(x) (((x) << 6) & GENMASK(8, 6))
  440. #define ANA_CPUQ_CFG_CPUQ_LRN_M GENMASK(8, 6)
  441. #define ANA_CPUQ_CFG_CPUQ_LRN_X(x) (((x) & GENMASK(8, 6)) >> 6)
  442. #define ANA_CPUQ_CFG_CPUQ_MIRROR(x) (((x) << 3) & GENMASK(5, 3))
  443. #define ANA_CPUQ_CFG_CPUQ_MIRROR_M GENMASK(5, 3)
  444. #define ANA_CPUQ_CFG_CPUQ_MIRROR_X(x) (((x) & GENMASK(5, 3)) >> 3)
  445. #define ANA_CPUQ_CFG_CPUQ_SFLOW(x) ((x) & GENMASK(2, 0))
  446. #define ANA_CPUQ_CFG_CPUQ_SFLOW_M GENMASK(2, 0)
  447. #define ANA_CPUQ_8021_CFG_RSZ 0x4
  448. #define ANA_CPUQ_8021_CFG_CPUQ_BPDU_VAL(x) (((x) << 6) & GENMASK(8, 6))
  449. #define ANA_CPUQ_8021_CFG_CPUQ_BPDU_VAL_M GENMASK(8, 6)
  450. #define ANA_CPUQ_8021_CFG_CPUQ_BPDU_VAL_X(x) (((x) & GENMASK(8, 6)) >> 6)
  451. #define ANA_CPUQ_8021_CFG_CPUQ_GARP_VAL(x) (((x) << 3) & GENMASK(5, 3))
  452. #define ANA_CPUQ_8021_CFG_CPUQ_GARP_VAL_M GENMASK(5, 3)
  453. #define ANA_CPUQ_8021_CFG_CPUQ_GARP_VAL_X(x) (((x) & GENMASK(5, 3)) >> 3)
  454. #define ANA_CPUQ_8021_CFG_CPUQ_CCM_VAL(x) ((x) & GENMASK(2, 0))
  455. #define ANA_CPUQ_8021_CFG_CPUQ_CCM_VAL_M GENMASK(2, 0)
  456. #define ANA_DSCP_CFG_RSZ 0x4
  457. #define ANA_DSCP_CFG_DP_DSCP_VAL BIT(11)
  458. #define ANA_DSCP_CFG_QOS_DSCP_VAL(x) (((x) << 8) & GENMASK(10, 8))
  459. #define ANA_DSCP_CFG_QOS_DSCP_VAL_M GENMASK(10, 8)
  460. #define ANA_DSCP_CFG_QOS_DSCP_VAL_X(x) (((x) & GENMASK(10, 8)) >> 8)
  461. #define ANA_DSCP_CFG_DSCP_TRANSLATE_VAL(x) (((x) << 2) & GENMASK(7, 2))
  462. #define ANA_DSCP_CFG_DSCP_TRANSLATE_VAL_M GENMASK(7, 2)
  463. #define ANA_DSCP_CFG_DSCP_TRANSLATE_VAL_X(x) (((x) & GENMASK(7, 2)) >> 2)
  464. #define ANA_DSCP_CFG_DSCP_TRUST_ENA BIT(1)
  465. #define ANA_DSCP_CFG_DSCP_REWR_ENA BIT(0)
  466. #define ANA_DSCP_REWR_CFG_RSZ 0x4
  467. #define ANA_VCAP_RNG_TYPE_CFG_RSZ 0x4
  468. #define ANA_VCAP_RNG_VAL_CFG_RSZ 0x4
  469. #define ANA_VCAP_RNG_VAL_CFG_VCAP_RNG_MIN_VAL(x) (((x) << 16) & GENMASK(31, 16))
  470. #define ANA_VCAP_RNG_VAL_CFG_VCAP_RNG_MIN_VAL_M GENMASK(31, 16)
  471. #define ANA_VCAP_RNG_VAL_CFG_VCAP_RNG_MIN_VAL_X(x) (((x) & GENMASK(31, 16)) >> 16)
  472. #define ANA_VCAP_RNG_VAL_CFG_VCAP_RNG_MAX_VAL(x) ((x) & GENMASK(15, 0))
  473. #define ANA_VCAP_RNG_VAL_CFG_VCAP_RNG_MAX_VAL_M GENMASK(15, 0)
  474. #define ANA_VRAP_CFG_VRAP_VLAN_AWARE_ENA BIT(12)
  475. #define ANA_VRAP_CFG_VRAP_VID(x) ((x) & GENMASK(11, 0))
  476. #define ANA_VRAP_CFG_VRAP_VID_M GENMASK(11, 0)
  477. #define ANA_DISCARD_CFG_DROP_TAGGING_ISDX0 BIT(3)
  478. #define ANA_DISCARD_CFG_DROP_CTRLPROT_ISDX0 BIT(2)
  479. #define ANA_DISCARD_CFG_DROP_TAGGING_S2_ENA BIT(1)
  480. #define ANA_DISCARD_CFG_DROP_CTRLPROT_S2_ENA BIT(0)
  481. #define ANA_FID_CFG_VID_MC_ENA BIT(0)
  482. #define ANA_POL_PIR_CFG_GSZ 0x20
  483. #define ANA_POL_PIR_CFG_PIR_RATE(x) (((x) << 6) & GENMASK(20, 6))
  484. #define ANA_POL_PIR_CFG_PIR_RATE_M GENMASK(20, 6)
  485. #define ANA_POL_PIR_CFG_PIR_RATE_X(x) (((x) & GENMASK(20, 6)) >> 6)
  486. #define ANA_POL_PIR_CFG_PIR_BURST(x) ((x) & GENMASK(5, 0))
  487. #define ANA_POL_PIR_CFG_PIR_BURST_M GENMASK(5, 0)
  488. #define ANA_POL_CIR_CFG_GSZ 0x20
  489. #define ANA_POL_CIR_CFG_CIR_RATE(x) (((x) << 6) & GENMASK(20, 6))
  490. #define ANA_POL_CIR_CFG_CIR_RATE_M GENMASK(20, 6)
  491. #define ANA_POL_CIR_CFG_CIR_RATE_X(x) (((x) & GENMASK(20, 6)) >> 6)
  492. #define ANA_POL_CIR_CFG_CIR_BURST(x) ((x) & GENMASK(5, 0))
  493. #define ANA_POL_CIR_CFG_CIR_BURST_M GENMASK(5, 0)
  494. #define ANA_POL_MODE_CFG_GSZ 0x20
  495. #define ANA_POL_MODE_CFG_IPG_SIZE(x) (((x) << 5) & GENMASK(9, 5))
  496. #define ANA_POL_MODE_CFG_IPG_SIZE_M GENMASK(9, 5)
  497. #define ANA_POL_MODE_CFG_IPG_SIZE_X(x) (((x) & GENMASK(9, 5)) >> 5)
  498. #define ANA_POL_MODE_CFG_FRM_MODE(x) (((x) << 3) & GENMASK(4, 3))
  499. #define ANA_POL_MODE_CFG_FRM_MODE_M GENMASK(4, 3)
  500. #define ANA_POL_MODE_CFG_FRM_MODE_X(x) (((x) & GENMASK(4, 3)) >> 3)
  501. #define ANA_POL_MODE_CFG_DLB_COUPLED BIT(2)
  502. #define ANA_POL_MODE_CFG_CIR_ENA BIT(1)
  503. #define ANA_POL_MODE_CFG_OVERSHOOT_ENA BIT(0)
  504. #define ANA_POL_PIR_STATE_GSZ 0x20
  505. #define ANA_POL_CIR_STATE_GSZ 0x20
  506. #define ANA_POL_STATE_GSZ 0x20
  507. #define ANA_POL_FLOWC_RSZ 0x4
  508. #define ANA_POL_FLOWC_POL_FLOWC BIT(0)
  509. #define ANA_POL_HYST_POL_FC_HYST(x) (((x) << 4) & GENMASK(9, 4))
  510. #define ANA_POL_HYST_POL_FC_HYST_M GENMASK(9, 4)
  511. #define ANA_POL_HYST_POL_FC_HYST_X(x) (((x) & GENMASK(9, 4)) >> 4)
  512. #define ANA_POL_HYST_POL_STOP_HYST(x) ((x) & GENMASK(3, 0))
  513. #define ANA_POL_HYST_POL_STOP_HYST_M GENMASK(3, 0)
  514. #define ANA_POL_MISC_CFG_POL_CLOSE_ALL BIT(1)
  515. #define ANA_POL_MISC_CFG_POL_LEAK_DIS BIT(0)
  516. #endif