Skip to content

Commit

Permalink
_projects/armv7m7-imxrt106x-evk: Add config for iMX RT106x ENET driver
Browse files Browse the repository at this point in the history
JIRA: RTOS-507
  • Loading branch information
Julian Uziemblo authored and julianuziemblo committed Oct 1, 2024
1 parent 42214c2 commit 10e1fea
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
18 changes: 18 additions & 0 deletions _projects/armv7m7-imxrt106x-evk/build.project
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@
: "${WATCHDOG:=0}"
export WATCHDOG

#
# lwIP configuration
#
export LWIPOPTS_DIR="$(pwd)/_projects/$TARGET/lwip"
export LWIP_IPSEC_BUILD=no
export LWIP_WIFI_BUILD=no

#
# Setup model of KSZ8081 On-Board Chip
#
export EPHY_KSZ8081=RNB

PRIMARY_SCRIPT=(
"wait 2000"
"kernel ${BOOT_DEVICE}"
"go!"
)

b_image_project () {
b_log "The images have been built for the ${TARGET} platform"
}
113 changes: 113 additions & 0 deletions _projects/armv7m7-imxrt106x-evk/lwip/lwipopts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#define LWIP_TCPIP_CORE_LOCKING 1
#define LWIP_SUPPORT_CUSTOM_PBUF 1
#define LWIP_NETIF_LOOPBACK 1
#define LWIP_HAVE_SLIPIF 0
#define LWIP_NETIF_API 1
#define LWIP_SOCKET 1
#define LWIP_COMPAT_SOCKETS 0
#define LWIP_ARP 1
#define LWIP_ICMP 1
#define LWIP_RAW 1
#define LWIP_NETPACKET 1
#define LWIP_DHCP 1
#define LWIP_DNS 1
#define LWIP_AUTOIP 1
#define LWIP_UDP 1
#define LWIP_TCP 1
#define LWIP_TCP_KEEPALIVE 1
#define MEM_LIBC_MALLOC 1
#define MEMP_MEM_MALLOC 1
#define LWIP_ERRNO_INCLUDE "errno.h"
#define LWIP_DNS_API_DEFINE_ERRORS 0
#define LWIP_DNS_API_DEFINE_FLAGS 0
#define LWIP_DNS_API_DECLARE_STRUCTS 0
#define LWIP_DNS_API_DECLARE_H_ERRNO 0
#define MEMP_NUM_NETCONN 1024
#define PPP_SUPPORT 1
#define PPPOS_SUPPORT 1
#define PAP_SUPPORT 1
#define CHAP_SUPPORT 1
#define MSCHAP_SUPPORT 0
#define LWIP_TIMEVAL_PRIVATE 0

#if 0 // debugging LWiP PPPoS
#define LWIP_DEBUG 1
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
#define PPP_DEBUG LWIP_DBG_ON
#define HAVE_DRIVER_pppos 1 // register and start PPPoS driver
#define HAVE_DRIVER_pppou 1 // register and start PPPoU driver
#endif

#if 0
#define LWIP_DEBUG 1
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
#define PBUF_DEBUG LWIP_DBG_ON
#define ETHARP_DEBUG LWIP_DBG_ON
#define SOCKETS_DEBUG LWIP_DBG_ON
#endif

// debugging LWIP ENET
#define ENET_ENABLE_DEBUG 0
#define ENET_DEBUG (1 && ENET_ENABLE_DEBUG)
#define EPHY_DEBUG (1 && ENET_ENABLE_DEBUG)
#define MDIO_DEBUG (0 && ENET_ENABLE_DEBUG)
#define GPIO_DEBUG (0 && ENET_ENABLE_DEBUG)
#define ENET_SELFTEST (1 && ENET_ENABLE_DEBUG)

// Ethernet opts
#define ENET_ENABLE_FLOW_CONTROL 1
#define ENET_PROMISC_MODE 0
#define ENET_INTERNAL_LOOPBACK_MODE 0

#define TCP_MSS 1460
#define TCP_WND (32 * TCP_MSS)
#define TCP_SND_BUF TCP_WND
#define TCP_SND_QUEUELEN 192
#define ETH_PAD_SIZE 2
#define ETHARP_TABLE_MATCH_NETIF 1
#define IP_REASSEMBLY 1
#define IP_FRAG 1
#define SO_REUSE 1
#define DEFAULT_THREAD_STACKSIZE (4 * 4096)
#define TCPIP_THREAD_STACKSIZE (4 * 4096)
#define TCPIP_THREAD_PRIO 3
#define TCPIP_MBOX_SIZE 256
#define DEFAULT_RAW_RECVMBOX_SIZE 32
#define DEFAULT_UDP_RECVMBOX_SIZE 32
#define DEFAULT_TCP_RECVMBOX_SIZE 32
#define DEFAULT_ACCEPTMBOX_SIZE 32
#define LWIP_HOOK_FILENAME "phoenix-hooks.h"
#define LWIP_EXT_PF 1
#define LWIP_NETIF_STATUS_CALLBACK 1
#define LWIP_DHCP_AUTOIP_COOP 1
#define LWIP_DHCP_AUTOIP_COOP_TRIES 3
#define LWIP_SO_RCVTIMEO 1
#define LWIP_SO_SNDTIMEO 1
#define ifreq lwip_ifreq
#define LWIP_NETIF_LINK_CALLBACK 1
#define LWIP_DHCP_GET_MOBILE_AGENT 1
#define LWIP_EXT_IPSEC 1
#define LWIP_LINKMONITOR_DEV 1
#define LWIP_IFSTATUS_DEV_BUFFER_SIZE 1024
#define LWIP_IFSTATUS_DEV 1

/* required by Wi-Fi driver */
#define PBUF_LINK_HLEN 44
#define LWIP_NETIF_REMOVE_CALLBACK 1

/* stats */
#define LWIP_STATS 1
#define LWIP_STATS_DISPLAY 1
#define LINK_STATS 1
#define IP_STATS 1
#define ICMP_STATS 1
#define IGMP_STATS 1
#define IPFRAG_STATS 1
#define UDP_STATS 1
#define TCP_STATS 1
#define MEM_STATS 1
#define MEMP_STATS 1
#define PBUF_STATS 1
#define SYS_STATS 1
1 change: 1 addition & 0 deletions _targets/armv7m7/imxrt106x/user.plo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ contents:
- app {{ env.BOOT_DEVICE }} -x imxrt-multi xip1 ocram2;aips14;aips5
- app {{ env.BOOT_DEVICE }} -x psh xip1 ocram2
- app {{ env.BOOT_DEVICE }} imxrt-flash ocram2 ocram2;aips14
- app {{ env.BOOT_DEVICE }} -xn lwip;enet:0x402D8000:130:PHY:0.2:irq:-10:/dev/gpio1:reset:-9:/dev/gpio1 xip1 dtcm;aips14
- wait 2000
- go!

0 comments on commit 10e1fea

Please sign in to comment.