aboutsummaryrefslogtreecommitdiffstats
path: root/include/flash.h
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2022-08-15 12:05:31 +1000
committerFelix Singer <felixsinger@posteo.net>2022-11-01 01:15:21 +0000
commit10e7a0ebd74db72f00b8fc1b741f411d5a49b92d (patch)
treece00649acaeb036526489740af32b9a8cc3c403b /include/flash.h
parent74c3e56ec24f0d2800ea376d73d9b244cd8a4b40 (diff)
downloadflashrom-10e7a0ebd74db72f00b8fc1b741f411d5a49b92d.tar.gz
flashrom-10e7a0ebd74db72f00b8fc1b741f411d5a49b92d.tar.bz2
flashrom-10e7a0ebd74db72f00b8fc1b741f411d5a49b92d.zip
tree/: Convert flashchip probe func ptr to enumerate
This forges the way for flashchips.c to be pure declarative data and lookup functions for dispatch to be pure. This means that the flashchips data could be extracted out to be agnostic data of the flashrom code and algorithms. TEST='R|W|E && --flash-name' on ARM, AMD & Intel DUT's. Change-Id: I00aaab9c83f305cd47e78c36d9c2867f2b73c396 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66781 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'include/flash.h')
-rw-r--r--include/flash.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/flash.h b/include/flash.h
index 32290e4d..37f21ac5 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -217,6 +217,27 @@ enum decode_range_func {
};
typedef void (decode_range_func_t)(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len);
+enum probe_func {
+ NO_PROBE_FUNC = 0, /* 0 indicates no probe function set. */
+ PROBE_JEDEC = 1,
+ PROBE_JEDEC_29GL,
+ PROBE_OPAQUE,
+ PROBE_EDI_KB9012,
+ PROBE_AT82802AB,
+ PROBE_W29EE011,
+ PROBE_EN29LV640B,
+ PROBE_SPI_AT25F,
+ PROBE_SPI_AT45DB,
+ PROBE_SPI_BIG_SPANSION,
+ PROBE_SPI_RDID,
+ PROBE_SPI_RDID4,
+ PROBE_SPI_REMS,
+ PROBE_SPI_RES1,
+ PROBE_SPI_RES2,
+ PROBE_SPI_SFDP,
+ PROBE_SPI_ST95,
+};
+
struct flashchip {
const char *vendor;
const char *name;
@@ -258,7 +279,7 @@ struct flashchip {
SPI_EDI = 1,
} spi_cmd_set;
- int (*probe) (struct flashctx *flash);
+ enum probe_func probe;
/* Delay after "enter/exit ID mode" commands in microseconds.
* NB: negative values have special meanings, see TIMING_* below.