Skip to content

Commit fdbba03

Browse files
decsnyaescolar
authored andcommitted
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 <[email protected]>
1 parent 83bfcb1 commit fdbba03

19 files changed

+125
-137
lines changed

doc/releases/release-notes-3.7.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ Drivers and Sensors
126126

127127
* Ethernet
128128

129+
* Deperecated eth_mcux driver in favor of the reworked nxp_enet driver.
130+
* Driver nxp_enet is no longer experimental.
131+
* All boards and SOCs with :dtcompatible:`nxp,kinetis-ethernet` compatible nodes
132+
reworked to use the new :dtcompatible:`nxp,enet` binding.
133+
129134
* Flash
130135

131136
* GNSS

drivers/ethernet/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ zephyr_library_sources_ifdef(CONFIG_ETH_ENC424J600 eth_enc424j600.c)
2828
zephyr_library_sources_ifdef(CONFIG_ETH_ESP32 eth_esp32.c)
2929
zephyr_library_sources_ifdef(CONFIG_DSA_KSZ8XXX dsa_ksz8xxx.c)
3030
zephyr_library_sources_ifdef(CONFIG_ETH_LITEETH eth_liteeth.c)
31-
zephyr_library_sources_ifdef(CONFIG_ETH_MCUX eth_mcux.c)
3231
zephyr_library_sources_ifdef(CONFIG_ETH_SMSC911X eth_smsc911x.c)
3332
zephyr_library_sources_ifdef(CONFIG_ETH_STELLARIS eth_stellaris.c)
3433
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)
4039
zephyr_library_sources_ifdef(CONFIG_ETH_IVSHMEM eth_ivshmem.c eth_ivshmem_queue.c)
4140
zephyr_library_sources_ifdef(CONFIG_ETH_ADIN2111 eth_adin2111.c)
4241
zephyr_library_sources_ifdef(CONFIG_ETH_LAN865X eth_lan865x.c oa_tc6.c)
43-
zephyr_library_sources_ifdef(CONFIG_ETH_NXP_ENET eth_nxp_enet.c)
4442
zephyr_library_sources_ifdef(CONFIG_ETH_XMC4XXX eth_xmc4xxx.c)
4543

4644
if(CONFIG_ETH_NXP_S32_NETC)
@@ -68,3 +66,4 @@ endif()
6866

6967
add_subdirectory(phy)
7068
add_subdirectory(eth_nxp_enet_qos)
69+
add_subdirectory(nxp_enet)

drivers/ethernet/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ config ETH_QEMU_EXTRA_ARGS
5252
source "drivers/ethernet/Kconfig.enc28j60"
5353
source "drivers/ethernet/Kconfig.enc424j600"
5454
source "drivers/ethernet/Kconfig.esp32"
55-
source "drivers/ethernet/Kconfig.mcux"
5655
source "drivers/ethernet/Kconfig.e1000"
5756
source "drivers/ethernet/Kconfig.sam_gmac"
5857
source "drivers/ethernet/Kconfig.stm32_hal"
@@ -73,13 +72,14 @@ source "drivers/ethernet/Kconfig.ivshmem"
7372
source "drivers/ethernet/Kconfig.adin2111"
7473
source "drivers/ethernet/Kconfig.numaker"
7574
source "drivers/ethernet/Kconfig.lan865x"
76-
source "drivers/ethernet/Kconfig.nxp_enet"
7775
source "drivers/ethernet/Kconfig.xmc4xxx"
7876

7977
source "drivers/ethernet/eth_nxp_enet_qos/Kconfig"
8078

8179
source "drivers/ethernet/phy/Kconfig"
8280

81+
source "drivers/ethernet/nxp_enet/Kconfig"
82+
8383
endif # "Ethernet Drivers"
8484

8585
config ETH_INIT_PRIORITY

drivers/ethernet/Kconfig.nxp_enet

Lines changed: 0 additions & 62 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2024 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_library_sources_ifdef(CONFIG_ETH_NXP_ENET eth_nxp_enet.c)
5+
zephyr_library_sources_ifdef(CONFIG_ETH_MCUX eth_mcux.c)

drivers/ethernet/Kconfig.mcux renamed to drivers/ethernet/nxp_enet/Kconfig

Lines changed: 102 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,122 @@
1-
# ETH_MCUX Ethernet driver configuration options
1+
# NXP ENET ethernet drivers configuration options
22

