From patchwork Thu May 4 05:36:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 758354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wJP286FwPz9rxm for ; Thu, 4 May 2017 15:38:08 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wJP285RDNzDqJ7 for ; Thu, 4 May 2017 15:38:08 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wJP1w3yMWzDqFG for ; Thu, 4 May 2017 15:37:56 +1000 (AEST) Received: by ozlabs.org (Postfix, from userid 1023) id 3wJP1w2w1Jz9rxm; Thu, 4 May 2017 15:37:56 +1000 (AEST) From: Jeremy Kerr To: skiboot@lists.ozlabs.org Date: Thu, 4 May 2017 13:36:59 +0800 Message-Id: <1493876219-28583-2-git-send-email-jk@ozlabs.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493876219-28583-1-git-send-email-jk@ozlabs.org> References: <1493876219-28583-1-git-send-email-jk@ozlabs.org> Subject: [Skiboot] [PATCH RFC 2/2] opal-prd: use get_ipoll_mask() callback X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel M Crowell , William G Hoffa , Brian Stegmiller , Zane Shelley MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This change hooks-up the get_ipoll_mask callback, and use a HBRT-provided mask if it's present. Signed-off-by: Jeremy Kerr CC: Daniel M Crowell CC: Zane Shelley CC: Brian Stegmiller CC: William G Hoffa --- 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: