From ffd32a61d2bfa3d25e1ed8e6cb08fdc231480c50 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Thu, 29 Aug 2024 18:08:57 -0400 Subject: [PATCH] Efinix: do not allow untested detect_flash() non-SoJ path until someone tries it out for sure --- src/efinix.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/efinix.cpp b/src/efinix.cpp index 328a5c218..634fb183c 100644 --- a/src/efinix.cpp +++ b/src/efinix.cpp @@ -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(_spi)->detect_flash(); + bool rv = reinterpret_cast(_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);