summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2024-10-01 12:40:48 +0200
committerMartin L Roth <gaumless@gmail.com>2024-10-09 18:18:19 +0000
commitd1e8873e08043d78ff0c39a036c9d4ece60288f2 (patch)
tree9598ebb3c6e50f1fdf47a278da42be6e0b88e825 /src/soc/amd
parenta5f61e09a0b2e664060c9d89f6fd3817fdd3b80a (diff)
soc/amd/common/psp: add and call PSP SMI SPI RPMC function stubs
In the case where the x86 owns the SPI controller and the RPMC feature is used, the PSP will send an SMI to the x86 side for it to send the RPMC increment monotonic counter and RPMC request monotonic counter commands to the SPI flash and return the result to the PSP. Add stubs as handlers for those two PSP SMI commands. Change-Id: If6091d2b0002f817922cac4cba373f0f981b646e Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84702 Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Ana Cabral
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/block/psp/psp_smi.c8
-rw-r--r--src/soc/amd/common/block/psp/psp_smi_flash.c14
-rw-r--r--src/soc/amd/common/block/psp/psp_smi_flash.h2
3 files changed, 24 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/psp/psp_smi.c b/src/soc/amd/common/block/psp/psp_smi.c
index ccd03793c9..5a1a4b9e46 100644
--- a/src/soc/amd/common/block/psp/psp_smi.c
+++ b/src/soc/amd/common/block/psp/psp_smi.c
@@ -14,6 +14,8 @@
#define MBOX_PSP_CMD_SPI_READ 0x84
#define MBOX_PSP_CMD_SPI_WRITE 0x85
#define MBOX_PSP_CMD_SPI_ERASE 0x86
+#define MBOX_PSP_CMD_SPI_RPMC_INC_MC 0x88
+#define MBOX_PSP_CMD_SPI_RPMC_REQ_MC 0x89
extern struct {
uint8_t buffer[P2C_BUFFER_MAXSIZE];
@@ -154,6 +156,12 @@ static void handle_psp_command(void)
case MBOX_PSP_CMD_SPI_ERASE:
status = psp_smi_spi_erase(buffer);
break;
+ case MBOX_PSP_CMD_SPI_RPMC_INC_MC:
+ status = psp_smi_spi_rpmc_inc_mc(buffer);
+ break;
+ case MBOX_PSP_CMD_SPI_RPMC_REQ_MC:
+ status = psp_smi_spi_rpmc_req_mc(buffer);
+ break;
default:
printk(BIOS_ERR, "PSP: Unknown command %d\n", cmd);
status = MBOX_PSP_UNSUPPORTED;
diff --git a/src/soc/amd/common/block/psp/psp_smi_flash.c b/src/soc/amd/common/block/psp/psp_smi_flash.c
index ab9bc6c7f2..d78db48ddc 100644
--- a/src/soc/amd/common/block/psp/psp_smi_flash.c
+++ b/src/soc/amd/common/block/psp/psp_smi_flash.c
@@ -269,3 +269,17 @@ enum mbox_p2c_status psp_smi_spi_erase(struct mbox_default_buffer *buffer)
return MBOX_PSP_SUCCESS;
}
+
+enum mbox_p2c_status psp_smi_spi_rpmc_inc_mc(struct mbox_default_buffer *buffer)
+{
+ printk(BIOS_SPEW, "PSP: SPI RPMC increment monotonic counter request\n");
+
+ return MBOX_PSP_UNSUPPORTED;
+}
+
+enum mbox_p2c_status psp_smi_spi_rpmc_req_mc(struct mbox_default_buffer *buffer)
+{
+ printk(BIOS_SPEW, "PSP: SPI RPMC request monotonic counter request\n");
+
+ return MBOX_PSP_UNSUPPORTED;
+}
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 c9c6a1c9ce..344c9fb429 100644
--- a/src/soc/amd/common/block/psp/psp_smi_flash.h
+++ b/src/soc/amd/common/block/psp/psp_smi_flash.h
@@ -66,3 +66,5 @@ enum mbox_p2c_status psp_smi_spi_get_info(struct mbox_default_buffer *buffer);
enum mbox_p2c_status psp_smi_spi_read(struct mbox_default_buffer *buffer);
enum mbox_p2c_status psp_smi_spi_write(struct mbox_default_buffer *buffer);
enum mbox_p2c_status psp_smi_spi_erase(struct mbox_default_buffer *buffer);
+enum mbox_p2c_status psp_smi_spi_rpmc_inc_mc(struct mbox_default_buffer *buffer);
+enum mbox_p2c_status psp_smi_spi_rpmc_req_mc(struct mbox_default_buffer *buffer);