1# NXP ENET ethernet drivers configuration options
2
3# Copyright (c) 2016-2017 ARM Ltd
4# Copyright 2024 NXP
5# SPDX-License-Identifier: Apache-2.0
6
7menu "NXP ENET"
8
9choice 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
15config ETH_NXP_ENET
16	bool "NXP ENET Ethernet driver"
17	select NOCACHE_MEMORY if HAS_MCUX_CACHE && CPU_HAS_DCACHE
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	select ETH_DSA_SUPPORT
22	help
23	  Enable NXP ENET Ethernet driver.
24
25config ETH_MCUX
26	bool "MCUX Ethernet driver"
27	select NOCACHE_MEMORY if HAS_MCUX_CACHE && CPU_HAS_DCACHE
28	select ARM_MPU if CPU_CORTEX_M7
29	select NET_POWER_MANAGEMENT if PM_DEVICE
30	select ETH_DSA_SUPPORT
31	select DEPRECATED
32	help
33	  Enable deprecated legacy MCUX Ethernet driver.
34	  Note, this driver performs one shot PHY setup.
35	  There is no support for PHY disconnect, reconnect or configuration change.
36
37endchoice
38
39if ETH_NXP_ENET
40
41config ETH_NXP_ENET_1G
42	bool "1G mode for ENET1G instance"
43	default y
44	depends on DT_HAS_NXP_ENET1G_ENABLED
45	help
46	  Enable the use of the ENET1G ethernet instance in 1G mode.
47
48config ETH_NXP_ENET_USE_DTCM_FOR_DMA_BUFFER
49	bool "Use DTCM for hardware DMA buffers"
50	default y
51	help
52	  Place the hardware DMA buffers into DTCM for better
53	  networking performance.
54
55config ETH_NXP_ENET_HW_ACCELERATION
56	bool "Hardware acceleration"
57	default y
58	depends on !NET_IPV6
59	help
60	  Enable hardware acceleration for the following:
61	  - IPv4, UDP and TCP checksum (both Rx and Tx)
62
63config ETH_NXP_ENET_RX_BUFFERS
64	int "Number of RX buffers for ethernet driver"
65	default 6
66	range 6 16
67	help
68	  Set the number of RX buffers provided to the NXP ENET driver.
69
70config ETH_NXP_ENET_TX_BUFFERS
71	int "Number of TX buffers for ethernet driver"
72	default 1
73	range 1 16
74	help
75	  Set the number of TX buffers provided to the NXP ENET driver.
76
77config ETH_NXP_ENET_RX_THREAD_STACK_SIZE
78	int "NXP ENET RX thread stack size"
79	default 1600
80	help
81	  ENET RX thread stack size in bytes.
82
83config ETH_NXP_ENET_RX_THREAD_PRIORITY
84	int "NXP ENET driver RX cooperative thread priority"
85	default 2
86	help
87	  ENET MAC Driver handles RX in cooperative workqueue thread.
88	  This options sets the priority of that thread.
89
90endif # ETH_NXP_ENET
91
92if ETH_MCUX
93
94config ETH_MCUX_PROMISCUOUS_MODE
95	bool "Promiscuous mode"
96	help
97	  Place the Ethernet receiver in promiscuous mode. This may be useful
98	  for debugging and not needed for normal work.
99
100config ETH_MCUX_USE_DTCM_FOR_DMA_BUFFER
101	bool "Use DTCM for hardware DMA buffers"
102	default y
103	help
104	  Place the hardware DMA buffers into DTCM for better
105	  networking performance.
106
107config ETH_MCUX_HW_ACCELERATION
108	bool "Hardware acceleration"
109	default y
110	help
111	  Enable hardware acceleration for the following:
112	  - IPv4, UDP and TCP checksum (both Rx and Tx)
113
114config ETH_MCUX_RX_BUFFERS
115	int "Number of RX buffers for ethernet driver"
116	default 6
117	range 6 16
118	help
119	  Set the number of RX buffers provided to the NXP ENET driver.
120
121config ETH_MCUX_TX_BUFFERS
122	int "Number of TX buffers for ethernet driver"
123	default 1
124	range 1 16
125	help
126	  Set the number of TX buffers provided to the NXP ENET driver.
127
128menu "Legacy driver options"
129
130config ETH_MCUX_RMII_EXT_CLK
131	bool "RMII clock from external sources"
132	help
133	  Setting this option will configure MCUX clock block to feed RMII
134	  reference clock from external source (ENET_1588_CLKIN)
135
136config ETH_MCUX_NO_PHY_SMI
137	bool "Do not use SMI for PHY communication"
138	help
139	  Some PHY devices, with DSA capabilities do not use SMI for
140	  communication with MAC ENET controller. Other busses - like SPI
141	  or I2C are used instead.
142
143config ETH_MCUX_PHY_TICK_MS
144	int "PHY poll period (ms)"
145	default 1000
146	range 100 30000
147	help
148	  Set the PHY status polling period.
149
150config ETH_MCUX_PHY_EXTRA_DEBUG
151	bool "Additional detailed PHY debug"
152	help
153	  Enable additional PHY related debug information related to
154	  PHY status polling.
155
156config ETH_MCUX_PHY_RESET
157	bool "Reset the PHY at boot"
158	help
159	  Reset the ethernet PHY at boot. Requires dts properties int-gpios and
160	  reset-gpios to be present.
161
162config PTP_CLOCK_MCUX
163	bool "MCUX PTP clock driver support"
164	default y
165	depends on PTP_CLOCK || NET_L2_PTP
166	help
167	  Enable MCUX PTP clock support.
168
169if PTP_CLOCK_MCUX
170
171config ETH_MCUX_PTP_CLOCK_SRC_HZ
172	int "Frequency of the clock source for the PTP timer"
173	default 50000000 if SOC_SERIES_KINETIS_K6X
174	default 50000000 if SOC_SERIES_IMXRT10XX
175	default 24000000 if SOC_SERIES_IMXRT11XX
176	help
177	  Set the frequency in Hz sourced to the PTP timer.
178	  If the value is set properly, the timer will be accurate.
179
180config ETH_MCUX_PTP_CLOCK_INIT_PRIO
181	int
182	default 85
183	help
184	  MCUX PTP Clock initialization priority level. There is
185	  a dependency from the network stack that this device
186	  initializes before network stack (NET_INIT_PRIO).
187
188endif # PTP_CLOCK_MCUX
189
190endmenu # Legacy options
191
192endif # ETH_MCUX
193
194endmenu # NXP ENET
195