diff --git a/components/bootloader_support/src/bootloader_common_loader.c b/components/bootloader_support/src/bootloader_common_loader.c index 34a8221b42..73167cf267 100644 --- a/components/bootloader_support/src/bootloader_common_loader.c +++ b/components/bootloader_support/src/bootloader_common_loader.c @@ -19,7 +19,6 @@ #include "soc/efuse_reg.h" #include "soc/chip_revision.h" #include "hal/efuse_hal.h" -#include "hal/efuse_ll.h" #include "hal/gpio_ll.h" #include "esp_image_format.h" #include "bootloader_sha.h" @@ -80,7 +79,7 @@ esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hd } if (type == ESP_IMAGE_APPLICATION) { unsigned max_rev = img_hdr->max_chip_rev_full; - if ((IS_MAX_REV_SET(max_rev) && (revision > max_rev) && !efuse_ll_get_disable_wafer_version_major())) { + if ((IS_MAX_REV_SET(max_rev) && (revision > max_rev) && !efuse_hal_get_disable_wafer_version_major())) { ESP_LOGE(TAG, "Image requires chip rev <= v%d.%d, but chip is v%d.%d", max_rev / 100, max_rev % 100, major_rev, minor_rev); diff --git a/components/esp_system/startup.c b/components/esp_system/startup.c index 4f1b39532a..6390954421 100644 --- a/components/esp_system/startup.c +++ b/components/esp_system/startup.c @@ -450,7 +450,7 @@ static void start_cpu0_default(void) ESP_EARLY_LOGI(TAG, "Min chip rev: v%d.%d", CONFIG_ESP_REV_MIN_FULL / 100, CONFIG_ESP_REV_MIN_FULL % 100); ESP_EARLY_LOGI(TAG, "Max chip rev: v%d.%d %s",CONFIG_ESP_REV_MAX_FULL / 100, CONFIG_ESP_REV_MAX_FULL % 100, - efuse_ll_get_disable_wafer_version_major() ? "(constraint ignored)" : ""); + efuse_hal_get_disable_wafer_version_major() ? "(constraint ignored)" : ""); unsigned revision = efuse_hal_chip_revision(); ESP_EARLY_LOGI(TAG, "Chip rev: v%d.%d", revision / 100, revision % 100); } diff --git a/components/hal/efuse_hal.c b/components/hal/efuse_hal.c index 6a46c85d36..12acfa4e6f 100644 --- a/components/hal/efuse_hal.c +++ b/components/hal/efuse_hal.c @@ -24,6 +24,11 @@ IRAM_ATTR uint32_t efuse_hal_chip_revision(void) return efuse_hal_get_major_chip_version() * 100 + efuse_hal_get_minor_chip_version(); } +IRAM_ATTR bool efuse_hal_get_disable_wafer_version_major(void) +{ + return efuse_ll_get_disable_wafer_version_major(); +} + IRAM_ATTR bool efuse_hal_flash_encryption_enabled(void) { uint32_t flash_crypt_cnt = efuse_ll_get_flash_crypt_cnt(); diff --git a/components/hal/include/hal/efuse_hal.h b/components/hal/include/hal/efuse_hal.h index a30c77da5a..a7c2ae575e 100644 --- a/components/hal/include/hal/efuse_hal.h +++ b/components/hal/include/hal/efuse_hal.h @@ -36,6 +36,14 @@ uint32_t efuse_hal_chip_revision(void); */ bool efuse_hal_flash_encryption_enabled(void); +/** + * @brief Returns the status of whether the bootloader (and OTA) + * will check the maximum chip version or not. + * + * @return true - Skip the maximum chip version check. + */ +bool efuse_hal_get_disable_wafer_version_major(void); + /** * @brief Returns major chip version */