[rtems-lwip commit] Fix build for arm/tms570 BSPs

Sebastian Huber sebh at rtems.org
Fri Mar 24 10:22:57 UTC 2023


Module:    rtems-lwip
Branch:    master
Commit:    5fc0adebb90bbcd95d70168d5b167317ee42cf9b
Changeset: http://git.rtems.org/rtems-lwip/commit/?id=5fc0adebb90bbcd95d70168d5b167317ee42cf9b

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar  9 12:58:22 2023 +0100

Fix build for arm/tms570 BSPs

---

 defs/bsps/arm/tms570_base.json               |  6 ++++--
 uLan/ports/driver/tms570_emac/eth_lwip.c     | 15 +++++++++++----
 uLan/ports/driver/tms570_emac/phy_dp83848h.c |  3 +++
 uLan/ports/driver/tms570_emac/phy_dp83848h.h |  4 ++++
 4 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/defs/bsps/arm/tms570_base.json b/defs/bsps/arm/tms570_base.json
index 33cd969..050f77a 100644
--- a/defs/bsps/arm/tms570_base.json
+++ b/defs/bsps/arm/tms570_base.json
@@ -1,9 +1,11 @@
 {
 	"header-paths-to-import": [
 		"uLan/ports/driver/tms570_emac",
-		"uLan/ports/os"
+		"uLan/ports/os",
+		"cpsw/src/include"
 	],
 	"source-paths-to-import": [
-		"uLan/ports/driver/tms570_emac"
+		"uLan/ports/driver/tms570_emac",
+		"cpsw/src"
 	]
 }
diff --git a/uLan/ports/driver/tms570_emac/eth_lwip.c b/uLan/ports/driver/tms570_emac/eth_lwip.c
index 6105268..0315cdf 100644
--- a/uLan/ports/driver/tms570_emac/eth_lwip.c
+++ b/uLan/ports/driver/tms570_emac/eth_lwip.c
@@ -39,7 +39,7 @@
 #include "netif/etharp.h" /* includes - lwip/ip.h, lwip/netif.h, lwip/ip_addr.h, lwip/pbuf.h */
 #include "eth_lwip_default.h"
 #include "eth_lwip.h"
-#include "beaglebone.h"
+#include "tms570_netif.h"
 #include <stdio.h>
 
 /* The lwIP network interface structure for the Ethernet EMAC. */
@@ -72,8 +72,13 @@ eth_lwip_get_dhcp_info(void)
   }
 }
 
-int8_t
-eth_lwip_init(uint8_t *mac_addr)
+int start_networking(
+  struct netif  *net_interface,
+  ip_addr_t     *ipaddr,
+  ip_addr_t     *netmask,
+  ip_addr_t     *gateway,
+  unsigned char *mac_addr
+)
 {
   unsigned int instance_number = 0;
   int8_t retVal = SUCCESS;
@@ -103,15 +108,17 @@ eth_lwip_init(uint8_t *mac_addr)
 #endif
 
   netif_tmp = netif_add(netif, &ip_addr, &net_mask, &gw_addr,
-                        NULL, ETH_LWIP_INIT_NETIF_FNC, tcpip_input);
+                        NULL, tms570_eth_init_netif, tcpip_input);
 
   if (netif_tmp == NULL)
     return NETIF_ADD_ERR;
 
   netif_set_default(netif);
+#if LWIP_NETIF_API
   netifapi_netif_set_up(netif);
 #if !STATIC_IP_ADDRESS
   netifapi_dhcp_start(netif);
+#endif
 #endif
 
   return retVal;
diff --git a/uLan/ports/driver/tms570_emac/phy_dp83848h.c b/uLan/ports/driver/tms570_emac/phy_dp83848h.c
index d20f669..91516bf 100644
--- a/uLan/ports/driver/tms570_emac/phy_dp83848h.c
+++ b/uLan/ports/driver/tms570_emac/phy_dp83848h.c
@@ -34,6 +34,9 @@
 
 #include "ti_drv_mdio.h"
 #include "phy_dp83848h.h"
+#ifdef __rtems__
+#include "mdio.h"
+#endif /* __rtems__ */
 
 #ifndef TRUE
 /**
diff --git a/uLan/ports/driver/tms570_emac/phy_dp83848h.h b/uLan/ports/driver/tms570_emac/phy_dp83848h.h
index 58d9f04..d45ecc5 100644
--- a/uLan/ports/driver/tms570_emac/phy_dp83848h.h
+++ b/uLan/ports/driver/tms570_emac/phy_dp83848h.h
@@ -35,6 +35,10 @@
 #ifndef __DRV_PHY_H
 #define __DRV_PHY_H
 
+#ifdef __rtems__
+#include <bsp/ti_herc/reg_mdio.h>
+#endif /* __rtems__ */
+
 #ifdef __cplusplus
 extern "C" {
 #endif



More information about the vc mailing list