33
# Copyright (c) 2016-2017 ARM Ltd
4+
# Copyright 2024 NXP
45
# SPDX-License-Identifier: Apache-2.0
56

6-
menuconfig ETH_MCUX
7+
menu "NXP ENET"
8+
9+
choice NXP_ENET_DRIVER
10+
prompt "NXP ENET Driver Version"
11+
default ETH_NXP_ENET if DT_HAS_NXP_ENET_MAC_ENABLED
12+
default ETH_MCUX if DT_HAS_NXP_KINETIS_ETHERNET_ENABLED
13+
depends on DT_HAS_NXP_ENET_MAC_ENABLED || DT_HAS_NXP_KINETIS_ETHERNET_ENABLED
14+
15+
config ETH_NXP_ENET
16+
bool "NXP ENET Ethernet driver"
17+
select NOCACHE_MEMORY if HAS_MCUX_CACHE
18+
select ARM_MPU if CPU_CORTEX_M7
19+
select MDIO if DT_HAS_NXP_ENET_MDIO_ENABLED
20+
select NET_POWER_MANAGEMENT if (PM_DEVICE && SOC_FAMILY_KINETIS)
21+
help
22+
Enable NXP ENET Ethernet driver.
23+
24+
config ETH_MCUX
725
bool "MCUX Ethernet driver"
8-
default y
9-
depends on DT_HAS_NXP_KINETIS_ETHERNET_ENABLED
1026
select NOCACHE_MEMORY if HAS_MCUX_CACHE && CPU_HAS_DCACHE
1127
select ARM_MPU if CPU_CORTEX_M7
1228
select NET_POWER_MANAGEMENT if PM_DEVICE
29+
select DEPRECATED
1330
help
14-
Enable MCUX Ethernet driver. Note, this driver performs one shot PHY
15-
setup. There is no support for PHY disconnect, reconnect or
16-
configuration change.
31+
Enable deprecated legacy MCUX Ethernet driver.
32+
Note, this driver performs one shot PHY setup.
33+
There is no support for PHY disconnect, reconnect or configuration change.
1734

18-
if ETH_MCUX
35+
endchoice
1936

20-
config ETH_MCUX_USE_DTCM_FOR_DMA_BUFFER
37+
if ETH_NXP_ENET
38+
39+
config ETH_NXP_ENET_USE_DTCM_FOR_DMA_BUFFER
2140
bool "Use DTCM for hardware DMA buffers"
2241
default y
2342
help
24-
Place the hardware DMA buffers into DTCM for better networking
25-
performance
43+
Place the hardware DMA buffers into DTCM for better
44+
networking performance.
45+
46+
config ETH_NXP_ENET_HW_ACCELERATION
47+
bool "Hardware acceleration"
48+
default y
49+
help
50+
Enable hardware acceleration for the following:
51+
- IPv4, UDP and TCP checksum (both Rx and Tx)
52+
53+
config ETH_NXP_ENET_RX_BUFFERS
54+
int "Number of RX buffers for ethernet driver"
55+
default 6
56+
range 6 16
57+
help
58+
Set the number of RX buffers provided to the NXP ENET driver.
59+
60+
config ETH_NXP_ENET_TX_BUFFERS
61+
int "Number of TX buffers for ethernet driver"
62+
default 1
63+
range 1 16
64+
help
65+
Set the number of TX buffers provided to the NXP ENET driver.
66+
67+
config ETH_NXP_ENET_RX_THREAD_STACK_SIZE
68+
int "NXP ENET RX thread stack size"
69+
default 1600
70+
help
71+
ENET RX thread stack size in bytes.
72+
73+
config ETH_NXP_ENET_RX_THREAD_PRIORITY
74+
int "NXP ENET driver RX cooperative thread priority"
75+
default 2
76+
help
77+
ENET MAC Driver handles RX in cooperative workqueue thread.
78+
This options sets the priority of that thread.
79+
80+
endif # ETH_NXP_ENET
81+
82+
if ETH_MCUX
2683

2784
config ETH_MCUX_PROMISCUOUS_MODE
2885
bool "Promiscuous mode"
2986
help
3087
Place the Ethernet receiver in promiscuous mode. This may be useful
3188
for debugging and not needed for normal work.
3289

