From 0c774d6b6a075f37f21ca9c3506141cb0d4ae34b Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Wed, 23 Nov 2022 22:36:53 +1100 Subject: tree/: Convert unlock func ptr into enumerate values Converting the blockprotect unlock function pointer within the flashchip struct into enum values allows for the flashchips db to be turn into pure, declarative data. A nice side-effect of this is to reduce link-time symbol space of chipdrivers and increase modularity of the spi25_statusreg.c and related implementations. BUG=none TEST=ninja test. Change-Id: Ie5c5db1b09d07e1a549990d6f5a622fae4c83233 Signed-off-by: Edward O'Callaghan Reviewed-on: https://review.coreboot.org/c/flashrom/+/69933 Tested-by: build bot (Jenkins) Reviewed-by: Sam McNally Reviewed-by: Anastasia Klimchuk --- include/chipdrivers.h | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'include/chipdrivers.h') diff --git a/include/chipdrivers.h b/include/chipdrivers.h index c485aafa..bac77850 100644 --- a/include/chipdrivers.h +++ b/include/chipdrivers.h @@ -76,11 +76,6 @@ int spi_prettyprint_status_register_bp3_srwd(struct flashctx *flash); int spi_prettyprint_status_register_bp4_srwd(struct flashctx *flash); int spi_prettyprint_status_register_bp2_bpl(struct flashctx *flash); int spi_prettyprint_status_register_bp2_tb_bpl(struct flashctx *flash); -int spi_disable_blockprotect(struct flashctx *flash); -int spi_disable_blockprotect_bp1_srwd(struct flashctx *flash); -int spi_disable_blockprotect_bp2_srwd(struct flashctx *flash); -int spi_disable_blockprotect_bp3_srwd(struct flashctx *flash); -int spi_disable_blockprotect_bp4_srwd(struct flashctx *flash); int spi_prettyprint_status_register_amic_a25l032(struct flashctx *flash); int spi_prettyprint_status_register_at25df(struct flashctx *flash); int spi_prettyprint_status_register_at25df_sec(struct flashctx *flash); @@ -91,22 +86,12 @@ int spi_prettyprint_status_register_at25f4096(struct flashctx *flash); int spi_prettyprint_status_register_at25fs010(struct flashctx *flash); int spi_prettyprint_status_register_at25fs040(struct flashctx *flash); int spi_prettyprint_status_register_at26df081a(struct flashctx *flash); -int spi_disable_blockprotect_at2x_global_unprotect(struct flashctx *flash); -int spi_disable_blockprotect_at2x_global_unprotect_sec(struct flashctx *flash); -int spi_disable_blockprotect_at25f(struct flashctx *flash); -int spi_disable_blockprotect_at25f512a(struct flashctx *flash); -int spi_disable_blockprotect_at25f512b(struct flashctx *flash); -int spi_disable_blockprotect_at25fs010(struct flashctx *flash); -int spi_disable_blockprotect_at25fs040(struct flashctx *flash); int spi_prettyprint_status_register_en25s_wp(struct flashctx *flash); int spi_prettyprint_status_register_n25q(struct flashctx *flash); -int spi_disable_blockprotect_n25q(struct flashctx *flash); int spi_prettyprint_status_register_bp2_ep_srwd(struct flashctx *flash); -int spi_disable_blockprotect_bp2_ep_srwd(struct flashctx *flash); int spi_prettyprint_status_register_sst25(struct flashctx *flash); int spi_prettyprint_status_register_sst25vf016(struct flashctx *flash); int spi_prettyprint_status_register_sst25vf040b(struct flashctx *flash); -int spi_disable_blockprotect_sst26_global_unprotect(struct flashctx *flash); /* sfdp.c */ int probe_spi_sfdp(struct flashctx *flash); @@ -136,8 +121,7 @@ int probe_82802ab(struct flashctx *flash); int erase_block_82802ab(struct flashctx *flash, unsigned int page, unsigned int pagesize); int write_82802ab(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); void print_status_82802ab(uint8_t status); -int unlock_28f004s5(struct flashctx *flash); -int unlock_lh28f008bjt(struct flashctx *flash); +blockprotect_func_t *lookup_82802ab_blockprotect_func_ptr(const struct flashchip *const chip); /* jedec.c */ uint8_t oddparity(uint8_t val); @@ -151,10 +135,7 @@ int erase_sector_jedec(struct flashctx *flash, unsigned int page, unsigned int p int erase_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize); int erase_chip_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize); -int unlock_regspace2_uniform_32k(struct flashctx *flash); -int unlock_regspace2_uniform_64k(struct flashctx *flash); -int unlock_regspace2_block_eraser_0(struct flashctx *flash); -int unlock_regspace2_block_eraser_1(struct flashctx *flash); +blockprotect_func_t *lookup_jedec_blockprotect_func_ptr(const struct flashchip *const chip); int printlock_regspace2_uniform_64k(struct flashctx *flash); int printlock_regspace2_block_eraser_0(struct flashctx *flash); int printlock_regspace2_block_eraser_1(struct flashctx *flash); -- cgit v1.2.3