drivers: nxp_enet: Deprecate ETH_MCUX

Deprecate ETH_MCUX, by:

- Marking it as DEPRECATED in Kconfig, obviously.
- Unmarking the new driver as experimental.
- Putting the new and old drivers in the same folder.
- Reworking the menu appearance of the driver selection.
  Note that technically now it is possible to choose the wrong
  driver than what is enabled in DT, this is intentional, but
  the correct one will obviously be enabled by default.
- Convert all sample overlays to the new Kconfigs. This was
  part of the motivation for the shared overlays, as it was
  causing twister/CI logs to look ugly and misleading due
  to Kconfig warnings.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
Declan Snyder 2024-03-18 17:59:29 -05:00 committed by Alberto Escolar
parent 83bfcb1b30
commit fdbba0341c
19 changed files with 125 additions and 137 deletions

View file

@ -126,6 +126,11 @@ Drivers and Sensors
* Ethernet
* Deperecated eth_mcux driver in favor of the reworked nxp_enet driver.
* Driver nxp_enet is no longer experimental.
* All boards and SOCs with :dtcompatible:`nxp,kinetis-ethernet` compatible nodes
reworked to use the new :dtcompatible:`nxp,enet` binding.
* Flash
* GNSS

View file

@ -28,7 +28,6 @@ zephyr_library_sources_ifdef(CONFIG_ETH_ENC424J600 eth_enc424j600.c)
zephyr_library_sources_ifdef(CONFIG_ETH_ESP32 eth_esp32.c)
zephyr_library_sources_ifdef(CONFIG_DSA_KSZ8XXX dsa_ksz8xxx.c)
zephyr_library_sources_ifdef(CONFIG_ETH_LITEETH eth_liteeth.c)
zephyr_library_sources_ifdef(CONFIG_ETH_MCUX eth_mcux.c)
zephyr_library_sources_ifdef(CONFIG_ETH_SMSC911X eth_smsc911x.c)
zephyr_library_sources_ifdef(CONFIG_ETH_STELLARIS eth_stellaris.c)
zephyr_library_sources_ifdef(CONFIG_ETH_STM32_HAL eth_stm32_hal.c)
@ -40,7 +39,6 @@ zephyr_library_sources_ifdef(CONFIG_ETH_SMSC91X eth_smsc91x.c)
zephyr_library_sources_ifdef(CONFIG_ETH_IVSHMEM eth_ivshmem.c eth_ivshmem_queue.c)
zephyr_library_sources_ifdef(CONFIG_ETH_ADIN2111 eth_adin2111.c)
zephyr_library_sources_ifdef(CONFIG_ETH_LAN865X eth_lan865x.c oa_tc6.c)
zephyr_library_sources_ifdef(CONFIG_ETH_NXP_ENET eth_nxp_enet.c)
zephyr_library_sources_ifdef(CONFIG_ETH_XMC4XXX eth_xmc4xxx.c)
if(CONFIG_ETH_NXP_S32_NETC)
@ -68,3 +66,4 @@ endif()
add_subdirectory(phy)
add_subdirectory(eth_nxp_enet_qos)
add_subdirectory(nxp_enet)

View file

@ -52,7 +52,6 @@ config ETH_QEMU_EXTRA_ARGS
source "drivers/ethernet/Kconfig.enc28j60"
source "drivers/ethernet/Kconfig.enc424j600"
source "drivers/ethernet/Kconfig.esp32"
source "drivers/ethernet/Kconfig.mcux"
source "drivers/ethernet/Kconfig.e1000"
source "drivers/ethernet/Kconfig.sam_gmac"
source "drivers/ethernet/Kconfig.stm32_hal"
@ -73,13 +72,14 @@ source "drivers/ethernet/Kconfig.ivshmem"
source "drivers/ethernet/Kconfig.adin2111"
source "drivers/ethernet/Kconfig.numaker"
source "drivers/ethernet/Kconfig.lan865x"
source "drivers/ethernet/Kconfig.nxp_enet"
source "drivers/ethernet/Kconfig.xmc4xxx"
source "drivers/ethernet/eth_nxp_enet_qos/Kconfig"
source "drivers/ethernet/phy/Kconfig"
source "drivers/ethernet/nxp_enet/Kconfig"
endif # "Ethernet Drivers"
config ETH_INIT_PRIORITY

View file

@ -1,62 +0,0 @@
# NXP ENET Ethernet driver configuration options
# Copyright 2023 NXP
# SPDX-License-Identifier: Apache-2.0
menuconfig ETH_NXP_ENET
bool "NXP ENET Ethernet driver"
default y
depends on DT_HAS_NXP_ENET_MAC_ENABLED
select NOCACHE_MEMORY if HAS_MCUX_CACHE
select ARM_MPU if CPU_CORTEX_M7
select MDIO if DT_HAS_NXP_ENET_MDIO_ENABLED
select NET_POWER_MANAGEMENT if (PM_DEVICE && SOC_FAMILY_KINETIS)
select EXPERIMENTAL
help
Enable NXP ENET Ethernet driver.
if ETH_NXP_ENET
config ETH_NXP_ENET_HW_ACCELERATION
bool "Hardware acceleration"
default y
depends on !NET_IPV6
help
Enable hardware acceleration for the following:
- IPv4, UDP and TCP checksum (both Rx and Tx)
config ETH_NXP_ENET_USE_DTCM_FOR_DMA_BUFFER
bool "Use DTCM for hardware DMA buffers"
default y
help
Place the hardware DMA buffers into DTCM for better
networking performance.
config ETH_NXP_ENET_RX_THREAD_STACK_SIZE
int "NXP ENET RX thread stack size"
default 1600
help
ENET RX thread stack size in bytes.
config ETH_NXP_ENET_RX_THREAD_PRIORITY
int "NXP ENET driver RX cooperative thread priority"
default 2
help
ENET MAC Driver handles RX in cooperative workqueue thread.
This options sets the priority of that thread.
config ETH_NXP_ENET_RX_BUFFERS
int "Number of RX buffers for ethernet driver"
default 6
range 6 16
help
Set the number of RX buffers provided to the NXP ENET driver.
config ETH_NXP_ENET_TX_BUFFERS
int "Number of TX buffers for ethernet driver"
default 1
range 1 16
help
Set the number of TX buffers provided to the NXP ENET driver.
endif # ETH_NXP_ENET

View file

@ -0,0 +1,5 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0
zephyr_library_sources_ifdef(CONFIG_ETH_NXP_ENET eth_nxp_enet.c)
zephyr_library_sources_ifdef(CONFIG_ETH_MCUX eth_mcux.c)

View file

@ -1,28 +1,85 @@
# ETH_MCUX Ethernet driver configuration options
# NXP ENET ethernet drivers configuration options
# Copyright (c) 2016-2017 ARM Ltd
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0
menuconfig ETH_MCUX
menu "NXP ENET"
choice NXP_ENET_DRIVER
prompt "NXP ENET Driver Version"
default ETH_NXP_ENET if DT_HAS_NXP_ENET_MAC_ENABLED
default ETH_MCUX if DT_HAS_NXP_KINETIS_ETHERNET_ENABLED
depends on DT_HAS_NXP_ENET_MAC_ENABLED || DT_HAS_NXP_KINETIS_ETHERNET_ENABLED
config ETH_NXP_ENET
bool "NXP ENET Ethernet driver"
select NOCACHE_MEMORY if HAS_MCUX_CACHE
select ARM_MPU if CPU_CORTEX_M7
select MDIO if DT_HAS_NXP_ENET_MDIO_ENABLED
select NET_POWER_MANAGEMENT if (PM_DEVICE && SOC_FAMILY_KINETIS)
help
Enable NXP ENET Ethernet driver.
config ETH_MCUX
bool "MCUX Ethernet driver"
default y
depends on DT_HAS_NXP_KINETIS_ETHERNET_ENABLED
select NOCACHE_MEMORY if HAS_MCUX_CACHE && CPU_HAS_DCACHE
select ARM_MPU if CPU_CORTEX_M7
select NET_POWER_MANAGEMENT if PM_DEVICE
select DEPRECATED
help
Enable MCUX Ethernet driver. Note, this driver performs one shot PHY
setup. There is no support for PHY disconnect, reconnect or
configuration change.
Enable deprecated legacy MCUX Ethernet driver.
Note, this driver performs one shot PHY setup.
There is no support for PHY disconnect, reconnect or configuration change.
if ETH_MCUX
endchoice
config ETH_MCUX_USE_DTCM_FOR_DMA_BUFFER
if ETH_NXP_ENET
config ETH_NXP_ENET_USE_DTCM_FOR_DMA_BUFFER
bool "Use DTCM for hardware DMA buffers"
default y
help
Place the hardware DMA buffers into DTCM for better networking
performance
Place the hardware DMA buffers into DTCM for better
networking performance.
config ETH_NXP_ENET_HW_ACCELERATION
bool "Hardware acceleration"
default y
help
Enable hardware acceleration for the following:
- IPv4, UDP and TCP checksum (both Rx and Tx)
config ETH_NXP_ENET_RX_BUFFERS
int "Number of RX buffers for ethernet driver"
default 6
range 6 16
help
Set the number of RX buffers provided to the NXP ENET driver.
config ETH_NXP_ENET_TX_BUFFERS
int "Number of TX buffers for ethernet driver"
default 1
range 1 16
help
Set the number of TX buffers provided to the NXP ENET driver.
config ETH_NXP_ENET_RX_THREAD_STACK_SIZE
int "NXP ENET RX thread stack size"
default 1600
help
ENET RX thread stack size in bytes.
config ETH_NXP_ENET_RX_THREAD_PRIORITY
int "NXP ENET driver RX cooperative thread priority"
default 2
help
ENET MAC Driver handles RX in cooperative workqueue thread.
This options sets the priority of that thread.
endif # ETH_NXP_ENET
if ETH_MCUX
config ETH_MCUX_PROMISCUOUS_MODE
bool "Promiscuous mode"
@ -30,6 +87,36 @@ config ETH_MCUX_PROMISCUOUS_MODE
Place the Ethernet receiver in promiscuous mode. This may be useful
for debugging and not needed for normal work.
config ETH_MCUX_USE_DTCM_FOR_DMA_BUFFER
bool "Use DTCM for hardware DMA buffers"
default y
help
Place the hardware DMA buffers into DTCM for better
networking performance.
config ETH_MCUX_HW_ACCELERATION
bool "Hardware acceleration"
default y
help
Enable hardware acceleration for the following:
- IPv4, UDP and TCP checksum (both Rx and Tx)
config ETH_MCUX_RX_BUFFERS
int "Number of RX buffers for ethernet driver"
default 6
range 6 16
help
Set the number of RX buffers provided to the NXP ENET driver.
config ETH_MCUX_TX_BUFFERS
int "Number of TX buffers for ethernet driver"
default 1
range 1 16
help
Set the number of TX buffers provided to the NXP ENET driver.
menu "Legacy driver options"
config ETH_MCUX_RMII_EXT_CLK
bool "RMII clock from external sources"
help
@ -56,32 +143,12 @@ config ETH_MCUX_PHY_EXTRA_DEBUG
Enable additional PHY related debug information related to
PHY status polling.
config ETH_MCUX_RX_BUFFERS
int "Number of MCUX RX buffers"
default 6
range 6 16
help
Set the number of RX buffers provided to the MCUX driver.
config ETH_MCUX_PHY_RESET
bool "Reset the PHY at boot"
help
Reset the ethernet PHY at boot. Requires dts properties int-gpios and
reset-gpios to be present.
config ETH_MCUX_TX_BUFFERS
int "Number of MCUX TX buffers"
default 1
range 1 16
help
Set the number of TX buffers provided to the MCUX driver.
config ETH_MCUX_HW_ACCELERATION
bool "Hardware acceleration"
help
Enable hardware acceleration for the following:
- IPv4, UDP and TCP checksum (both Rx and Tx)
config PTP_CLOCK_MCUX
bool "MCUX PTP clock driver support"
default y
@ -110,4 +177,8 @@ config ETH_MCUX_PTP_CLOCK_INIT_PRIO
endif # PTP_CLOCK_MCUX
endmenu # Legacy options
endif # ETH_MCUX
endmenu # NXP ENET

View file

@ -56,7 +56,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <zephyr/drivers/pinctrl.h>
#endif
#include "eth.h"
#include "../eth.h"
#define PHY_OMS_OVERRIDE_REG 0x16U /* The PHY Operation Mode Strap Override register. */
#define PHY_OMS_STATUS_REG 0x17U /* The PHY Operation Mode Strap Status register. */

View file

@ -47,7 +47,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <zephyr/pm/device.h>
#endif
#include "eth.h"
#include "../eth.h"
#include <zephyr/drivers/ethernet/eth_nxp_enet.h>
#include <zephyr/dt-bindings/ethernet/nxp_enet.h>
#include <fsl_enet.h>

View file

@ -57,8 +57,6 @@ CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.0.2"
CONFIG_NET_CONFIG_MY_IPV4_GW="192.168.0.1"
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1"
CONFIG_ETH_MCUX_PROMISCUOUS_MODE=y
# Add RTT SHELL support -> Instead of LOG_BACKEND_RTT
# Shell can be used to test the DSA operation with e.g.
# 'net ping -I3 192.168.0.1'

