<tt><font size=2>             
    /* Reserve some space for future growth. */<br>-                
void (*reserved[31])(void);<br>+                
void (*reserved[27])(void);<br></font></tt><br><tt><font size=2>           
      /* Reserve some space for future growth. */<br>-                
void (*reserved[29])(void);<br>+                
void (*reserved[22])(void);<br></font></tt><br><br><font size=2 face="sans-serif">So 27 and 22 is what you want me to
change to?</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">Jeremy Kerr <jk@ozlabs.org></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">Dan Crowell <dcrowell@us.ibm.com>,
Jeremy Kerr <jk@ozlabs.org></font><br><font size=1 color=#5f5f5f face="sans-serif">Date:      
 </font><font size=1 face="sans-serif">05/25/2017 02:06 AM</font><br><font size=1 color=#5f5f5f face="sans-serif">Subject:    
   </font><font size=1 face="sans-serif">[PATCH RFC 06/12]
opal-prd: Sync hostboot interfaces with HBRT</font><br><hr noshade><br><br><br><tt><font size=2>This change adds new callbacks defined for p9, and
the base thunks for<br>the added calls.<br><br>Signed-off-by: Jeremy Kerr <jk@ozlabs.org><br>CC: Daniel M Crowell <dcrowell@us.ibm.com><br>---<br> external/opal-prd/hostboot-interface.h | 194 ++++++++++++++++++++++++++++++++-<br> external/opal-prd/thunk.S              |
 13 ++-<br> 2 files changed, 203 insertions(+), 4 deletions(-)<br><br>diff --git a/external/opal-prd/hostboot-interface.h b/external/opal-prd/hostboot-interface.h<br>index 3e73ef8..3a7ca19 100644<br>--- a/external/opal-prd/hostboot-interface.h<br>+++ b/external/opal-prd/hostboot-interface.h<br>@@ -18,7 +18,7 @@<br> /* Hostboot runtime interface */<br> /* Derived from src/include/runtime/interface.h in Hostboot */<br> <br>-#define HOSTBOOT_RUNTIME_INTERFACE_VERSION 1<br>+#define HOSTBOOT_RUNTIME_INTERFACE_VERSION 0x9002<br> <br> /** Memory error types defined for memory_error() interface. */<br> enum MemoryError_t<br>@@ -39,6 +39,12 @@ enum MemoryError_t<br>                  
* attentions so that the hypervisor will know all areas of<br>                  
* memory that are impacted by the failure. */<br>                  MEMORY_ERROR_UE
= 1,<br>+<br>+                
/** Firmware has predictively requested service on a part in the memory<br>+                
 * subsystem. The partitions may not have been affected, but it is<br>+                
 * advised to migrate off of the address range as soon as possible
to<br>+                
 * avoid potential partition outages. */<br>+                
MEMORY_ERROR_PREDICTIVE = 2,<br> };<br> <br> /* Capability sets, for get_interface_capabilities */<br>@@ -54,6 +60,16 @@ enum MemoryError_t<br>  */<br> #define HBRT_CAPS_OPAL_HAS_XSCOM_RC   (1ul << 0)<br> <br>+/**<br>+ *  Load types for the load_pm_complex() interface<br>+ *      HBRT_PM_LOAD: initial load of all lids/sections
from scratch,<br>+ *                    preserve
nothing<br>+ *      HBRT_PM_RELOAD: concurrent reload of all lids/sections,<br>+ *                    
 but preserve runtime updates<br>+ */<br>+#define HBRT_PM_LOAD    0<br>+#define HBRT_PM_RELOAD  1<br>+<br> struct host_interfaces {<br>                  /**
