spi_flash: move the unlock patch to bootloader and add support for GD (backport v4.0)

This commit is contained in:
Cao Sen Miao
2021-09-18 04:28:03 +08:00
committed by zhaokeke
parent 6b79d1c206
commit 04a730c80c
5 changed files with 98 additions and 2 deletions

View File

@@ -17,6 +17,8 @@
extern "C" {
#endif
#include "esp_err.h"
/** @brief Enable Quad I/O mode in bootloader (if configured)
*
* Queries attached SPI flash ID and sends correct SPI flash
@@ -32,6 +34,14 @@ void bootloader_enable_qio_mode(void);
*/
uint32_t bootloader_read_flash_id();
/**
* @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 Read the SFDP of the flash
*