Lines Matching refs:sparx5

78 static int sparx5_get_dev2g5_status(struct sparx5 *sparx5,  in sparx5_get_dev2g5_status()  argument
87 value = spx5_rd(sparx5, DEV2G5_PCS1G_STICKY(portno)); in sparx5_get_dev2g5_status()
90 spx5_wr(value, sparx5, DEV2G5_PCS1G_STICKY(portno)); in sparx5_get_dev2g5_status()
93 value = spx5_rd(sparx5, DEV2G5_PCS1G_LINK_STATUS(portno)); in sparx5_get_dev2g5_status()
105 value = spx5_rd(sparx5, DEV2G5_PCS1G_ANEG_STATUS(portno)); in sparx5_get_dev2g5_status()
113 value = spx5_rd(sparx5, DEV2G5_PCS1G_ANEG_CFG(portno)); in sparx5_get_dev2g5_status()
121 static int sparx5_get_sfi_status(struct sparx5 *sparx5, in sparx5_get_sfi_status() argument
137 inst = spx5_inst_get(sparx5, dev, tinst); in sparx5_get_sfi_status()
160 int sparx5_get_port_status(struct sparx5 *sparx5, in sparx5_get_port_status() argument
175 return sparx5_get_dev2g5_status(sparx5, port, status); in sparx5_get_port_status()
179 return sparx5_get_sfi_status(sparx5, port, status); in sparx5_get_port_status()
212 static int sparx5_port_verify_speed(struct sparx5 *sparx5, in sparx5_port_verify_speed() argument
264 static bool sparx5_dev_change(struct sparx5 *sparx5, in sparx5_dev_change() argument
272 static int sparx5_port_flush_poll(struct sparx5 *sparx5, u32 portno) in sparx5_port_flush_poll() argument
291 value = spx5_rd(sparx5, in sparx5_port_flush_poll()
305 dev_err(sparx5->dev, in sparx5_port_flush_poll()
316 static int sparx5_port_disable(struct sparx5 *sparx5, struct sparx5_port *port, bool high_spd_dev) in sparx5_port_disable() argument
322 void __iomem *devinst = spx5_inst_get(sparx5, dev, tinst); in sparx5_port_disable()
354 sparx5, in sparx5_port_disable()
360 sparx5, in sparx5_port_disable()
366 sparx5, in sparx5_port_disable()
382 sparx5, in sparx5_port_disable()
388 sparx5, in sparx5_port_disable()
392 err = sparx5_port_flush_poll(sparx5, port->portno); in sparx5_port_disable()
426 sparx5, in sparx5_port_disable()
431 void __iomem *pcsinst = spx5_inst_get(sparx5, pcs, tinst); in sparx5_port_disable()
443 sparx5, in sparx5_port_disable()
449 sparx5, in sparx5_port_disable()
457 static int sparx5_port_fifo_sz(struct sparx5 *sparx5, in sparx5_port_fifo_sz() argument
460 u32 sys_clk = sparx5_clk_period(sparx5->coreclock); in sparx5_port_fifo_sz()
516 static int sparx5_port_mux_set(struct sparx5 *sparx5, in sparx5_port_mux_set() argument
531 sparx5, in sparx5_port_mux_set()
542 sparx5, in sparx5_port_mux_set()
552 static int sparx5_port_max_tags_set(struct sparx5 *sparx5, in sparx5_port_max_tags_set() argument
563 void __iomem *inst = spx5_inst_get(sparx5, dev, tinst); in sparx5_port_max_tags_set()
575 sparx5, in sparx5_port_max_tags_set()
600 int sparx5_port_fwd_urg(struct sparx5 *sparx5, u32 speed) in sparx5_port_fwd_urg() argument
635 static int sparx5_port_fc_setup(struct sparx5 *sparx5, in sparx5_port_fc_setup() argument
649 sparx5, in sparx5_port_fc_setup()
655 sparx5, in sparx5_port_fc_setup()
661 sparx5, in sparx5_port_fc_setup()
667 sparx5, in sparx5_port_fc_setup()
681 int sparx5_serdes_set(struct sparx5 *sparx5, in sparx5_serdes_set() argument
727 static int sparx5_port_pcs_low_set(struct sparx5 *sparx5, in sparx5_port_pcs_low_set() argument
742 err = sparx5_serdes_set(sparx5, port, conf); in sparx5_port_pcs_low_set()
752 sparx5, in sparx5_port_pcs_low_set()
757 sparx5, in sparx5_port_pcs_low_set()
768 sparx5, in sparx5_port_pcs_low_set()
771 spx5_wr(0, sparx5, DEV2G5_PCS1G_ANEG_CFG(port->portno)); in sparx5_port_pcs_low_set()
781 sparx5, in sparx5_port_pcs_low_set()
787 static int sparx5_port_pcs_high_set(struct sparx5 *sparx5, in sparx5_port_pcs_high_set() argument
799 devinst = spx5_inst_get(sparx5, dev, pix); in sparx5_port_pcs_high_set()
800 pcsinst = spx5_inst_get(sparx5, pcs, pix); in sparx5_port_pcs_high_set()
803 err = sparx5_serdes_set(sparx5, port, conf); in sparx5_port_pcs_high_set()
810 sparx5, in sparx5_port_pcs_high_set()
844 static void sparx5_dev_switch(struct sparx5 *sparx5, int port, bool hsd) in sparx5_dev_switch() argument
851 sparx5, in sparx5_dev_switch()
856 sparx5, in sparx5_dev_switch()
861 sparx5, in sparx5_dev_switch()
867 static int sparx5_port_config_low_set(struct sparx5 *sparx5, in sparx5_port_config_low_set() argument
886 sparx5, in sparx5_port_config_low_set()
893 sparx5, in sparx5_port_config_low_set()
899 sparx5, in sparx5_port_config_low_set()
905 sparx5, in sparx5_port_config_low_set()
915 sparx5, in sparx5_port_config_low_set()
921 int sparx5_port_pcs_set(struct sparx5 *sparx5, in sparx5_port_pcs_set() argument
929 if (sparx5_dev_change(sparx5, port, conf)) { in sparx5_port_pcs_set()
931 sparx5_dev_switch(sparx5, port->portno, high_speed_dev); in sparx5_port_pcs_set()
934 err = sparx5_port_disable(sparx5, port, !high_speed_dev); in sparx5_port_pcs_set()
939 err = sparx5_port_disable(sparx5, port, high_speed_dev); in sparx5_port_pcs_set()
944 err = sparx5_port_pcs_high_set(sparx5, port, conf); in sparx5_port_pcs_set()
946 err = sparx5_port_pcs_low_set(sparx5, port, conf); in sparx5_port_pcs_set()
955 sparx5, in sparx5_port_pcs_set()
961 sparx5, in sparx5_port_pcs_set()
970 int sparx5_port_config(struct sparx5 *sparx5, in sparx5_port_config() argument
977 err = sparx5_port_verify_speed(sparx5, port, conf); in sparx5_port_config()
983 sparx5_port_config_low_set(sparx5, port, conf); in sparx5_port_config()
986 err = sparx5_port_fc_setup(sparx5, port, conf); in sparx5_port_config()
991 stop_wm = sparx5_port_fifo_sz(sparx5, port->portno, conf->speed); in sparx5_port_config()
994 sparx5, in sparx5_port_config()
998 urgency = sparx5_port_fwd_urg(sparx5, conf->speed); in sparx5_port_config()
1003 sparx5, in sparx5_port_config()
1013 int sparx5_port_init(struct sparx5 *sparx5, in sparx5_port_init() argument
1030 devinst = spx5_inst_get(sparx5, devhigh, pix); in sparx5_port_init()
1031 pcsinst = spx5_inst_get(sparx5, pcs, pix); in sparx5_port_init()
1034 err = sparx5_port_mux_set(sparx5, port, conf); in sparx5_port_init()
1039 err = sparx5_port_max_tags_set(sparx5, port); in sparx5_port_init()
1046 sparx5, in sparx5_port_init()
1053 sparx5, in sparx5_port_init()
1063 sparx5, in sparx5_port_init()
1068 sparx5, in sparx5_port_init()
1072 spx5_wr(PAUSE_DISCARD, sparx5, ANA_CL_CAPTURE_BPDU_CFG(port->portno)); in sparx5_port_init()
1077 sparx5, ANA_CL_FILTER_CTRL(port->portno)); in sparx5_port_init()
1081 err = sparx5_serdes_set(sparx5, port, conf); in sparx5_port_init()
1089 sparx5, in sparx5_port_init()
1092 sparx5_dev_switch(sparx5, port->portno, false); in sparx5_port_init()
1098 sparx5, in sparx5_port_init()
1105 sparx5, in sparx5_port_init()
1116 sparx5_dev_switch(sparx5, port->portno, true); in sparx5_port_init()
1136 sparx5, in sparx5_port_init()
1145 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_enable() local
1150 sparx5, in sparx5_port_enable()
1170 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_qos_pcp_rewr_set() local
1183 port->sparx5, REW_TAG_CTRL(port->portno)); in sparx5_port_qos_pcp_rewr_set()
1202 REW_PCP_MAP_DE1_PCP_DE1, sparx5, in sparx5_port_qos_pcp_rewr_set()
1206 REW_DEI_MAP_DE1_DEI_DE1, port->sparx5, in sparx5_port_qos_pcp_rewr_set()
1210 REW_PCP_MAP_DE0_PCP_DE0, sparx5, in sparx5_port_qos_pcp_rewr_set()
1214 REW_DEI_MAP_DE0_DEI_DE0, port->sparx5, in sparx5_port_qos_pcp_rewr_set()
1225 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_qos_pcp_set() local
1234 sparx5, ANA_CL_QOS_CFG(port->portno)); in sparx5_port_qos_pcp_set()
1243 ANA_CL_PCP_DEI_MAP_CFG_PCP_DEI_DP_VAL, sparx5, in sparx5_port_qos_pcp_set()
1254 ANA_CL_QOS_CFG_DSCP_REWR_MODE_SEL, port->sparx5, in sparx5_port_qos_dscp_rewr_mode_set()
1261 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_qos_dscp_rewr_set() local
1273 REW_DSCP_MAP_DSCP_UPDATE_ENA, sparx5, in sparx5_port_qos_dscp_rewr_set()
1282 ANA_CL_QOS_MAP_CFG_DSCP_REWR_VAL, sparx5, in sparx5_port_qos_dscp_rewr_set()
1292 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_qos_dscp_set() local
1303 ANA_CL_QOS_CFG_DSCP_KEEP_ENA, sparx5, in sparx5_port_qos_dscp_set()
1311 ANA_CL_DSCP_CFG_DSCP_DP_VAL, sparx5, in sparx5_port_qos_dscp_set()
1319 ANA_CL_DSCP_CFG_DSCP_TRUST_ENA, sparx5, in sparx5_port_qos_dscp_set()
1330 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_qos_default_set() local
1337 sparx5, ANA_CL_QOS_CFG(port->portno)); in sparx5_port_qos_default_set()
1344 sparx5, ANA_CL_VLAN_CTRL(port->portno)); in sparx5_port_qos_default_set()