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