ichspi: Allow all opcodes when the "opmenu" isn't locked
The opmenu is not authoritative when we can re-program it on the fly.
Hence always return true in ich_spi_probe_opcode() when it isn't locked.
Tested by `cobra` on IRC.
Change-Id: I636f00acbdfa1661c13c2d82d7d7e61fbe6b543b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/151
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/ichspi.c b/ichspi.c
index 18f0d3f..0fc96ba 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1576,7 +1576,7 @@
static bool ich_spi_probe_opcode(const struct flashctx *flash, uint8_t opcode)
{
- return find_opcode(curopcodes, opcode) >= 0;
+ return !ichspi_lock || find_opcode(curopcodes, opcode) >= 0;
}
#define ICH_BMWAG(x) ((x >> 24) & 0xff)