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>
This commit is contained in:
Sylvain Munaut 2020-06-02 10:31:17 +02:00
parent 502d847b41
commit c5a8beffec
1 changed files with 6 additions and 0 deletions

View File

@ -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()