Skip to content

Commit 61aaaf3

Browse files
committed
Merge branch 'feat/remove_eth_drivers' into 'master'
Feat/remove eth drivers Closes IDF-13553 and IDF-5865 See merge request espressif/esp-idf!42021
2 parents a44c3d4 + d622d4d commit 61aaaf3

File tree

106 files changed

+577
-7436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+577
-7436
lines changed

components/esp_eth/CMakeLists.txt

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,12 @@ if(CONFIG_ETH_ENABLED)
3030
list(APPEND srcs "src/mac/esp_eth_mac_esp.c"
3131
"src/mac/esp_eth_mac_esp_dma.c"
3232
"src/mac/esp_eth_mac_esp_gpio.c"
33-
"src/phy/esp_eth_phy_generic.c"
34-
"src/phy/esp_eth_phy_dp83848.c"
35-
"src/phy/esp_eth_phy_ip101.c"
36-
"src/phy/esp_eth_phy_ksz80xx.c"
37-
"src/phy/esp_eth_phy_lan87xx.c"
38-
"src/phy/esp_eth_phy_rtl8201.c")
39-
endif()
40-
41-
if(CONFIG_ETH_SPI_ETHERNET_DM9051)
42-
list(APPEND srcs "src/spi/dm9051/esp_eth_mac_dm9051.c"
43-
"src/spi/dm9051/esp_eth_phy_dm9051.c")
44-
endif()
45-
46-
if(CONFIG_ETH_SPI_ETHERNET_W5500)
47-
list(APPEND srcs "src/spi/w5500/esp_eth_mac_w5500.c"
48-
"src/spi/w5500/esp_eth_phy_w5500.c")
49-
endif()
50-
51-
if(CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL)
52-
list(APPEND srcs "src/spi/ksz8851snl/esp_eth_mac_ksz8851snl.c"
53-
"src/spi/ksz8851snl/esp_eth_phy_ksz8851snl.c")
33+
"src/phy/esp_eth_phy_generic.c")
5434
endif()
5535

5636
if(CONFIG_ETH_USE_OPENETH)
5737
list(APPEND srcs "src/openeth/esp_eth_mac_openeth.c"
58-
"src/phy/esp_eth_phy_dp83848.c")
38+
"src/phy/esp_eth_phy_generic.c")
5939
endif()
6040
endif()
6141

components/esp_eth/Kconfig

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -57,38 +57,13 @@ menu "Ethernet"
5757
If disabled, all functions are placed into FLASH.
5858

5959
endif # ETH_USE_ESP32_EMAC
60-
6160
menuconfig ETH_USE_SPI_ETHERNET
6261
bool "Support SPI to Ethernet Module"
6362
default y
6463
select ETH_ENABLED
6564
help
66-
ESP-IDF can also support some SPI-Ethernet modules.
67-
68-
if ETH_USE_SPI_ETHERNET
69-
config ETH_SPI_ETHERNET_DM9051
70-
bool "Use DM9051"
71-
help
72-
DM9051 is a fast Ethernet controller with an SPI interface.
73-
It's also integrated with a 10/100M PHY and MAC.
74-
Select this to enable DM9051 driver.
75-
76-
config ETH_SPI_ETHERNET_W5500
77-
bool "Use W5500 (MAC RAW)"
78-
help
79-
W5500 is a HW TCP/IP embedded Ethernet controller.
80-
TCP/IP stack, 10/100 Ethernet MAC and PHY are embedded in a single chip.
81-
However the driver in ESP-IDF only enables the RAW MAC mode,
82-
making it compatible with the software TCP/IP stack.
83-
Say yes to enable W5500 driver.
84-
85-
config ETH_SPI_ETHERNET_KSZ8851SNL
86-
bool "Use KSZ8851SNL"
87-
help
88-
The KSZ8851SNL is a single-chip Fast Ethernet controller consisting of
89-
a 10/100 physical layer transceiver (PHY), a MAC, and a Serial Peripheral Interface (SPI).
90-
Select this to enable KSZ8851SNL driver.
91-
endif # ETH_USE_SPI_ETHERNET
65+
ESP-IDF can also support SPI-Ethernet. Actual chip drivers are available as components in
66+
Component Registry.
9267

