From 5f9ae3510a7cae5b8b3fc2cb12af0d62bd9293bb Mon Sep 17 00:00:00 2001 From: Frank Sautter Date: Mon, 1 Nov 2021 22:03:30 +0100 Subject: [PATCH 1/2] Increased LAN8720 ETH-PHY reset assertion time (IDFGH-6018) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increase reset assertion time from 100µs (as specified minimum in the datasheet) to 150µs. Some specimen of the LAN8720 need the reset signal asserted longer than 100µs to initialise properly. Otherwise they are in a zombie state where they are establishing and loosing an Ethernet link once in a seconds interval. --- components/esp_eth/src/esp_eth_phy_lan87xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/esp_eth/src/esp_eth_phy_lan87xx.c b/components/esp_eth/src/esp_eth_phy_lan87xx.c index e6465501f0..2f09cba631 100644 --- a/components/esp_eth/src/esp_eth_phy_lan87xx.c +++ b/components/esp_eth/src/esp_eth_phy_lan87xx.c @@ -337,7 +337,8 @@ static esp_err_t lan87xx_reset_hw(esp_eth_phy_t *phy) esp_rom_gpio_pad_select_gpio(lan87xx->reset_gpio_num); gpio_set_direction(lan87xx->reset_gpio_num, GPIO_MODE_OUTPUT); gpio_set_level(lan87xx->reset_gpio_num, 0); - esp_rom_delay_us(100); // insert min input assert time + /* assert nRST signal on LAN87xx a little longer than the minimum specified in datasheet */ + esp_rom_delay_us(150); gpio_set_level(lan87xx->reset_gpio_num, 1); } return ESP_OK; From 43b62a5b62afa6532e1b9c9d5ffd65c40f97a286 Mon Sep 17 00:00:00 2001 From: Ondrej Kosta Date: Tue, 2 Nov 2021 09:57:03 +0100 Subject: [PATCH 2/2] Copyright message fix for 'Increased LAN8720 ETH-PHY reset assertion time' --- components/esp_eth/src/esp_eth_phy_lan87xx.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/components/esp_eth/src/esp_eth_phy_lan87xx.c b/components/esp_eth/src/esp_eth_phy_lan87xx.c index 2f09cba631..92dbfdad23 100644 --- a/components/esp_eth/src/esp_eth_phy_lan87xx.c +++ b/components/esp_eth/src/esp_eth_phy_lan87xx.c @@ -1,16 +1,9 @@ -// Copyright 2019-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + #include #include #include