Lines Matching refs:sparx5
55 u32 sparx5_psfp_isdx_get_sf(struct sparx5 *sparx5, u32 isdx) in sparx5_psfp_isdx_get_sf() argument
57 return ANA_L2_TSN_CFG_TSN_SFID_GET(spx5_rd(sparx5, in sparx5_psfp_isdx_get_sf()
61 u32 sparx5_psfp_isdx_get_fm(struct sparx5 *sparx5, u32 isdx) in sparx5_psfp_isdx_get_fm() argument
63 return ANA_L2_DLB_CFG_DLB_IDX_GET(spx5_rd(sparx5, in sparx5_psfp_isdx_get_fm()
67 u32 sparx5_psfp_sf_get_sg(struct sparx5 *sparx5, u32 sfid) in sparx5_psfp_sf_get_sg() argument
69 return ANA_AC_TSN_SF_CFG_TSN_SGID_GET(spx5_rd(sparx5, in sparx5_psfp_sf_get_sg()
73 void sparx5_isdx_conf_set(struct sparx5 *sparx5, u32 isdx, u32 sfid, u32 fmid) in sparx5_isdx_conf_set() argument
76 sparx5, ANA_L2_TSN_CFG(isdx)); in sparx5_isdx_conf_set()
79 sparx5, ANA_L2_DLB_CFG(isdx)); in sparx5_isdx_conf_set()
88 static int sparx5_psfp_sgid_get_status(struct sparx5 *sparx5) in sparx5_psfp_sgid_get_status() argument
90 return spx5_rd(sparx5, ANA_AC_SG_ACCESS_CTRL); in sparx5_psfp_sgid_get_status()
93 static int sparx5_psfp_sgid_wait_for_completion(struct sparx5 *sparx5) in sparx5_psfp_sgid_wait_for_completion() argument
97 return readx_poll_timeout(sparx5_psfp_sgid_get_status, sparx5, val, in sparx5_psfp_sgid_wait_for_completion()
103 static void sparx5_psfp_sg_config_change(struct sparx5 *sparx5, u32 id) in sparx5_psfp_sg_config_change() argument
105 spx5_wr(ANA_AC_SG_ACCESS_CTRL_SGID_SET(id), sparx5, in sparx5_psfp_sg_config_change()
110 sparx5, ANA_AC_SG_ACCESS_CTRL); in sparx5_psfp_sg_config_change()
112 if (sparx5_psfp_sgid_wait_for_completion(sparx5) < 0) in sparx5_psfp_sg_config_change()
117 static void sparx5_psfp_sf_set(struct sparx5 *sparx5, u32 id, in sparx5_psfp_sf_set() argument
128 sparx5, ANA_AC_TSN_SF_CFG(id)); in sparx5_psfp_sf_set()
131 static int sparx5_psfp_sg_set(struct sparx5 *sparx5, u32 id, in sparx5_psfp_sg_set() argument
143 spx5_wr(ANA_AC_SG_ACCESS_CTRL_SGID_SET(id), sparx5, in sparx5_psfp_sg_set()
147 spx5_wr(sg->basetime.tv_nsec, sparx5, ANA_AC_SG_CONFIG_REG_1); in sparx5_psfp_sg_set()
148 spx5_wr(base_lsb, sparx5, ANA_AC_SG_CONFIG_REG_2); in sparx5_psfp_sg_set()
160 sparx5, ANA_AC_SG_CONFIG_REG_3); in sparx5_psfp_sg_set()
162 spx5_wr(sg->cycletime, sparx5, ANA_AC_SG_CONFIG_REG_4); in sparx5_psfp_sg_set()
163 spx5_wr(sg->cycletimeext, sparx5, ANA_AC_SG_CONFIG_REG_5); in sparx5_psfp_sg_set()
174 sparx5, ANA_AC_SG_GCL_GS_CONFIG(i)); in sparx5_psfp_sg_set()
177 spx5_wr(accum_time_interval, sparx5, in sparx5_psfp_sg_set()
181 spx5_wr(gce->maxoctets, sparx5, ANA_AC_SG_GCL_OCT_CONFIG(i)); in sparx5_psfp_sg_set()
187 static int sparx5_sdlb_conf_set(struct sparx5 *sparx5, in sparx5_sdlb_conf_set() argument
190 int (*sparx5_sdlb_group_action)(struct sparx5 *sparx5, u32 group, in sparx5_sdlb_conf_set()
198 sparx5_policer_conf_set(sparx5, &fm->pol); in sparx5_sdlb_conf_set()
200 return sparx5_sdlb_group_action(sparx5, fm->pol.group, fm->pol.idx); in sparx5_sdlb_conf_set()
203 int sparx5_psfp_sf_add(struct sparx5 *sparx5, const struct sparx5_psfp_sf *sf, in sparx5_psfp_sf_add() argument
212 sparx5_psfp_sf_set(sparx5, *id, sf); in sparx5_psfp_sf_add()
217 int sparx5_psfp_sf_del(struct sparx5 *sparx5, u32 id) in sparx5_psfp_sf_del() argument
221 sparx5_psfp_sf_set(sparx5, id, &sf); in sparx5_psfp_sf_del()
226 int sparx5_psfp_sg_add(struct sparx5 *sparx5, u32 uidx, in sparx5_psfp_sg_add() argument
240 sparx5_new_base_time(sparx5, sg->cycletime, 0, &basetime); in sparx5_psfp_sg_add()
243 sparx5_psfp_sg_set(sparx5, *id, sg); in sparx5_psfp_sg_add()
246 sparx5_psfp_sg_config_change(sparx5, *id); in sparx5_psfp_sg_add()
251 int sparx5_psfp_sg_del(struct sparx5 *sparx5, u32 id) in sparx5_psfp_sg_del() argument
263 return sparx5_psfp_sg_set(sparx5, id, &sg); in sparx5_psfp_sg_del()
266 int sparx5_psfp_fm_add(struct sparx5 *sparx5, u32 uidx, in sparx5_psfp_fm_add() argument
280 ret = sparx5_sdlb_group_get_by_rate(sparx5, pol->rate, pol->burst); in sparx5_psfp_fm_add()
286 ret = sparx5_sdlb_conf_set(sparx5, fm); in sparx5_psfp_fm_add()
295 int sparx5_psfp_fm_del(struct sparx5 *sparx5, u32 id) in sparx5_psfp_fm_del() argument
302 ret = sparx5_sdlb_group_get_by_index(sparx5, id, &fm.pol.group); in sparx5_psfp_fm_del()
313 return sparx5_sdlb_conf_set(sparx5, &fm); in sparx5_psfp_fm_del()
316 void sparx5_psfp_init(struct sparx5 *sparx5) in sparx5_psfp_init() argument
323 sparx5_sdlb_group_init(sparx5, group->max_rate, in sparx5_psfp_init()
328 sparx5, ANA_AC_SG_CYCLETIME_UPDATE_PERIOD); in sparx5_psfp_init()
331 ANA_L2_FWD_CFG_ISDX_LOOKUP_ENA, sparx5, ANA_L2_FWD_CFG); in sparx5_psfp_init()