aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2017-10-05 14:38:59 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-10-10 13:36:17 +1100
commit19d4f98e9483e4c1cae1d5a59491d8ab4f9a6e7f (patch)
treebadfa72654453c32971d8b02dad1bae0ace17a96
parenta1fcbaac29d785875eaea09bd70e9a287580a452 (diff)
downloadskiboot-19d4f98e9483e4c1cae1d5a59491d8ab4f9a6e7f.zip
skiboot-19d4f98e9483e4c1cae1d5a59491d8ab4f9a6e7f.tar.gz
skiboot-19d4f98e9483e4c1cae1d5a59491d8ab4f9a6e7f.tar.bz2
FSP/NVRAM: Handle "get vNVRAM statistics" command
FSP sends MBOX command (cmd : 0xEB, subcmd : 0x05, mod : 0x00) to get vNVRAM statistics. OPAL doesn't maintain any such statistics. Hence return FSP_STATUS_INVALID_SUBCMD. Sample OPAL log: [16944.384670488,3] FSP: Unhandled message eb0500 [16944.474110465,3] FSP: Unhandled message eb0500 [16945.111280784,3] FSP: Unhandled message eb0500 [16945.293393485,3] FSP: Unhandled message eb0500 With this patch, I don't think FSP will ever call "free vNVRAM" MBOX command. But to be safer side lets return FSP_STATUS_INVALID_SUBCMD for this MBOX command as well. Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Tested-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hw/fsp/fsp-nvram.c41
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();