aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/fpga-mgr.c6
-rw-r--r--drivers/fpga/socfpga-a10.c1
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index 79ce2eea44db..f0a69d3e60a5 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -53,10 +53,12 @@ int fpga_mgr_buf_load(struct fpga_manager *mgr, struct fpga_image_info *info,
53 /* 53 /*
54 * Call the low level driver's write_init function. This will do the 54 * Call the low level driver's write_init function. This will do the
55 * device-specific things to get the FPGA into the state where it is 55 * device-specific things to get the FPGA into the state where it is
56 * ready to receive an FPGA image. 56 * ready to receive an FPGA image. The low level driver only gets to
57 * see the first initial_header_size bytes in the buffer.
57 */ 58 */
58 mgr->state = FPGA_MGR_STATE_WRITE_INIT; 59 mgr->state = FPGA_MGR_STATE_WRITE_INIT;
59 ret = mgr->mops->write_init(mgr, info, buf, count); 60 ret = mgr->mops->write_init(mgr, info, buf,
61 min(mgr->mops->initial_header_size, count));
60 if (ret) { 62 if (ret) {
61 dev_err(dev, "Error preparing FPGA for writing\n"); 63 dev_err(dev, "Error preparing FPGA for writing\n");
62 mgr->state = FPGA_MGR_STATE_WRITE_INIT_ERR; 64 mgr->state = FPGA_MGR_STATE_WRITE_INIT_ERR;
diff --git a/drivers/fpga/socfpga-a10.c b/drivers/fpga/socfpga-a10.c
index ccd9fb23bd52..f8770af0f6b5 100644
--- a/drivers/fpga/socfpga-a10.c
+++ b/drivers/fpga/socfpga-a10.c
@@ -470,6 +470,7 @@ static enum fpga_mgr_states socfpga_a10_fpga_state(struct fpga_manager *mgr)
470} 470}
471 471
472static const struct fpga_manager_ops socfpga_a10_fpga_mgr_ops = { 472static const struct fpga_manager_ops socfpga_a10_fpga_mgr_ops = {
473 .initial_header_size = (RBF_DECOMPRESS_OFFSET + 1) * 4,
473 .state = socfpga_a10_fpga_state, 474 .state = socfpga_a10_fpga_state,
474 .write_init = socfpga_a10_fpga_write_init, 475 .write_init = socfpga_a10_fpga_write_init,
475 .write = socfpga_a10_fpga_write, 476 .write = socfpga_a10_fpga_write,