From ee93b35bc3dd86d23ec6b587bbe4c7297d7eddd2 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 1 Oct 2024 12:43:27 +0200 Subject: soc/amd/common/psp_smi_flash: add RPMC command-specific data structures Add the data structures used for the command buffers for the PSP SMI commands to increment and request the state of the monotonic counters in the SPI flash. These data structures are specific to the PSP SMI mailbox interface and not the data structures from the RPMC specification. The AGESA code was used as a reference. Change-Id: I8bc8ff4cf9b7ebd0e034f040dde2db8385bb8f79 Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/84704 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson Reviewed-by: Nicholas Sudsgaard --- src/soc/amd/common/block/psp/psp_smi_flash.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src') 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 344c9fb429..79593b55cc 100644 --- a/src/soc/amd/common/block/psp/psp_smi_flash.h +++ b/src/soc/amd/common/block/psp/psp_smi_flash.h @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include "psp_def.h" @@ -50,6 +51,30 @@ struct mbox_psp_cmd_spi_erase { struct psp_spi_erase_request req; } __packed; +struct psp_spi_rpmc_inc_mc { + uint32_t counter_address; + uint32_t counter_data; + uint8_t signature[SPI_RPMC_SIG_LEN]; +} __packed; + +struct mbox_psp_cmd_spi_rpmc_inc_mc { + struct mbox_buffer_header header; + struct psp_spi_rpmc_inc_mc req; +} __packed; + +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_signature[SPI_RPMC_SIG_LEN]; +} __packed; + +struct mbox_psp_cmd_spi_rpmc_req_mc { + struct mbox_buffer_header header; + struct psp_smi_rpmc_req_mc req; +} __packed; + bool is_valid_psp_spi_info(struct mbox_psp_cmd_spi_info *cmd_buf); bool is_valid_psp_spi_read_write(struct mbox_psp_cmd_spi_read_write *cmd_buf); bool is_valid_psp_spi_erase(struct mbox_psp_cmd_spi_erase *cmd_buf); -- cgit v1.2.3