]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/ethoc.c
sf: add paired dev info for winbond w25q16jv
[u-boot] / drivers / net / ethoc.c
index ad8c462a6099b62a4f6b2485564919b73499ea9c..3d43a58d4af89756f68b6ad6e23c508ca659a1cb 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Opencore 10/100 ethernet mac driver
  *
@@ -6,12 +7,10 @@
  *   Thierry Reding <thierry.reding@avionic-design.de>
  * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
  * Copyright (C) 2016 Cadence Design Systems Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0
  */
 
 #include <common.h>
-#include <dm/device.h>
+#include <dm.h>
 #include <dm/platform_data/net_ethoc.h>
 #include <linux/io.h>
 #include <malloc.h>
@@ -548,8 +547,8 @@ static int ethoc_mdio_read(struct mii_dev *bus, int addr, int devad, int reg)
        ethoc_write(priv, MIIADDRESS, MIIADDRESS_ADDR(addr, reg));
        ethoc_write(priv, MIICOMMAND, MIICOMMAND_READ);
 
-       rc = wait_for_bit(__func__, ethoc_reg(priv, MIISTATUS),
-                         MIISTATUS_BUSY, false, CONFIG_SYS_HZ, false);
+       rc = wait_for_bit_le32(ethoc_reg(priv, MIISTATUS),
+                              MIISTATUS_BUSY, false, CONFIG_SYS_HZ, false);
 
        if (rc == 0) {
                u32 data = ethoc_read(priv, MIIRX_DATA);
@@ -571,8 +570,8 @@ static int ethoc_mdio_write(struct mii_dev *bus, int addr, int devad, int reg,
        ethoc_write(priv, MIITX_DATA, val);
        ethoc_write(priv, MIICOMMAND, MIICOMMAND_WRITE);
 
-       rc = wait_for_bit(__func__, ethoc_reg(priv, MIISTATUS),
-                         MIISTATUS_BUSY, false, CONFIG_SYS_HZ, false);
+       rc = wait_for_bit_le32(ethoc_reg(priv, MIISTATUS),
+                              MIISTATUS_BUSY, false, CONFIG_SYS_HZ, false);
 
        if (rc == 0) {
                /* reset MII command register */
@@ -689,8 +688,8 @@ static int ethoc_ofdata_to_platdata(struct udevice *dev)
        struct ethoc_eth_pdata *pdata = dev_get_platdata(dev);
        fdt_addr_t addr;
 
-       pdata->eth_pdata.iobase = dev_get_addr(dev);
-       addr = dev_get_addr_index(dev, 1);
+       pdata->eth_pdata.iobase = devfdt_get_addr(dev);
+       addr = devfdt_get_addr_index(dev, 1);
        if (addr != FDT_ADDR_T_NONE)
                pdata->packet_base = addr;
        return 0;