spi_flash: add support for 32Mbit address GD flash, for GD25Q256

This commit is contained in:
Cao Sen Miao
2021-05-18 12:05:41 +08:00
parent ba15ac8634
commit e226a65a1f
10 changed files with 136 additions and 18 deletions

View File

@@ -463,6 +463,20 @@ esp_err_t spi_flash_chip_generic_set_io_mode(esp_flash_t *chip)
}
#endif // CONFIG_SPI_FLASH_ROM_IMPL
spi_flash_caps_t spi_flash_chip_generic_get_caps(esp_flash_t *chip)
{
// For generic part flash capability, take the XMC chip as reference.
spi_flash_caps_t caps_flags = 0;
// 32M-bits address support
// flash suspend support
// Only `XMC` support suspend for now.
if (chip->chip_id >> 16 == 0x20) {
caps_flags |= SPI_FLASH_CHIP_CAP_SUSPEND;
}
return caps_flags;
}
static const char chip_name[] = "generic";
const spi_flash_chip_t esp_flash_chip_generic = {
@@ -501,6 +515,7 @@ const spi_flash_chip_t esp_flash_chip_generic = {
.read_reg = spi_flash_chip_generic_read_reg,
.yield = spi_flash_chip_generic_yield,
.sus_setup = spi_flash_chip_generic_suspend_cmd_conf,
.get_chip_caps = spi_flash_chip_generic_get_caps,
};
#ifndef CONFIG_SPI_FLASH_ROM_IMPL