90+
config ETH_MCUX_USE_DTCM_FOR_DMA_BUFFER
91+
bool "Use DTCM for hardware DMA buffers"
92+
default y
93+
help
94+
Place the hardware DMA buffers into DTCM for better
95+
networking performance.
96+
97+
config ETH_MCUX_HW_ACCELERATION
98+
bool "Hardware acceleration"
99+
default y
100+
help
101+
Enable hardware acceleration for the following:
102+
- IPv4, UDP and TCP checksum (both Rx and Tx)
103+
104+
config ETH_MCUX_RX_BUFFERS
105+
int "Number of RX buffers for ethernet driver"
106+
default 6
107+
range 6 16
108+
help
109+
Set the number of RX buffers provided to the NXP ENET driver.
110+
111+
config ETH_MCUX_TX_BUFFERS
112+
int "Number of TX buffers for ethernet driver"
113+
default 1
114+
range 1 16
115+
help
116+
Set the number of TX buffers provided to the NXP ENET driver.
117+
118+
menu "Legacy driver options"
119+
33120
config ETH_MCUX_RMII_EXT_CLK
34121
bool "RMII clock from external sources"
35122
help
@@ -56,32 +143,12 @@ config ETH_MCUX_PHY_EXTRA_DEBUG
56143
Enable additional PHY related debug information related to
57144
PHY status polling.
58145

59-
config ETH_MCUX_RX_BUFFERS
60-
int "Number of MCUX RX buffers"
61-
default 6
62-
range 6 16
63-
help
64-
Set the number of RX buffers provided to the MCUX driver.
65-
66146
config ETH_MCUX_PHY_RESET
67147
bool "Reset the PHY at boot"
68148
help
69149
Reset the ethernet PHY at boot. Requires dts properties int-gpios and
70150
reset-gpios to be present.
71151

72-
config ETH_MCUX_TX_BUFFERS
73-
int "Number of MCUX TX buffers"
74-
default 1
75-
range 1 16
76-
help
77-
Set the number of TX buffers provided to the MCUX driver.
78-
79-
config ETH_MCUX_HW_ACCELERATION
80-
bool "Hardware acceleration"
81-
help
82-
Enable hardware acceleration for the following:
83-
- IPv4, UDP and TCP checksum (both Rx and Tx)
84-
85152
config PTP_CLOCK_MCUX
86153
bool "MCUX PTP clock driver support"
87154
default y
@@ -110,4 +177,8 @@ config ETH_MCUX_PTP_CLOCK_INIT_PRIO
110177

111178
endif # PTP_CLOCK_MCUX
112179

180+
endmenu # Legacy options
181+
113182
endif # ETH_MCUX
183+
184+
endmenu # NXP ENET

drivers/ethernet/eth_mcux.c renamed to drivers/ethernet/nxp_enet/eth_mcux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
5656
#include <zephyr/drivers/pinctrl.h>
5757
#endif
5858

59-
#include "eth.h"
59+
#include "../eth.h"
6060

6161
#define PHY_OMS_OVERRIDE_REG 0x16U /* The PHY Operation Mode Strap Override register. */
6262
#define PHY_OMS_STATUS_REG 0x17U /* The PHY Operation Mode Strap Status register. */

drivers/ethernet/eth_nxp_enet.c renamed to drivers/ethernet/nxp_enet/eth_nxp_enet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
4747
#include <zephyr/pm/device.h>
4848
#endif
4949

50-
#include "eth.h"
50+
#include "../eth.h"
5151
#include <zephyr/drivers/ethernet/eth_nxp_enet.h>
5252
#include <zephyr/dt-bindings/ethernet/nxp_enet.h>
5353
#include <fsl_enet.h>

samples/net/dsa/prj.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.0.2"
5757
CONFIG_NET_CONFIG_MY_IPV4_GW="192.168.0.1"
5858
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1"
5959

60-
CONFIG_ETH_MCUX_PROMISCUOUS_MODE=y
61-
6260
# Add RTT SHELL support -> Instead of LOG_BACKEND_RTT
6361
# Shell can be used to test the DSA operation with e.g.
6462
# 'net ping -I3 192.168.0.1'

samples/net/gptp/boards/frdm_k64f.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# MCUX driver settings
2-
CONFIG_PTP_CLOCK_MCUX=y
31
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2"
42
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::1"
53
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.2"

0 commit comments

Comments
 (0)