+// SPDX-License-Identifier: GPL-2.0+
/*
* LPC32xx Ethernet MAC interface driver
*
* (C) Copyright 2014 DENX Software Engineering GmbH
* Written-by: Albert ARIBAUD - 3ADEV <albert.aribaud@3adev.fr>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <malloc.h>
#include <miiphy.h>
#include <asm/io.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
#include <asm/types.h>
#include <asm/system.h>
#include <asm/byteorder.h>
#define MII_MAX_PHY (MADR_PHY_MASK >> MADR_PHY_OFFSET)
-DECLARE_GLOBAL_DATA_PTR;
-
#if defined(CONFIG_PHYLIB) || defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
/*
* mii_reg_read - miiphy_read callback function.
}
#endif
-#if defined(CONFIG_PHYLIB)
-int lpc32xx_eth_phy_read(struct mii_dev *bus, int phy_addr, int dev_addr,
- int reg_addr)
-{
- u16 data;
- int ret;
- ret = mii_reg_read(bus->name, phy_addr, reg_addr, &data);
- if (ret)
- return ret;
- return data;
-}
-
-int lpc32xx_eth_phy_write(struct mii_dev *bus, int phy_addr, int dev_addr,
- int reg_addr, u16 data)
-{
- return mii_reg_write(bus->name, phy_addr, reg_addr, data);
-}
-#endif
-
/*
* Provide default Ethernet buffers base address if target did not.
* Locate buffers in SRAM at 0x00001000 to avoid cache issues and
printf("mdio_alloc failed\n");
return -ENOMEM;
}
- bus->read = lpc32xx_eth_phy_read;
- bus->write = lpc32xx_eth_phy_write;
+ bus->read = mii_reg_read;
+ bus->write = mii_reg_write;
strcpy(bus->name, dev->name);
ret = mdio_register(bus);