efuse: Adds major and minor versions and others

This commit is contained in:
KonstantinKondrashov
2022-05-26 03:16:15 +08:00
committed by BOT
parent ab6735155a
commit 3dcdcc08eb
74 changed files with 1813 additions and 538 deletions

View File

@@ -31,6 +31,7 @@
#include "soc/rtc.h"
#include "soc/efuse_reg.h"
#include "soc/soc_memory_layout.h"
#include "hal/efuse_hal.h"
#include "hal/gpio_ll.h"
#include "esp_image_format.h"
#include "bootloader_sha.h"
@@ -75,7 +76,15 @@ esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hd
ESP_LOGE(TAG, "mismatch chip ID, expected %d, found %d", chip_id, img_hdr->chip_id);
err = ESP_FAIL;
}
uint8_t revision = bootloader_common_get_chip_revision();
#ifndef CONFIG_IDF_ENV_FPGA
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2)
uint8_t revision = efuse_hal_get_major_chip_version();
// min_chip_rev keeps the MAJOR wafer version for these chips
#else
uint8_t revision = efuse_hal_get_minor_chip_version();
// min_chip_rev keeps the MINOR wafer version for these chips
#endif
if (revision < img_hdr->min_chip_rev) {
/* To fix this error, please update mininum supported chip revision from configuration,
* located in TARGET (e.g. ESP32) specific options under "Component config" menu */
@@ -86,6 +95,8 @@ esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hd
ESP_LOGI(TAG, "chip revision: %d, min. %s chip revision: %d", revision, type == ESP_IMAGE_BOOTLOADER ? "bootloader" : "application", img_hdr->min_chip_rev);
#endif
}
#endif // CONFIG_IDF_ENV_FPGA
return err;
}