efinix: add support for flash detect and flash dump in SoJ mode
This commit is contained in:
parent
286b34b14d
commit
90e62e07c3
|
|
@ -228,11 +228,23 @@ void Efinix::program(unsigned int offset, bool unprotect_flash)
|
|||
delete bit;
|
||||
}
|
||||
|
||||
bool Efinix::detect_flash()
|
||||
{
|
||||
if (_jtag) {
|
||||
return SPIInterface::detect_flash();
|
||||
}
|
||||
|
||||
uint32_t timeout = 1000;
|
||||
_spi->gpio_clear(_rst_pin);
|
||||
|
||||
return reinterpret_cast<SPIInterface *>(_spi)->detect_flash();
|
||||
}
|
||||
|
||||
bool Efinix::dumpFlash(uint32_t base_addr, uint32_t len)
|
||||
{
|
||||
if (!_spi) {
|
||||
printError("jtag: dumpFlash not supported");
|
||||
return false;
|
||||
if (_jtag) {
|
||||
SPIInterface::set_filename(_filename);
|
||||
return SPIInterface::dump(base_addr, len);
|
||||
}
|
||||
|
||||
uint32_t timeout = 1000;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class Efinix: public Device, SPIInterface {
|
|||
~Efinix();
|
||||
|
||||
void program(unsigned int offset, bool unprotect_flash) override;
|
||||
bool detect_flash() override;
|
||||
bool dumpFlash(uint32_t base_addr, uint32_t len) override;
|
||||
bool protect_flash(uint32_t len) override {
|
||||
(void) len;
|
||||
|
|
|
|||
Loading…
Reference in New Issue