From 145a8d22914b68efb6181b3dc422aaa9a9fd5efe Mon Sep 17 00:00:00 2001 From: Fischerauer Christian Date: Tue, 16 Nov 2021 16:18:43 +0100 Subject: [PATCH] esp_eth: rework KSZ80xx implementation and add more KSZ80xx PHYs * add support for KSZ8001, KSZ8021, KSZ8031, KSZ8051 and KSZ8061 * remove duplicate code * simplify architecture to make the code base extensible (for future work) * Original commit: espressif/esp-idf@3fb83f2866f266209e3aaed0c80df952b8d82b91 --- .../protocol_examples_common/Kconfig.projbuild | 9 +++++++++ .../common_components/protocol_examples_common/connect.c | 2 ++ 2 files changed, 11 insertions(+) diff --git a/examples/common_components/protocol_examples_common/Kconfig.projbuild b/examples/common_components/protocol_examples_common/Kconfig.projbuild index 079cbb260..867863e48 100644 --- a/examples/common_components/protocol_examples_common/Kconfig.projbuild +++ b/examples/common_components/protocol_examples_common/Kconfig.projbuild @@ -191,6 +191,15 @@ menu "Example Connection Configuration" help DP83848 is a single port 10/100Mb/s Ethernet Physical Layer Transceiver. Goto http://www.ti.com/product/DP83848J for more information about it. + + config EXAMPLE_ETH_PHY_KSZ80XX + bool "KSZ80xx" + help + With the KSZ80xx series, Microchip offers single-chip 10BASE-T/100BASE-TX + Ethernet Physical Layer Tranceivers (PHY). + The following chips are supported: KSZ8001, KSZ8021, KSZ8031, KSZ8041, + KSZ8051, KSZ8061, KSZ8081, KSZ8091 + Goto https://www.microchip.com for more information about them. endchoice config EXAMPLE_ETH_MDC_GPIO diff --git a/examples/common_components/protocol_examples_common/connect.c b/examples/common_components/protocol_examples_common/connect.c index 0f2dc3f9c..b3b03940f 100644 --- a/examples/common_components/protocol_examples_common/connect.c +++ b/examples/common_components/protocol_examples_common/connect.c @@ -390,6 +390,8 @@ static esp_netif_t *eth_start(void) s_phy = esp_eth_phy_new_lan87xx(&phy_config); #elif CONFIG_EXAMPLE_ETH_PHY_DP83848 s_phy = esp_eth_phy_new_dp83848(&phy_config); +#elif CONFIG_EXAMPLE_ETH_PHY_KSZ80XX + s_phy = esp_eth_phy_new_ksz80xx(&phy_config); #endif #elif CONFIG_EXAMPLE_USE_SPI_ETHERNET gpio_install_isr_service(0);