mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-20 00:36:01 -04:00
fix(esp_eth): ip101-specific reset_hw to match reset timings from datasheet
IP101 requires 10ms reset assertion time and 10ms post-reset delay to properly initialize.
This commit is contained in:
parent
170b46e331
commit
222f67f043
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -12,6 +12,9 @@
|
|||||||
|
|
||||||
static const char *TAG = "ip101";
|
static const char *TAG = "ip101";
|
||||||
|
|
||||||
|
#define IP101_PHY_RESET_ASSERTION_TIME_US 10000
|
||||||
|
#define IP101_PHY_POST_RESET_INIT_TIME_MS 10
|
||||||
|
|
||||||
/***************Vendor Specific Register***************/
|
/***************Vendor Specific Register***************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,6 +169,14 @@ err:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static esp_err_t ip101_reset_hw(esp_eth_phy_t *phy)
|
||||||
|
{
|
||||||
|
phy_802_3_t *phy_802_3 = esp_eth_phy_into_phy_802_3(phy);
|
||||||
|
esp_err_t ret = esp_eth_phy_802_3_reset_hw(phy_802_3, IP101_PHY_RESET_ASSERTION_TIME_US);
|
||||||
|
vTaskDelay(pdMS_TO_TICKS(IP101_PHY_POST_RESET_INIT_TIME_MS));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static esp_err_t ip101_init(esp_eth_phy_t *phy)
|
static esp_err_t ip101_init(esp_eth_phy_t *phy)
|
||||||
{
|
{
|
||||||
esp_err_t ret = ESP_OK;
|
esp_err_t ret = ESP_OK;
|
||||||
@ -197,6 +208,7 @@ esp_eth_phy_t *esp_eth_phy_new_ip101(const eth_phy_config_t *config)
|
|||||||
// redefine functions which need to be customized for sake of IP101
|
// redefine functions which need to be customized for sake of IP101
|
||||||
ip101->phy_802_3.parent.init = ip101_init;
|
ip101->phy_802_3.parent.init = ip101_init;
|
||||||
ip101->phy_802_3.parent.get_link = ip101_get_link;
|
ip101->phy_802_3.parent.get_link = ip101_get_link;
|
||||||
|
ip101->phy_802_3.parent.reset_hw = ip101_reset_hw;
|
||||||
|
|
||||||
return &ip101->phy_802_3.parent;
|
return &ip101->phy_802_3.parent;
|
||||||
err:
|
err:
|
||||||
|
Loading…
Reference in New Issue
Block a user