summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2015-05-13 13:40:40 +0200
committerJoe Hershberger <joe.hershberger@ni.com>2015-05-19 13:33:21 -0500
commitabbfcbe58eefc1accda5dd120fcfe58d244b63dd (patch)
tree9b4c9401b5c8b8f261f8078f3d046dd6e68b943d
parent793ea947703899c36a51c30e477466c49a8e9657 (diff)
downloadu-boot-abbfcbe58eefc1accda5dd120fcfe58d244b63dd.tar.gz
u-boot-abbfcbe58eefc1accda5dd120fcfe58d244b63dd.tar.xz
u-boot-abbfcbe58eefc1accda5dd120fcfe58d244b63dd.zip
net: phy: Add support for all targets which requires MANUAL_RELOC
Targets with CONFIG_NEEDS_MANUAL_RELOC do not use REL/RELA relocation (mostly only GOT) where functions aray are not updated. This patch is fixing function pointers passed to phy_register function. This patch was tested on Microblaze architecture. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r--drivers/net/phy/phy.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f5221a3833..c8d08e8f4f 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -21,6 +21,8 @@
#include <linux/err.h>
#include <linux/compiler.h>
+DECLARE_GLOBAL_DATA_PTR;
+
/* Generic PHY support and helper functions */
/**
@@ -494,6 +496,20 @@ int phy_register(struct phy_driver *drv)
INIT_LIST_HEAD(&drv->list);
list_add_tail(&drv->list, &phy_drivers);
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+ if (drv->probe)
+ drv->probe += gd->reloc_off;
+ if (drv->config)
+ drv->config += gd->reloc_off;
+ if (drv->startup)
+ drv->startup += gd->reloc_off;
+ if (drv->shutdown)
+ drv->shutdown += gd->reloc_off;
+ if (drv->readext)
+ drv->readext += gd->reloc_off;
+ if (drv->writeext)
+ drv->writeext += gd->reloc_off;
+#endif
return 0;
}