esp32/network_lan: Add PHY_GENERIC device type.

Support the new PHY_GENERIC device type, added in ESP-IDF v5.4.0 [1].

This PHY driver was added to ESP-IDF to support "generic"/oddball PHY
LAN chips like the JL1101, which offer no features beyond the bare
802.3 PHY standard and don't actually need a chip-specific driver (see
discussion at [2]).

[1] 0738314308
[2] https://github.com/espressif/esp-eth-drivers/pull/28

Signed-off-by: Elvis Pfutzenreuter <epxx@epxx.co>
This commit is contained in:
Elvis Pfutzenreuter
2025-05-01 14:30:04 -03:00
parent 90aeac800a
commit ecbbc512b2
4 changed files with 22 additions and 0 deletions

View File

@@ -163,6 +163,9 @@ static mp_obj_t get_lan(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_ar
#if PHY_LAN867X_ENABLED
args[ARG_phy_type].u_int != PHY_LAN8670 &&
#endif
#if PHY_GENERIC_ENABLED
args[ARG_phy_type].u_int != PHY_GENERIC &&
#endif
#if CONFIG_ETH_USE_SPI_ETHERNET
#if CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL
args[ARG_phy_type].u_int != PHY_KSZ8851SNL &&
@@ -243,6 +246,11 @@ static mp_obj_t get_lan(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_ar
self->phy = esp_eth_phy_new_lan867x(&phy_config);
break;
#endif
#if PHY_GENERIC_ENABLED
case PHY_GENERIC:
self->phy = esp_eth_phy_new_generic(&phy_config);
break;
#endif
#endif // CONFIG_IDF_TARGET_ESP32
#if CONFIG_ETH_USE_SPI_ETHERNET
#if CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL