diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/usr/hwpf/hwp/occ/occ.H (renamed from src/include/usr/hwpf/hwp/occ.H) | 1 | ||||
| -rw-r--r-- | src/include/usr/hwpf/hwpf_reasoncodes.H | 4 | ||||
| -rw-r--r-- | src/include/usr/mbox/mbox_queues.H | 4 | ||||
| -rw-r--r-- | src/include/usr/targeting/common/attrsyncdefs.H | 2 | ||||
| -rw-r--r-- | src/include/usr/util/util_reasoncodes.H | 7 | ||||
| -rw-r--r-- | src/include/usr/util/utillidmgr.H | 319 |
6 files changed, 335 insertions, 2 deletions
diff --git a/src/include/usr/hwpf/hwp/occ.H b/src/include/usr/hwpf/hwp/occ/occ.H index fd59137d4..3e77af1dd 100644 --- a/src/include/usr/hwpf/hwp/occ.H +++ b/src/include/usr/hwpf/hwp/occ/occ.H @@ -29,7 +29,6 @@ namespace OCC { uint64_t i_common_addr, TARGETING::Target* i_target); - } //end OCC namespace #endif diff --git a/src/include/usr/hwpf/hwpf_reasoncodes.H b/src/include/usr/hwpf/hwpf_reasoncodes.H index 53ba4622e..cb20f4b9c 100644 --- a/src/include/usr/hwpf/hwpf_reasoncodes.H +++ b/src/include/usr/hwpf/hwpf_reasoncodes.H @@ -80,6 +80,7 @@ namespace fapi MOD_GET_CACHE_DECONFIG = 0x29, MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL = 0x2A, MOD_MBVPD_ACCESS = 0x2B, + MOD_OCC_LOAD_OCC_IMAGE_TO_HOMER = 0x2C, }; /** @@ -118,6 +119,9 @@ namespace fapi RC_NO_SINGLE_MCS = HWPF_COMP_ID | 0x25, RC_NO_SINGLE_MEMBUFF = HWPF_COMP_ID | 0x26, RC_STATE_MISMATCH = HWPF_COMP_ID | 0x27, + + // OCC Errors + RC_MMIO_UNMAP_ERR = HWPF_COMP_ID | 0x28, }; /** diff --git a/src/include/usr/mbox/mbox_queues.H b/src/include/usr/mbox/mbox_queues.H index 094811d53..1ebfc93d4 100644 --- a/src/include/usr/mbox/mbox_queues.H +++ b/src/include/usr/mbox/mbox_queues.H @@ -47,7 +47,7 @@ namespace MBOX // 5, // Reserved for VID HB_HWPF_ATTR_MSGQ = 6, // HWPF Attribute override/sync HB_TRACE_MSGQ = 7, - + HB_LID_MSGQ = 8, //For transferring LIDs from FSP. HB_TEST_MSGQ = 0x7FFFFFFF, // FSP mailboxes @@ -63,6 +63,8 @@ namespace MBOX FSP_DUMP_MSGQ_ID = 0x8000000A, FSP_HWPF_ATTR_MSGQ = 0x8000000B, // HWPF Attribute override/sync FSP_VPD_MSGQ = 0x8000000C, + FSP_LID_MSGQ = FSP_ATTR_SYNC_MSGQ, + FSP_ECHO_MSGQ = 0xFFFFFFFF, // Fake FSP for test }; diff --git a/src/include/usr/targeting/common/attrsyncdefs.H b/src/include/usr/targeting/common/attrsyncdefs.H index f435ca2d6..8bfbc502e 100644 --- a/src/include/usr/targeting/common/attrsyncdefs.H +++ b/src/include/usr/targeting/common/attrsyncdefs.H @@ -96,6 +96,8 @@ namespace TARGETING */ enum ATTR_SYNC_MSG_TYPE { + //NOTE: Types cannot overlap with types in utillidmgrdefs.H + // due to common FSP message queue ATTR_SYNC_NO_MSG = 0, ATTR_SYNC_SECTION_TO_FSP = 0x000000A1, ATTR_SYNC_COMPLETE_TO_FSP = 0x000000A2, diff --git a/src/include/usr/util/util_reasoncodes.H b/src/include/usr/util/util_reasoncodes.H index ed690cecc..4295bc4d6 100644 --- a/src/include/usr/util/util_reasoncodes.H +++ b/src/include/usr/util/util_reasoncodes.H @@ -32,6 +32,9 @@ namespace Util { UTIL_MOD_MEM_READ = 0x01, // UtilMem::Read UTIL_MOD_MEM_WRITE = 0x02, // UtilMem::Write + UTIL_LIDMGR_GETLID = 0x03, // UtilLidMgr::getLid + UTIL_LIDMGR_GETLIDSIZE = 0x04, // UtilLidMgr::getLidSize + UTIL_LIDMGR_GETLIDPNOR = 0x06, // UtilLidMgr::getLidPnor }; enum ReasonCode @@ -39,6 +42,10 @@ namespace Util UTIL_ERC_NONE = UTIL_COMP_ID | 0x01, UTIL_ERC_BAD_PTR = UTIL_COMP_ID | 0x02, UTIL_ERC_EOF = UTIL_COMP_ID | 0x03, + UTIL_LIDMGR_RC_FAIL = UTIL_COMP_ID | 0x04, + UTIL_LIDMGR_INVAL_DATA = UTIL_COMP_ID | 0x05, + UTIL_LIDMGR_INVAL_SIZE = UTIL_COMP_ID | 0x06, + UTIL_LIDMGR_UNSUP_MSG = UTIL_COMP_ID | 0x07, }; }; diff --git a/src/include/usr/util/utillidmgr.H b/src/include/usr/util/utillidmgr.H new file mode 100644 index 000000000..d6839a802 --- /dev/null +++ b/src/include/usr/util/utillidmgr.H @@ -0,0 +1,319 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/util/utillidmgr.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef _UTILLIDMGR_H +#define _UTILLIDMGR_H + +/** + * @file util/utillidmgr.H + * + * @brief Interface to support loading lids into memory. The utilities are + * smart enough to determine if a lid is available in PNOR. If not, + * it will attempt to get the LID from the FSP via mailbox messages. + */ + +#include <mbox/mbox_queues.H> +#include <mbox/mboxif.H> +#include <errl/errlentry.H> +#include <sys/msg.h> + + + +class UtilLidMgr +{ + private: + /** + * @brief Default constructor. + * + * @par Detailed Description + * Forcing user to use constructor with input parm/ + */ + UtilLidMgr(); + + + public: + /** + * @brief Initialize Lid Manager object. + * + * @par Detailed Description + * Ensures member variables are initialized to sane values. + * Sets the initial LID ID. + * + * @param[in] i_lidId + * LID ID. + * + */ + explicit UtilLidMgr(uint32_t i_lidId); + + /** + * @brief Destroy the Lid Manager object resources + * + * @par Detailed Description: + * Frees any allocated memory + * + */ + ~UtilLidMgr(); + + /** + * @brief Sets the desired LID ID in an instance variable. + * + * @par Detailed Description: + * This is how the user declares which LID they want + * to work with. It can also be used to reset the + * object to a different LID Id.. + * + * @param[in] i_lidId + * LID ID. + * + * @return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + */ + errlHndl_t setLidId(uint32_t i_lidId); + + /** + * @brief Get LID Size + * + * @par Detailed Description: + * Returns useful LID metrics to the user. Currently + * this is only the size of the LID in bytes. + * + * @param[out] o_lidSize + * Size of the LID in bytes. + * + * @return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + */ + errlHndl_t getLidSize(size_t& o_lidSize); + + /** + * @brief Get LID + * + * @par Detailed Description: + * Gets lid and puts it into space allocated + * by the caller. The caller is required to + * allocate the indicated memory space before + * calling this function. + * + * @param[in] i_dest + * Pointer to where LID should be stored in + * hostboot memory + * + * @param[in] i_destSeze + * Reserved space in bytes at destintion address + * for LID. + * + * @return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + */ + errlHndl_t getLid(void* i_dest, size_t i_destSize); + + protected: + + /** + * @brief Get LID Size PNOR + * + * @par Detailed Description: + * Checks if LID is in Hostboot Ext image and + * gets the size from there if available. + * This function assumes the lid name is of the format + * <uppercase hex>.lidbin + * The file is not technically a lid, thus the slightly + * different name + * + * @param[out] o_lidSize + * Size of the LID in bytes. + * + * @param[out] o_imgInPnor + * Indicates image was found in PNOR + * + * @return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + */ + errlHndl_t getLidSizePnor(size_t& o_lidSize, bool& o_imgInPnor); + + /** + * @brief Get LID PNOR + * + * @par Detailed Description: + * Gets the LID from the PNOR extended image + * if it exists. The caller is required to + * allocate the indicated memory space before + * calling this function. + * This function assumes the lid name is of the format + * <uppercase hex>.lidbin + * The file is not technically a lid, thus the slightly + * different name + * + * @param[in] i_dest + * pointer where LID should be stored in + * hostboot memory + * + * @param[in] i_destSeze + * Reserved space in bytes at destintion address + * for LID. + * + * @param[out] o_imgInPnor + * Indicates image was found in PNOR + * + * @return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + */ + errlHndl_t getLidPnor(void* i_dest, + size_t i_destSize, + bool& o_imgInPnor); + + /** + * @brief performs object cleanup when a new lidId is set + * Function is also called by the destructor. + */ + errlHndl_t cleanup(); + + + /** + * @brief Updates the lidId in the object + * + * @par Detailed Description: + * Updates the lidId in the object + * Also composes the LID filename + * This function assumes the lid name is of the format + * <uppercase hex>.lidbin + * The file is not technically a lid, thus the slightly + * different name + * + * @param[in] i_lidId + * LID ID. + */ + void updateLid(uint32_t i_lidId); + + + /** + * @enum UtilLidMgr::MBOX_MSG_TYPE + * + * @brief Message enum to determine if msg should be sent + * asynchronously or if the call should be synchronous + * + */ + enum MBOX_MSG_TYPE + { + ASYNCHRONOUS, + SYNCHRONOUS + }; + + /** + * @brief Create message queue + * + * @par Detailed Description: + * Creates LID message queue and registers with mbox. + * It also locks the cv_mutex. This ensures only the + * current instance will listen for response messages + * from FSP. + * Any function that calls this function must also call + * unregisterMsgQueue() to free the queue and unlock + * the mutex. + * + * @return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + */ + errlHndl_t createMsgQueue(); + + /** + * @brief Unregister Msg Queue + * + * @par Detailed Description: + * Unregisters LID msg queue with mbox + */ + void unregisterMsgQueue(); + + /** + * @brief Uses the internal mailbox to send a message to the FSP + * + * + * @par Detailed Description: + * This funciton will call into mailboxsp code using the + * UtilLidMgr as a target message queue.. + * + * @param[in] i_type + * ::MBOX_MSG_TYPE passed in to define the + * message sending policy. + * + * @param[in/out] i_msg + * This parameter is used as both input and an + * output parameter. If the message is sent + * synchronusly the response will be populated + * in an object pointed to by this pointer. If + * the message is asynchronus the object + * pointed to by this paramter will be sent to + * the fsp. + * + * @return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + */ + errlHndl_t sendMboxMessage( MBOX_MSG_TYPE i_type, msg_t * i_msg ); + + /** + * @brief Mutex to prevent concurrent LID operations. + * This needs to be static so we can mutex across multiple instances + */ + static mutex_t cv_mutex; + + /** + * @brief Keep track of mutex state + */ + bool iv_needUnlock; + + /** + * @brief Keep track of Msg queue registered state + */ + bool iv_queueRegistered; + + /** + * @brief Pointer to message queue + */ + msg_q_t iv_HbMsgQ; + + /** + * @brief LID fileName + */ + char iv_lidFileName[16]; + + /** + * @brief current LID ID + */ + uint32_t iv_lidId; + + /** + * @brief reported size of current LID + */ + size_t iv_lidSize; + + +}; + +#endif /* _UTILLIDMGR_H */ + |

