mfd: intel-m10-bmc: Change staging size to a variable
Subsystems (4)
PATCH v2 1/1 mfd: intel-m10-bmc: Change staging size to a variable
From: Ilpo Järvinen <[email protected]>
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.
---
v2:
- Revise commit message to remove reference to nonexistent larger FPGAs.
--- drivers/fpga/intel-m10-bmc-sec-update.c | 3 ++- drivers/mfd/intel-m10-bmc-pmci.c | 1 + drivers/mfd/intel-m10-bmc-spi.c | 1 + include/linux/mfd/intel-m10-bmc.h | 1 + 4 files changed, 5 insertions(+), 1 deletion(-)
drivers/fpga/intel-m10-bmc-sec-update.c +2 -1
@@ -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)
drivers/mfd/intel-m10-bmc-pmci.c +1 -0
@@ -370,6 +370,7 @@ static const struct m10bmc_csr_map m10bmc_n6000_csr_map = { .pr_reh_addr = M10BMC_N6000_PR_REH_ADDR, .pr_magic = M10BMC_N6000_PR_PROG_MAGIC, .rsu_update_counter = M10BMC_N6000_STAGING_FLASH_COUNT, + .staging_size = M10BMC_STAGING_SIZE, };static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = {
drivers/mfd/intel-m10-bmc-spi.c +1 -0
@@ -109,6 +109,7 @@ static const struct m10bmc_csr_map m10bmc_n3000_csr_map = { .pr_reh_addr = M10BMC_N3000_PR_REH_ADDR, .pr_magic = M10BMC_N3000_PR_PROG_MAGIC, .rsu_update_counter = M10BMC_N3000_STAGING_FLASH_COUNT, + .staging_size = M10BMC_STAGING_SIZE, };static struct mfd_cell m10bmc_d5005_subdevs[] = {
include/linux/mfd/intel-m10-bmc.h +1 -0
@@ -205,6 +205,7 @@ struct m10bmc_csr_map {unsigned int pr_reh_addr;unsigned int pr_magic;unsigned int rsu_update_counter; +unsigned int staging_size; };/**
Signature · 1 line
2.44.0
Quoted 11 lines · Peter Colberg
From: Ilpo Järvinen <[email protected]>
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 them10bmc_csr_mapstructure 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]>
Quoted 68 lines
---
v2:
- Revise commit message to remove reference to nonexistent larger FPGAs.--- drivers/fpga/intel-m10-bmc-sec-update.c | 3 ++- drivers/mfd/intel-m10-bmc-pmci.c | 1 + drivers/mfd/intel-m10-bmc-spi.c | 1 + include/linux/mfd/intel-m10-bmc.h | 1 + 4 files changed, 5 insertions(+), 1 deletion(-)drivers/fpga/intel-m10-bmc-sec-update.c +2
-1@@ -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)drivers/mfd/intel-m10-bmc-pmci.c +1
-0@@ -370,6 +370,7 @@ static const struct m10bmc_csr_map m10bmc_n6000_csr_map = { .pr_reh_addr = M10BMC_N6000_PR_REH_ADDR, .pr_magic = M10BMC_N6000_PR_PROG_MAGIC, .rsu_update_counter = M10BMC_N6000_STAGING_FLASH_COUNT, + .staging_size = M10BMC_STAGING_SIZE, };static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = {drivers/mfd/intel-m10-bmc-spi.c +1
-0@@ -109,6 +109,7 @@ static const struct m10bmc_csr_map m10bmc_n3000_csr_map = { .pr_reh_addr = M10BMC_N3000_PR_REH_ADDR, .pr_magic = M10BMC_N3000_PR_PROG_MAGIC, .rsu_update_counter = M10BMC_N3000_STAGING_FLASH_COUNT, + .staging_size = M10BMC_STAGING_SIZE, };static struct mfd_cell m10bmc_d5005_subdevs[] = {include/linux/mfd/intel-m10-bmc.h +1
-0@@ -205,6 +205,7 @@ struct m10bmc_csr_map {unsigned int pr_reh_addr;unsigned int pr_magic;unsigned int rsu_update_counter; +unsigned int staging_size; };/** Signature · 1 line
2.44.0
Lee Jones
maintainerQuoted 11 lines · Peter Colberg
From: Ilpo Järvinen <[email protected]>
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 them10bmc_csr_mapstructure 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]>
Xu Yilun, Peter,
Do you require a pull-request from an immutable branch for this?
Signature · 1 line
Lee Jones [李琼斯]
Quoted 9 lines · Lee Jones
Quoted 7 lines · Peter Colberg
From: Ilpo Järvinen <[email protected]>
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 them10bmc_csr_mapstructure to make the size assignment more flexible.
Quoted 8 lines
Quoted 4 lines
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]>Xu Yilun, Peter,
Do you require a pull-request from an immutable branch for this?
No need. The patchset could all be applied to mfd branch.
Thanks,
Yilun
Quoted 4 lines
Signature · 2 lines
-- Lee Jones [李琼斯]
Lee Jones
maintainerQuoted 15 lines · Xu Yilun
Quoted 14 lines · Lee Jones
Quoted 11 lines · Peter Colberg
From: Ilpo Järvinen <[email protected]>
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 them10bmc_csr_mapstructure 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]>
Quoted 5 lines
Quoted 3 lines
Xu Yilun, Peter,
Do you require a pull-request from an immutable branch for this?
No need. The patchset could all be applied to mfd branch.
Prefect, thank you.
Signature · 1 line
Lee Jones [李琼斯]
Re: (subset) [PATCH v2] mfd: intel-m10-bmc: Change staging size to a variable
In reply to Peter ColbergQuoted 6 lines · Peter Colberg
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 them10bmc_csr_mapstructure to make the size assignment more flexible.
Applied, thanks!
[1/1] mfd: intel-m10-bmc: Change staging size to a variable
commit: 770bb9cf4e857ac76f0671309cec689d2a3a4b46
--
Lee Jones [李琼斯]