Skip to content

Commit

Permalink
fpga manager: xilinx-spi: provide better diagnostics on programming f…
Browse files Browse the repository at this point in the history
…ailure

When the DONE pin does not go high after programming to confirm programming
success, the INIT_B pin provides some info on the reason. Use it if
available to provide a more explanatory error message.

Reviewed-by: Tom Rix <trix@redhat.com>
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
  • Loading branch information
Luca Ceresoli authored and Moritz Fischer committed Aug 31, 2020
1 parent eefe64f commit 4e772ab
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion drivers/fpga/xilinx-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,21 @@ static int xilinx_spi_write_complete(struct fpga_manager *mgr,
return 0;
}

dev_err(&mgr->dev, "Timeout after config data transfer\n");
if (conf->init_b) {
ret = gpiod_get_value(conf->init_b);

if (ret < 0) {
dev_err(&mgr->dev, "Error reading INIT_B (%d)\n", ret);
return ret;
}

dev_err(&mgr->dev,
ret ? "CRC error or invalid device\n"
: "Missing sync word or incomplete bitstream\n");
} else {
dev_err(&mgr->dev, "Timeout after config data transfer\n");
}

return -ETIMEDOUT;
}

Expand Down

0 comments on commit 4e772ab

Please sign in to comment.