[lwip 1/2] Fix build for arm/tms570 BSPs

Kinsey Moore kinsey.moore at oarcorp.com
Thu Mar 9 13:50:18 UTC 2023


The changes to TI sources for dp83848h should use the #ifdef __rtems__
convention since they will not be fully integrated into the rtemslwip
directory.

Kinsey

On Thu, Mar 9, 2023 at 6:13 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> ---
>  defs/bsps/arm/tms570_base.json               |  6 ++++--
>  uLan/ports/driver/tms570_emac/eth_lwip.c     | 15 +++++++++++----
>  uLan/ports/driver/tms570_emac/phy_dp83848h.c |  1 +
>  uLan/ports/driver/tms570_emac/phy_dp83848h.h |  2 ++
>  4 files changed, 18 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..dec1011 100644
> --- a/uLan/ports/driver/tms570_emac/phy_dp83848h.c
> +++ b/uLan/ports/driver/tms570_emac/phy_dp83848h.c
> @@ -34,6 +34,7 @@
>
>  #include "ti_drv_mdio.h"
>  #include "phy_dp83848h.h"
> +#include "mdio.h"
>
>  #ifndef TRUE
>  /**
> diff --git a/uLan/ports/driver/tms570_emac/phy_dp83848h.h
> b/uLan/ports/driver/tms570_emac/phy_dp83848h.h
> index 58d9f04..8ddb3ec 100644
> --- a/uLan/ports/driver/tms570_emac/phy_dp83848h.h
> +++ b/uLan/ports/driver/tms570_emac/phy_dp83848h.h
> @@ -35,6 +35,8 @@
>  #ifndef __DRV_PHY_H
>  #define __DRV_PHY_H
>
> +#include <bsp/ti_herc/reg_mdio.h>
> +
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
> --
> 2.35.3
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20230309/b46748db/attachment.htm>


More information about the devel mailing list