summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-11-17 17:07:09 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2021-07-02 16:36:34 +0100
commit485c23aeaae079ba260a176bf22a697d884b3a8a (patch)
treed282ddbcabba2d6c1e33e2563b24bd350af1f8d4
parent91f02fb521ac978b946048cb52ccd3d563ce01c0 (diff)
dpaa2-mac: hacks to allow any interface mode [*not for mainline*]
Allow any supported ethtool link modes to allow flexible SFP testing. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
index 43ac047cab30..073829d983fa 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
@@ -78,7 +78,7 @@ static int dpaa2_mac_get_if_mode(struct device_node *node,
return err;
}
-static bool dpaa2_mac_phy_mode_mismatch(struct dpaa2_mac *mac,
+static __maybe_unused bool dpaa2_mac_phy_mode_mismatch(struct dpaa2_mac *mac,
phy_interface_t interface)
{
switch (interface) {
@@ -111,13 +111,13 @@ static void dpaa2_mac_validate(struct phylink_config *config,
unsigned long *supported,
struct phylink_link_state *state)
{
- struct dpaa2_mac *mac = phylink_to_dpaa2_mac(config);
+// struct dpaa2_mac *mac = phylink_to_dpaa2_mac(config);
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
- if (state->interface != PHY_INTERFACE_MODE_NA &&
- dpaa2_mac_phy_mode_mismatch(mac, state->interface)) {
- goto empty_set;
- }
+// if (state->interface != PHY_INTERFACE_MODE_NA &&
+// dpaa2_mac_phy_mode_mismatch(mac, state->interface)) {
+// goto empty_set;
+// }
phylink_set_port_modes(mask);
phylink_set(mask, Autoneg);
@@ -342,6 +342,16 @@ int dpaa2_mac_connect(struct dpaa2_mac *mac)
memset(&mac->phylink_config, 0, sizeof(mac->phylink_config));
mac->phylink_config.dev = &net_dev->dev;
mac->phylink_config.type = PHYLINK_NETDEV;
+ __set_bit(PHY_INTERFACE_MODE_10GBASER,
+ mac->phylink_config.supported_interfaces);
+ __set_bit(PHY_INTERFACE_MODE_2500BASEX,
+ mac->phylink_config.supported_interfaces);
+ __set_bit(PHY_INTERFACE_MODE_QSGMII,
+ mac->phylink_config.supported_interfaces);
+ __set_bit(PHY_INTERFACE_MODE_SGMII,
+ mac->phylink_config.supported_interfaces);
+ __set_bit(PHY_INTERFACE_MODE_1000BASEX,
+ mac->phylink_config.supported_interfaces);
__set_bit(mac->if_mode, mac->phylink_config.supported_interfaces);
if (mac->if_mode == PHY_INTERFACE_MODE_SGMII && mac->pcs)