summaryrefslogtreecommitdiff
path: root/drivers/emac-dwc-eqos
diff options
context:
space:
mode:
authorcpratapa <cpratapa@codeaurora.org>2019-01-29 12:37:06 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-02-28 02:22:14 -0800
commit67c92c4c09ab424f2e143b6b63d613426c1e5785 (patch)
tree10899c35c96aeac8e034394e7ca3744620473813 /drivers/emac-dwc-eqos
parentf518ee45c26eb7f59df29ee6aba50dea0390a7da (diff)
downloaddata-kernel-67c92c4c09ab424f2e143b6b63d613426c1e5785.tar.gz
data-kernel: EMAC: Keep advertisement options from phy driver.
Don't set more advertisement features than the PHY supports. Use basic GBIT and default features based on the connection type. Rely on the PHY driver for the remaining advertisement options. Change-Id: I98e9b8d8db10e2ea55f1265d9e173b76237c4427 Signed-off-by: Sunil Paidimarri<hisunil@codeaurora.org> Signed-off-by: Chaitanya Pratapa<cpratapa@codeaurora.org>
Diffstat (limited to 'drivers/emac-dwc-eqos')
-rw-r--r--drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c b/drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c
index f295dc0..ab0d3b6 100644
--- a/drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c
+++ b/drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1104,28 +1104,17 @@ static int DWC_ETH_QOS_init_phy(struct net_device *dev)
#endif
if (pdata->interface == PHY_INTERFACE_MODE_GMII ||
- pdata->interface == PHY_INTERFACE_MODE_RGMII) {
- phydev->supported = PHY_DEFAULT_FEATURES;
- phydev->supported |= SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Full;
-
-#ifdef DWC_ETH_QOS_CERTIFICATION_PKTBURSTCNT_HALFDUPLEX
- phydev->supported &= ~SUPPORTED_1000baseT_Full;
-#endif
+ pdata->interface == PHY_INTERFACE_MODE_RGMII) {
+ phy_set_max_speed(phydev, SPEED_1000);
+ /* Half duplex not supported */
+ phydev->supported &= ~(SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half | SUPPORTED_1000baseT_Half);
} else if ((pdata->interface == PHY_INTERFACE_MODE_MII) ||
- (pdata->interface == PHY_INTERFACE_MODE_RMII)) {
- phydev->supported = PHY_DEFAULT_FEATURES;
- phydev->supported |= SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Full;
+ (pdata->interface == PHY_INTERFACE_MODE_RMII)) {
+ phy_set_max_speed(phydev, SPEED_100);
+ /* Half duplex is not supported */
+ phydev->supported &= ~(SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half);
}
-#ifndef DWC_ETH_QOS_CONFIG_PGTEST
- phydev->supported |= (SUPPORTED_Pause | SUPPORTED_Asym_Pause);
-#endif
-
- /* Lets Make the code support for both 100M and Giga bit */
-/* #ifdef DWC_ETH_QOS_CONFIG_PGTEST */
-/* phydev->supported = PHY_BASIC_FEATURES; */
-/* #endif */
-
phydev->advertising = phydev->supported;
pdata->phydev = phydev;