Skip to content

Commit c71b596

Browse files
Danielmachonkuba-moo
authored andcommitted
net: sparx5: do some preparation work
The sparx5_port_init() does initial configuration of a variety of different features and options for each port. Some are shared for all types of devices, some are not. As it is now, common configuration is done after configuration of low-speed devices. This will not work when adding RGMII support in a subsequent patch. In preparation for lan969x RGMII support, move a block of code, that configures 2g5 devices, down. This ensures that the configuration common to all devices is done before configuration of 2g5, 5g, 10g and 25g devices. Reviewed-by: Steen Hegelund <[email protected]> Reviewed-by: Horatiu Vultur <[email protected]> Tested-by: Robert Marko <[email protected]> Signed-off-by: Daniel Machon <[email protected]> Link: https://patch.msgid.link/20241220-sparx5-lan969x-switch-driver-4-v5-1-fa8ba5dff732@microchip.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 847cf3b commit c71b596

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_port.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,24 +1067,6 @@ int sparx5_port_init(struct sparx5 *sparx5,
10671067
if (err)
10681068
return err;
10691069

1070-
/* Configure MAC vlan awareness */
1071-
err = sparx5_port_max_tags_set(sparx5, port);
1072-
if (err)
1073-
return err;
1074-
1075-
/* Set Max Length */
1076-
spx5_rmw(DEV2G5_MAC_MAXLEN_CFG_MAX_LEN_SET(ETH_MAXLEN),
1077-
DEV2G5_MAC_MAXLEN_CFG_MAX_LEN,
1078-
sparx5,
1079-
DEV2G5_MAC_MAXLEN_CFG(port->portno));
1080-
1081-
/* 1G/2G5: Signal Detect configuration */
1082-
spx5_wr(DEV2G5_PCS1G_SD_CFG_SD_POL_SET(sd_pol) |
1083-
DEV2G5_PCS1G_SD_CFG_SD_SEL_SET(sd_sel) |
1084-
DEV2G5_PCS1G_SD_CFG_SD_ENA_SET(sd_ena),
1085-
sparx5,
1086-
DEV2G5_PCS1G_SD_CFG(port->portno));
1087-
10881070
/* Set Pause WM hysteresis */
10891071
spx5_rmw(QSYS_PAUSE_CFG_PAUSE_START_SET(pause_start) |
10901072
QSYS_PAUSE_CFG_PAUSE_STOP_SET(pause_stop) |
@@ -1108,6 +1090,24 @@ int sparx5_port_init(struct sparx5 *sparx5,
11081090
ANA_CL_FILTER_CTRL_FILTER_SMAC_MC_DIS,
11091091
sparx5, ANA_CL_FILTER_CTRL(port->portno));
11101092

1093+
/* Configure MAC vlan awareness */
1094+
err = sparx5_port_max_tags_set(sparx5, port);
1095+
if (err)
1096+
return err;
1097+
1098+
/* Set Max Length */
1099+
spx5_rmw(DEV2G5_MAC_MAXLEN_CFG_MAX_LEN_SET(ETH_MAXLEN),
1100+
DEV2G5_MAC_MAXLEN_CFG_MAX_LEN,
1101+
sparx5,
1102+
DEV2G5_MAC_MAXLEN_CFG(port->portno));
1103+
1104+
/* 1G/2G5: Signal Detect configuration */
1105+
spx5_wr(DEV2G5_PCS1G_SD_CFG_SD_POL_SET(sd_pol) |
1106+
DEV2G5_PCS1G_SD_CFG_SD_SEL_SET(sd_sel) |
1107+
DEV2G5_PCS1G_SD_CFG_SD_ENA_SET(sd_ena),
1108+
sparx5,
1109+
DEV2G5_PCS1G_SD_CFG(port->portno));
1110+
11111111
if (conf->portmode == PHY_INTERFACE_MODE_QSGMII ||
11121112
conf->portmode == PHY_INTERFACE_MODE_SGMII) {
11131113
err = sparx5_serdes_set(sparx5, port, conf);

0 commit comments

Comments
 (0)