Attention is currently required from: ritul guru.
Hello ritul guru,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/83757?usp=email
to review the following change.
Change subject: [WIP] soc/amd/common/psp_smi_flash: add command-specific data structures ......................................................................
[WIP] 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 --- M src/soc/amd/common/block/psp/psp_smi_flash.c 1 file changed, 41 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/83757/1
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 54edf14..3c1b920 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[0]; +} __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");