View file

@ -1,5 +1,3 @@
# MCUX driver settings
CONFIG_PTP_CLOCK_MCUX=y
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2"
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::1"
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.2"

View file

@ -1,2 +0,0 @@
CONFIG_PTP_CLOCK_MCUX=y
CONFIG_ETH_MCUX_PTP_CLOCK_SRC_HZ=25000000

View file

@ -1,11 +1,9 @@
CONFIG_PTP_CLOCK_MCUX=y
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2"
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::1"
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.2"
CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.1"
CONFIG_ETH_MCUX_PTP_CLOCK_SRC_HZ=25000000
CONFIG_ETH_MCUX_RX_BUFFERS=6
CONFIG_ETH_MCUX_TX_BUFFERS=4
CONFIG_ETH_NXP_ENET_RX_BUFFERS=6
CONFIG_ETH_NXP_ENET_TX_BUFFERS=4
CONFIG_NET_GPTP_STATISTICS=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_REQUIRES_FLOAT_PRINTF=y

View file

@ -1,10 +1,8 @@
CONFIG_PTP_CLOCK_MCUX=y
CONFIG_ETH_MCUX_PTP_CLOCK_SRC_HZ=25000000
CONFIG_NET_GPTP_NEIGHBOR_PROP_DELAY_THR=1000000
CONFIG_NET_GPTP_PROBE_CLOCK_SOURCE_ON_DEMAND=y
CONFIG_NET_GPTP_CLOCK_ACCURACY_25MS=y
#CONFIG_ETH_MCUX_RX_BUFFERS=6
#CONFIG_ETH_MCUX_TX_BUFFERS=8
#CONFIG_ETH_NXP_ENET_RX_BUFFERS=6
#CONFIG_ETH_NXP_ENET_TX_BUFFERS=8
CONFIG_NET_GPTP_STATISTICS=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
CONFIG_REQUIRES_FULL_LIBC=y

View file

@ -21,10 +21,3 @@ tests:
depends_on: eth
integration_platforms:
- frdm_k64f
sample.net.gpt.nxp_enet_experimental:
extra_args: EXTRA_DTC_OVERLAY_FILE="nxp,enet-experimental.overlay"
platform_allow:
- mimxrt1050_evk
- mimxrt1060_evk
- mimxrt1064_evk
- mimxrt1024_evk

View file

@ -1,4 +1,4 @@
# Note: HW accleration does not support IPV6
CONFIG_ETH_MCUX_HW_ACCELERATION=y
CONFIG_ETH_NXP_ENET_HW_ACCELERATION=y
CONFIG_NET_SAMPLE_CODE_RELOCATE=y
CONFIG_NET_SAMPLE_CODE_RAM_NAME="ITCM"

View file

@ -1,4 +1,4 @@
# Note: HW accleration does not support IPV6
CONFIG_ETH_MCUX_HW_ACCELERATION=y
CONFIG_ETH_NXP_ENET_HW_ACCELERATION=y
CONFIG_NET_SAMPLE_CODE_RELOCATE=y
CONFIG_NET_SAMPLE_CODE_RAM_NAME="ITCM"

View file

@ -1,4 +1,4 @@
# Note: HW accleration does not support IPV6
CONFIG_ETH_MCUX_HW_ACCELERATION=y
CONFIG_ETH_NXP_ENET_HW_ACCELERATION=y
CONFIG_NET_SAMPLE_CODE_RELOCATE=y
CONFIG_NET_SAMPLE_CODE_RAM_NAME="ITCM"

View file

@ -1,4 +1,4 @@
# Note: HW accleration does not support IPV6
CONFIG_ETH_MCUX_HW_ACCELERATION=y
CONFIG_ETH_NXP_ENET_HW_ACCELERATION=y
CONFIG_NET_SAMPLE_CODE_RELOCATE=y
CONFIG_NET_SAMPLE_CODE_RAM_NAME="ITCM"

View file

@ -98,16 +98,3 @@ tests:
depends_on:
- arduino_spi
- arduino_gpio
sample.net.zperf.nxp_enet_experimental:
extra_args: EXTRA_DTC_OVERLAY_FILE="nxp,enet-experimental.overlay"
tags:
- net
- zperf
platform_allow:
- mimxrt1050_evk
- mimxrt1060_evk
- mimxrt1064_evk
- mimxrt1024_evk
- frdm_k64f
- mimxrt1170_evk/mimxrt1176/cm7
- mimxrt1160_evk/mimxrt1166/cm7