]> Git Repo - J-u-boot.git/blobdiff - drivers/net/xilinx_axi_emac.c
common: Drop linux/delay.h from common header
[J-u-boot.git] / drivers / net / xilinx_axi_emac.c
index 80ed06ac66c9b950dd71939ea01df6422e911182..d0683db80d88413ea95c765a9fb8b3fe613edb76 100644 (file)
@@ -1,20 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2011 Michal Simek <[email protected]>
  * Copyright (C) 2011 PetaLogix
  * Copyright (C) 2010 Xilinx, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
+#include <log.h>
 #include <net.h>
 #include <malloc.h>
 #include <asm/io.h>
 #include <phy.h>
 #include <miiphy.h>
 #include <wait_bit.h>
+#include <linux/delay.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -94,6 +96,7 @@ struct axidma_priv {
        struct phy_device *phydev;
        struct mii_dev *bus;
        u8 eth_hasnobuf;
+       int phy_of_handle;
 };
 
 /* BD descriptors */
@@ -277,6 +280,8 @@ static int axiemac_phy_init(struct udevice *dev)
        phydev->supported &= supported;
        phydev->advertising = phydev->supported;
        priv->phydev = phydev;
+       if (priv->phy_of_handle)
+               priv->phydev->node = offset_to_ofnode(priv->phy_of_handle);
        phy_config(phydev);
 
        return 0;
@@ -737,8 +742,10 @@ static int axi_emac_ofdata_to_platdata(struct udevice *dev)
        priv->phyaddr = -1;
 
        offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "phy-handle");
-       if (offset > 0)
+       if (offset > 0) {
                priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
+               priv->phy_of_handle = offset;
+       }
 
        phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL);
        if (phy_mode)
This page took 0.026919 seconds and 4 git commands to generate.