diff options
author | Ilpo Järvinen <[email protected]> | 2024-04-02 14:49:25 -0400 |
---|---|---|
committer | Lee Jones <[email protected]> | 2024-05-10 15:39:16 +0100 |
commit | 74c6317df04bbfbb82ffed9dbb530e4075c7abed (patch) | |
tree | 790829cd4658ec83e9b29c3dda8cbb6efc6e7b52 /drivers/fpga | |
parent | 4fd7e2ffe32dfd5e68cec6463a9b462de4e56611 (diff) |
mfd: intel-m10-bmc: Change staging size to a variable
The secure update driver does a sanity-check of the image size in
comparison to the size of the staging area in FLASH. Instead of
hard-wiring M10BMC_STAGING_SIZE, move the staging size to the
m10bmc_csr_map structure to make the size assignment more flexible.
Co-developed-by: Russ Weight <[email protected]>
Signed-off-by: Russ Weight <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Peter Colberg <[email protected]>
Reviewed-by: Xu Yilun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Lee Jones <[email protected]>
Diffstat (limited to 'drivers/fpga')
-rw-r--r-- | drivers/fpga/intel-m10-bmc-sec-update.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/fpga/intel-m10-bmc-sec-update.c b/drivers/fpga/intel-m10-bmc-sec-update.c index 89851b133709..7ac9f9f5af12 100644 --- a/drivers/fpga/intel-m10-bmc-sec-update.c +++ b/drivers/fpga/intel-m10-bmc-sec-update.c @@ -529,11 +529,12 @@ static enum fw_upload_err m10bmc_sec_prepare(struct fw_upload *fwl, const u8 *data, u32 size) { struct m10bmc_sec *sec = fwl->dd_handle; + const struct m10bmc_csr_map *csr_map = sec->m10bmc->info->csr_map; u32 ret; sec->cancel_request = false; - if (!size || size > M10BMC_STAGING_SIZE) + if (!size || size > csr_map->staging_size) return FW_UPLOAD_ERR_INVALID_SIZE; if (sec->m10bmc->flash_bulk_ops) |