9368
menuconfig ETH_USE_OPENETH
9469
bool "Support OpenCores Ethernet MAC (for use with QEMU)"
Lines changed: 3 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -9,15 +9,14 @@
99
#include "soc/soc_caps.h"
1010
#include "esp_eth_com.h"
1111
#include "esp_eth_mac.h"
12-
#include "sdkconfig.h"
1312
#include "driver/spi_master.h"
13+
#include "sdkconfig.h"
1414

1515
#ifdef __cplusplus
1616
extern "C" {
1717
#endif
1818

1919
#if CONFIG_ETH_USE_SPI_ETHERNET
20-
2120
/**
2221
* @brief Custom SPI Driver Configuration.
2322
* This structure declares configuration and callback functions to access Ethernet SPI module via
@@ -112,125 +111,8 @@ typedef struct
112111
.read = NULL, \
113112
.write = NULL \
114113
}
115-
#endif // CONFIG_ETH_USE_SPI_ETHERNET
116-
117-
#if CONFIG_ETH_SPI_ETHERNET_DM9051
118-
/**
119-
* @brief DM9051 specific configuration
120-
*
121-
*/
122-
typedef struct {
123-
int int_gpio_num; /*!< Interrupt GPIO number, set -1 to not use interrupt and to poll rx status periodically */
124-
uint32_t poll_period_ms; /*!< Period in ms to poll rx status when interrupt mode is not used */
125-
spi_host_device_t spi_host_id; /*!< SPI peripheral (this field is invalid when custom SPI driver is defined) */
126-
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration (this field is invalid when custom SPI driver is defined) */
127-
eth_spi_custom_driver_config_t custom_spi_driver; /*!< Custom SPI driver definitions */
128-
} eth_dm9051_config_t;
129-
130-
/**
131-
* @brief Default DM9051 specific configuration
132-
*
133-
*/
134-
#define ETH_DM9051_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
135-
{ \
136-
.int_gpio_num = 4, \
137-
.poll_period_ms = 0, \
138-
.spi_host_id = spi_host, \
139-
.spi_devcfg = spi_devcfg_p, \
140-
.custom_spi_driver = ETH_DEFAULT_SPI, \
141-
}
142-
143-
/**
144-
* @brief Create DM9051 Ethernet MAC instance
145-
*
146-
* @param dm9051_config: DM9051 specific configuration
147-
* @param mac_config: Ethernet MAC configuration
148-
*
149-
* @return
150-
* - instance: create MAC instance successfully
151-
* - NULL: create MAC instance failed because some error occurred
152-
*/
153-
esp_eth_mac_t *esp_eth_mac_new_dm9051(const eth_dm9051_config_t *dm9051_config, const eth_mac_config_t *mac_config);
154-
#endif // CONFIG_ETH_SPI_ETHERNET_DM9051
155-
156-
#if CONFIG_ETH_SPI_ETHERNET_W5500
157-
/**
158-
* @brief W5500 specific configuration
159-
*
160-
*/
161-
typedef struct {
162-
int int_gpio_num; /*!< Interrupt GPIO number, set -1 to not use interrupt and to poll rx status periodically */
163-
uint32_t poll_period_ms; /*!< Period in ms to poll rx status when interrupt mode is not used */
164-
spi_host_device_t spi_host_id; /*!< SPI peripheral (this field is invalid when custom SPI driver is defined)*/
165-
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration (this field is invalid when custom SPI driver is defined)*/
166-
eth_spi_custom_driver_config_t custom_spi_driver; /*!< Custom SPI driver definitions */
167-
} eth_w5500_config_t;
168-
169-
/**
170-
* @brief Default W5500 specific configuration
171-
*
172-
*/
173-
#define ETH_W5500_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
174-
{ \
175-
.int_gpio_num = 4, \
176-
.poll_period_ms = 0, \
177-
.spi_host_id = spi_host, \
178-
.spi_devcfg = spi_devcfg_p, \
179-
.custom_spi_driver = ETH_DEFAULT_SPI, \
180-
}
181-
182-
/**
183-
* @brief Create W5500 Ethernet MAC instance
184-
*
185-
* @param w5500_config: W5500 specific configuration
186-
* @param mac_config: Ethernet MAC configuration
187-
*
188-
* @return
189-
* - instance: create MAC instance successfully
190-
* - NULL: create MAC instance failed because some error occurred
191-
*/
192-
esp_eth_mac_t *esp_eth_mac_new_w5500(const eth_w5500_config_t *w5500_config, const eth_mac_config_t *mac_config);
193-
#endif // CONFIG_ETH_SPI_ETHERNET_W5500
194-
195-
#if CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL
196-
/**
197-
* @brief KSZ8851SNL specific configuration
198-
*
199-
*/
200-
typedef struct {
201-
int int_gpio_num; /*!< Interrupt GPIO number, set -1 to not use interrupt and to poll rx status periodically */
202-
uint32_t poll_period_ms; /*!< Period in ms to poll rx status when interrupt mode is not used */
203-
spi_host_device_t spi_host_id; /*!< SPI peripheral (this field is invalid when custom SPI driver is defined) */
204-
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration (this field is invalid when custom SPI driver is defined) */
205-
eth_spi_custom_driver_config_t custom_spi_driver; /*!< Custom SPI driver definitions */
206-
} eth_ksz8851snl_config_t;
207-
208-
/**
209-
* @brief Default KSZ8851SNL specific configuration
210-
*
211-
*/
212-
#define ETH_KSZ8851SNL_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
213-
{ \
214-
.int_gpio_num = 4, \
215-
.poll_period_ms = 0, \
216-
.spi_host_id = spi_host, \
217-
.spi_devcfg = spi_devcfg_p, \
218-
.custom_spi_driver = ETH_DEFAULT_SPI, \
219-
}
220-
221-
/**
222-
* @brief Create KSZ8851SNL Ethernet MAC instance
223-
*
224-
* @param ksz8851snl_config: KSZ8851SNL specific configuration
225-
* @param mac_config: Ethernet MAC configuration
226-
*
227-
* @return
228-
* - instance: create MAC instance successfully
229-
* - NULL: create MAC instance failed because some error occurred
230-
*/
231-
esp_eth_mac_t *esp_eth_mac_new_ksz8851snl(const eth_ksz8851snl_config_t *ksz8851snl_config, const eth_mac_config_t *mac_config);
232-
#endif // CONFIG_ETH_SPI_ETHERNET_KSZ8851
233114

115+
#endif // CONFIG_ETH_USE_SPI_ETHERNET
234116
#ifdef __cplusplus
235117
}
236118
#endif

