From ee6ff6bdd2999987efc81fb7e1f79de6dda24952 Mon Sep 17 00:00:00 2001 From: morris Date: Thu, 9 Jul 2020 22:03:11 +0800 Subject: [PATCH] ethernet: insert min assert time for PHY HW reset Closes https://github.com/espressif/esp-idf/issues/5528 --- components/esp_eth/src/esp_eth_phy_dm9051.c | 1 + components/esp_eth/src/esp_eth_phy_dp83848.c | 1 + components/esp_eth/src/esp_eth_phy_ip101.c | 1 + components/esp_eth/src/esp_eth_phy_lan8720.c | 1 + components/esp_eth/src/esp_eth_phy_rtl8201.c | 1 + 5 files changed, 5 insertions(+) diff --git a/components/esp_eth/src/esp_eth_phy_dm9051.c b/components/esp_eth/src/esp_eth_phy_dm9051.c index 8dbe3876df..0415249792 100644 --- a/components/esp_eth/src/esp_eth_phy_dm9051.c +++ b/components/esp_eth/src/esp_eth_phy_dm9051.c @@ -192,6 +192,7 @@ static esp_err_t dm9051_reset_hw(esp_eth_phy_t *phy) gpio_pad_select_gpio(dm9051->reset_gpio_num); gpio_set_direction(dm9051->reset_gpio_num, GPIO_MODE_OUTPUT); gpio_set_level(dm9051->reset_gpio_num, 0); + ets_delay_us(100); // insert min input assert time gpio_set_level(dm9051->reset_gpio_num, 1); } return ESP_OK; diff --git a/components/esp_eth/src/esp_eth_phy_dp83848.c b/components/esp_eth/src/esp_eth_phy_dp83848.c index 9bcfeeda18..951f772081 100644 --- a/components/esp_eth/src/esp_eth_phy_dp83848.c +++ b/components/esp_eth/src/esp_eth_phy_dp83848.c @@ -181,6 +181,7 @@ static esp_err_t dp83848_reset_hw(esp_eth_phy_t *phy) gpio_pad_select_gpio(dp83848->reset_gpio_num); gpio_set_direction(dp83848->reset_gpio_num, GPIO_MODE_OUTPUT); gpio_set_level(dp83848->reset_gpio_num, 0); + ets_delay_us(100); // insert min input assert time gpio_set_level(dp83848->reset_gpio_num, 1); } return ESP_OK; diff --git a/components/esp_eth/src/esp_eth_phy_ip101.c b/components/esp_eth/src/esp_eth_phy_ip101.c index c3ea8a1b01..564974e4fb 100644 --- a/components/esp_eth/src/esp_eth_phy_ip101.c +++ b/components/esp_eth/src/esp_eth_phy_ip101.c @@ -221,6 +221,7 @@ static esp_err_t ip101_reset_hw(esp_eth_phy_t *phy) gpio_pad_select_gpio(ip101->reset_gpio_num); gpio_set_direction(ip101->reset_gpio_num, GPIO_MODE_OUTPUT); gpio_set_level(ip101->reset_gpio_num, 0); + ets_delay_us(100); // insert min input assert time gpio_set_level(ip101->reset_gpio_num, 1); } return ESP_OK; diff --git a/components/esp_eth/src/esp_eth_phy_lan8720.c b/components/esp_eth/src/esp_eth_phy_lan8720.c index b6480a6649..28a65353bd 100644 --- a/components/esp_eth/src/esp_eth_phy_lan8720.c +++ b/components/esp_eth/src/esp_eth_phy_lan8720.c @@ -266,6 +266,7 @@ static esp_err_t lan8720_reset_hw(esp_eth_phy_t *phy) gpio_pad_select_gpio(lan8720->reset_gpio_num); gpio_set_direction(lan8720->reset_gpio_num, GPIO_MODE_OUTPUT); gpio_set_level(lan8720->reset_gpio_num, 0); + ets_delay_us(100); // insert min input assert time gpio_set_level(lan8720->reset_gpio_num, 1); } return ESP_OK; diff --git a/components/esp_eth/src/esp_eth_phy_rtl8201.c b/components/esp_eth/src/esp_eth_phy_rtl8201.c index 2a5808a22c..2d94ce8522 100644 --- a/components/esp_eth/src/esp_eth_phy_rtl8201.c +++ b/components/esp_eth/src/esp_eth_phy_rtl8201.c @@ -175,6 +175,7 @@ static esp_err_t rtl8201_reset_hw(esp_eth_phy_t *phy) gpio_pad_select_gpio(rtl8201->reset_gpio_num); gpio_set_direction(rtl8201->reset_gpio_num, GPIO_MODE_OUTPUT); gpio_set_level(rtl8201->reset_gpio_num, 0); + ets_delay_us(100); // insert min input assert time gpio_set_level(rtl8201->reset_gpio_num, 1); } return ESP_OK;