summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2024-10-01 12:43:27 +0200
committerFelix Held <felix-coreboot@felixheld.de>2024-10-11 13:28:50 +0000
commitee93b35bc3dd86d23ec6b587bbe4c7297d7eddd2 (patch)
treee1b91538f8848aeeeecffeba1c0f2372d624b7eb /src/soc/amd/common/block
parent542dd2e4e64c6e4e1a7e32f3dd2b3d688f1de4bf (diff)
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 <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84704 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r--src/soc/amd/common/block/psp/psp_smi_flash.h25
1 files changed, 25 insertions, 0 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 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 <spi_flash.h>
#include <types.h>
#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);