diff options
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/amd/common/block/psp/psp_smi_flash.c | 41 |
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"); |