Use new probing path for chips w/o IDs
We used to have a probe_noop() that simply assumed a chip is there
but wasn't called by default. Instead we can handle this case spe-
cifically in the new probing path.
Change-Id: I633c55f8de3a36c4de96f79fd938f58aa39b5bf9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/426
diff --git a/flashchips.c b/flashchips.c
index 505f0b9..8259cd4 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -13510,7 +13510,7 @@
.feature_bits = FEATURE_WRSR_WREN | FEATURE_NO_ERASE | FEATURE_ERASED_ZERO,
.tested = TEST_UNTESTED,
.spi_cmd_set = SPI25_EEPROM,
- .probe = probe_noop,
+ .probe = probe_buses,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
@@ -13538,7 +13538,7 @@
.feature_bits = FEATURE_WRSR_WREN | FEATURE_NO_ERASE | FEATURE_ERASED_ZERO,
.tested = TEST_UNTESTED,
.spi_cmd_set = SPI25_EEPROM,
- .probe = probe_noop,
+ .probe = probe_buses,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
@@ -13566,7 +13566,7 @@
.feature_bits = FEATURE_WRSR_WREN | FEATURE_NO_ERASE | FEATURE_ERASED_ZERO,
.tested = TEST_UNTESTED,
.spi_cmd_set = SPI25_EEPROM,
- .probe = probe_noop,
+ .probe = probe_buses,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
@@ -13594,7 +13594,7 @@
.feature_bits = FEATURE_WRSR_WREN | FEATURE_NO_ERASE | FEATURE_ERASED_ZERO,
.tested = TEST_UNTESTED,
.spi_cmd_set = SPI25_EEPROM,
- .probe = probe_noop,
+ .probe = probe_buses,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
@@ -13622,7 +13622,7 @@
.feature_bits = FEATURE_WRSR_WREN | FEATURE_NO_ERASE | FEATURE_ERASED_ZERO,
.tested = TEST_UNTESTED,
.spi_cmd_set = SPI25_EEPROM,
- .probe = probe_noop,
+ .probe = probe_buses,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
@@ -13650,7 +13650,7 @@
.feature_bits = FEATURE_WRSR_WREN | FEATURE_NO_ERASE | FEATURE_ERASED_ZERO,
.tested = TEST_UNTESTED,
.spi_cmd_set = SPI25_EEPROM,
- .probe = probe_noop,
+ .probe = probe_buses,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
@@ -13678,7 +13678,7 @@
.feature_bits = FEATURE_WRSR_WREN | FEATURE_NO_ERASE | FEATURE_ERASED_ZERO,
.tested = TEST_UNTESTED,
.spi_cmd_set = SPI25_EEPROM,
- .probe = probe_noop,
+ .probe = probe_buses,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
@@ -13706,7 +13706,7 @@
.feature_bits = FEATURE_WRSR_WREN | FEATURE_NO_ERASE | FEATURE_ERASED_ZERO,
.tested = TEST_UNTESTED,
.spi_cmd_set = SPI25_EEPROM,
- .probe = probe_noop,
+ .probe = probe_buses,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
diff --git a/flashprog.c b/flashprog.c
index cf697fb..6eb450e 100644
--- a/flashprog.c
+++ b/flashprog.c
@@ -612,11 +612,6 @@
return ret;
}
-int probe_noop(struct flashctx *flash)
-{
- return 1;
-}
-
static int init_default_layout(struct flashctx *flash)
{
/* Fill default layout covering the whole chip. */
@@ -673,8 +668,11 @@
};
if (chip_to_probe) {
- /* If we are looking for a particular chip,
- limit the probing functions to its type. */
+ /* We are looking for a particular chip.
+ If it can't be probed, assume it's there... */
+ if (chip->id.type == ID_NONE)
+ return true;
+ /* ...otherwise, limit the probing functions to its type. */
probe_bus(mst, chip->id.type);
} else {
probe_bus(mst, 0);
diff --git a/include/chipdrivers.h b/include/chipdrivers.h
index f936b6a..ceb7064 100644
--- a/include/chipdrivers.h
+++ b/include/chipdrivers.h
@@ -230,7 +230,4 @@
int prepare_memory_register_access(struct flashctx *, enum preparation_steps);
void finish_memory_access(struct flashctx *);
-/* flashprog.c */
-int probe_noop(struct flashctx *);
-
#endif /* !__CHIPDRIVERS_H__ */