spi_flash: refact that flash qio can be overidable

This commit is contained in:
Cao Sen Miao
2021-09-24 12:03:03 +08:00
parent 534cd5bb31
commit 981abed2b2
3 changed files with 136 additions and 66 deletions

View File

@@ -9,6 +9,7 @@
#include <esp_spi_flash.h> /* including in bootloader for error values */
#include "sdkconfig.h"
#include "soc/soc_caps.h"
#include "bootloader_flash_override.h"
#ifdef __cplusplus
extern "C" {
@@ -32,14 +33,6 @@ uint32_t bootloader_read_flash_id(void);
esp_err_t bootloader_flash_wrap_set(spi_flash_wrap_mode_t mode);
#endif
/**
* @brief Unlock Flash write protect.
* Please do not call this function in SDK.
*
* @note This can be overridden because it's attribute weak.
*/
esp_err_t bootloader_flash_unlock(void);
/**
* @brief Startup flow recommended by XMC. Call at startup before any erase/write operation.
*
@@ -47,6 +40,15 @@ esp_err_t bootloader_flash_unlock(void);
*/
esp_err_t bootloader_flash_xmc_startup(void);
/**
* @brief Unlock Flash write protect.
* Please do not call this function in SDK.
*
* @note This can be overridden because it's attribute weak.
*/
esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void);
#ifdef __cplusplus
}
#endif