spi_flash: add config option to override flash size in bootloader header

Sometimes the flash size read from bootloader is not correct. This may
forbid SPI Flash driver from reading the the area larger than the size
in bootloader header.

When the new config option is enabled, the latest configured
ESPTOOLPY_FLAHSIZE in the app header will be used to override the value
read from bootloader header.
This commit is contained in:
Michael (XIAO Xufeng)
2020-08-24 11:09:33 +08:00
parent 8a9dc46b14
commit 37423083bb
7 changed files with 65 additions and 4 deletions

View File

@@ -33,6 +33,11 @@ void bootloader_flash_update_id(void)
g_rom_flashchip.device_id = bootloader_read_flash_id();
}
void bootloader_flash_update_size(uint32_t size)
{
g_rom_flashchip.chip_size = size;
}
void IRAM_ATTR bootloader_flash_cs_timing_config(void)
{
SET_PERI_REG_MASK(SPI_USER_REG(0), SPI_CS_HOLD_M | SPI_CS_SETUP_M);