diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2017-11-29 18:41:18 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-14 23:56:06 -0600 |
commit | 5d847a1b9d495a4b09f675677ffc75a02a8f210a (patch) | |
tree | 40d497a348e34dd132b936af058a2514d38ecfc5 | |
parent | 9088e400d3196d691980e36b908548cefcbcd3e0 (diff) | |
download | skiboot-5d847a1b9d495a4b09f675677ffc75a02a8f210a.zip skiboot-5d847a1b9d495a4b09f675677ffc75a02a8f210a.tar.gz skiboot-5d847a1b9d495a4b09f675677ffc75a02a8f210a.tar.bz2 |
prd: Enable error logging via firmware_request interface
In P9 HBRT sends error logs to FSP via firmware_request interface.
This patch adds support to parse error log and send it to FSP.
CC: Jeremy Kerr <jk@ozlabs.org>
CC: Daniel M Crowell <dcrowell@us.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/hostservices.c | 2 | ||||
-rw-r--r-- | hw/prd.c | 13 | ||||
-rw-r--r-- | include/hostservices.h | 1 | ||||
-rw-r--r-- | include/prd-fw-msg.h | 5 |
4 files changed, 20 insertions, 1 deletions
diff --git a/core/hostservices.c b/core/hostservices.c index d1f6fda..dd8cae2 100644 --- a/core/hostservices.c +++ b/core/hostservices.c @@ -329,7 +329,7 @@ static void hservice_start_elog_send(void) goto again; } -static int hservice_send_error_log(uint32_t plid, uint32_t dsize, void *data) +int hservice_send_error_log(uint32_t plid, uint32_t dsize, void *data) { struct hbrt_elog_ent *ent; void *abuf; @@ -23,6 +23,7 @@ #include <fsp.h> #include <mem_region.h> #include <prd-fw-msg.h> +#include <hostservices.h> enum events { EVENT_ATTN = 1 << 0, @@ -375,6 +376,18 @@ static int prd_msg_handle_firmware_req(struct opal_prd_msg *msg) prd_msg->hdr.size = cpu_to_be16(sizeof(*prd_msg)); rc = 0; break; + case PRD_FW_MSG_TYPE_ERROR_LOG: + rc = hservice_send_error_log(fw_req->errorlog.plid, + fw_req->errorlog.size, + fw_req->errorlog.data); + /* Return generic response to HBRT */ + fw_resp->type = cpu_to_be64(PRD_FW_MSG_TYPE_RESP_GENERIC); + fw_resp->generic_resp.status = cpu_to_be64(rc); + prd_msg->fw_resp.len = cpu_to_be64(PRD_FW_MSG_BASE_SIZE + + sizeof(fw_resp->generic_resp)); + prd_msg->hdr.size = cpu_to_be16(sizeof(*prd_msg)); + rc = 0; + break; default: rc = -ENOSYS; } diff --git a/include/hostservices.h b/include/hostservices.h index d6bb3e3..62ef04b 100644 --- a/include/hostservices.h +++ b/include/hostservices.h @@ -38,5 +38,6 @@ void host_services_occ_base_setup(void); int find_master_and_slave_occ(uint64_t **master, uint64_t **slave, int *nr_masters, int *nr_slaves); +int hservice_send_error_log(uint32_t plid, uint32_t dsize, void *data); #endif /* __HOSTSERVICES_H */ diff --git a/include/prd-fw-msg.h b/include/prd-fw-msg.h index d68482c..333e594 100644 --- a/include/prd-fw-msg.h +++ b/include/prd-fw-msg.h @@ -39,6 +39,11 @@ struct prd_fw_msg { struct { __be64 status; } generic_resp; + struct { + __be32 plid; + __be32 size; + char data[]; + } __packed errorlog; }; }; |