]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/phy/generic_10g.c
Merge branch 'u-boot-arm/next' into 'u-boot-arm/master'
[u-boot] / drivers / net / phy / generic_10g.c
index 315c50867dfdda864996574f1897f0d6d9dc5782..ed3dcd91da3473298a20b7322df3dee1ee941eb2 100644 (file)
@@ -1,21 +1,7 @@
 /*
  * Generic PHY Management code
  *
- * 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+
  *
  * Copyright 2011 Freescale Semiconductor, Inc.
  * author Andy Fleming
@@ -36,7 +22,7 @@ int gen10g_shutdown(struct phy_device *phydev)
 int gen10g_startup(struct phy_device *phydev)
 {
        int devad, reg;
-       u32 mmd_mask = phydev->mmds;
+       u32 mmd_mask = phydev->mmds & MDIO_DEVS_LINK;
 
        phydev->link = 1;
 
@@ -44,8 +30,12 @@ int gen10g_startup(struct phy_device *phydev)
        phydev->speed = SPEED_10000;
        phydev->duplex = DUPLEX_FULL;
 
+       /*
+        * Go through all the link-reporting devices, and make sure
+        * they're all up and happy
+        */
        for (devad = 0; mmd_mask; devad++, mmd_mask = mmd_mask >> 1) {
-               if (!mmd_mask & 1)
+               if (!(mmd_mask & 1))
                        continue;
 
                /* Read twice because link state is latched and a
@@ -102,4 +92,3 @@ struct phy_driver gen10g_driver = {
        .startup        = gen10g_startup,
        .shutdown       = gen10g_shutdown,
 };
-