summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2024-08-02 19:55:24 +0200
committerFelix Held <felix-coreboot@felixheld.de>2024-08-07 16:32:29 +0000
commit159430aa290dddce499c2f8dcbc863b11b6a56f4 (patch)
treea757511ec19dae21abdd662c8346755bef09f19b /src
parent4ea3bfd1bc4d24237814ec6ded444a7b94fa606c (diff)
soc/amd/common/psp_smi_flash: add command-specific data structures
This patch is a slightly modified version of parts of CB:65523. Document #55758 Rev. 2.04 was used as a reference. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Signed-off-by: Ritul Guru <ritul.bits@gmail.com> Change-Id: I41efeecf9243ddbbd8dc3f842c5ce11058bb7999 Reviewed-on: https://review.coreboot.org/c/coreboot/+/83757 Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/common/block/psp/psp_smi_flash.c41
1 files changed, 41 insertions, 0 deletions
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 54edf1446b..b987cec170 100644
--- a/src/soc/amd/common/block/psp/psp_smi_flash.c
+++ b/src/soc/amd/common/block/psp/psp_smi_flash.c
@@ -4,6 +4,47 @@
#include <types.h>
#include "psp_def.h"
+enum psp_spi_id_type {
+ SMI_TARGET_NVRAM = 0,
+ SMI_TARGET_RPMC_NVRAM = 5,
+};
+
+struct pspv2_spi_info_request {
+ u64 target_nv_id;
+ u64 lba;
+ u64 block_size;
+ u64 num_blocks;
+} __packed;
+
+struct mbox_pspv2_cmd_spi_info {
+ struct mbox_buffer_header header;
+ struct pspv2_spi_info_request req;
+} __packed;
+
+struct pspv2_spi_read_write_request {
+ u64 target_nv_id;
+ u64 lba;
+ u64 offset;
+ u64 num_bytes;
+ u8 buffer[];
+} __packed;
+
+struct mbox_pspv2_cmd_spi_read_write {
+ struct mbox_buffer_header header;
+ struct pspv2_spi_read_write_request req;
+} __packed;
+
+struct pspv2_spi_erase_request {
+ u64 target_nv_id;
+ u64 lba;
+ u64 num_blocks;
+} __packed;
+
+struct mbox_pspv2_cmd_spi_erase {
+ struct mbox_buffer_header header;
+ struct pspv2_spi_erase_request req;
+} __packed;
+
enum mbox_p2c_status psp_smi_spi_get_info(struct mbox_default_buffer *buffer)
{
printk(BIOS_SPEW, "PSP: SPI info request\n");