Add new flash-chip preparation step after probing
Change-Id: I57fd63ddc4c8ccd07b0744df33d6a499bfeae9ff
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/321
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/memory_bus.c b/memory_bus.c
index 8badfda..b9cd68c 100644
--- a/memory_bus.c
+++ b/memory_bus.c
@@ -46,6 +46,9 @@
int prepare_memory_access(struct flashctx *flash, enum preparation_steps prep)
{
+ if (prep == PREPARE_POST_PROBE)
+ return 0;
+
/* Init pointers to the fail-safe state to distinguish them later from legit values. */
flash->virtual_memory = (chipaddr)ERROR_PTR;
flash->virtual_registers = (chipaddr)ERROR_PTR;
@@ -66,6 +69,9 @@
int prepare_memory_register_access(struct flashctx *flash, enum preparation_steps prep)
{
+ if (prep == PREPARE_POST_PROBE)
+ return 0;
+
if (prepare_memory_access(flash, prep))
return 1;