Merge branch 'bugfix/update_phy_lib_same_to_master_v4.4' into 'release/v4.4'

fix(phy): update phy lib (v4.4)

See merge request espressif/esp-idf!26867
This commit is contained in:
Jiang Jiang Jian 2023-11-07 10:29:48 +08:00
commit 13b649ab95
7 changed files with 88 additions and 39 deletions

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -245,6 +245,18 @@ esp_err_t esp_phy_apply_phy_init_data(uint8_t *init_data);
*/ */
char * get_phy_version_str(void); char * get_phy_version_str(void);
/**
* @brief Set PHY init parameters
* @param param is 1 means combo module
*/
void phy_init_param_set(uint8_t param);
/**
* @brief Wi-Fi RX enable
* @param enable Whether to enable phy for wifi
*/
void phy_wifi_enable_set(uint8_t enable);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -1 +1 @@
Subproject commit 32583f98f229ab9b3c48aa3a10f954fcdddfe4d1 Subproject commit 8590ca3a3575d879646ba76763f3b40d92cddf53

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -674,6 +674,13 @@ void esp_phy_load_cal_and_init(void)
#if CONFIG_IDF_TARGET_ESP32S2 #if CONFIG_IDF_TARGET_ESP32S2
phy_eco_version_sel(efuse_hal_chip_revision() / 100); phy_eco_version_sel(efuse_hal_chip_revision() / 100);
#endif #endif
// Set PHY whether in combo module
// For comode mode, phy enable will be not in WiFi RX state
#if SOC_PHY_COMBO_MODULE
phy_init_param_set(0);
#endif
esp_phy_calibration_data_t* cal_data = esp_phy_calibration_data_t* cal_data =
(esp_phy_calibration_data_t*) calloc(sizeof(esp_phy_calibration_data_t), 1); (esp_phy_calibration_data_t*) calloc(sizeof(esp_phy_calibration_data_t), 1);
if (cal_data == NULL) { if (cal_data == NULL) {

View File

@ -1,16 +1,8 @@
// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
@ -727,6 +719,18 @@ int32_t IRAM_ATTR coex_is_in_isr_wrapper(void)
return !xPortCanYield(); return !xPortCanYield();
} }
static void esp_phy_enable_wrapper(void)
{
esp_phy_enable();
phy_wifi_enable_set(1);
}
static void esp_phy_disable_wrapper(void)
{
phy_wifi_enable_set(0);
esp_phy_disable();
}
wifi_osi_funcs_t g_wifi_osi_funcs = { wifi_osi_funcs_t g_wifi_osi_funcs = {
._version = ESP_WIFI_OS_ADAPTER_VERSION, ._version = ESP_WIFI_OS_ADAPTER_VERSION,
._env_is_chip = env_is_chip_wrapper, ._env_is_chip = env_is_chip_wrapper,
@ -780,8 +784,8 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._dport_access_stall_other_cpu_end_wrap = s_esp_dport_access_stall_other_cpu_end, ._dport_access_stall_other_cpu_end_wrap = s_esp_dport_access_stall_other_cpu_end,
._wifi_apb80m_request = wifi_apb80m_request_wrapper, ._wifi_apb80m_request = wifi_apb80m_request_wrapper,
._wifi_apb80m_release = wifi_apb80m_release_wrapper, ._wifi_apb80m_release = wifi_apb80m_release_wrapper,
._phy_disable = esp_phy_disable, ._phy_disable = esp_phy_disable_wrapper,
._phy_enable = esp_phy_enable, ._phy_enable = esp_phy_enable_wrapper,
._phy_common_clock_enable = esp_phy_common_clock_enable, ._phy_common_clock_enable = esp_phy_common_clock_enable,
._phy_common_clock_disable = esp_phy_common_clock_disable, ._phy_common_clock_disable = esp_phy_common_clock_disable,
._phy_update_country_info = esp_phy_update_country_info, ._phy_update_country_info = esp_phy_update_country_info,

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -649,6 +649,18 @@ static void IRAM_ATTR esp_empty_wrapper(void)
} }
static void esp_phy_enable_wrapper(void)
{
esp_phy_enable();
phy_wifi_enable_set(1);
}
static void esp_phy_disable_wrapper(void)
{
phy_wifi_enable_set(0);
esp_phy_disable();
}
wifi_osi_funcs_t g_wifi_osi_funcs = { wifi_osi_funcs_t g_wifi_osi_funcs = {
._version = ESP_WIFI_OS_ADAPTER_VERSION, ._version = ESP_WIFI_OS_ADAPTER_VERSION,
._env_is_chip = env_is_chip_wrapper, ._env_is_chip = env_is_chip_wrapper,
@ -702,8 +714,8 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._dport_access_stall_other_cpu_end_wrap = esp_empty_wrapper, ._dport_access_stall_other_cpu_end_wrap = esp_empty_wrapper,
._wifi_apb80m_request = wifi_apb80m_request_wrapper, ._wifi_apb80m_request = wifi_apb80m_request_wrapper,
._wifi_apb80m_release = wifi_apb80m_release_wrapper, ._wifi_apb80m_release = wifi_apb80m_release_wrapper,
._phy_disable = esp_phy_disable, ._phy_disable = esp_phy_disable_wrapper,
._phy_enable = esp_phy_enable, ._phy_enable = esp_phy_enable_wrapper,
._phy_update_country_info = esp_phy_update_country_info, ._phy_update_country_info = esp_phy_update_country_info,
._read_mac = esp_read_mac_wrapper, ._read_mac = esp_read_mac_wrapper,
._timer_arm = timer_arm_wrapper, ._timer_arm = timer_arm_wrapper,

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -719,6 +719,16 @@ int32_t IRAM_ATTR coex_is_in_isr_wrapper(void)
return !xPortCanYield(); return !xPortCanYield();
} }
static void esp_phy_enable_wrapper(void)
{
esp_phy_enable();
}
static void esp_phy_disable_wrapper(void)
{
esp_phy_disable();
}
wifi_osi_funcs_t g_wifi_osi_funcs = { wifi_osi_funcs_t g_wifi_osi_funcs = {
._version = ESP_WIFI_OS_ADAPTER_VERSION, ._version = ESP_WIFI_OS_ADAPTER_VERSION,
._env_is_chip = env_is_chip_wrapper, ._env_is_chip = env_is_chip_wrapper,
@ -772,8 +782,8 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._dport_access_stall_other_cpu_end_wrap = esp_empty_wrapper, ._dport_access_stall_other_cpu_end_wrap = esp_empty_wrapper,
._wifi_apb80m_request = wifi_apb80m_request_wrapper, ._wifi_apb80m_request = wifi_apb80m_request_wrapper,
._wifi_apb80m_release = wifi_apb80m_release_wrapper, ._wifi_apb80m_release = wifi_apb80m_release_wrapper,
._phy_disable = esp_phy_disable, ._phy_disable = esp_phy_disable_wrapper,
._phy_enable = esp_phy_enable, ._phy_enable = esp_phy_enable_wrapper,
._phy_common_clock_enable = esp_phy_common_clock_enable, ._phy_common_clock_enable = esp_phy_common_clock_enable,
._phy_common_clock_disable = esp_phy_common_clock_disable, ._phy_common_clock_disable = esp_phy_common_clock_disable,
._phy_update_country_info = esp_phy_update_country_info, ._phy_update_country_info = esp_phy_update_country_info,

View File

@ -1,16 +1,8 @@
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
@ -749,6 +741,18 @@ int32_t IRAM_ATTR coex_is_in_isr_wrapper(void)
return !xPortCanYield(); return !xPortCanYield();
} }
static void esp_phy_enable_wrapper(void)
{
esp_phy_enable();
phy_wifi_enable_set(1);
}
static void esp_phy_disable_wrapper(void)
{
phy_wifi_enable_set(0);
esp_phy_disable();
}
wifi_osi_funcs_t g_wifi_osi_funcs = { wifi_osi_funcs_t g_wifi_osi_funcs = {
._version = ESP_WIFI_OS_ADAPTER_VERSION, ._version = ESP_WIFI_OS_ADAPTER_VERSION,
._env_is_chip = env_is_chip_wrapper, ._env_is_chip = env_is_chip_wrapper,
@ -802,8 +806,8 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._dport_access_stall_other_cpu_end_wrap = esp_empty_wrapper, ._dport_access_stall_other_cpu_end_wrap = esp_empty_wrapper,
._wifi_apb80m_request = wifi_apb80m_request_wrapper, ._wifi_apb80m_request = wifi_apb80m_request_wrapper,
._wifi_apb80m_release = wifi_apb80m_release_wrapper, ._wifi_apb80m_release = wifi_apb80m_release_wrapper,
._phy_disable = esp_phy_disable, ._phy_disable = esp_phy_disable_wrapper,
._phy_enable = esp_phy_enable, ._phy_enable = esp_phy_enable_wrapper,
._phy_update_country_info = esp_phy_update_country_info, ._phy_update_country_info = esp_phy_update_country_info,
._read_mac = esp_read_mac, ._read_mac = esp_read_mac,
._timer_arm = timer_arm_wrapper, ._timer_arm = timer_arm_wrapper,