summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2015-12-08 16:45:30 +0100
committerMichal Simek <michal.simek@xilinx.com>2015-12-18 13:15:58 +0100
commit94067580a5b8b7a7b393e8f38fac385e3f93d780 (patch)
treec8569190512ecad3f0089d7ff516ef95fa676dde /net
parent7bccc75a2b3f728981920abde4454ba4ea4e481a (diff)
downloadu-boot-imx-94067580a5b8b7a7b393e8f38fac385e3f93d780.zip
u-boot-imx-94067580a5b8b7a7b393e8f38fac385e3f93d780.tar.gz
u-boot-imx-94067580a5b8b7a7b393e8f38fac385e3f93d780.tar.bz2
dm: net: Fix DM for targets which use MANUAL_RELOC
All ethernet operation needs to be updated for architectures which requires MANUAL_RELOC. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net')
-rw-r--r--net/eth.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/net/eth.c b/net/eth.c
index c542f4a..6cf3a35 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -541,6 +541,34 @@ static int eth_post_probe(struct udevice *dev)
struct eth_pdata *pdata = dev->platdata;
unsigned char env_enetaddr[6];
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
+ struct eth_ops *ops = eth_get_ops(dev);
+ static int reloc_done;
+
+ if (!reloc_done) {
+ if (ops->start)
+ ops->start += gd->reloc_off;
+ if (ops->send)
+ ops->send += gd->reloc_off;
+ if (ops->recv)
+ ops->recv += gd->reloc_off;
+ if (ops->free_pkt)
+ ops->free_pkt += gd->reloc_off;
+ if (ops->stop)
+ ops->stop += gd->reloc_off;
+#ifdef CONFIG_MCAST_TFTP
+ if (ops->mcast)
+ ops->mcast += gd->reloc_off;
+#endif
+ if (ops->write_hwaddr)
+ ops->write_hwaddr += gd->reloc_off;
+ if (ops->read_rom_hwaddr)
+ ops->read_rom_hwaddr += gd->reloc_off;
+
+ reloc_done++;
+ }
+#endif
+
priv->state = ETH_STATE_INIT;
/* Check if the device has a MAC address in ROM */