Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85236?usp=email )
(
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: soc/amd/common/block/psp/psp_smi_flash.h: fix struct element types ......................................................................
soc/amd/common/block/psp/psp_smi_flash.h: fix struct element types
Commit ee93b35bc3dd ("soc/amd/common/psp_smi_flash: add RPMC command- specific data structures") added the 'psp_spi_rpmc_inc_mc' and 'psp_smi_rpmc_req_mc' structs, but added the counter data as uint32_t while it should have been an array of 4 uint8_t, since the bytes in that buffer are already in the order in which they need to be sent over to the SPI flash which is different than the byte order of a uint32_t. This was only noticed after getting the code that uses these structs was tested.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I6c290535a1896c080b74d892cb289e6e122d4525 Reviewed-on: https://review.coreboot.org/c/coreboot/+/85236 Reviewed-by: Matt DeVillier matt.devillier@gmail.com Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/common/block/psp/psp_smi_flash.h 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Marshall Dawson: Looks good to me, approved Matt DeVillier: Looks good to me, approved
diff --git a/src/soc/amd/common/block/psp/psp_smi_flash.h b/src/soc/amd/common/block/psp/psp_smi_flash.h index 79593b5..789e28d 100644 --- a/src/soc/amd/common/block/psp/psp_smi_flash.h +++ b/src/soc/amd/common/block/psp/psp_smi_flash.h @@ -53,7 +53,7 @@
struct psp_spi_rpmc_inc_mc { uint32_t counter_address; - uint32_t counter_data; + uint8_t counter_data[SPI_RPMC_COUNTER_DATA_LEN]; uint8_t signature[SPI_RPMC_SIG_LEN]; } __packed;
@@ -66,7 +66,7 @@ uint32_t counter_address; uint8_t tag[SPI_RPMC_TAG_LEN]; uint8_t signature[SPI_RPMC_SIG_LEN]; - uint32_t output_counter_data; + uint8_t output_counter_data[SPI_RPMC_COUNTER_DATA_LEN]; uint8_t output_signature[SPI_RPMC_SIG_LEN]; } __packed;