From 09a034d61b7c320914b56ae4500d85304bece57e Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 4 Jun 2021 16:45:45 +0800 Subject: [PATCH 1/5] esp_wifi: support multi phy init data bin embedded --- components/esp_phy/CMakeLists.txt | 9 +++- components/esp_phy/Kconfig | 8 +++ components/esp_phy/Makefile.projbuild | 2 +- .../{ => esp32}/phy_multiple_init_data.bin | Bin .../esp32c3/phy_multiple_init_data.bin | Bin 0 -> 1072 bytes .../esp32s2/phy_multiple_init_data.bin | Bin 0 -> 1072 bytes .../esp32s3/phy_multiple_init_data.bin | Bin 0 -> 1072 bytes components/esp_phy/src/phy_init.c | 46 +++++++++++++++--- components/esp_wifi/lib | 2 +- 9 files changed, 57 insertions(+), 10 deletions(-) rename components/esp_phy/{ => esp32}/phy_multiple_init_data.bin (100%) create mode 100644 components/esp_phy/esp32c3/phy_multiple_init_data.bin create mode 100644 components/esp_phy/esp32s2/phy_multiple_init_data.bin create mode 100644 components/esp_phy/esp32s3/phy_multiple_init_data.bin diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index 9f3064e125..b59948788e 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -17,7 +17,9 @@ endif() idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" "${idf_target}/include" PRIV_REQUIRES nvs_flash - LDFRAGMENTS "${ldfragments}") + LDFRAGMENTS "${ldfragments}" + EMBED_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin" + ) idf_build_get_property(build_dir BUILD_DIR) @@ -52,7 +54,10 @@ if(CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION) partition_table_get_partition_info(phy_partition_offset "--partition-type data --partition-subtype phy" "offset") if(CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN) - set(phy_init_data_bin "${CMAKE_CURRENT_SOURCE_DIR}/phy_multiple_init_data.bin") + set(phy_init_data_bin "${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin") + if(CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED) + set(COMPONENT_EMBED_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin") + endif() else() set(phy_init_data_bin "${build_dir}/phy_init_data.bin") diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index e3bb40f3db..b929df68b3 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -57,6 +57,14 @@ menu "PHY" 3. Country configured by API esp_wifi_set_country() and the parameter policy is WIFI_COUNTRY_POLICY_AUTO. + config ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED + bool "Support embedded multiple phy init data bin to app bin" + depends on ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN + default n + help + If enabled, multiple phy init data bin will embedded into app bin + If not enabled, multiple phy init data bin will still leave alone, and need to be flashed by users. + config ESP32_PHY_INIT_DATA_ERROR bool "Terminate operation when PHY init data error" depends on ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN diff --git a/components/esp_phy/Makefile.projbuild b/components/esp_phy/Makefile.projbuild index d759446c3e..0d70e7b710 100644 --- a/components/esp_phy/Makefile.projbuild +++ b/components/esp_phy/Makefile.projbuild @@ -3,7 +3,7 @@ ifdef CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION ESP_PHY_COMPONENT_PATH := $(COMPONENT_PATH) ifdef CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN -PHY_INIT_DATA_BIN = $(ESP_PHY_COMPONENT_PATH)/phy_multiple_init_data.bin +PHY_INIT_DATA_BIN = $(ESP_PHY_COMPONENT_PATH)/$(IDF_TARGET)/phy_multiple_init_data.bin else PHY_INIT_DATA_OBJ = $(BUILD_DIR_BASE)/phy_init_data.o PHY_INIT_DATA_BIN = $(BUILD_DIR_BASE)/phy_init_data.bin diff --git a/components/esp_phy/phy_multiple_init_data.bin b/components/esp_phy/esp32/phy_multiple_init_data.bin similarity index 100% rename from components/esp_phy/phy_multiple_init_data.bin rename to components/esp_phy/esp32/phy_multiple_init_data.bin diff --git a/components/esp_phy/esp32c3/phy_multiple_init_data.bin b/components/esp_phy/esp32c3/phy_multiple_init_data.bin new file mode 100644 index 0000000000000000000000000000000000000000..0f754a2c496b5cf7b712c49b15e83a02082692f4 GIT binary patch literal 1072 zcmWIWi1hUH3}Ikk2nY!9@$vBS@Nn^Rb8}+&PdZ>A7cep`gSlh6%ptaIvLd;R4D1XI zSj|IsC!-rO`0s!WaPhDjOjwYSF%~nN7;SuDz{bYrzljG7n3$NL^ISl{#KeTKRajLp zGJVBnzYP-jj~p0oxOiAiCoIUwY>3T%nD>2X?tc~yEcPQuxC1U9gMtN-8VGw8s|rTe k1z79{#VH))wOA7cep`gSlh6%ptaIvLd;R4D1XI zSj|IsC!-rO`0s!WaPhDjOjwYSF%~nN7;SuDz{bYrzljG7n3$NL^ISl{#KeTKRajLp zGJVBnzYP-jj~p0oxOiAiCoIUwY>3T%nD>2X?tc~yEcPQuxC1U9gMtN-8VGw8s|rTe k1z79{#VH))wOcheck_algorithm) == PHY_CRC_ALGORITHM) { err = phy_crc_check_init_data(init_data_control_info->multiple_bin_checksum, init_data_control_info->control_info_checksum, sizeof(phy_control_info_data_t) - sizeof(init_data_control_info->control_info_checksum)); @@ -745,6 +762,9 @@ static esp_err_t phy_get_multiple_init_data(const esp_partition_t* partition, return ESP_FAIL; } +#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED + memcpy(init_data_multiple, multi_phy_init_data_bin_start + init_data_store_length + sizeof(phy_control_info_data_t), sizeof(esp_phy_init_data_t) * init_data_control_info->number); +#else err = esp_partition_read(partition, init_data_store_length + sizeof(phy_control_info_data_t), init_data_multiple, sizeof(esp_phy_init_data_t) * init_data_control_info->number); if (err != ESP_OK) { @@ -753,7 +773,7 @@ static esp_err_t phy_get_multiple_init_data(const esp_partition_t* partition, ESP_LOGE(TAG, "failed to read PHY init data multiple bin partition (0x%x)", err); return ESP_FAIL; } - +#endif if ((init_data_control_info->check_algorithm) == PHY_CRC_ALGORITHM) { err = phy_crc_check_init_data(init_data_multiple, init_data_control_info->multiple_bin_checksum, sizeof(esp_phy_init_data_t) * init_data_control_info->number); @@ -785,6 +805,19 @@ static esp_err_t phy_get_multiple_init_data(const esp_partition_t* partition, esp_err_t esp_phy_update_init_data(phy_init_data_type_t init_data_type) { +#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED + esp_err_t err = ESP_OK; + const esp_partition_t* partition = NULL; + size_t init_data_store_length = sizeof(phy_init_magic_pre) + + sizeof(esp_phy_init_data_t) + sizeof(phy_init_magic_post); + uint8_t* init_data_store = (uint8_t*) malloc(init_data_store_length); + if (init_data_store == NULL) { + ESP_LOGE(TAG, "failed to allocate memory for updated country code PHY init data"); + return ESP_ERR_NO_MEM; + } + memcpy(init_data_store, multi_phy_init_data_bin_start, init_data_store_length); + ESP_LOGI(TAG, "load embedded multi phy init data"); +#else const esp_partition_t* partition = esp_partition_find_first( ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_PHY, NULL); if (partition == NULL) { @@ -805,6 +838,7 @@ esp_err_t esp_phy_update_init_data(phy_init_data_type_t init_data_type) ESP_LOGE(TAG, "failed to read updated country code PHY data partition (0x%x)", err); return ESP_FAIL; } +#endif if (memcmp(init_data_store, PHY_INIT_MAGIC, sizeof(phy_init_magic_pre)) != 0 || memcmp(init_data_store + init_data_store_length - sizeof(phy_init_magic_post), PHY_INIT_MAGIC, sizeof(phy_init_magic_post)) != 0) { diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 0c3f24cc83..681c8bfeb7 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 0c3f24cc83d595f60e3b785e3eb098c3bc5ce2d3 +Subproject commit 681c8bfeb739c2fcd579e404b1df8b19acc07497 From c898810991c8b032516d2fd84c68120e2c0bf47e Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 10 Jun 2021 13:33:54 +0800 Subject: [PATCH 2/5] esp_phy: support copy multi phy init data bin to build dir --- components/esp_phy/CMakeLists.txt | 32 ++++++++++++++++++++++--------- components/esp_phy/src/phy_init.c | 4 ++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index b59948788e..174a6b4e58 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -14,15 +14,29 @@ else() set(srcs "src/phy_init.c") endif() -idf_component_register(SRCS "${srcs}" - INCLUDE_DIRS "include" "${idf_target}/include" - PRIV_REQUIRES nvs_flash - LDFRAGMENTS "${ldfragments}" - EMBED_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin" - ) - idf_build_get_property(build_dir BUILD_DIR) +if(CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN) + if(NOT EXISTS "${build_dir}/phy_multiple_init_data.bin") + file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin DESTINATION "${build_dir}") + endif() +endif() + +if(CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED) + idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "include" "${idf_target}/include" + PRIV_REQUIRES nvs_flash + LDFRAGMENTS "${ldfragments}" + EMBED_FILES "${build_dir}/phy_multiple_init_data.bin" + ) +else() + idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "include" "${idf_target}/include" + PRIV_REQUIRES nvs_flash + LDFRAGMENTS "${ldfragments}" + ) +endif() + set(target_name "${idf_target}") target_link_libraries(${COMPONENT_LIB} PUBLIC "-L \"${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}\"") @@ -54,9 +68,9 @@ if(CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION) partition_table_get_partition_info(phy_partition_offset "--partition-type data --partition-subtype phy" "offset") if(CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN) - set(phy_init_data_bin "${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin") + set(phy_init_data_bin "${build_dir}/phy_multiple_init_data.bin") if(CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED) - set(COMPONENT_EMBED_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin") + set(COMPONENT_EMBED_FILES "${build_dir}/phy_multiple_init_data.bin") endif() else() set(phy_init_data_bin "${build_dir}/phy_init_data.bin") diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index b5dcff7b8c..bcd5e3f809 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -332,6 +332,10 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void) size_t init_data_store_length = sizeof(phy_init_magic_pre) + sizeof(esp_phy_init_data_t) + sizeof(phy_init_magic_post); uint8_t* init_data_store = (uint8_t*) malloc(init_data_store_length); + if (init_data_store == NULL) { + ESP_LOGE(TAG, "failed to allocate memory for updated country code PHY init data"); + return ESP_ERR_NO_MEM; + } memcpy(init_data_store, multi_phy_init_data_bin_start, init_data_store_length); ESP_LOGI(TAG, "loading embedded multiple PHY init data"); #else From 2a0923495739143cadf71601696aceb5fbc1a078 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 16 Jun 2021 11:39:08 +0800 Subject: [PATCH 3/5] esp_phy: rename esp_phy component prefix --- components/esp_phy/CMakeLists.txt | 10 ++--- components/esp_phy/Kconfig | 32 +++++++-------- components/esp_phy/Makefile.projbuild | 8 ++-- .../esp_phy/esp32/include/phy_init_data.h | 18 ++++----- .../esp_phy/esp32c3/include/phy_init_data.h | 34 ++++++++-------- .../esp_phy/esp32s2/include/phy_init_data.h | 18 ++++----- .../esp_phy/esp32s3/include/phy_init_data.h | 34 ++++++++-------- components/esp_phy/include/esp_phy_init.h | 4 +- components/esp_phy/sdkconfig.rename | 13 +++++- components/esp_phy/src/phy_init.c | 40 +++++++++---------- docs/en/api-guides/RF_calibration.rst | 8 ++-- docs/en/api-guides/partition-tables.rst | 2 +- docs/zh_CN/api-guides/partition-tables.rst | 2 +- .../sdkconfig.ci.phy_multiple_init_data | 4 +- 14 files changed, 118 insertions(+), 109 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index 174a6b4e58..a604c446ea 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -16,13 +16,13 @@ endif() idf_build_get_property(build_dir BUILD_DIR) -if(CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN) +if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN) if(NOT EXISTS "${build_dir}/phy_multiple_init_data.bin") file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin DESTINATION "${build_dir}") endif() endif() -if(CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED) +if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED) idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" "${idf_target}/include" PRIV_REQUIRES nvs_flash @@ -63,13 +63,13 @@ if(link_binary_libs) endif() endif() -if(CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION) +if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION) idf_component_get_property(esp_common_dir esp_common COMPONENT_DIR) partition_table_get_partition_info(phy_partition_offset "--partition-type data --partition-subtype phy" "offset") - if(CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN) + if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN) set(phy_init_data_bin "${build_dir}/phy_multiple_init_data.bin") - if(CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED) + if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED) set(COMPONENT_EMBED_FILES "${build_dir}/phy_multiple_init_data.bin") endif() else() diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index b929df68b3..49a51eec33 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -1,6 +1,6 @@ menu "PHY" - config ESP32_PHY_CALIBRATION_AND_DATA_STORAGE + config ESP_PHY_CALIBRATION_AND_DATA_STORAGE bool "Store phy calibration data in NVS" default y help @@ -15,7 +15,7 @@ menu "PHY" 2.Because of your board design, each time when you do calibration, the result are too unstable. If unsure, choose 'y'. - menuconfig ESP32_PHY_INIT_DATA_IN_PARTITION + menuconfig ESP_PHY_INIT_DATA_IN_PARTITION bool "Use a partition to store PHY init data" default n help @@ -31,20 +31,20 @@ menu "PHY" If unsure, choose 'n'. - config ESP32_PHY_DEFAULT_INIT_IF_INVALID + config ESP_PHY_DEFAULT_INIT_IF_INVALID bool "Reset default PHY init data if invalid" default n - depends on ESP32_PHY_INIT_DATA_IN_PARTITION + depends on ESP_PHY_INIT_DATA_IN_PARTITION help If enabled, PHY init data will be restored to default if it cannot be verified successfully to avoid endless bootloops. If unsure, choose 'n'. - if ESP32_PHY_INIT_DATA_IN_PARTITION - config ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN + if ESP_PHY_INIT_DATA_IN_PARTITION + config ESP_PHY_MULTIPLE_INIT_DATA_BIN bool "Support multiple PHY init data bin" - depends on ESP32_PHY_INIT_DATA_IN_PARTITION + depends on ESP_PHY_INIT_DATA_IN_PARTITION default n help If enabled, the corresponding PHY init data type can be automatically switched @@ -57,17 +57,17 @@ menu "PHY" 3. Country configured by API esp_wifi_set_country() and the parameter policy is WIFI_COUNTRY_POLICY_AUTO. - config ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED + config ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED bool "Support embedded multiple phy init data bin to app bin" - depends on ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN + depends on ESP_PHY_MULTIPLE_INIT_DATA_BIN default n help If enabled, multiple phy init data bin will embedded into app bin If not enabled, multiple phy init data bin will still leave alone, and need to be flashed by users. - config ESP32_PHY_INIT_DATA_ERROR + config ESP_PHY_INIT_DATA_ERROR bool "Terminate operation when PHY init data error" - depends on ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN + depends on ESP_PHY_MULTIPLE_INIT_DATA_BIN default n help If enabled, when an error occurs while the PHY init data is updated, @@ -75,7 +75,7 @@ menu "PHY" If not enabled, the PHY init data will not be updated when an error occurs. endif - config ESP32_PHY_MAX_WIFI_TX_POWER + config ESP_PHY_MAX_WIFI_TX_POWER int "Max WiFi TX power (dBm)" range 10 20 default 20 @@ -83,11 +83,11 @@ menu "PHY" Set maximum transmit power for WiFi radio. Actual transmit power for high data rates may be lower than this setting. - config ESP32_PHY_MAX_TX_POWER + config ESP_PHY_MAX_TX_POWER int - default ESP32_PHY_MAX_WIFI_TX_POWER + default ESP_PHY_MAX_WIFI_TX_POWER - config ESP32_PHY_MAC_BB_PD + config ESP_PHY_MAC_BB_PD bool "Power down MAC and baseband of Wi-Fi and Bluetooth when PHY is disabled" depends on ((IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3) && FREERTOS_USE_TICKLESS_IDLE) default n @@ -97,7 +97,7 @@ menu "PHY" by a small amount but increases RAM use by approximately 4 KB(Wi-Fi only), 2 KB(Bluetooth only) or 5.3 KB(Wi-Fi + Bluetooth). - config ESP32_REDUCE_PHY_TX_POWER + config ESP_PHY_REDUCE_TX_POWER bool "Reduce PHY TX power when brownout reset" depends on ESP32_BROWNOUT_DET default y diff --git a/components/esp_phy/Makefile.projbuild b/components/esp_phy/Makefile.projbuild index 0d70e7b710..285d4b4276 100644 --- a/components/esp_phy/Makefile.projbuild +++ b/components/esp_phy/Makefile.projbuild @@ -1,8 +1,8 @@ -ifdef CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION +ifdef CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION ESP_PHY_COMPONENT_PATH := $(COMPONENT_PATH) -ifdef CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +ifdef CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN PHY_INIT_DATA_BIN = $(ESP_PHY_COMPONENT_PATH)/$(IDF_TARGET)/phy_multiple_init_data.bin else PHY_INIT_DATA_OBJ = $(BUILD_DIR_BASE)/phy_init_data.o @@ -27,7 +27,7 @@ phy_init_data-flash: $(PHY_INIT_DATA_BIN) @echo "Flashing PHY init data..." $(PHY_INIT_DATA_FLASH_CMD) -ifndef CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +ifndef CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN phy_init_data-clean: rm -f $(PHY_INIT_DATA_BIN) $(PHY_INIT_DATA_OBJ) @@ -37,4 +37,4 @@ endif all: phy_init_data flash: phy_init_data -endif # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION +endif # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION diff --git a/components/esp_phy/esp32/include/phy_init_data.h b/components/esp_phy/esp32/include/phy_init_data.h index 3d633a9084..f8759c8002 100644 --- a/components/esp_phy/esp32/include/phy_init_data.h +++ b/components/esp_phy/esp32/include/phy_init_data.h @@ -23,11 +23,11 @@ #define PHY_INIT_MAGIC "PHYINIT" // define the lowest tx power as LOWEST_PHY_TX_POWER -#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52) +#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52) #define PHY_TX_POWER_OFFSET 44 #define PHY_TX_POWER_NUM 5 -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN #define PHY_CRC_ALGORITHM 1 #define PHY_COUNTRY_CODE_LEN 2 #define PHY_INIT_DATA_TYPE_OFFSET 126 @@ -83,12 +83,12 @@ static const esp_phy_init_data_t phy_init_data= { { 0x18, 0x18, 0x18, - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 78), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 72), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 66), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 60), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 56), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 52), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 78), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 72), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 66), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 60), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 56), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 52), 0, 1, 1, @@ -150,7 +150,7 @@ static const esp_phy_init_data_t phy_init_data= { { static const char phy_init_magic_post[] = PHY_INIT_MAGIC; -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN /** * @brief PHY init data control infomation structure */ diff --git a/components/esp_phy/esp32c3/include/phy_init_data.h b/components/esp_phy/esp32c3/include/phy_init_data.h index bc5d1edd2a..95b340c62a 100644 --- a/components/esp_phy/esp32c3/include/phy_init_data.h +++ b/components/esp_phy/esp32c3/include/phy_init_data.h @@ -27,11 +27,11 @@ extern "C" { #define PHY_INIT_MAGIC "PHYINIT" // define the lowest tx power as LOWEST_PHY_TX_POWER -#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52) +#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52) #define PHY_TX_POWER_OFFSET 44 #define PHY_TX_POWER_NUM 5 -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN #define PHY_CRC_ALGORITHM 1 #define PHY_COUNTRY_CODE_LEN 2 #define PHY_INIT_DATA_TYPE_OFFSET 126 @@ -46,20 +46,20 @@ static const char __attribute__((section(".rodata"))) phy_init_magic_pre[] = PHY static const esp_phy_init_data_t phy_init_data= { { 0x00, 0x00, - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x44), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4a), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x46), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x46), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x42), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x44), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4a), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x46), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x46), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x42), 0x00, 0x00, 0x00, @@ -160,7 +160,7 @@ static const esp_phy_init_data_t phy_init_data= { { static const char __attribute__((section(".rodata"))) phy_init_magic_post[] = PHY_INIT_MAGIC; -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN /** * @brief PHY init data control infomation structure */ diff --git a/components/esp_phy/esp32s2/include/phy_init_data.h b/components/esp_phy/esp32s2/include/phy_init_data.h index a17b7b910b..5711d0c8b5 100644 --- a/components/esp_phy/esp32s2/include/phy_init_data.h +++ b/components/esp_phy/esp32s2/include/phy_init_data.h @@ -27,11 +27,11 @@ extern "C" { #define PHY_INIT_MAGIC "PHYINIT" // define the lowest tx power as LOWEST_PHY_TX_POWER -#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52) +#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52) #define PHY_TX_POWER_OFFSET 44 #define PHY_TX_POWER_NUM 5 -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN #define PHY_CRC_ALGORITHM 1 #define PHY_COUNTRY_CODE_LEN 2 #define PHY_INIT_DATA_TYPE_OFFSET 126 @@ -88,12 +88,12 @@ static const esp_phy_init_data_t phy_init_data= { { 0x18, 0x18, 0x18, - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 84), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 72), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 66), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 60), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 56), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 84), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 72), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 66), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 60), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 56), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52), 0, 1, 1, @@ -155,7 +155,7 @@ static const esp_phy_init_data_t phy_init_data= { { static const char phy_init_magic_post[] = PHY_INIT_MAGIC; -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN /** * @brief PHY init data control infomation structure */ diff --git a/components/esp_phy/esp32s3/include/phy_init_data.h b/components/esp_phy/esp32s3/include/phy_init_data.h index 8624b3e7a7..80516bc5db 100644 --- a/components/esp_phy/esp32s3/include/phy_init_data.h +++ b/components/esp_phy/esp32s3/include/phy_init_data.h @@ -27,11 +27,11 @@ extern "C" { #define PHY_INIT_MAGIC "PHYINIT" // define the lowest tx power as LOWEST_PHY_TX_POWER -#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52) +#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52) #define PHY_TX_POWER_OFFSET 44 #define PHY_TX_POWER_NUM 5 -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN #define PHY_CRC_ALGORITHM 1 #define PHY_COUNTRY_CODE_LEN 2 #define PHY_INIT_DATA_TYPE_OFFSET 126 @@ -46,20 +46,20 @@ static const char phy_init_magic_pre[] = PHY_INIT_MAGIC; static const esp_phy_init_data_t phy_init_data= { { 0x00, 0x00, - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x44), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4a), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x46), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x46), - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x42), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x44), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4a), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x46), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x46), + LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x42), 0x00, 0x00, 0x00, @@ -160,7 +160,7 @@ static const esp_phy_init_data_t phy_init_data= { { static const char phy_init_magic_post[] = PHY_INIT_MAGIC; -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN /** * @brief PHY init data control infomation structure */ diff --git a/components/esp_phy/include/esp_phy_init.h b/components/esp_phy/include/esp_phy_init.h index f85d8b38b1..0458d06c19 100644 --- a/components/esp_phy/include/esp_phy_init.h +++ b/components/esp_phy/include/esp_phy_init.h @@ -48,7 +48,7 @@ typedef enum { PHY_RF_CAL_FULL = 0x00000002 /*!< Do full RF calibration. Produces best results, but also consumes a lot of time and current. Suggested to be used once. */ } esp_phy_calibration_mode_t; -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN /** * @brief PHY init data type */ @@ -220,7 +220,7 @@ int64_t esp_phy_rf_get_on_ts(void); esp_err_t esp_phy_update_country_info(const char *country); -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN /** * @brief Apply PHY init bin to PHY * @return ESP_OK on success. diff --git a/components/esp_phy/sdkconfig.rename b/components/esp_phy/sdkconfig.rename index 64085678ce..17cee6d513 100644 --- a/components/esp_phy/sdkconfig.rename +++ b/components/esp_phy/sdkconfig.rename @@ -1,5 +1,14 @@ # sdkconfig replacement configurations for deprecated options formatted as # CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION -CONFIG_MAC_BB_PD CONFIG_ESP32_PHY_MAC_BB_PD -CONFIG_REDUCE_PHY_TX_POWER CONFIG_ESP32_REDUCE_PHY_TX_POWER +CONFIG_MAC_BB_PD CONFIG_ESP32_PHY_MAC_BB_PD +CONFIG_REDUCE_PHY_TX_POWER CONFIG_ESP32_REDUCE_PHY_TX_POWER +CONFIG_ESP32_PHY_MAC_BB_PD CONFIG_ESP_PHY_MAC_BB_PD +CONFIG_ESP32_REDUCE_PHY_TX_POWER CONFIG_ESP_PHY_REDUCE_TX_POWER +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE +CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION +CONFIG_ESP32_PHY_DEFAULT_INIT_IF_INVALID CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID +CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN +CONFIG_ESP32_PHY_INIT_DATA_ERROR CONFIG_ESP_PHY_INIT_DATA_ERROR +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER CONFIG_ESP_PHY_MAX_WIFI_TX_POWER +CONFIG_ESP32_PHY_MAX_TX_POWER CONFIG_ESP_PHY_MAX_TX_POWER diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index bcd5e3f809..6cbe1574a3 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -78,8 +78,8 @@ static uint32_t* s_phy_digital_regs_mem = NULL; uint32_t* s_mac_bb_pd_mem = NULL; #endif -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN -#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED extern uint8_t multi_phy_init_data_bin_start[] asm("_binary_phy_multiple_init_data_bin_start"); extern uint8_t multi_phy_init_data_bin_end[] asm("_binary_phy_multiple_init_data_bin_end"); #endif @@ -321,20 +321,20 @@ IRAM_ATTR void esp_mac_bb_power_down(void) #endif // PHY init data handling functions -#if CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION +#if CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION #include "esp_partition.h" const esp_phy_init_data_t* esp_phy_get_init_data(void) { esp_err_t err = ESP_OK; const esp_partition_t* partition = NULL; -#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED size_t init_data_store_length = sizeof(phy_init_magic_pre) + sizeof(esp_phy_init_data_t) + sizeof(phy_init_magic_post); uint8_t* init_data_store = (uint8_t*) malloc(init_data_store_length); if (init_data_store == NULL) { ESP_LOGE(TAG, "failed to allocate memory for updated country code PHY init data"); - return ESP_ERR_NO_MEM; + return NULL; } memcpy(init_data_store, multi_phy_init_data_bin_start, init_data_store_length); ESP_LOGI(TAG, "loading embedded multiple PHY init data"); @@ -365,7 +365,7 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void) if (memcmp(init_data_store, PHY_INIT_MAGIC, sizeof(phy_init_magic_pre)) != 0 || memcmp(init_data_store + init_data_store_length - sizeof(phy_init_magic_post), PHY_INIT_MAGIC, sizeof(phy_init_magic_post)) != 0) { -#ifndef CONFIG_ESP32_PHY_DEFAULT_INIT_IF_INVALID +#ifndef CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID ESP_LOGE(TAG, "failed to validate PHY data partition"); free(init_data_store); return NULL; @@ -390,9 +390,9 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void) free(init_data_store); return NULL; } -#endif // CONFIG_ESP32_PHY_DEFAULT_INIT_IF_INVALID +#endif // CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID } -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN if ((*(init_data_store + (sizeof(phy_init_magic_pre) + PHY_SUPPORT_MULTIPLE_BIN_OFFSET)))) { s_multiple_phy_init_data_bin = true; ESP_LOGI(TAG, "Support multiple PHY init data bins"); @@ -409,7 +409,7 @@ void esp_phy_release_init_data(const esp_phy_init_data_t* init_data) free((uint8_t*) init_data - sizeof(phy_init_magic_pre)); } -#else // CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION +#else // CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION // phy_init_data.h will declare static 'phy_init_data' variable initialized with default init data @@ -423,7 +423,7 @@ void esp_phy_release_init_data(const esp_phy_init_data_t* init_data) { // no-op } -#endif // CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION +#endif // CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION // PHY calibration data handling functions @@ -579,7 +579,7 @@ static esp_err_t store_cal_data_to_nvs_handle(nvs_handle_t handle, return err; } -#if CONFIG_ESP32_REDUCE_PHY_TX_POWER +#if CONFIG_ESP_PHY_REDUCE_TX_POWER // TODO: fix the esp_phy_reduce_tx_power unused warning for esp32s2 - IDF-759 static void __attribute((unused)) esp_phy_reduce_tx_power(esp_phy_init_data_t* init_data) { @@ -604,7 +604,7 @@ void esp_phy_load_cal_and_init(void) abort(); } -#if CONFIG_ESP32_REDUCE_PHY_TX_POWER +#if CONFIG_ESP_PHY_REDUCE_TX_POWER const esp_phy_init_data_t* phy_init_data = esp_phy_get_init_data(); if (phy_init_data == NULL) { ESP_LOGE(TAG, "failed to obtain PHY init data"); @@ -629,7 +629,7 @@ void esp_phy_load_cal_and_init(void) } #endif -#ifdef CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE +#ifdef CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE esp_phy_calibration_mode_t calibration_mode = PHY_RF_CAL_PARTIAL; uint8_t sta_mac[6]; if (esp_rom_get_reset_reason(0) == RESET_REASON_CORE_DEEP_SLEEP) { @@ -658,7 +658,7 @@ void esp_phy_load_cal_and_init(void) register_chipv7_phy(init_data, cal_data, PHY_RF_CAL_FULL); #endif -#if CONFIG_ESP32_REDUCE_PHY_TX_POWER +#if CONFIG_ESP_PHY_REDUCE_TX_POWER esp_phy_release_init_data(phy_init_data); free(init_data); #else @@ -668,7 +668,7 @@ void esp_phy_load_cal_and_init(void) free(cal_data); // PHY maintains a copy of calibration data, so we can free this } -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN static esp_err_t phy_crc_check_init_data(uint8_t* init_data, const uint8_t* checksum, size_t init_data_length) { uint32_t crc_data = 0; @@ -735,7 +735,7 @@ static esp_err_t phy_get_multiple_init_data(const esp_partition_t* partition, return ESP_FAIL; } esp_err_t err = ESP_OK; -#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED memcpy(init_data_control_info, multi_phy_init_data_bin_start + init_data_store_length, sizeof(phy_control_info_data_t)); #else err = esp_partition_read(partition, init_data_store_length, init_data_control_info, sizeof(phy_control_info_data_t)); @@ -766,7 +766,7 @@ static esp_err_t phy_get_multiple_init_data(const esp_partition_t* partition, return ESP_FAIL; } -#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED memcpy(init_data_multiple, multi_phy_init_data_bin_start + init_data_store_length + sizeof(phy_control_info_data_t), sizeof(esp_phy_init_data_t) * init_data_control_info->number); #else err = esp_partition_read(partition, init_data_store_length + sizeof(phy_control_info_data_t), @@ -809,7 +809,7 @@ static esp_err_t phy_get_multiple_init_data(const esp_partition_t* partition, esp_err_t esp_phy_update_init_data(phy_init_data_type_t init_data_type) { -#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED esp_err_t err = ESP_OK; const esp_partition_t* partition = NULL; size_t init_data_store_length = sizeof(phy_init_magic_pre) + @@ -856,7 +856,7 @@ esp_err_t esp_phy_update_init_data(phy_init_data_type_t init_data_type) err = phy_get_multiple_init_data(partition, init_data_store, init_data_store_length, init_data_type); if (err != ESP_OK) { free(init_data_store); -#if CONFIG_ESP32_PHY_INIT_DATA_ERROR +#if CONFIG_ESP_PHY_INIT_DATA_ERROR abort(); #else return ESP_FAIL; @@ -886,7 +886,7 @@ esp_err_t esp_phy_update_init_data(phy_init_data_type_t init_data_type) esp_err_t esp_phy_update_country_info(const char *country) { -#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN +#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN uint8_t phy_init_data_type_map = 0; if (!s_multiple_phy_init_data_bin) { diff --git a/docs/en/api-guides/RF_calibration.rst b/docs/en/api-guides/RF_calibration.rst index 3d81b9eb19..df81000eec 100644 --- a/docs/en/api-guides/RF_calibration.rst +++ b/docs/en/api-guides/RF_calibration.rst @@ -13,7 +13,7 @@ Partial calibration ------------------- During RF initialization, the partial calibration method is used by default for RF calibration. It is done based on the full calibration data which is stored in the NVS. -To use this method, please go to ``menuconfig`` and enable :ref:`CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE`. +To use this method, please go to ``menuconfig`` and enable :ref:`CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE`. Full calibration ---------------- @@ -31,7 +31,7 @@ Full calibration is triggered in the follwing conditions: It takes about 100ms more than partial calibration. If boot duration is not critical, it is suggested to use the full calibration method. -To switch to the full calibration method, go to ``menuconfig`` and disable :ref:`CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE`. +To switch to the full calibration method, go to ``menuconfig`` and disable :ref:`CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE`. If you use the default method of RF calibration, there are two ways to add the function of triggering full calibration as a last-resort remedy. 1. Erase the NVS partition if you don't mind all of the data stored in the NVS partition is erased. That is indeed the easiest way. @@ -51,10 +51,10 @@ There are two ways to get the PHY initialization data. One is the default initialization data which is located in the header file :idf_file:`components/esp_phy/{IDF_TARGET_PATH_NAME}/include/phy_init_data.h`. It is embedded into the application binary after compiling and then stored into read-only memory (DROM). -To use the default initialization data, please go to ``menuconfig`` and disable :ref:`CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION`. +To use the default initialization data, please go to ``menuconfig`` and disable :ref:`CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION`. Another is the initialization data which is stored in a partition. When using a custom partition table, make sure that PHY data partition is included (type: `data`, subtype: `phy`). With default partition table, this is done automatically. If initialization data is stored in a partition, it has to be flashed there, otherwise runtime error will occur. -To switch to the initialization data stored in a partition, go to ``menuconfig`` and enable :ref:`CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION`. +To switch to the initialization data stored in a partition, go to ``menuconfig`` and enable :ref:`CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION`. diff --git a/docs/en/api-guides/partition-tables.rst b/docs/en/api-guides/partition-tables.rst index f0ec74944c..0cdebb72be 100644 --- a/docs/en/api-guides/partition-tables.rst +++ b/docs/en/api-guides/partition-tables.rst @@ -109,7 +109,7 @@ See enum :cpp:type:`esp_partition_subtype_t` for the full list of subtypes defin - ``phy`` (1) is for storing PHY initialisation data. This allows PHY to be configured per-device, instead of in firmware. - In the default configuration, the phy partition is not used and PHY initialisation data is compiled into the app itself. As such, this partition can be removed from the partition table to save space. - - To load PHY data from this partition, open the project configuration menu (``idf.py menuconfig``) and enable :ref:`CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION` option. You will also need to flash your devices with phy init data as the esp-idf build system does not do this automatically. + - To load PHY data from this partition, open the project configuration menu (``idf.py menuconfig``) and enable :ref:`CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION` option. You will also need to flash your devices with phy init data as the esp-idf build system does not do this automatically. - ``nvs`` (2) is for the :doc:`Non-Volatile Storage (NVS) API <../api-reference/storage/nvs_flash>`. - NVS is used to store per-device PHY calibration data (different to initialisation data). diff --git a/docs/zh_CN/api-guides/partition-tables.rst b/docs/zh_CN/api-guides/partition-tables.rst index 2efde1f858..1b380f6354 100644 --- a/docs/zh_CN/api-guides/partition-tables.rst +++ b/docs/zh_CN/api-guides/partition-tables.rst @@ -109,7 +109,7 @@ SubType 字段长度为 8 bit,内容与具体分区 Type 有关。目前,esp - ``phy`` (1) 分区用于存放 PHY 初始化数据,从而保证可以为每个设备单独配置 PHY,而非必须采用固件中的统一 PHY 初始化数据。 - 默认配置下,phy 分区并不启用,而是直接将 phy 初始化数据编译至应用程序中,从而节省分区表空间(直接将此分区删掉)。 - - 如果需要从此分区加载 phy 初始化数据,请打开项目配置菜单(``idf.py menuconfig``),并且使能 :ref:`CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION` 选项。此时,您还需要手动将 phy 初始化数据烧至设备 flash(esp-idf 编译系统并不会自动完成该操作)。 + - 如果需要从此分区加载 phy 初始化数据,请打开项目配置菜单(``idf.py menuconfig``),并且使能 :ref:`CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION` 选项。此时,您还需要手动将 phy 初始化数据烧至设备 flash(esp-idf 编译系统并不会自动完成该操作)。 - ``nvs`` (2) 是专门给 :doc:`非易失性存储 (NVS) API <../api-reference/storage/nvs_flash>` 使用的分区。 - 用于存储每台设备的 PHY 校准数据(注意,并不是 PHY 初始化数据)。 diff --git a/tools/test_apps/system/build_test/sdkconfig.ci.phy_multiple_init_data b/tools/test_apps/system/build_test/sdkconfig.ci.phy_multiple_init_data index 8136f0c247..c1a4c0dce6 100644 --- a/tools/test_apps/system/build_test/sdkconfig.ci.phy_multiple_init_data +++ b/tools/test_apps/system/build_test/sdkconfig.ci.phy_multiple_init_data @@ -1,2 +1,2 @@ -CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION=y -CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN=y +CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION=y +CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN=y From 94c81b71b1b79c4ee3d7e9efa78667e90e2e12aa Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 17 Jun 2021 20:55:42 +0800 Subject: [PATCH 4/5] esp_phy: add phy multi init data bin test app --- .../phy_multi_init_data_test/CMakeLists.txt | 6 ++ .../phy/phy_multi_init_data_test/app_test.py | 33 +++++++++++ .../main/CMakeLists.txt | 2 + .../main/phy_init_data_main.c | 55 +++++++++++++++++++ .../sdkconfig.ci.phy_multiple_init_data | 3 + .../sdkconfig.ci.phy_multiple_init_data_embed | 4 ++ 6 files changed, 103 insertions(+) create mode 100644 tools/test_apps/phy/phy_multi_init_data_test/CMakeLists.txt create mode 100644 tools/test_apps/phy/phy_multi_init_data_test/app_test.py create mode 100644 tools/test_apps/phy/phy_multi_init_data_test/main/CMakeLists.txt create mode 100644 tools/test_apps/phy/phy_multi_init_data_test/main/phy_init_data_main.c create mode 100644 tools/test_apps/phy/phy_multi_init_data_test/sdkconfig.ci.phy_multiple_init_data create mode 100644 tools/test_apps/phy/phy_multi_init_data_test/sdkconfig.ci.phy_multiple_init_data_embed diff --git a/tools/test_apps/phy/phy_multi_init_data_test/CMakeLists.txt b/tools/test_apps/phy/phy_multi_init_data_test/CMakeLists.txt new file mode 100644 index 0000000000..9c3b369e90 --- /dev/null +++ b/tools/test_apps/phy/phy_multi_init_data_test/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(phy_multi_init_data_test) diff --git a/tools/test_apps/phy/phy_multi_init_data_test/app_test.py b/tools/test_apps/phy/phy_multi_init_data_test/app_test.py new file mode 100644 index 0000000000..dbe0d75346 --- /dev/null +++ b/tools/test_apps/phy/phy_multi_init_data_test/app_test.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 +import glob +import os + +import tiny_test_fw +import ttfw_idf +from tiny_test_fw import Utility + + +@ttfw_idf.idf_custom_test(env_tag='Example_GENERIC', group='test-apps') +def test_phy_multi_init_data_bin(env, _): + # type: (tiny_test_fw.Env.Env, None) -> None + config_files = glob.glob(os.path.join(os.path.dirname(__file__), 'sdkconfig.ci.*')) + config_names = [os.path.basename(s).replace('sdkconfig.ci.', '') for s in config_files] + for name in config_names: + dut = env.get_dut('phy_multi_init_data_test', 'tools/test_apps/phy/phy_multi_init_data_test',app_config_name=name) + dut.start_app() + + if 'CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED' in dut.app.get_sdkconfig().keys(): + Utility.console_log('multi init data bin embed test') + dut.expect('load embedded multi phy init data') + else: + Utility.console_log('multi init data bin test') + dut.expect('Support multiple PHY init data bins') + + dut.expect('wifi_init finished') + Utility.console_log('Test Success') + + +if __name__ == '__main__': + test_phy_multi_init_data_bin() diff --git a/tools/test_apps/phy/phy_multi_init_data_test/main/CMakeLists.txt b/tools/test_apps/phy/phy_multi_init_data_test/main/CMakeLists.txt new file mode 100644 index 0000000000..ebe797b1c5 --- /dev/null +++ b/tools/test_apps/phy/phy_multi_init_data_test/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "phy_init_data_main.c" + INCLUDE_DIRS ".") diff --git a/tools/test_apps/phy/phy_multi_init_data_test/main/phy_init_data_main.c b/tools/test_apps/phy/phy_multi_init_data_test/main/phy_init_data_main.c new file mode 100644 index 0000000000..8c9953b1d3 --- /dev/null +++ b/tools/test_apps/phy/phy_multi_init_data_test/main/phy_init_data_main.c @@ -0,0 +1,55 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* test phy init data bin options + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/event_groups.h" +#include "esp_system.h" +#include "esp_wifi.h" +#include "esp_event.h" +#include "esp_log.h" +#include "nvs_flash.h" + +static const char *TAG = "phy init"; +static EventGroupHandle_t s_wifi_event_group; + +void wifi_init(void) +{ + s_wifi_event_group = xEventGroupCreate(); + + ESP_ERROR_CHECK(esp_netif_init()); + + ESP_ERROR_CHECK(esp_event_loop_create_default()); + esp_netif_create_default_wifi_sta(); + + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); + ESP_ERROR_CHECK(esp_wifi_start() ); + + ESP_LOGI(TAG, "wifi_init finished."); +} + +void app_main(void) +{ + //Initialize NVS + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK(ret); + + wifi_init(); +} diff --git a/tools/test_apps/phy/phy_multi_init_data_test/sdkconfig.ci.phy_multiple_init_data b/tools/test_apps/phy/phy_multi_init_data_test/sdkconfig.ci.phy_multiple_init_data new file mode 100644 index 0000000000..05d129b95e --- /dev/null +++ b/tools/test_apps/phy/phy_multi_init_data_test/sdkconfig.ci.phy_multiple_init_data @@ -0,0 +1,3 @@ +CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID=y +CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION=y +CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN=y diff --git a/tools/test_apps/phy/phy_multi_init_data_test/sdkconfig.ci.phy_multiple_init_data_embed b/tools/test_apps/phy/phy_multi_init_data_test/sdkconfig.ci.phy_multiple_init_data_embed new file mode 100644 index 0000000000..6246d196ee --- /dev/null +++ b/tools/test_apps/phy/phy_multi_init_data_test/sdkconfig.ci.phy_multiple_init_data_embed @@ -0,0 +1,4 @@ +CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID=y +CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION=y +CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN=y +CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED=y From 8e49eec076d71dc103603d880d627480cf486810 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 30 Sep 2021 10:53:26 +0800 Subject: [PATCH 5/5] esp_phy: update esp_phy submodule files copyright --- .../esp_phy/esp32/include/phy_init_data.h | 18 +++++------------- .../esp_phy/esp32c3/include/phy_init_data.h | 18 +++++------------- .../esp_phy/esp32s2/include/phy_init_data.h | 18 +++++------------- .../esp_phy/esp32s3/include/phy_init_data.h | 18 +++++------------- components/esp_phy/include/esp_phy_init.h | 18 +++++------------- components/esp_phy/include/phy.h | 18 +++++------------- components/esp_phy/src/phy_init.c | 18 +++++------------- tools/ci/check_copyright_ignore.txt | 8 -------- 8 files changed, 35 insertions(+), 99 deletions(-) diff --git a/components/esp_phy/esp32/include/phy_init_data.h b/components/esp_phy/esp32/include/phy_init_data.h index f8759c8002..36f5440caa 100644 --- a/components/esp_phy/esp32/include/phy_init_data.h +++ b/components/esp_phy/esp32/include/phy_init_data.h @@ -1,16 +1,8 @@ -// Copyright 2016 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: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef PHY_INIT_DATA_H #define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */ diff --git a/components/esp_phy/esp32c3/include/phy_init_data.h b/components/esp_phy/esp32c3/include/phy_init_data.h index 95b340c62a..7e458c4311 100644 --- a/components/esp_phy/esp32c3/include/phy_init_data.h +++ b/components/esp_phy/esp32c3/include/phy_init_data.h @@ -1,16 +1,8 @@ -// Copyright 2016-2020 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: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef PHY_INIT_DATA_H #define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */ diff --git a/components/esp_phy/esp32s2/include/phy_init_data.h b/components/esp_phy/esp32s2/include/phy_init_data.h index 5711d0c8b5..55f0cdc491 100644 --- a/components/esp_phy/esp32s2/include/phy_init_data.h +++ b/components/esp_phy/esp32s2/include/phy_init_data.h @@ -1,16 +1,8 @@ -// Copyright 2016 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: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef PHY_INIT_DATA_H #define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */ diff --git a/components/esp_phy/esp32s3/include/phy_init_data.h b/components/esp_phy/esp32s3/include/phy_init_data.h index 80516bc5db..88f56282d5 100644 --- a/components/esp_phy/esp32s3/include/phy_init_data.h +++ b/components/esp_phy/esp32s3/include/phy_init_data.h @@ -1,16 +1,8 @@ -// Copyright 2016-2020 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: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef PHY_INIT_DATA_H #define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */ diff --git a/components/esp_phy/include/esp_phy_init.h b/components/esp_phy/include/esp_phy_init.h index 0458d06c19..04068c7f38 100644 --- a/components/esp_phy/include/esp_phy_init.h +++ b/components/esp_phy/include/esp_phy_init.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 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: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/components/esp_phy/include/phy.h b/components/esp_phy/include/phy.h index 51b972bb6c..c2a49ed203 100644 --- a/components/esp_phy/include/phy.h +++ b/components/esp_phy/include/phy.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 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: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_phy_init.h" diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index 6cbe1574a3..cac6bc9ebf 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -1,16 +1,8 @@ -// Copyright 2015-2016 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: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index bb101de637..1280cb7471 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -884,17 +884,9 @@ components/esp_netif/private_include/esp_netif_private.h components/esp_netif/test/test_esp_netif.c components/esp_netif/test_apps/component_ut_test.py components/esp_netif/test_apps/main/esp_netif_test.c -components/esp_phy/esp32/include/phy_init_data.h -components/esp_phy/esp32c3/include/phy_init_data.h components/esp_phy/esp32h2/include/phy_init_data.h -components/esp_phy/esp32s2/include/phy_init_data.h -components/esp_phy/esp32s3/include/phy_init_data.h -components/esp_phy/include/esp_phy_init.h -components/esp_phy/include/phy.h -components/esp_phy/src/phy_init.c components/esp_phy/src/phy_init_esp32hxx.c components/esp_phy/test/test_phy_rtc.c -components/esp_pm/include/esp32/pm.h components/esp_pm/include/esp32c3/pm.h components/esp_pm/include/esp32h2/pm.h components/esp_pm/include/esp32s2/pm.h