Lines Matching refs:sparx5

53 static u32 sparx5_target_bandwidth(struct sparx5 *sparx5)  in sparx5_target_bandwidth()  argument
55 switch (sparx5->target_ct) { in sparx5_target_bandwidth()
129 static enum sparx5_cal_bw sparx5_get_port_cal_speed(struct sparx5 *sparx5, in sparx5_get_port_cal_speed() argument
153 port = sparx5->ports[portno]; in sparx5_get_port_cal_speed()
160 int sparx5_config_auto_calendar(struct sparx5 *sparx5) in sparx5_config_auto_calendar() argument
170 max_core_bw = sparx5_clk_to_bandwidth(sparx5->coreclock); in sparx5_config_auto_calendar()
172 dev_err(sparx5->dev, "Core clock not supported"); in sparx5_config_auto_calendar()
180 spd = sparx5_get_port_cal_speed(sparx5, portno); in sparx5_config_auto_calendar()
196 if (used_port_bw > sparx5_target_bandwidth(sparx5)) { in sparx5_config_auto_calendar()
197 dev_err(sparx5->dev, in sparx5_config_auto_calendar()
199 used_port_bw, sparx5_target_bandwidth(sparx5)); in sparx5_config_auto_calendar()
204 dev_err(sparx5->dev, in sparx5_config_auto_calendar()
213 sparx5, QSYS_CAL_CTRL); in sparx5_config_auto_calendar()
217 spx5_wr(cal[idx], sparx5, QSYS_CAL_AUTO(idx)); in sparx5_config_auto_calendar()
224 sparx5, in sparx5_config_auto_calendar()
230 sparx5, in sparx5_config_auto_calendar()
236 sparx5, QSYS_CAL_CTRL); in sparx5_config_auto_calendar()
239 value = spx5_rd(sparx5, QSYS_CAL_CTRL); in sparx5_config_auto_calendar()
241 dev_err(sparx5->dev, "QSYS calendar error\n"); in sparx5_config_auto_calendar()
281 static int sparx5_dsm_calendar_calc(struct sparx5 *sparx5, u32 taxi, in sparx5_dsm_calendar_calc() argument
289 clk_period_ps = sparx5_clk_period(sparx5->coreclock); in sparx5_dsm_calendar_calc()
309 (sparx5_get_port_cal_speed(sparx5, portno)); in sparx5_dsm_calendar_calc()
333 dev_err(sparx5->dev, in sparx5_dsm_calendar_calc()
372 dev_err(sparx5->dev, in sparx5_dsm_calendar_calc()
380 dev_err(sparx5->dev, in sparx5_dsm_calendar_calc()
458 dev_err(sparx5->dev, in sparx5_dsm_calendar_calc()
477 static int sparx5_dsm_calendar_check(struct sparx5 *sparx5, in sparx5_dsm_calendar_check() argument
527 dev_err(sparx5->dev, in sparx5_dsm_calendar_check()
533 static int sparx5_dsm_calendar_update(struct sparx5 *sparx5, u32 taxi, in sparx5_dsm_calendar_update() argument
540 sparx5, in sparx5_dsm_calendar_update()
545 sparx5, in sparx5_dsm_calendar_update()
549 sparx5, in sparx5_dsm_calendar_update()
553 sparx5, in sparx5_dsm_calendar_update()
555 len = DSM_TAXI_CAL_CFG_CAL_CUR_LEN_GET(spx5_rd(sparx5, in sparx5_dsm_calendar_update()
561 dev_err(sparx5->dev, "Incorrect calendar length: %u\n", len); in sparx5_dsm_calendar_update()
566 int sparx5_config_dsm_calendar(struct sparx5 *sparx5) in sparx5_config_dsm_calendar() argument
577 err = sparx5_dsm_calendar_calc(sparx5, taxi, data); in sparx5_config_dsm_calendar()
579 dev_err(sparx5->dev, "DSM calendar calculation failed\n"); in sparx5_config_dsm_calendar()
582 err = sparx5_dsm_calendar_check(sparx5, data); in sparx5_config_dsm_calendar()
584 dev_err(sparx5->dev, "DSM calendar check failed\n"); in sparx5_config_dsm_calendar()
587 err = sparx5_dsm_calendar_update(sparx5, taxi, data); in sparx5_config_dsm_calendar()
589 dev_err(sparx5->dev, "DSM calendar update failed\n"); in sparx5_config_dsm_calendar()