Skip to content

Commit

Permalink
Efinix: do not allow untested detect_flash() non-SoJ path until someo…
Browse files Browse the repository at this point in the history
…ne tries it out for sure
  • Loading branch information
jwise committed Aug 29, 2024
1 parent d6ad8ea commit ffd32a6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/efinix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);

Expand Down

0 comments on commit ffd32a6

Please sign in to comment.