spi_flash: Support suspend/resume mode for operations

- Adds arbitration between the erase and write in suspend mode
     (If the flash memory is suspended then only a read operation can be performed.)
- espcoredump: Dump does not use suspend feature, just resume before continue.
- spi_flash: Add release_cpu() to do suspend/release_cpu/resume
This commit is contained in:
KonstantinKondrashov 2020-04-25 04:12:43 +08:00 committed by Cao Sen Miao
parent 728801883e
commit afef16c2e9
3 changed files with 5 additions and 2 deletions

View File

@ -266,7 +266,7 @@ typedef volatile struct spi_mem_dev_s {
};
uint32_t val;
} fsm;
uint32_t data_buf[18]; /*data buffer*/
uint32_t data_buf[16]; /*data buffer*/
union {
struct {
uint32_t waiti_en: 1; /*auto-waiting flash idle operation when program flash or erase flash. 1: enable 0: disable.*/

View File

@ -124,6 +124,7 @@ menu "SPI Flash driver"
config SPI_FLASH_YIELD_DURING_ERASE
bool "Enables yield operation during flash erase"
default y
depends on SPI_FLASH_USE_LEGACY_IMPL
help
This allows to yield the CPUs between erase commands.
Prevents starvation of other tasks.
@ -137,7 +138,7 @@ menu "SPI Flash driver"
then it will yield CPUs after finishing a current command.
config SPI_FLASH_ERASE_YIELD_TICKS
int "CPU release time (tick)"
int "CPU release time (tick) for an erase operation"
depends on SPI_FLASH_YIELD_DURING_ERASE
default 1
help

View File

@ -47,6 +47,8 @@
#define CMD_LARGE_BLOCK_ERASE_4B 0xDC /* 64KB block erase command */
#define CMD_PROGRAM_PAGE 0x02
#define CMD_PROGRAM_PAGE_4B 0x12
#define CMD_SUSPEND 0x75
#define CMD_RESUME 0x7A
#define CMD_RST_EN 0x66
#define CMD_RST_DEV 0x99