summaryrefslogtreecommitdiffstats
path: root/src/drivers/spi/spi_flash_internal.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2020-01-11 23:18:51 -0700
committerAaron Durbin <adurbin@chromium.org>2020-01-17 05:48:52 +0000
commita6c73c898775bbc59b9d6e1fcb03e340db89ee67 (patch)
tree2d8970388b3871bd7428c2d703f769ebd0cefe49 /src/drivers/spi/spi_flash_internal.h
parentae43f32458ad85a8b9cca4868ed47afda108652d (diff)
downloadcoreboot-a6c73c898775bbc59b9d6e1fcb03e340db89ee67.tar.gz
coreboot-a6c73c898775bbc59b9d6e1fcb03e340db89ee67.tar.bz2
coreboot-a6c73c898775bbc59b9d6e1fcb03e340db89ee67.zip
drivers/spi/spi_flash: introduce common spi_flash_part_id object
To further drive to a common approach for describing the spi flash parts in the drivers add spi_flash_part_id object. All the drivers are updated to utilize the new object. Additionally, the driver_private is also not needed in the spi_flash object. A Chrome OS build of Aleena provides 960 byte saving of text. A subsequent patch will save more memory. Change-Id: I9c0cc75f188ac004ab647805b9551bf06a0c646b Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38378 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/drivers/spi/spi_flash_internal.h')
-rw-r--r--src/drivers/spi/spi_flash_internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/drivers/spi/spi_flash_internal.h b/src/drivers/spi/spi_flash_internal.h
index ef756c78d736..cc258ded2087 100644
--- a/src/drivers/spi/spi_flash_internal.h
+++ b/src/drivers/spi/spi_flash_internal.h
@@ -93,4 +93,18 @@ int spi_flash_probe_gigadevice(const struct spi_slave *spi, u8 *idcode,
int spi_flash_probe_adesto(const struct spi_slave *spi, u8 *idcode,
struct spi_flash *flash);
+struct spi_flash_part_id {
+ uint32_t id;
+ const char *name;
+ /* Log based 2 total number of sectors. */
+ uint16_t nr_sectors_shift: 4;
+ /* Log based 2 sector size */
+ uint16_t sector_size_kib_shift: 4;
+ uint16_t fast_read_dual_output_support : 1;
+ uint16_t _reserved_for_flags: 7;
+ /* Block protection. Currently used by Winbond. */
+ uint16_t protection_granularity_shift : 5;
+ uint16_t bp_bits : 3;
+};
+
#endif /* SPI_FLASH_INTERNAL_H */