All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: phy: Add support for all targets which requires MANUAL_RELOC
@ 2015-05-13 11:40 Michal Simek
  2015-05-13 15:37 ` Joe Hershberger
  2015-05-13 19:32 ` Joe Hershberger
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Simek @ 2015-05-13 11:40 UTC (permalink / raw)
  To: u-boot

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>
---

 drivers/net/phy/phy.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f5221a3833fe..c8d08e8f4f1c 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;
 }
 
-- 
2.3.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] net: phy: Add support for all targets which requires MANUAL_RELOC
  2015-05-13 11:40 [U-Boot] [PATCH] net: phy: Add support for all targets which requires MANUAL_RELOC Michal Simek
@ 2015-05-13 15:37 ` Joe Hershberger
  2015-05-13 19:32 ` Joe Hershberger
  1 sibling, 0 replies; 4+ messages in thread
From: Joe Hershberger @ 2015-05-13 15:37 UTC (permalink / raw)
  To: u-boot

Hi Michal,

On Wed, May 13, 2015 at 6:40 AM, Michal Simek <michal.simek@xilinx.com> wrote:
> 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>

I'll pick this up in a bit.

-Joe

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] net: phy: Add support for all targets which requires MANUAL_RELOC
  2015-05-13 11:40 [U-Boot] [PATCH] net: phy: Add support for all targets which requires MANUAL_RELOC Michal Simek
  2015-05-13 15:37 ` Joe Hershberger
@ 2015-05-13 19:32 ` Joe Hershberger
  2015-05-14  6:31   ` Michal Simek
  1 sibling, 1 reply; 4+ messages in thread
From: Joe Hershberger @ 2015-05-13 19:32 UTC (permalink / raw)
  To: u-boot

Hi Michal,

On Wed, May 13, 2015 at 6:40 AM, Michal Simek <michal.simek@xilinx.com> wrote:
> 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>
> ---

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] net: phy: Add support for all targets which requires MANUAL_RELOC
  2015-05-13 19:32 ` Joe Hershberger
@ 2015-05-14  6:31   ` Michal Simek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2015-05-14  6:31 UTC (permalink / raw)
  To: u-boot

On 05/13/2015 09:32 PM, Joe Hershberger wrote:
> Hi Michal,
> 
> On Wed, May 13, 2015 at 6:40 AM, Michal Simek <michal.simek@xilinx.com> wrote:
>> 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>
>> ---
> 
> Applied to u-boot-net/next, thanks!

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

Thanks,
Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-14  6:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 11:40 [U-Boot] [PATCH] net: phy: Add support for all targets which requires MANUAL_RELOC Michal Simek
2015-05-13 15:37 ` Joe Hershberger
2015-05-13 19:32 ` Joe Hershberger
2015-05-14  6:31   ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.