diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2020-06-05 04:05:41 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-10-05 12:51:38 +0000 |
commit | f20d7d6aa46be6ce89cc4bc90e47f7401772154f (patch) | |
tree | 2e16951ca1c6fd4b70a1c1823a362ad2795a49a5 /src/include | |
parent | a5b06b9b578f48b30502bba04841f06cf9ce9e4a (diff) |
spi: Add new struct spi_flash_bpbits for block protection bits
Currently the block protection bits are being passed around as
individual arguments. We will use this new struct to replace the
corresponding arguments in the winbond_bpbits_to_region and
winbond_set_write_protection functions.
Change-Id: I02828b1f764aea29374e794001e74cdc86a94c92
Signed-off-by: Daniel Gröber <dxld@darkboxed.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42112
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <czapiga@google.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/spi_flash.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h index fe77e3ef79..d5471a4406 100644 --- a/src/include/spi_flash.h +++ b/src/include/spi_flash.h @@ -49,6 +49,17 @@ struct spi_flash_ops { int (*status)(const struct spi_flash *flash, u8 *reg); }; +struct spi_flash_bpbits { + unsigned int bp; /*< block protection select bits */ + bool cmp; /*< complement protect */ + bool tb; /*< top=0 / bottom=1 select */ + union { + struct { + bool srp1, srp0; + } winbond; + }; +}; + /* Current code assumes all callbacks are supplied in this object. */ struct spi_flash_protection_ops { /* |