From 16f7e78a1149095e8654e66d016cdfe5a52c86da Mon Sep 17 00:00:00 2001
From: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
Date: Mon, 18 May 2015 11:34:59 +0530
Subject: [PATCH] lwip: RGMII Ethernet not working on Artix devices

Avoid inlining of the AxiEthernetPhyDelay routine by the toolchain. Inlining of
this function can cause issues for certain use cases.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
 ThirdParty/sw_services/lwip141/src/ChangeLog                  | 3 +++
 .../src/contrib/ports/xilinx/netif/xaxiemacif_physpeed.c      | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ThirdParty/sw_services/lwip141/src/ChangeLog b/ThirdParty/sw_services/lwip141/src/ChangeLog
index a42fda4f..32dcb00e 100755
--- a/ThirdParty/sw_services/lwip141/src/ChangeLog
+++ b/ThirdParty/sw_services/lwip141/src/ChangeLog
@@ -1,5 +1,8 @@
 Change Log for lwip
 =================================
+2015-05-15
+	* Don't align the functions with the Toolchain. Fix RGMII Ethernet
+	  Not working on Artix devices (CR#861391).
 2015-03-12
 	* Fix compilation Errors during generation of LWIP Echo server
 	  application (CR#853861).
diff --git a/ThirdParty/sw_services/lwip141/src/contrib/ports/xilinx/netif/xaxiemacif_physpeed.c b/ThirdParty/sw_services/lwip141/src/contrib/ports/xilinx/netif/xaxiemacif_physpeed.c
index aaab543f..a20f47e4 100755
--- a/ThirdParty/sw_services/lwip141/src/contrib/ports/xilinx/netif/xaxiemacif_physpeed.c
+++ b/ThirdParty/sw_services/lwip141/src/contrib/ports/xilinx/netif/xaxiemacif_physpeed.c
@@ -138,7 +138,7 @@
 #define IEEE_CTRL_ISOLATE_DISABLE               0xFBFF
 #endif
 
-static void AxiEthernetUtilPhyDelay(unsigned int Seconds);
+static void __attribute__ ((noinline)) AxiEthernetUtilPhyDelay(unsigned int Seconds);
 
 static int detect_phy(XAxiEthernet *xaxiemacp)
 {
@@ -574,7 +574,7 @@ unsigned Phy_Setup (XAxiEthernet *xaxiemacp)
 	return link_speed;
 }
 
-static void AxiEthernetUtilPhyDelay(unsigned int Seconds)
+static void __attribute__ ((noinline)) AxiEthernetUtilPhyDelay(unsigned int Seconds)
 {
 #if defined (__MICROBLAZE__) || defined(__PPC__)
 	static int WarningFlag = 0;