Commit ae089a81 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by David S. Miller
Browse files

net: sparx5: populate supported_interfaces member



Populate the phy_interface_t bitmap for the Microchip Sparx5 driver
with interfaces modes supported by the MAC.

Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d3a41000
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -293,6 +293,30 @@ static int sparx5_create_port(struct sparx5 *sparx5,
	spx5_port->phylink_config.type = PHYLINK_NETDEV;
	spx5_port->phylink_config.pcs_poll = true;

	__set_bit(PHY_INTERFACE_MODE_SGMII,
		  spx5_port->phylink_config.supported_interfaces);
	__set_bit(PHY_INTERFACE_MODE_QSGMII,
		  spx5_port->phylink_config.supported_interfaces);
	__set_bit(PHY_INTERFACE_MODE_1000BASEX,
		  spx5_port->phylink_config.supported_interfaces);
	__set_bit(PHY_INTERFACE_MODE_2500BASEX,
		  spx5_port->phylink_config.supported_interfaces);

	if (spx5_port->conf.bandwidth == SPEED_5000 ||
	    spx5_port->conf.bandwidth == SPEED_10000 ||
	    spx5_port->conf.bandwidth == SPEED_25000)
		__set_bit(PHY_INTERFACE_MODE_5GBASER,
			  spx5_port->phylink_config.supported_interfaces);

	if (spx5_port->conf.bandwidth == SPEED_10000 ||
	    spx5_port->conf.bandwidth == SPEED_25000)
		__set_bit(PHY_INTERFACE_MODE_10GBASER,
			  spx5_port->phylink_config.supported_interfaces);

	if (spx5_port->conf.bandwidth == SPEED_25000)
		__set_bit(PHY_INTERFACE_MODE_25GBASER,
			  spx5_port->phylink_config.supported_interfaces);

	phylink = phylink_create(&spx5_port->phylink_config,
				 of_fwnode_handle(config->node),
				 config->conf.phy_mode,