Skip to contentSkip to conversation

net: phy: Add support for all targets which requires MANUAL_RELOC

PATCH New Michal Simek 2 participants 4 messages May 13, 2015 – May 14, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

 drivers/net/phy/phy.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/net/phy/phy.c +16 -0
index f5221a3833fe..c8d08e8f4f1c 100644
@@ -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;
 }
 
Signature · 1 line
2.3.5
#1 lore raw

PATCH 1/1 net: phy: Add support for all targets which requires MANUAL_RELOC

Hi Michal,

Quoted 8 lines · Michal Simek

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.

---

I'll pick this up in a bit.

-Joe

#2 lore raw

PATCH 1/1 net: phy: Add support for all targets which requires MANUAL_RELOC

In reply to Michal Simek

Hi Michal,

Quoted 8 lines · Michal Simek

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.

---

Applied to u-boot-net/next, thanks!
-Joe

#3 lore raw

PATCH 1/1 net: phy: Add support for all targets which requires MANUAL_RELOC

Quoted 9 lines · Joe Hershberger

Hi Michal,

Quoted 6 lines · Michal Simek

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.

Quoted 4 lines
Quoted 2 lines

---

Applied to u-boot-net/next, thanks!

Thanks. Hopefully this will go to 2015.07 because it is bug fix. :-)

Thanks,
Michal