Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit c49024f

Browse files
committed
lattice_ecp5: Don't try to scan for attached SPI flash if we're not the first device in the chain
1 parent e6a5d8e commit c49024f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/target/lattice_ecp5.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,19 @@ static bool ecp5_attach(target_s *const target)
303303
{
304304
const ecp5_ctx_s *const ctx = (ecp5_ctx_s *)target->priv;
305305
const uint32_t status = ecp5_read32(ctx->device_index, CMD_LSC_READ_STATUS);
306+
const jtag_dev_s *const device = &jtag_devs[ctx->device_index];
306307

307308
if (ECP5_STATUS_ENCRYPTED_ONLY(status))
308309
DEBUG_WARN("This FPGA only accepts encrypted bitstreams!\n");
309310

310311
if (ECP5_STATUS_DONE(status))
311312
DEBUG_INFO("FPGA is configured\n");
312313

314+
if (device->dr_postscan) {
315+
DEBUG_WARN("Transparent SPI Flash not possible, not first device in the chain\n");
316+
return true;
317+
}
318+
313319
ecp5_enter_flash(target);
314320

315321
// Create a synthetic flash object so we can shell out to `spi_flash_prepare` to enter transparent SPI mode

0 commit comments

Comments
 (0)