Use the register mapping feature bit
All functions which just call probe_jedec and then map flash registers
are replaced by probe_jedec. All functions which call probe_jedec, map
flash registers and do something else can at least eliminate mapping
flash registers.
Fix logic inversion in probe_jedec to map flash registers on success
instead of on failure.
Change a few TIMING_IGNORED to TIMING_FIXME where probe_jedec is used.
Total savings: One probe function simplified, three probe functions
eliminated.
Corresponding to flashrom svn r839.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Sean Nelson <audiohacked@gmail.com>
diff --git a/flashchips.c b/flashchips.c
index e6c4b86..913e030 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -827,7 +827,7 @@
.total_size = 64,
.page_size = 128,
.tested = TEST_OK_PRW,
- .probe = probe_jedec,
+ .probe = probe_jedec,
.probe_timing = 10000, /* 10mS, Enter=Exec */
.erase = NULL,
.block_erasers =
@@ -1252,8 +1252,9 @@
.model_id = AMIC_A49LF040A,
.total_size = 512,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PREW,
- .probe = probe_49fl00x,
+ .probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* routine is wrapper to probe_jedec (pm49fl00x.c) */
.erase = erase_49fl00x,
.write = write_49fl00x,
@@ -2473,8 +2474,9 @@
.model_id = PMC_49FL002,
.total_size = 256,
.page_size = 16 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PREW,
- .probe = probe_49fl00x,
+ .probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* routine is wrapper to probe_jedec (pm49fl00x.c) */
.erase = erase_49fl00x,
.write = write_49fl00x,
@@ -2489,8 +2491,9 @@
.model_id = PMC_49FL004,
.total_size = 512,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PREW,
- .probe = probe_49fl00x,
+ .probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* routine is wrapper to probe_jedec (pm49fl00x.c) */
.erase = erase_49fl00x,
.write = write_49fl00x,
@@ -2980,6 +2983,7 @@
.model_id = SST_49LF002A,
.total_size = 256,
.page_size = 16 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PREW,
.probe = probe_sst_fwhub,
.probe_timing = 1, /* 150 ns | routine is wrapper to probe_jedec (sst_fwhub.c) */
@@ -2996,6 +3000,7 @@
.model_id = SST_49LF003A,
.total_size = 384,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PR,
.probe = probe_sst_fwhub,
.probe_timing = 1, /* 150 ns | routine is wrapper to probe_jedec (sst_fwhub.c) */
@@ -3015,6 +3020,7 @@
.model_id = SST_49LF004A,
.total_size = 512,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PREW,
.probe = probe_sst_fwhub,
.probe_timing = 1, /* 150 ns | routine is wrapper to probe_jedec (sst_fwhub.c) */
@@ -3060,6 +3066,7 @@
.model_id = SST_49LF008A,
.total_size = 1024,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PREW,
.probe = probe_sst_fwhub,
.probe_timing = 1, /* 150 ns | routine is wrapper to probe_jedec (sst_fwhub.c) */
@@ -3156,6 +3163,7 @@
.model_id = SST_49LF040B,
.total_size = 512,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PREW,
.probe = probe_sst_fwhub,
.probe_timing = 1, /* 150ns | routine is wrapper to probe_jedec (sst_fwhub.c) */
@@ -3498,8 +3506,9 @@
.model_id = ST_M50FLW040A,
.total_size = 512,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_UNTESTED,
- .probe = probe_stm50flw0x0x,
+ .probe = probe_jedec,
.probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (stm50flw0x0x.c) */
.erase = erase_stm50flw0x0x,
.write = write_stm50flw0x0x,
@@ -3514,8 +3523,9 @@
.model_id = ST_M50FLW040B,
.total_size = 512,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_UNTESTED,
- .probe = probe_stm50flw0x0x,
+ .probe = probe_jedec,
.probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (stm50flw0x0x.c) */
.erase = erase_stm50flw0x0x,
.write = write_stm50flw0x0x,
@@ -3530,8 +3540,9 @@
.model_id = ST_M50FLW080A,
.total_size = 1024,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PREW,
- .probe = probe_stm50flw0x0x,
+ .probe = probe_jedec,
.probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (stm50flw0x0x.c) */
.erase = erase_stm50flw0x0x,
.write = write_stm50flw0x0x,
@@ -3546,8 +3557,9 @@
.model_id = ST_M50FLW080B,
.total_size = 1024,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_UNTESTED,
- .probe = probe_stm50flw0x0x,
+ .probe = probe_jedec,
.probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (stm50flw0x0x.c) */
.erase = erase_stm50flw0x0x,
.write = write_stm50flw0x0x,
@@ -4042,9 +4054,10 @@
.model_id = W_39V080FA,
.total_size = 1024,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_OK_PREW,
- .probe = probe_winbond_fwhub,
- .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (w39v080fa.c) */
+ .probe = probe_jedec,
+ .probe_timing = TIMING_FIXME,
.erase = erase_winbond_fwhub,
.write = write_winbond_fwhub,
.read = read_memmapped,
@@ -4058,9 +4071,10 @@
.model_id = W_39V080FA_DM,
.total_size = 512,
.page_size = 64 * 1024,
+ .feature_bits = FEATURE_REGISTERMAP,
.tested = TEST_UNTESTED,
- .probe = probe_winbond_fwhub,
- .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (w39v080fa.c) */
+ .probe = probe_jedec,
+ .probe_timing = TIMING_FIXME,
.erase = erase_winbond_fwhub,
.write = write_winbond_fwhub,
.read = read_memmapped,