spi_flash: Support select flash mode automatically at run time(Quad flash or Octal flash)

This commit is contained in:
Cao Sen Miao
2022-09-23 17:32:16 +08:00
parent 542bdea689
commit 2c9bb4eb7d
12 changed files with 170 additions and 78 deletions

View File

@@ -10,6 +10,7 @@
#include <esp_flash_encrypt.h>
#include "sdkconfig.h"
#include "soc/soc_caps.h"
#include "hal/efuse_ll.h"
#if CONFIG_IDF_TARGET_ESP32
# include "soc/spi_struct.h"
@@ -780,3 +781,12 @@ esp_err_t IRAM_ATTR bootloader_flash_reset_chip(void)
return ESP_OK;
}
bool bootloader_flash_is_octal_mode_enabled(void)
{
#if SOC_SPI_MEM_SUPPORT_OPI_MODE
return efuse_ll_get_flash_type();
#else
return false;
#endif
}