Efinix: do not allow untested detect_flash() non-SoJ path until someone tries it out for sure

This commit is contained in:
Joshua Wise 2024-08-29 18:08:57 -04:00
parent d6ad8ea661
commit ffd32a61d2
1 changed files with 13 additions and 3 deletions

View File

@ -234,10 +234,20 @@ bool Efinix::detect_flash()
return SPIInterface::detect_flash();
}
uint32_t timeout = 1000;
#if 0
/* Untested logic in SPI path -- if you test this, and it works,
* uncomment it and submit a PR! */
_spi->gpio_clear(_rst_pin);
return reinterpret_cast<SPIInterface *>(_spi)->detect_flash();
bool rv = reinterpret_cast<SPIInterface *>(_spi)->detect_flash();
reset();
return rv;
#else
printError("detect flash not supported");
return false;
#endif
}
bool Efinix::dumpFlash(uint32_t base_addr, uint32_t len)
@ -263,7 +273,7 @@ bool Efinix::dumpFlash(uint32_t base_addr, uint32_t len)
return false;
}
/* release SPI access */
/* release SPI access. XXX later: refactor to use reset() and make sure the behavior is the same */
_spi->gpio_set(_rst_pin | _oe_pin);
usleep(12000);