From patchwork Thu Sep 15 01:52:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 670186 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sZM4f4kwFz9t0t for ; Thu, 15 Sep 2016 11:57:54 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3sZM4f3qvjzDsXC for ; Thu, 15 Sep 2016 11:57:54 +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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sZM4Y5GDXzDrqP for ; Thu, 15 Sep 2016 11:57:49 +1000 (AEST) Received: by ozlabs.org (Postfix, from userid 1023) id 3sZM4Y4RyVz9t0m; Thu, 15 Sep 2016 11:57:49 +1000 (AEST) From: Jeremy Kerr To: skiboot@lists.ozlabs.org, Dan Crowell Date: Thu, 15 Sep 2016 09:52:31 +0800 Message-Id: <1473904352-20478-2-git-send-email-jk@ozlabs.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473904352-20478-1-git-send-email-jk@ozlabs.org> References: <1473904352-20478-1-git-send-email-jk@ozlabs.org> Subject: [Skiboot] [PATCH v2 1/2] opal-prd: Add get_interface_capabilities to host interfaces X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Swenson , Patrick Barrett MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" We need a way to indicate behaviour changes & fixes in the prd interface, without requiring a major version bump. This change introduces the get_interface_capabilities callback, returning a bitmask of capability flags, pertaining to 'sets' of capabilities. We currently return 0 for all. Signed-off-by: Jeremy Kerr --- external/opal-prd/hostboot-interface.h | 16 +++++++++++++++- external/opal-prd/opal-prd.c | 5 +++++ external/opal-prd/thunk.S | 3 ++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/external/opal-prd/hostboot-interface.h b/external/opal-prd/hostboot-interface.h index 05fe052..36d53a6 100644 --- a/external/opal-prd/hostboot-interface.h +++ b/external/opal-prd/hostboot-interface.h @@ -41,6 +41,11 @@ enum MemoryError_t MEMORY_ERROR_UE = 1, }; +/* Capability sets, for get_interface_capabilities */ +#define HBRT_CAPS_SET0_COMMON 0 +#define HBRT_CAPS_SET1_OPAL 1 +#define HBRT_CAPS_SET2_PHYP 2 + struct host_interfaces { /** Interface version. */ uint64_t interface_version; @@ -277,8 +282,17 @@ struct host_interfaces { int (*memory_error)( uint64_t i_startAddr, uint64_t i_endAddr, enum MemoryError_t i_errorType ); + /** + * @brief Query the prd infrastructure for interface capabilities. + * @param[in] i_set The set of capabilites to retrieve + * + * @return a bitmask containing the relevant HBRT_CAPS_* for + * this implementation and the specified set. + */ + uint64_t (*get_interface_capabilities)(uint64_t i_set); + /* Reserve some space for future growth. */ - void (*reserved[32])(void); + void (*reserved[31])(void); }; struct runtime_interfaces { diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c index 18c6e49..245c957 100644 --- a/external/opal-prd/opal-prd.c +++ b/external/opal-prd/opal-prd.c @@ -649,6 +649,11 @@ int hservice_memory_error(uint64_t i_start_addr, uint64_t i_endAddr, return 0; } +uint64_t hservice_get_interface_capabilities(uint64_t set) +{ + return 0; +} + int hservices_init(struct opal_prd_ctx *ctx, void *code) { uint64_t *s, *d; diff --git a/external/opal-prd/thunk.S b/external/opal-prd/thunk.S index f25afde..f355158 100644 --- a/external/opal-prd/thunk.S +++ b/external/opal-prd/thunk.S @@ -186,10 +186,11 @@ hinterface: CALLBACK_THUNK(hservice_i2c_write) CALLBACK_THUNK(hservice_ipmi_msg) CALLBACK_THUNK(hservice_memory_error) + CALLBACK_THUNK(hservice_get_interface_capabilities) .globl __hinterface_pad __hinterface_pad: /* Reserved space for future growth */ - .space 32*8,0 + .space 31*8,0 .globl __hinterface_end __hinterface_end: /* Eye catcher for debugging */