<font size=2 face="sans-serif">Roland - Where did we land on the constant?
Is it 4 or 5? (latest gerrit has 5)</font><br><tt><font size=2>+
PRD_FW_MSG_TYPE_ERROR_LOG = 4,</font></tt><br><br><font size=2 face="sans-serif">The rest seems fine.</font><br><font size=2 face="sans-serif"><br>--<br>Dan Crowell<br>Senior Software Engineer - Power Systems Enablement Firmware<br>IBM Rochester: t/l 553-2987<br>dcrowell@us.ibm.com</font><br><br><br><br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Vasant Hegde <hegdevasant@linux.vnet.ibm.com></font><br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">skiboot@lists.ozlabs.org</font><br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">Vasant Hegde <hegdevasant@linux.vnet.ibm.com>,
Jeremy Kerr <jk@ozlabs.org>, Daniel M Crowell/Rochester/IBM@IBMUS</font><br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">09/11/2017 08:34 AM</font><br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">[PATCH] prd:
Enable error logging via firmware_request interface</font><br><hr noshade><br><br><br><tt><font size=2>In P9 HBRT sends error logs to FSP via firmware_request
interface.<br>This patch adds support to parse error log and send it to FSP.<br><br>CC: Jeremy Kerr <jk@ozlabs.org><br>CC: Daniel M Crowell <dcrowell@us.ibm.com><br>Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com><br>---<br> core/hostservices.c | 2 +-<br> hw/prd.c | 13 +++++++++++++<br> include/hostservices.h | 1 +<br> include/prd-fw-msg.h | 13 +++++++++++++<br> 4 files changed, 28 insertions(+), 1 deletion(-)<br><br>diff --git a/core/hostservices.c b/core/hostservices.c<br>index d1f6fda..dd8cae2 100644<br>--- a/core/hostservices.c<br>+++ b/core/hostservices.c<br>@@ -329,7 +329,7 @@ static void hservice_start_elog_send(void)<br> goto
again;<br> }<br> <br>-static int hservice_send_error_log(uint32_t plid, uint32_t dsize, void
*data)<br>+int hservice_send_error_log(uint32_t plid, uint32_t dsize, void *data)<br> {<br> struct
hbrt_elog_ent *ent;<br> void
*abuf;<br>diff --git a/hw/prd.c b/hw/prd.c<br>index d076c19..4db92eb 100644<br>--- a/hw/prd.c<br>+++ b/hw/prd.c<br>@@ -23,6 +23,7 @@<br> #include <fsp.h><br> #include <mem_region.h><br> #include <prd-fw-msg.h><br>+#include <hostservices.h><br> <br> enum events {<br> EVENT_ATTN
= 1 << 0,<br>@@ -375,6 +376,18 @@ static int prd_msg_handle_firmware_req(struct opal_prd_msg
*msg)<br>
prd_msg->hdr.size = cpu_to_be16(sizeof(*prd_msg));<br>
rc = 0;<br>
break;<br>+
case PRD_FW_MSG_TYPE_ERROR_LOG:<br>+
rc
= hservice_send_error_log(fw_req->errorlog.plid,<br>+
fw_req->errorlog.size,<br>+
fw_req->errorlog.data);<br>+
/*
Return generic response to HBRT */<br>+
fw_resp->type
= cpu_to_be64(PRD_FW_MSG_TYPE_RESP_GENERIC);<br>+
fw_resp->generic_resp.status
= cpu_to_be64(rc);<br>+
prd_msg->fw_resp.len
= cpu_to_be64(PRD_FW_MSG_BASE_SIZE +<br>+
sizeof(fw_resp->generic_resp));<br>+
prd_msg->hdr.size
= cpu_to_be16(sizeof(*prd_msg));<br>+
rc
= 0;<br>+
break;<br> default:<br>
rc = -ENOSYS;<br> }<br>diff --git a/include/hostservices.h b/include/hostservices.h<br>index d6bb3e3..62ef04b 100644<br>--- a/include/hostservices.h<br>+++ b/include/hostservices.h<br>@@ -38,5 +38,6 @@ void host_services_occ_base_setup(void);<br> <br> int find_master_and_slave_occ(uint64_t **master, uint64_t **slave,<br>
int *nr_masters, int *nr_slaves);<br>+int hservice_send_error_log(uint32_t plid, uint32_t dsize, void *data);<br> <br> #endif /* __HOSTSERVICES_H */<br>diff --git a/include/prd-fw-msg.h b/include/prd-fw-msg.h<br>index c00405d..950deb5 100644<br>--- a/include/prd-fw-msg.h<br>+++ b/include/prd-fw-msg.h<br>@@ -26,10 +26,23 @@<br> enum {<br> PRD_FW_MSG_TYPE_REQ_NOP
= 0,<br> PRD_FW_MSG_TYPE_RESP_NOP
= 1,<br>+
PRD_FW_MSG_TYPE_RESP_GENERIC = 2,<br>+
PRD_FW_MSG_TYPE_REQ_HCODE_UPDATE = 3,<br>+
PRD_FW_MSG_TYPE_ERROR_LOG = 4,<br> };<br> <br> struct prd_fw_msg {<br> __be64
type;<br>+
union {<br>+
struct
{<br>+
__be64
status;<br>+
}
generic_resp;<br>+
struct
{<br>+
__be32
plid;<br>+
__be32
size;<br>+
char
data[];<br>+
}
__packed errorlog;<br>+
};<br> };<br> <br> #define PRD_FW_MSG_BASE_SIZE
sizeof(__be64)<br>-- <br>2.9.3<br><br></font></tt><br><br><BR>