components/esp_eth/include/esp_eth_phy.h

Lines changed: 2 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -299,7 +299,7 @@ typedef struct {
299299
/**
300300
* @brief Create a PHY instance of generic chip which conforms with IEEE 802.3
301301
*
302-
* @note Default reset timing configuration is set conservatively( @c DEFAULT_PHY_RESET_ASSERTION_TIME_US ).
302+
* @note Default reset timing configuration is set conservatively(see internals of the function).
303303
* If you need faster response and your chip supports it, configure it via @c config parameter.
304304
*
305305
* @warning While basic functionality should always work, some specific features might be limited,
@@ -313,105 +313,6 @@ typedef struct {
313313
*/
314314
esp_eth_phy_t *esp_eth_phy_new_generic(const eth_phy_config_t *config);
315315

316-
/**
317-
* @brief Create a PHY instance of IP101
318-
*
319-
* @param[in] config: configuration of PHY
320-
*
321-
* @return
322-
* - instance: create PHY instance successfully
323-
* - NULL: create PHY instance failed because some error occurred
324-
*/
325-
esp_eth_phy_t *esp_eth_phy_new_ip101(const eth_phy_config_t *config);
326-
327-
/**
328-
* @brief Create a PHY instance of RTL8201
329-
*
330-
* @param[in] config: configuration of PHY
331-
*
332-
* @return
333-
* - instance: create PHY instance successfully
334-
* - NULL: create PHY instance failed because some error occurred
335-
*/
336-
esp_eth_phy_t *esp_eth_phy_new_rtl8201(const eth_phy_config_t *config);
337-
338-
/**
339-
* @brief Create a PHY instance of LAN87xx
340-
*
341-
* @param[in] config: configuration of PHY
342-
*
343-
* @return
344-
* - instance: create PHY instance successfully
345-
* - NULL: create PHY instance failed because some error occurred
346-
*/
347-
esp_eth_phy_t *esp_eth_phy_new_lan87xx(const eth_phy_config_t *config);
348-
349-
/**
350-
* @brief Create a PHY instance of DP83848
351-
*
352-
* @param[in] config: configuration of PHY
353-
*
354-
* @return
355-
* - instance: create PHY instance successfully
356-
* - NULL: create PHY instance failed because some error occurred
357-
*/
358-
esp_eth_phy_t *esp_eth_phy_new_dp83848(const eth_phy_config_t *config);
359-
360-
/**
361-
* @brief Create a PHY instance of KSZ80xx
362-
*
363-
* The phy model from the KSZ80xx series is detected automatically. If the driver
364-
* is unable to detect a supported model, \c NULL is returned.
365-
*
366-
* Currently, the following models are supported:
367-
* KSZ8001, KSZ8021, KSZ8031, KSZ8041, KSZ8051, KSZ8061, KSZ8081, KSZ8091
368-
*
369-
* @param[in] config: configuration of PHY
370-
*
371-
* @return
372-
* - instance: create PHY instance successfully
373-
* - NULL: create PHY instance failed because some error occurred
374-
*/
375-
esp_eth_phy_t *esp_eth_phy_new_ksz80xx(const eth_phy_config_t *config);
376-
377-
#if CONFIG_ETH_SPI_ETHERNET_DM9051
378-
/**
379-
* @brief Create a PHY instance of DM9051
380-
*
381-
* @param[in] config: configuration of PHY
382-
*
383-
* @return
384-
* - instance: create PHY instance successfully
385-
* - NULL: create PHY instance failed because some error occurred
386-
*/
387-
esp_eth_phy_t *esp_eth_phy_new_dm9051(const eth_phy_config_t *config);
388-
#endif
389-
390-
#if CONFIG_ETH_SPI_ETHERNET_W5500
391-
/**
392-
* @brief Create a PHY instance of W5500
393-
*
394-
* @param[in] config: configuration of PHY
395-
*
396-
* @return
397-
* - instance: create PHY instance successfully
398-
* - NULL: create PHY instance failed because some error occurred
399-
*/
400-
esp_eth_phy_t *esp_eth_phy_new_w5500(const eth_phy_config_t *config);
401-
#endif
402-
403-
#if CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL
404-
/**
405-
* @brief Create a PHY instance of KSZ8851SNL
406-
*
407-
* @param[in] config: configuration of PHY
408-
*
409-
* @return
410-
* - instance: create PHY instance successfully
411-
* - NULL: create PHY instance failed because some error occurred
412-
*/
413-
esp_eth_phy_t *esp_eth_phy_new_ksz8851snl(const eth_phy_config_t *config);
414-
#endif
415316
#ifdef __cplusplus
416317
}
417318
#endif

0 commit comments

Comments
 (0)