summaryrefslogtreecommitdiff
path: root/arch/mips/mach-au1x00/au1x00_eth.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-08-15 16:38:39 -0400
committerTom Rini <trini@konsulko.com>2016-08-15 16:38:39 -0400
commit2ef98d33166e5c22a61eba29c20e236b72f1e8a2 (patch)
tree288afa85ba7134787f5c7146b0d87aaeb07d9b78 /arch/mips/mach-au1x00/au1x00_eth.c
parentb064c9124acddbcdc70843f62fda13a2d7d7a392 (diff)
parentcc2593128f7ad1b879e9e5bd3097f6c717cf4c9a (diff)
downloadu-boot-imx-2ef98d33166e5c22a61eba29c20e236b72f1e8a2.zip
u-boot-imx-2ef98d33166e5c22a61eba29c20e236b72f1e8a2.tar.gz
u-boot-imx-2ef98d33166e5c22a61eba29c20e236b72f1e8a2.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-net
Diffstat (limited to 'arch/mips/mach-au1x00/au1x00_eth.c')
-rw-r--r--arch/mips/mach-au1x00/au1x00_eth.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/arch/mips/mach-au1x00/au1x00_eth.c b/arch/mips/mach-au1x00/au1x00_eth.c
index 9216860..67f4953 100644
--- a/arch/mips/mach-au1x00/au1x00_eth.c
+++ b/arch/mips/mach-au1x00/au1x00_eth.c
@@ -73,9 +73,9 @@ mac_fifo_t mac_fifo[NO_OF_FIFOS];
#define MAX_WAIT 1000
#if defined(CONFIG_CMD_MII)
-int au1x00_miiphy_read(const char *devname, unsigned char addr,
- unsigned char reg, unsigned short * value)
+int au1x00_miiphy_read(struct mii_dev *bus, int addr, int devad, int reg)
{
+ unsigned short value = 0;
volatile u32 *mii_control_reg = (volatile u32*)(ETH0_BASE+MAC_MII_CNTRL);
volatile u32 *mii_data_reg = (volatile u32*)(ETH0_BASE+MAC_MII_DATA);
u32 mii_control;
@@ -102,12 +102,12 @@ int au1x00_miiphy_read(const char *devname, unsigned char addr,
return -1;
}
}
- *value = *mii_data_reg;
- return 0;
+ value = *mii_data_reg;
+ return value;
}
-int au1x00_miiphy_write(const char *devname, unsigned char addr,
- unsigned char reg, unsigned short value)
+int au1x00_miiphy_write(struct mii_dev *bus, int addr, int devad, int reg,
+ u16 value)
{
volatile u32 *mii_control_reg = (volatile u32*)(ETH0_BASE+MAC_MII_CNTRL);
volatile u32 *mii_data_reg = (volatile u32*)(ETH0_BASE+MAC_MII_DATA);
@@ -290,8 +290,17 @@ int au1x00_enet_initialize(bd_t *bis){
eth_register(dev);
#if defined(CONFIG_CMD_MII)
- miiphy_register(dev->name,
- au1x00_miiphy_read, au1x00_miiphy_write);
+ int retval;
+ struct mii_dev *mdiodev = mdio_alloc();
+ if (!mdiodev)
+ return -ENOMEM;
+ strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN);
+ mdiodev->read = au1x00_miiphy_read;
+ mdiodev->write = au1x00_miiphy_write;
+
+ retval = mdio_register(mdiodev);
+ if (retval < 0)
+ return retval;
#endif
return 1;