Interface version. */<br>                  uint64_t
interface_version;<br>@@ -299,8 +315,77 @@ struct host_interfaces {<br>                  
*/<br>                  uint64_t
(*get_interface_capabilities)(uint64_t i_set);<br> <br>+                
/**<br>+                
 *  @brief Map a physical address space into usable memory<br>+                
 *  @note Repeated calls to map the same memory should not return
an<br>+                
 *        error<br>+                
 *  @param[in]  i_physMem  Physical address<br>+                
 *  @param[in]  i_bytes    Number of bytes to
map in<br>+                
 *  @return NULL on error, else pointer to usable memory<br>+                
 *  @platform FSP, OpenPOWER<br>+                
 */<br>+                
void* (*map_phys_mem)(uint64_t i_physMem, size_t i_bytes);<br>+<br>+                
/**<br>+                
 *  @brief Unmap a physical address space from usable memory<br>+                
 *  @param[in]  i_ptr  Previously mapped pointer<br>+                
 *  @return 0 on success, else RC<br>+                
 *  @platform FSP, OpenPOWER<br>+                
 */<br>+                
int (*unmap_phys_mem)(void* i_ptr);<br>+<br>+                
/**<br>+                
 *  @brief Modify the SCOM restore section of the HCODE image
with the<br>+                
 *         given register data<br>+                
 *<br>+                
 *  @note The Hypervisor should perform the following actions:<br>+                
 *        - insert the data into the HCODE image
(p9_stop_api)<br>+                
 *<br>+                
 *  @pre HBRT is responsible for enabling special wakeup on the<br>+                
 *       associated core(s) before calling this interface<br>+                
 *<br>+                
 *  @param  i_chipId    processor chip ID<br>+                
 *                  
    plus ID type, always proc (0x0)<br>+                
 *  @param  i_section   runtime section to update<br>+                
 *                  
   (passthru to pore_gen_scom)<br>+                
 *  @param  i_operation type of operation to perform<br>+                
 *                  
   (passthru to pore_gen_scom)<br>+                
 *  @param  i_scomAddr  fully qualified scom address<br>+                
 *  @param  i_scomData  data for operation<br>+                
 *<br>+                
 *  @return 0 if the request is successfully received.<br>+                
 *          Any value other than 0 on failure.<br>+                
 *  @platform FSP, OpenPOWER<br>+                
 */<br>+                
int (*hcode_scom_update)(uint64_t i_chipId,<br>+                
                 
               
uint32_t i_section,<br>+                
                 
               
uint32_t i_operation,<br>+                
                 
               
uint64_t i_scomAddr,<br>+                
                 
               
uint64_t i_scomData);<br>+<br>+                
/**<br>+                
 * @brief Send a request to firmware, and receive a response<br>+                
 * @details<br>+                
 *   req_len bytes are sent to runtime firmware, and resp_len<br>+                
 *   bytes received in response.<br>+                
 *<br>+                
 *   Both req and resp are allocated by the caller. If resp_len<br>+                
 *   is not large enough to contain the full response, an error<br>+                
 *   is returned.<br>+                
 *<br>+                
 * @param[in]  i_reqLen       length of request
data<br>+                
 * @param[in]  i_req          request
data<br>+                
 * @param[inout] o_respLen    in: size of request data buffer<br>+                
 *                  
         out: length of request data<br>+                
 * @param[in]  o_resp         response data<br>+                
 * @return 0 on success, else RC<br>+                
 * @platform FSP, OpenPOWER<br>+                
 */<br>+                
int (*firmware_request)(uint64_t i_reqLen, void *i_req,<br>+                
                 
               
uint64_t *o_respLen, void *o_resp);<br>+<br>                  /*
Reserve some space for future growth. */<br>-                
void (*reserved[31])(void);<br>+                
void (*reserved[27])(void);<br> };<br> <br> struct runtime_interfaces {<br>@@ -491,6 +576,109 @@ struct runtime_interfaces {<br>                  
*/<br>                  int
(*run_command)(int argc, const char **argv, char **o_outString);<br> <br>+                
/**<br>+                
 *  @brief Verify integrity of a secure container<br>+                
 *  @param[in] i_pContainer Pointer to a valid secure container,<br>+                
 *      Must not be NULL.  Container is assumed
to be stripped of any<br>+                
 *      ECC and must start with a valid secure header
(which contains<br>+                
 *      the container size information)<br>+                
 *  @param[in] i_pHwKeyHash Pointer to a valid hardware keys'
hash.<br>+                
 *      Must not be NULL.<br>+                
 *  @param[in] i_hwKeyHashSize Size of the hardware keys' hash.<br>+                
 *      A value which incorrectly states the size of
the hardware keys'<br>+                
 *      hash will be detected as a verification error
or worse, an<br>+                
 *      illegal memory access.  Must not be 0.<br>+                
 *  @note If secureboot is compiled out, the function pointer
will be<br>+                
 *      set to NULL.  If caller's secureboot support
is compiled in and<br>+                
 *      secureboot is enabled by policy, then caller
should treat a NULL<br>+                
 *      pointer as a verification failure.<br>+                
 *  @return Integer error code indicating success or failure<br>+                
 *  @retval 0 Container verified correctly<br>+                
 *  @retval !0 API error or otherwise failed to verify container<br>+                
 *  @platform FSP, OpenPOWER<br>+                
 */<br>+                
int (*verify_container)(const void *i_pContainer,<br>+                
                 
               
const void *i_pHwKeyHash,<br>+                
                 
               
size_t i_hwKeyHashSize);<br>+<br>+                
/**<br>+                
 *  @brief SBE message passing<br>+                
 *<br>+                
 *  @details<br>+                
 *      This is a blocking call that will pass an SBE
message<br>+                
 *      with a pass-through command through HBRT to
code that<br>+                
 *      will process the command and provide a response.<br>+                
 *<br>+                
 *  @param[in] i_procChipId Chip ID of the processor whose SBE
is<br>+                
 *      passing the message and sent the interrupt<br>+                
 *<br>+                
 *  @return 0 on success, or return code if the command failed<br>+                
 *  @platform FSP, OpenPOWER<br>+                
 */<br>+                
int (*sbe_message_passing)(uint32_t i_procChipId);<br>+<br>+                
/**<br>+                
 *  @brief Load OCC/HCODE images into mainstore<br>+                
 *<br>+                
 *  @param[in] i_chip            the
HW chip id (XSCOM chip ID)<br>+                
 *  @param[in] i_homer_addr      the physical
mainstore address of the<br>+                
 *                  
            start of the HOMER image,<br>+                
 *  @param[in] i_occ_common_addr the physical mainstore address
of the<br>+                
 *                  
            OCC common area, 8MB, used for<br>+                
 *                  
            OCC-OCC communication (1 per
node)<br>+                
 *  @param[in] i_mode            selects
initial load vs concurrent<br>+                
 *                  
            reloads<br>+                
 *                  
            HBRT_PM_LOAD:<br>+                
 *                  
               load all lids/sections
from scratch,<br>+                
 *                  
               preserve nothing<br>+                
 *                  
            HBRT_PM_RELOAD:<br>+                
 *                  
               reload all lids/sections,<br>+                
 *                  
               but preserve runtime
updates<br>+                
 *  @return 0 on success else return code<br>+                
 *  @platform FSP, OpenPOWER<br>+                
 */<br>+                
int (*load_pm_complex)(uint64_t i_chip,<br>+                
                 
               
uint64_t i_homer_addr,<br>+                
                 
               
uint64_t i_occ_common_addr,<br>+                
                 
               
uint32_t i_mode);<br>+<br>+                
/**<br>+                
 *  @brief Start OCC/HCODE on the specified chip<br>+                
 *  @param[in] i_chip the HW chip id<br>+                
 *  @return 0 on success else return code<br>+                
 *  @platform FSP, OpenPOWER<br>+                
 */<br>+                
int (*start_pm_complex)(uint64_t i_chip);<br>+<br>+                
/**<br>+                
 *  @brief Reset OCC/HCODE on the specified chip<br>+                
 *  @param[in] i_chip the HW chip id<br>+                
 *  @return 0 on success else return code<br>+                
 *  @platform FSP, OpenPOWER<br>+                
 */<br>+                
int (*reset_pm_complex)(uint64_t i_chip);<br>+<br>+                
/**<br>+                
 * @brief Query the IPOLL event mask supported by HBRT<br>+                
 *<br>+                
 * @details  This call allows the wrapper application to query<br>+                
 * the ipoll event mask to set when the HBRT instance is running.
Bits<br>+                
 * that are *set* in this bitmask represent events that will be<br>+                
 * forwarded to the handle_attn() callback.<br>+                
 *<br>+                
 * @return        The IPOLL event bits to enable
during HBRT execution<br>+                
 * @platform FSP, OpenPOWER<br>+                
 */<br>+                
uint64_t (*get_ipoll_events)(void);<br>+<br>+                
/**<br>+                
 * @brief Receive an async notification from firmware<br>+                
 * @param[in] i_len   length of notification data<br>+                
 * @param[in] i_data  notification data<br>+                
 * @platform FSP, OpenPOWER<br>+                
 */<br>+                
void (*firmware_notify)(uint64_t len, void *data);<br>+<br>                  /*
Reserve some space for future growth. */<br>-                
void (*reserved[29])(void);<br>+                
void (*reserved[22])(void);<br> };<br>diff --git a/external/opal-prd/thunk.S b/external/opal-prd/thunk.S<br>index f355158..b18e3cb 100644<br>--- a/external/opal-prd/thunk.S<br>+++ b/external/opal-prd/thunk.S<br>@@ -93,6 +93,13 @@ call_##name:          
               
               
                 
               
        ;\<br>                  CALL_THUNK(apply_attr_override,
12)<br>                  CALL_THUNK(mfg_htmgt_pass_thru,
13)<br>                  CALL_THUNK(run_command,
14)<br>+                
CALL_THUNK(verify_container, 15)<br>+                
CALL_THUNK(sbe_message_passing, 16)<br>+                
CALL_THUNK(load_pm_complex, 17)<br>+                
CALL_THUNK(start_pm_complex, 18)<br>+                
CALL_THUNK(reset_pm_complex, 19)<br>+                
CALL_THUNK(get_ipoll_events, 20)<br>+                
CALL_THUNK(firmware_notify, 21)<br> <br>                  .globl
call_hbrt_init<br> call_hbrt_init:<br>@@ -187,10 +194,14 @@ hinterface:<br>                  CALLBACK_THUNK(hservice_ipmi_msg)<br>                  CALLBACK_THUNK(hservice_memory_error)<br>                  CALLBACK_THUNK(hservice_get_interface_capabilities)<br>+                
DISABLED_THUNK(hservice_map_phys_mem)<br>+                
DISABLED_THUNK(hservice_unmap_phys_mem)<br>+                
DISABLED_THUNK(hservice_hcode_scom_update)<br>+                
DISABLED_THUNK(hservice_firmware_request)<br> .globl __hinterface_pad<br> __hinterface_pad:<br>                  /*
Reserved space for future growth */<br>-                
.space 31*8,0<br>+                
.space 27*8,0<br> .globl __hinterface_end<br> __hinterface_end:<br>                  /*
Eye catcher for debugging */<br>-- <br>2.7.4<br><br></font></tt><br><br><BR>