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>
This commit is contained in:
Daniel Gröber 2020-06-05 04:05:41 +02:00 committed by Felix Held
parent a5b06b9b57
commit f20d7d6aa4
1 changed files with 11 additions and 0 deletions

View File

@ -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 {
/*