aboutsummaryrefslogtreecommitdiff
path: root/src/include/spi_flash.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2020-01-12 15:12:18 -0700
committerAaron Durbin <adurbin@chromium.org>2020-01-17 05:49:09 +0000
commit5abeb06a73c6f3073f2796a726ea6dc7fb584371 (patch)
tree82c6a3b967edcf0ccf0aabcbd06894b8847009af /src/include/spi_flash.h
parenta6c73c898775bbc59b9d6e1fcb03e340db89ee67 (diff)
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 <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38379 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/include/spi_flash.h')
-rw-r--r--src/include/spi_flash.h3
1 files changed, 3 insertions, 0 deletions
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);