Edward O'Callaghan has uploaded this change for review.
WIP convert blockprotect into enum
Change-Id: Ie5c5db1b09d07e1a549990d6f5a622fae4c83233
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M include/flash.h
1 file changed, 38 insertions(+), 26 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/33/69933/1
diff --git a/include/flash.h b/include/flash.h
index 3f78721..fc59a51 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -322,31 +322,33 @@
TEST_ERASE_INJECTOR, /* special case must come last. */
};
-#define NO_BLOCKPROTECT_FUNC NULL
-#define SPI_DISABLE_BLOCKPROTECT spi_disable_blockprotect
-#define SPI_DISABLE_BLOCKPROTECT_BP2_EP_SRWD spi_disable_blockprotect_bp2_ep_srwd
-#define SPI_DISABLE_BLOCKPROTECT_BP1_SRWD spi_disable_blockprotect_bp1_srwd
-#define SPI_DISABLE_BLOCKPROTECT_BP2_SRWD spi_disable_blockprotect_bp2_srwd
-#define SPI_DISABLE_BLOCKPROTECT_BP3_SRWD spi_disable_blockprotect_bp3_srwd
-#define SPI_DISABLE_BLOCKPROTECT_BP4_SRWD spi_disable_blockprotect_bp4_srwd
-#define SPI_DISABLE_BLOCKPROTECT_AT45DB spi_disable_blockprotect_at45db
-#define SPI_DISABLE_BLOCKPROTECT_AT25F spi_disable_blockprotect_at25f
-#define SPI_DISABLE_BLOCKPROTECT_AT25FS010 spi_disable_blockprotect_at25fs010
-#define SPI_DISABLE_BLOCKPROTECT_AT25FS040 spi_disable_blockprotect_at25fs040
-#define SPI_DISABLE_BLOCKPROTECT_AT25F512A spi_disable_blockprotect_at25f512a
-#define SPI_DISABLE_BLOCKPROTECT_AT25F512B spi_disable_blockprotect_at25f512b
-#define SPI_DISABLE_BLOCKPROTECT_AT2X_GLOBAL_UNPROTECT spi_disable_blockprotect_at2x_global_unprotect
-#define SPI_DISABLE_BLOCKPROTECT_AT2X_GLOBAL_UNPROTECT_SEC spi_disable_blockprotect_at2x_global_unprotect_sec
-#define SPI_DISABLE_BLOCKPROTECT_SST26_GLOBAL_UNPROTECT spi_disable_blockprotect_sst26_global_unprotect
-#define SPI_DISABLE_BLOCKPROTECT_N25Q spi_disable_blockprotect_n25q
-#define UNLOCK_REGSPACE2_BLOCK_ERASER_0 unlock_regspace2_block_eraser_0
-#define UNLOCK_REGSPACE2_BLOCK_ERASER_1 unlock_regspace2_block_eraser_1
-#define UNLOCK_REGSPACE2_UNIFORM_32K unlock_regspace2_uniform_32k
-#define UNLOCK_REGSPACE2_UNIFORM_64K unlock_regspace2_uniform_64k
-#define UNLOCK_28F004S5 unlock_28f004s5
-#define UNLOCK_LH28F008BJT unlock_lh28f008bjt
-#define UNLOCK_SST_FWHUB unlock_sst_fwhub
-#define UNPROTECT_28SF040 unprotect_28sf040
+enum blockprotect_func {
+ NO_BLOCKPROTECT_FUNC,
+ SPI_DISABLE_BLOCKPROTECT,
+ SPI_DISABLE_BLOCKPROTECT_BP2_EP_SRWD,
+ SPI_DISABLE_BLOCKPROTECT_BP1_SRWD,
+ SPI_DISABLE_BLOCKPROTECT_BP2_SRWD,
+ SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
+ SPI_DISABLE_BLOCKPROTECT_BP4_SRWD,
+ SPI_DISABLE_BLOCKPROTECT_AT45DB,
+ SPI_DISABLE_BLOCKPROTECT_AT25F,
+ SPI_DISABLE_BLOCKPROTECT_AT25FS010,
+ SPI_DISABLE_BLOCKPROTECT_AT25FS040,
+ SPI_DISABLE_BLOCKPROTECT_AT25F512A,
+ SPI_DISABLE_BLOCKPROTECT_AT25F512B,
+ SPI_DISABLE_BLOCKPROTECT_AT2X_GLOBAL_UNPROTECT,
+ SPI_DISABLE_BLOCKPROTECT_AT2X_GLOBAL_UNPROTECT_SEC,
+ SPI_DISABLE_BLOCKPROTECT_SST26_GLOBAL_UNPROTECT,
+ SPI_DISABLE_BLOCKPROTECT_N25Q,
+ UNLOCK_REGSPACE2_BLOCK_ERASER_0,
+ UNLOCK_REGSPACE2_BLOCK_ERASER_1,
+ UNLOCK_REGSPACE2_UNIFORM_32K,
+ UNLOCK_REGSPACE2_UNIFORM_64K,
+ UNLOCK_28F004S5,
+ UNLOCK_LH28F008BJT,
+ UNLOCK_SST_FWHUB,
+ UNPROTECT_28SF040,
+};
#define NO_PRINTLOCK_FUNC NULL
#define PRINTLOCK_AT49F printlock_at49f
@@ -458,7 +460,7 @@
} block_erasers[NUM_ERASEFUNCTIONS];
int (*printlock) (struct flashctx *flash);
- int (*unlock) (struct flashctx *flash);
+ enum blockprotect_func unlock;
enum write_func write;
enum read_func read;
struct voltage {
To view, visit change 69933. To unsubscribe, or for help writing mail filters, visit settings.