]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/phy/smsc.c
fdt: add memory bank decoding functions for board setup
[u-boot] / drivers / net / phy / smsc.c
index 6dee8eb5194ee697bf12eff9b424bda56851e312..313fcdfdc52d07270c2291debdced8b96747bda8 100644 (file)
@@ -1,31 +1,18 @@
 /*
  * SMSC PHY drivers
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  *
  * Base code from drivers/net/phy/davicom.c
  *   Copyright 2010-2011 Freescale Semiconductor, Inc.
  *   author Andy Fleming
  *
- * Some code get from linux kenrel
+ * Some code copied from linux kernel
  * Copyright (c) 2006 Herbert Valerio Riedel <hvr@gnu.org>
- *
  */
 #include <miiphy.h>
 
+/* This code does not check the partner abilities. */
 static int smsc_parse_status(struct phy_device *phydev)
 {
        int mii_reg;
@@ -47,9 +34,13 @@ static int smsc_parse_status(struct phy_device *phydev)
 
 static int smsc_startup(struct phy_device *phydev)
 {
-       genphy_update_link(phydev);
-       smsc_parse_status(phydev);
-       return 0;
+       int ret;
+
+       ret = genphy_update_link(phydev);
+       if (ret)
+               return ret;
+
+       return smsc_parse_status(phydev);
 }
 
 static struct phy_driver lan8700_driver = {
@@ -76,17 +67,27 @@ static struct phy_driver lan8710_driver = {
        .name = "SMSC LAN8710/LAN8720",
        .uid = 0x0007c0f0,
        .mask = 0xffff0,
-       .features = PHY_GBIT_FEATURES,
+       .features = PHY_BASIC_FEATURES,
        .config = &genphy_config_aneg,
-       .startup = &smsc_startup,
+       .startup = &genphy_startup,
        .shutdown = &genphy_shutdown,
 };
 
+static struct phy_driver lan8740_driver = {
+       .name = "SMSC LAN8740",
+       .uid = 0x0007c110,
+       .mask = 0xffff0,
+       .features = PHY_BASIC_FEATURES,
+       .config = &genphy_config_aneg,
+       .startup = &genphy_startup,
+       .shutdown = &genphy_shutdown,
+};
 int phy_smsc_init(void)
 {
        phy_register(&lan8710_driver);
        phy_register(&lan911x_driver);
        phy_register(&lan8700_driver);
+       phy_register(&lan8740_driver);
 
        return 0;
 }