diff options
-rw-r--r-- | hw/fsp/fsp-nvram.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/hw/fsp/fsp-nvram.c b/hw/fsp/fsp-nvram.c index 85b7e81..1b4990f 100644 --- a/hw/fsp/fsp-nvram.c +++ b/hw/fsp/fsp-nvram.c @@ -310,6 +310,44 @@ static struct fsp_client fsp_nvram_client_rr = { .message = fsp_nvram_msg_rr, }; +static bool fsp_vnvram_msg(u32 cmd_sub_mod, struct fsp_msg *msg) +{ + u32 cmd; + struct fsp_msg *resp; + + assert(msg == NULL); + switch (cmd_sub_mod) { + case FSP_CMD_GET_VNV_STATS: + prlog(PR_DEBUG, + "FSP NVRAM: Get vNVRAM statistics not supported\n"); + cmd = FSP_RSP_GET_VNV_STATS | FSP_STATUS_INVALID_SUBCMD; + break; + case FSP_CMD_FREE_VNV_STATS: + prlog(PR_DEBUG, + "FSP NVRAM: Free vNVRAM statistics buffer not supported\n"); + cmd = FSP_RSP_FREE_VNV_STATS | FSP_STATUS_INVALID_SUBCMD; + break; + default: + return false; + } + + resp = fsp_mkmsg(cmd, 0); + if (!resp) { + prerror("FSP NVRAM: Failed to allocate resp message\n"); + return false; + } + if (fsp_queue_msg(resp, fsp_freemsg)) { + prerror("FSP NVRAM: Failed to queue resp message\n"); + fsp_freemsg(resp); + return false; + } + return true; +} + +static struct fsp_client fsp_vnvram_client = { + .message = fsp_vnvram_msg, +}; + int fsp_nvram_info(uint32_t *total_size) { if (!fsp_present()) { @@ -354,6 +392,9 @@ int fsp_nvram_start_read(void *dst, uint32_t src, uint32_t len) /* Register for the reset/reload event */ fsp_register_client(&fsp_nvram_client_rr, FSP_MCLASS_RR_EVENT); + /* Register for virtual NVRAM interface events */ + fsp_register_client(&fsp_vnvram_client, FSP_MCLASS_VIRTUAL_NVRAM); + /* Open and load the nvram from the FSP */ fsp_nvram_send_open(); |