summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-11-17 17:07:09 +0000
committerRussell King <rmk+kernel@armlinux.org.uk>2020-10-12 22:41:30 +0100
commitb53428835d9923fed7a0160ed838f3ca0b067e36 (patch)
treefb8368bab2f436494636c505d3ea874a1c78656b
parent94f09a33ced2c5bef51588748e6f959d3f2e4469 (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 e34cad15f1d7..b6ddc7a26c87 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
@@ -223,7 +223,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) {
@@ -249,13 +249,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);
@@ -533,6 +533,16 @@ int dpaa2_mac_connect(struct dpaa2_mac *mac)
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)