[Skiboot] [PATCH RFC 2/2] opal-prd: use get_ipoll_mask() callback

Jeremy Kerr jk at ozlabs.org
Thu May 4 15:36:59 AEST 2017


This change hooks-up the get_ipoll_mask callback, and use a
HBRT-provided mask if it's present.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
CC: Daniel M Crowell <dcrowell at us.ibm.com>
CC: Zane Shelley <zshelle at us.ibm.com>
CC: Brian Stegmiller <bjs at us.ibm.com>
CC: William G Hoffa <wghoffa at us.ibm.com>
---
 external/opal-prd/opal-prd.c | 10 +++++++++-
 external/opal-prd/thunk.S    |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 1723924..ba17286 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -109,7 +109,7 @@ static const char *opal_prd_devnode = "/dev/opal-prd";
 static const char *opal_prd_socket = "/run/opal-prd-control";
 static const char *hbrt_code_region_name = "ibm,hbrt-code-image";
 static const int opal_prd_version = 1;
-static const uint64_t opal_prd_ipoll = 0xf000000000000000;
+static uint64_t opal_prd_ipoll = 0xf000000000000000;
 
 static const char *ipmi_devnode = "/dev/ipmi0";
 static const int ipmi_timeout_ms = 5000;
@@ -256,6 +256,7 @@ extern int call_mfg_htmgt_pass_thru(uint16_t i_cmdLength, uint8_t *i_cmdData,
 				uint16_t *o_rspLength, uint8_t *o_rspData);
 extern int call_apply_attr_override(uint8_t *i_data, size_t size);
 extern int call_run_command(int argc, const char **argv, char **o_outString);
+extern int call_get_ipoll_events(void);
 
 void hservice_puts(const char *str)
 {
@@ -1491,6 +1492,13 @@ static int run_attn_loop(struct opal_prd_ctx *ctx)
 		}
 	}
 
+	if (hservice_runtime->get_ipoll_events) {
+		pr_debug("HBRT: calling get_ipoll_events");
+		opal_prd_ipoll = call_get_ipoll_events();
+	}
+
+	pr_debug("HBRT: enabling IPOLL events 0x%016lx", opal_prd_ipoll);
+
 	/* send init message, to unmask interrupts */
 	msg.hdr.type = OPAL_PRD_MSG_TYPE_INIT;
 	msg.hdr.size = htobe16(sizeof(msg));
diff --git a/external/opal-prd/thunk.S b/external/opal-prd/thunk.S
index f355158..dea540d 100644
--- a/external/opal-prd/thunk.S
+++ b/external/opal-prd/thunk.S
@@ -93,6 +93,7 @@ call_##name:					;\
 	CALL_THUNK(apply_attr_override, 12)
 	CALL_THUNK(mfg_htmgt_pass_thru, 13)
 	CALL_THUNK(run_command, 14)
+	CALL_THUNK(get_ipoll_events, 15)
 
 	.globl call_hbrt_init
 call_hbrt_init:
-- 
2.7.4



More information about the Skiboot mailing list