Commit 4e772ab8 authored by Luca Ceresoli's avatar Luca Ceresoli Committed by Moritz Fischer

fpga manager: xilinx-spi: provide better diagnostics on programming failure

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: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarLuca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: default avatarMoritz Fischer <mdf@kernel.org>
parent eefe64fb
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment