From 5abeb06a73c6f3073f2796a726ea6dc7fb584371 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Sun, 12 Jan 2020 15:12:18 -0700 Subject: drivers/spi/spi_flash: organize spi flash by sector topology By grouping the spi flash parts by their {vendor, sector topology} tuple one can use a common probe function for looking up the part instead of having per-vendor probe functions. Additionally, by grouping by the command set one can save more space as well. SST is the exception that requires after_probe() function to unlock the parts. 2KiB of savings in each of verstage, romstage, and ramstage on Aleena Chrome OS Build. Change-Id: I9cc20ca0f3d0a1b97154b000c95ff2e7e87f3375 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/c/coreboot/+/38379 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/include/spi_flash.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/include') diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h index ffa66db561..9acff3b104 100644 --- a/src/include/spi_flash.h +++ b/src/include/spi_flash.h @@ -91,6 +91,8 @@ struct spi_flash_protection_ops { }; +struct spi_flash_part_id; + struct spi_flash { struct spi_slave spi; u8 vendor; @@ -113,6 +115,7 @@ struct spi_flash { const struct spi_flash_ops *ops; /* If !NULL all protection callbacks exist. */ const struct spi_flash_protection_ops *prot_ops; + const struct spi_flash_part_id *part; }; void lb_spi_flash(struct lb_header *header); -- cgit v1.2.3