Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/42112?usp=email )
Change subject: spi: Add new struct spi_flash_bpbits for block protection bits ......................................................................
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 --- M src/include/spi_flash.h 1 file changed, 11 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Jakub Czapiga: Looks good to me, approved
diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h index fe77e3e..d5471a4 100644 --- a/src/include/spi_flash.h +++ b/src/include/spi_flash.h @@ -49,6 +49,17 @@ 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 { /*