[Skiboot] [PATCH 1/2] opal-prd: Add get_prd_flags to host interfaces

Daniel M Crowell dcrowell at us.ibm.com
Wed Sep 14 02:26:02 AEST 2016


Another suggestion just to avoid running out of space, let's add a parm to 
give us essentially an infinite number of values.  This also lets us 
separate out different implementations (i.e. OPAL vs PHYP) to avoid 
changes in one to indicate a fix in the other.

    /**
     * @brief Query the HBRT host for a list of fixes
     *
     * There are times when workarounds need to be put into place to 
handle
     * issues with the hosting layer (e.g. opal-prd) while fixes are not 
yet
     * released.  This is especially true because of the disconnected 
release
     * streams for the firmware and the hosting environment.
     *
     * @param  i_set Indicates which set of fixes we're checking
     *               see HBRT_FIX_LIST_SET...
     *
     * @return a bitmask containing the relevant flags for the current
     *         implementation, see HBRT_FIX_FLAGS_...
     */
    uint64_t (*get_fix_list)( uint64_t i_set );

    /* OPAL fixes */
    #define HBRT_FIX_LIST_SET0_OPAL  0
    #define HBRT_FIX_FLAGS_OPAL_HAS_XSCOM_RC  (1ul << 0)

    /* PHYP fixes */
    #define HBRT_FIX_LIST_SET1_PHYP  1

If we run over 64 flags, we'd just make a HBRT_FIX_LIST_SET2_OPAL2  2, 
etc.


--
Dan Crowell
Senior Software Engineer - Power Systems Enablement Firmware
IBM Rochester: t/l 553-2987
dcrowell at us.ibm.com

__________________

Don't call it "prd". That is a misleading name that only your team 
understands the way you are trying to use it.  PRD is just one of the 
functions provided inside HBRT (which you execute under the opal-prd 
application). 

Also, it doesn't seem like we're planning to support a feature list here, 
so maybe the name should reflect that this is really just to handle fixes.

How about just "get_fix_list"?

> containing the relevant OPAL_PRD_FLAGS_
Remember that we support PHYP now with the same code so we have to think 
commonality.  I'll assume that the master copy (steady state) of these 
flags will be the version inside of the hostboot code.

--
Dan Crowell
Senior Software Engineer - Power Systems Enablement Firmware
IBM Rochester: t/l 553-2987
dcrowell at us.ibm.com



From:   Jeremy Kerr <jk at ozlabs.org>
To:     skiboot at lists.ozlabs.org, Daniel M Crowell/Rochester/IBM at IBMUS
Cc:     Benjamin Herrenschmidt <benh at kernel.crashing.org>, Jeremy Kerr 
<jk at ozlabs.org>
Date:   09/12/2016 11:28 PM
Subject:        [PATCH 1/2] opal-prd: Add get_prd_flags to host interfaces



We need a way to indicate behaviour changes & fixes in the prd
interface, without requiring a major version bump.

This change introduces the get_prd_flags callback, returning a
bitmask of prd-specific flags. We currently return 0.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
---
 external/opal-prd/hostboot-interface.h | 10 +++++++++-
 external/opal-prd/opal-prd.c           |  5 +++++
 external/opal-prd/thunk.S              |  3 ++-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/external/opal-prd/hostboot-interface.h 
b/external/opal-prd/hostboot-interface.h
index 05fe052..7729a5b 100644
--- a/external/opal-prd/hostboot-interface.h
+++ b/external/opal-prd/hostboot-interface.h
@@ -277,8 +277,16 @@ 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.
+                 *
+                 * @return a bitmask containing the relevant 
OPAL_PRD_FLAGS_* for
+                 *              this implementation.
+                 */
+                uint64_t (*get_prd_flags)(void);
+
                 /* 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..775d9f1 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_prd_flags(void)
+{
+                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..58e98d7 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_prd_flags)
 .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 */
-- 
2.7.4





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/skiboot/attachments/20160913/3e6e74c9/attachment-0001.html>


More information about the Skiboot mailing list