drivers/spi/spi_flash: add missing status() command callbacks

The adesto, amic, atmel, and stmicro spi flash drivers didn't have
the status() call back. These parts do support the status command
retrieval. Fill them in accordingly.

Change-Id: Ie0e63bec844b8e01e292ef8c4df707494df02e69
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38377
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Aaron Durbin 2020-01-11 16:52:42 -07:00
parent f584f19efc
commit 937931ea04
4 changed files with 8 additions and 0 deletions

View File

@ -152,6 +152,7 @@ static const struct spi_flash_ops spi_flash_ops = {
.read = spi_flash_cmd_read, .read = spi_flash_cmd_read,
.write = spi_flash_cmd_write_page_program, .write = spi_flash_cmd_write_page_program,
.erase = spi_flash_cmd_erase, .erase = spi_flash_cmd_erase,
.status = spi_flash_cmd_status,
}; };
int spi_flash_probe_adesto(const struct spi_slave *spi, u8 *idcode, int spi_flash_probe_adesto(const struct spi_slave *spi, u8 *idcode,
@ -180,6 +181,7 @@ int spi_flash_probe_adesto(const struct spi_slave *spi, u8 *idcode,
flash->size = flash->sector_size *params->sectors_per_block * flash->size = flash->sector_size *params->sectors_per_block *
params->nr_blocks; params->nr_blocks;
flash->erase_cmd = CMD_AT25DF_SE; flash->erase_cmd = CMD_AT25DF_SE;
flash->status_cmd = CMD_AT25DF_RDSR;
flash->pp_cmd = CMD_AT25DF_PP; flash->pp_cmd = CMD_AT25DF_PP;
flash->wren_cmd = CMD_AT25DF_WREN; flash->wren_cmd = CMD_AT25DF_WREN;

View File

@ -123,6 +123,7 @@ static const struct spi_flash_ops spi_flash_ops = {
.read = spi_flash_cmd_read, .read = spi_flash_cmd_read,
.write = spi_flash_cmd_write_page_program, .write = spi_flash_cmd_write_page_program,
.erase = spi_flash_cmd_erase, .erase = spi_flash_cmd_erase,
.status = spi_flash_cmd_status,
}; };
int spi_flash_probe_amic(const struct spi_slave *spi, u8 *idcode, int spi_flash_probe_amic(const struct spi_slave *spi, u8 *idcode,
@ -152,6 +153,7 @@ int spi_flash_probe_amic(const struct spi_slave *spi, u8 *idcode,
flash->size = flash->sector_size * params->sectors_per_block * flash->size = flash->sector_size * params->sectors_per_block *
params->nr_blocks; params->nr_blocks;
flash->erase_cmd = CMD_A25_SE; flash->erase_cmd = CMD_A25_SE;
flash->status_cmd = CMD_A25_RDSR;
flash->pp_cmd = CMD_A25_PP; flash->pp_cmd = CMD_A25_PP;
flash->wren_cmd = CMD_A25_WREN; flash->wren_cmd = CMD_A25_WREN;

View File

@ -107,6 +107,7 @@ static const struct spi_flash_ops spi_flash_ops = {
.read = spi_flash_cmd_read, .read = spi_flash_cmd_read,
.write = spi_flash_cmd_write_page_program, .write = spi_flash_cmd_write_page_program,
.erase = spi_flash_cmd_erase, .erase = spi_flash_cmd_erase,
.status = spi_flash_cmd_status,
}; };
int spi_flash_probe_atmel(const struct spi_slave *spi, u8 *idcode, int spi_flash_probe_atmel(const struct spi_slave *spi, u8 *idcode,
@ -136,6 +137,7 @@ int spi_flash_probe_atmel(const struct spi_slave *spi, u8 *idcode,
flash->size = flash->sector_size * params->sectors_per_block * flash->size = flash->sector_size * params->sectors_per_block *
params->nr_blocks; params->nr_blocks;
flash->erase_cmd = CMD_AT25_SE; flash->erase_cmd = CMD_AT25_SE;
flash->status_cmd = CMD_AT25_RDSR;
flash->pp_cmd = CMD_AT25_PP; flash->pp_cmd = CMD_AT25_PP;
flash->wren_cmd = CMD_AT25_WREN; flash->wren_cmd = CMD_AT25_WREN;

View File

@ -288,6 +288,7 @@ static const struct spi_flash_ops spi_flash_ops = {
.read = spi_flash_cmd_read, .read = spi_flash_cmd_read,
.write = spi_flash_cmd_write_page_program, .write = spi_flash_cmd_write_page_program,
.erase = spi_flash_cmd_erase, .erase = spi_flash_cmd_erase,
.status = spi_flash_cmd_status,
}; };
int stmicro_release_deep_sleep_identify(const struct spi_slave *spi, u8 *idcode) int stmicro_release_deep_sleep_identify(const struct spi_slave *spi, u8 *idcode)
@ -333,6 +334,7 @@ int spi_flash_probe_stmicro(const struct spi_slave *spi, u8 *idcode,
flash->sector_size = params->page_size * params->pages_per_sector; flash->sector_size = params->page_size * params->pages_per_sector;
flash->size = flash->sector_size * params->nr_sectors; flash->size = flash->sector_size * params->nr_sectors;
flash->erase_cmd = params->op_erase; flash->erase_cmd = params->op_erase;
flash->status_cmd = CMD_M25PXX_RDSR;
flash->pp_cmd = CMD_M25PXX_PP; flash->pp_cmd = CMD_M25PXX_PP;
flash->wren_cmd = CMD_M25PXX_WREN; flash->wren_cmd = CMD_M25PXX_WREN;