From b1f954bc6c5caaeb85f3227b0d3cd4c4ffe3c41a Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 21 Nov 2024 00:11:36 +0100 Subject: [PATCH] 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 Change-Id: I6c290535a1896c080b74d892cb289e6e122d4525 Reviewed-on: https://review.coreboot.org/c/coreboot/+/85236 Reviewed-by: Matt DeVillier Reviewed-by: Marshall Dawson Tested-by: build bot (Jenkins) --- src/soc/amd/common/block/psp/psp_smi_flash.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 79593b55cc..789e28df95 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 mbox_psp_cmd_spi_erase { 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 @@ struct psp_smi_rpmc_req_mc { 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;