aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2020-06-02 10:31:17 +0200
committerSylvain Munaut <tnt@246tNt.com>2021-12-17 19:45:34 +0100
commitc5a8beffec05c906b0f3a06eed1f2820d11d8b15 (patch)
tree7d4db4d7e32e7301cdae6de6e67b0bc60d790c2e
parent502d847b41e7ee80ccffb253afaae8c72e983a01 (diff)
downloadicestorm-c5a8beffec05c906b0f3a06eed1f2820d11d8b15.tar.gz
icestorm-c5a8beffec05c906b0f3a06eed1f2820d11d8b15.tar.bz2
icestorm-c5a8beffec05c906b0f3a06eed1f2820d11d8b15.zip
iceprog: Improve reset to disable both CRM and QPI
It's hard to cover 100% of cases, but this seems to improve probability that a reset works, at least for me on the icebreaker. Some other flash have a different QPI disable command though :/ Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--iceprog/iceprog.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/iceprog/iceprog.c b/iceprog/iceprog.c
index 8c3827b..34245e3 100644
--- a/iceprog/iceprog.c
+++ b/iceprog/iceprog.c
@@ -202,9 +202,15 @@ static void flash_reset()
{
uint8_t data[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+ // This disables CRM is if it was enabled
flash_chip_select();
mpsse_xfer_spi(data, 8);
flash_chip_deselect();
+
+ // This disables QPI if it was enable
+ flash_chip_select();
+ mpsse_xfer_spi_bits(0xFF, 2);
+ flash_chip_deselect();
}
static void flash_power_up()