summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorJagan Teki <jagan@amarulasolutions.com>2016-12-06 00:00:51 +0100
committerStefano Babic <sbabic@denx.de>2016-12-16 17:15:27 +0100
commit1ed2570f7eebd78b6ee698fa327a0d92a478d0bc (patch)
tree7e6de2bb0b6b787444a20a59129aff71bfc785f6 /drivers/net
parent567173a610107ced9174f03290851f272b4cbfc2 (diff)
downloadu-boot-imx-1ed2570f7eebd78b6ee698fa327a0d92a478d0bc.zip
u-boot-imx-1ed2570f7eebd78b6ee698fa327a0d92a478d0bc.tar.gz
u-boot-imx-1ed2570f7eebd78b6ee698fa327a0d92a478d0bc.tar.bz2
dm: net: fec: Add .read_rom_hwaddr
Add .read_rom_hwaddr on dm eth_ops. Cc: Stefano Babic <sbabic@denx.de> Cc: Matteo Lisi <matteo.lisi@engicam.com> Cc: Michael Trimarchi <michael@amarulasolutions.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fec_mxc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 2c4be96..3304fddc 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1165,12 +1165,21 @@ int fecmxc_register_mii_postcall(struct eth_device *dev, int (*cb)(int))
#else
+static int fecmxc_read_rom_hwaddr(struct udevice *dev)
+{
+ struct fec_priv *priv = dev_get_priv(dev);
+ struct eth_pdata *pdata = dev_get_platdata(dev);
+
+ return fec_get_hwaddr(priv->dev_id, pdata->enetaddr);
+}
+
static const struct eth_ops fecmxc_ops = {
.start = fecmxc_init,
.send = fecmxc_send,
.recv = fecmxc_recv,
.stop = fecmxc_halt,
.write_hwaddr = fecmxc_set_hwaddr,
+ .read_rom_hwaddr = fecmxc_read_rom_hwaddr,
};
static int fec_phy_init(struct fec_priv *priv, struct udevice *dev)
@@ -1200,7 +1209,6 @@ static int fecmxc_probe(struct udevice *dev)
struct fec_priv *priv = dev_get_priv(dev);
struct mii_dev *bus = NULL;
int dev_id = -1;
- unsigned char ethaddr[6];
uint32_t start;
int ret;
@@ -1235,14 +1243,6 @@ static int fecmxc_probe(struct udevice *dev)
fec_set_dev_name((char *)dev->name, dev_id);
priv->dev_id = (dev_id == -1) ? 0 : dev_id;
- ret = fec_get_hwaddr(dev_id, ethaddr);
- if (!ret) {
- debug("got MAC%d address from fuse: %pM\n", dev_id, ethaddr);
- memcpy(pdata->enetaddr, ethaddr, 6);
- if (!getenv("ethaddr"))
- eth_setenv_enetaddr("ethaddr", ethaddr);
- }
-
return 0;
err_timeout: