Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 Ethernet: Added new PHY support #35671

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,53 @@ menu "CHIP Device Layer"
help
Set PHY address according your board schematic.

choice ETH_PHY_TYPE
prompt "Ethernet PHY Device"
default ETH_PHY_TYPE_IP101
help
Select the Ethernet PHY device to use in the example.

config ETH_PHY_TYPE_IP101
bool "IP101"
help
IP101 is a single port 10/100 MII/RMII/TP/Fiber Fast Ethernet Transceiver.
Goto http://www.icplus.com.tw/pp-IP101G.html for more information about it.

config ETH_PHY_TYPE_RTL8201
bool "RTL8201/SR8201"
help
RTL8201F/SR8201F is a single port 10/100Mb Ethernet Transceiver with auto MDIX.
Goto http://www.corechip-sz.com/productsview.asp?id=22 for more information about it.

config ETH_PHY_TYPE_LAN87XX
bool "LAN87xx"
help
Below chips are supported:
LAN8710A is a small footprint MII/RMII 10/100 Ethernet Transceiver with HP Auto-MDIX and
flexPWR® Technology.
LAN8720A is a small footprint RMII 10/100 Ethernet Transceiver with HP Auto-MDIX Support.
LAN8740A/LAN8741A is a small footprint MII/RMII 10/100 Energy Efficient Ethernet Transceiver
with HP Auto-MDIX and flexPWR® Technology.
LAN8742A is a small footprint RMII 10/100 Ethernet Transceiver with HP Auto-MDIX and
flexPWR® Technology.
Goto https://www.microchip.com for more information about them.

config ETH_PHY_TYPE_DP83848
bool "DP83848"
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 ETH_PHY_TYPE_KSZ80XX
bool "KSZ80xx"
help
With the KSZ80xx series, Microchip offers single-chip 10BASE-T/100BASE-TX
Ethernet Physical Layer Transceivers (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 # ETH_PHY_MODEL

endmenu

menu "Time Sync Options"
Expand Down
16 changes: 15 additions & 1 deletion src/platform/ESP32/NetworkCommissioningDriver_Ethernet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,21 @@ CHIP_ERROR ESPEthernetDriver::Init(NetworkStatusChangeCallback * networkStatusCh
esp32_emac_config.smi_mdc_gpio_num = CONFIG_ETH_MDC_GPIO;
esp32_emac_config.smi_mdio_gpio_num = CONFIG_ETH_MDIO_GPIO;
esp_eth_mac_t * mac = esp_eth_mac_new_esp32(&esp32_emac_config, &mac_config);
esp_eth_phy_t * phy = esp_eth_phy_new_ip101(&phy_config);

// Based on https://github.com/espressif/esp-idf/tree/master/examples/ethernet/basic/components/ethernet_init
#if defined(CONFIG_ETH_PHY_TYPE_IP101)
esp_eth_phy_t * phy = esp_eth_phy_new_ip101(&phy_config);
#elif defined(CONFIG_ETH_PHY_TYPE_RTL8201)
esp_eth_phy_t * phy = esp_eth_phy_new_rtl8201(&phy_config);
#elif defined(CONFIG_ETH_PHY_TYPE_LAN87XX)
esp_eth_phy_t * phy = esp_eth_phy_new_lan87xx(&phy_config);
#elif defined(CONFIG_ETH_PHY_TYPE_DP83848)
esp_eth_phy_t * phy = esp_eth_phy_new_dp83848(&phy_config);
#elif defined(CONFIG_ETH_PHY_TYPE_KSZ80XX)
esp_eth_phy_t * phy = esp_eth_phy_new_ksz80xx(&phy_config);
#else
#error "Ethernet PHY not selected"
#endif

esp_eth_config_t config = ETH_DEFAULT_CONFIG(mac, phy);
esp_eth_handle_t eth_handle = NULL;
Expand Down
Loading