summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Muhle <armuhle@us.ibm.com>2013-03-25 15:54:12 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-04-29 10:43:53 -0500
commit8e498eb418ccdb17da292ad0794c68815f343cf4 (patch)
tree2f43de6f6904f36646292e7d979b577859349782
parent60f7382c8d36e07234eee36f48c006cfdd0ab402 (diff)
downloadtalos-hostboot-8e498eb418ccdb17da292ad0794c68815f343cf4.tar.gz
talos-hostboot-8e498eb418ccdb17da292ad0794c68815f343cf4.zip
OCC DMA Support
Added support to get LIDs from either PNOR Ext Img or through mailbox DMA from FSP. The Extended Image path is fully tested, however the mailbox DMA code can't be tested until FSP support is available. The OCC function will be enabled with RTC 50987. Change-Id: I798ea19b2ca566288ff4ce64ce7440de20703496 RTC: 51076 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3845 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-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.H4
-rw-r--r--src/include/usr/mbox/mbox_queues.H4
-rw-r--r--src/include/usr/targeting/common/attrsyncdefs.H2
-rw-r--r--src/include/usr/util/util_reasoncodes.H7
-rw-r--r--src/include/usr/util/utillidmgr.H319
-rw-r--r--src/usr/hwpf/hwp/occ/occ.C78
-rwxr-xr-xsrc/usr/hwpf/hwp/occ/occ_procedures/p8_pmc_init.C6
-rwxr-xr-xsrc/usr/hwpf/hwp/occ/occ_procedures/p8_pss_init.C3
-rw-r--r--src/usr/util/makefile31
-rw-r--r--src/usr/util/utillidmgr.C632
-rw-r--r--src/usr/util/utillidmgrdefs.H134
12 files changed, 1193 insertions, 28 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 */
+
diff --git a/src/usr/hwpf/hwp/occ/occ.C b/src/usr/hwpf/hwp/occ/occ.C
index 07a270cbe..2d42091c1 100644
--- a/src/usr/hwpf/hwp/occ/occ.C
+++ b/src/usr/hwpf/hwp/occ/occ.C
@@ -28,7 +28,7 @@
#include <devicefw/userif.H>
#include <sys/misc.h>
-#include <sys/mm.h>
+#include <sys/mmio.h>
#include <vmmconst.h>
// targeting support
@@ -41,6 +41,9 @@
#include <hwpf/plat/fapiPlatTrace.H>
#include <hwpf/hwpf_reasoncodes.H>
+#include <vfs/vfs.H>
+#include <util/utillidmgr.H>
+
// Procedures
#include <p8_pba_init.H>
#include <p8_occ_control.H>
@@ -50,19 +53,81 @@
extern trace_desc_t* g_fapiTd;
+const uint32_t g_OCCLIDID = 0x81e00430;
+
namespace OCC
{
errlHndl_t loadOCCImageToHomer(uint64_t i_homer_addr )
{
errlHndl_t l_errl = NULL;
+ void* mapped_homer = NULL;
+ size_t lidSize = 0;
do {
- //RTC: 51076 - Implement DMA message passing to
- // get OCC image from FSP.
+ UtilLidMgr lidMgr(g_OCCLIDID);
+
+ l_errl = lidMgr.getLidSize(lidSize);
+ if(l_errl)
+ {
+ TRACFCOMP( g_fapiImpTd,
+ ERR_MRK"loadOCCImageToHomer: Error getting lid size. lidId=0x%.8x",
+ g_OCCLIDID);
+ break;
+ }
+
+ //Map homer into virtual memory
+ mapped_homer =
+ mmio_dev_map(reinterpret_cast<void*>(i_homer_addr), THIRTYTWO_MB);
+
+ l_errl = lidMgr.getLid(mapped_homer, lidSize);
+ if(l_errl)
+ {
+ TRACFCOMP( g_fapiImpTd,
+ ERR_MRK"loadOCCImageToHomer: Error getting lid.. lidId=0x%.8x",
+ g_OCCLIDID);
+ break;
+ }
}while(0);
+ if(mapped_homer)
+ {
+ int rc = 0;
+ errlHndl_t l_tmpErrl = NULL;
+ rc = mmio_dev_unmap(mapped_homer);
+ if (rc != 0)
+ {
+ /*@
+ * @errortype
+ * @moduleid fapi::MOD_OCC_LOAD_OCC_IMAGE_TO_HOMER
+ * @reasoncode fapi::RC_MMIO_UNMAP_ERR
+ * @userdata1 Return Code
+ * @userdata2 Unmap address
+ * @devdesc mmio_dev_unmap() returns error
+ */
+ l_tmpErrl =
+ new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_OCC_LOAD_OCC_IMAGE_TO_HOMER,
+ fapi::RC_MMIO_UNMAP_ERR,
+ rc,
+ reinterpret_cast<uint64_t>
+ (mapped_homer));
+ if(l_tmpErrl)
+ {
+ if(l_errl)
+ {
+ errlCommit( l_tmpErrl, HWPF_COMP_ID );
+ }
+ else
+ {
+ l_errl = l_tmpErrl;
+ }
+ }
+ }
+ }
+
return l_errl;
}
@@ -79,8 +144,9 @@ namespace OCC
do {
// cast OUR type of target to a FAPI type of target.
- const fapi::Target l_fapiTarg(fapi::TARGET_TYPE_PROC_CHIP,
- (const_cast<TARGETING::Target*>(i_target)));
+ const fapi::Target
+ l_fapiTarg(fapi::TARGET_TYPE_PROC_CHIP,
+ (const_cast<TARGETING::Target*>(i_target)));
//==============================
@@ -129,7 +195,7 @@ namespace OCC
break;
}
- //TODO: This flow needs to be updated along with procedure refresh
+ //TODO: This flow needs to be updated along with procedure refresh
//RTC: 68461
// Config path
// p8_pm_init.C enum: PM_CONFIG
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pmc_init.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pmc_init.C
index 0d52fd94d..129080c85 100755
--- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pmc_init.C
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pmc_init.C
@@ -139,10 +139,8 @@ pmc_config_spivid_settings(const Target& l_pTarget)
FAPI_INF("entering the config function");
rc = FAPI_ATTR_GET(ATTR_FREQ_PB, NULL, attr_proc_nest_frequency); if (rc) return rc;
- //TODO RTC: 68461 - refresh procedures - hacked target in the line below.
- rc = FAPI_ATTR_GET(ATTR_PM_SPIVID_FREQUENCY, &l_pTarget, attr_pm_spivid_frequency); if (rc) return rc;
-
-
+ rc = FAPI_ATTR_GET(ATTR_PM_SPIVID_FREQUENCY, NULL, attr_pm_spivid_frequency); if (rc) return rc;
+
// calculation of clock divider
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pss_init.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pss_init.C
index 877d1bd2d..14d76fe38 100755
--- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pss_init.C
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pss_init.C
@@ -175,7 +175,8 @@ pss_config_spi_settings(const Target& l_pTarget)
rc = FAPI_ATTR_GET(ATTR_FREQ_PB, NULL , attr_proc_pss_init_nest_frequency); if (rc) return rc;
- rc = FAPI_ATTR_GET(ATTR_PM_SPIPSS_FREQUENCY, &l_pTarget,attr_pm_pss_init_spipss_frequency); if (rc) return rc ;
+ //TODO RTC: 68461 - refresh procedures - hacked target in the line below to be NULL
+ rc = FAPI_ATTR_GET(ATTR_PM_SPIPSS_FREQUENCY, NULL,attr_pm_pss_init_spipss_frequency); if (rc) return rc ;
diff --git a/src/usr/util/makefile b/src/usr/util/makefile
index db91675be..33f61e90d 100644
--- a/src/usr/util/makefile
+++ b/src/usr/util/makefile
@@ -1,29 +1,30 @@
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/usr/util/makefile $
+# $Source: src/usr/util/makefile $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2012
+# COPYRIGHT International Business Machines Corp. 2012,2013
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# 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 other-
-# wise divested of its trade secrets, irrespective of what has
-# been deposited with the U.S. Copyright Office.
+# 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
+# Origin: 30
#
-# IBM_PROLOG_END
+# IBM_PROLOG_END_TAG
ROOTPATH = ../../..
MODULE = util
-OBJS = threadpool.o utilbase.o utilstream.o utilmem.o utilfile.o
+OBJS = threadpool.o utilbase.o utilstream.o utilmem.o utilfile.o \
+ utillidmgr.o
SUBDIRS = test.d
diff --git a/src/usr/util/utillidmgr.C b/src/usr/util/utillidmgr.C
new file mode 100644
index 000000000..ebff8d77c
--- /dev/null
+++ b/src/usr/util/utillidmgr.C
@@ -0,0 +1,632 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/util/utillidmgr.C $ */
+/* */
+/* 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 */
+
+#include <util/utillidmgr.H>
+#include <util/util_reasoncodes.H>
+#include <vfs/vfs.H>
+#include <stdio.h>
+#include <assert.h>
+
+#include <errl/errlmanager.H>
+#include "utillidmgrdefs.H"
+#include "utilbase.H"
+
+using namespace ERRORLOG;
+mutex_t UtilLidMgr::cv_mutex = MUTEX_INITIALIZER;
+
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+UtilLidMgr::UtilLidMgr(uint32_t i_lidId)
+: iv_needUnlock(false)
+,iv_queueRegistered(false)
+,iv_HbMsgQ(NULL)
+,iv_lidSize(0)
+{
+ updateLid(i_lidId);
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+UtilLidMgr::~UtilLidMgr()
+{
+ errlHndl_t l_err = NULL;
+
+ l_err = cleanup();
+ if(l_err)
+ {
+ //cleanup errors are extermely rare
+ errlCommit( l_err, UTIL_COMP_ID );
+ }
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+errlHndl_t UtilLidMgr::getLidSize(size_t& o_lidSize)
+{
+ errlHndl_t errl = NULL;
+ o_lidSize = 0;
+ bool img_in_pnor = false;
+ do{
+ //////////////////////////////////////////////////
+ //Check if file is in the PNOR Extended image first.
+ //////////////////////////////////////////////////
+ errl = getLidSizePnor(o_lidSize, img_in_pnor);
+ if(errl)
+ {
+ //unexpected error encountered, /return to caller.
+ break;
+ }
+ else if(img_in_pnor)
+ {
+ //Found image in PNOR. Save size and return
+ iv_lidSize = o_lidSize;
+ break;
+ }
+
+ //if we get here, it means we didn't find the LID in PNOR, so
+ //ask the FSP for it.
+
+ //Send message to FSP asking for info on the current LID.
+
+ // allocate message buffer
+ // buffer will be initialized to zero by msg_allocate()
+ msg_t * l_pMsg = msg_allocate();
+
+ l_pMsg->type = UTILLID::GET_INFO;
+
+ UTILLID_ADD_LID_ID( iv_lidId, l_pMsg->data[0] );
+ UTILLID_ADD_HEADER_FLAG( 0 , l_pMsg->data[0] );
+
+ errl = sendMboxMessage( SYNCHRONOUS, l_pMsg );
+ if(errl)
+ {
+ UTIL_FT(ERR_MRK"getLidSize: Error when calling sendMboxMessage(SYNCHRONOUS)");
+ break;
+ }
+
+ // see if there was an error on the other end
+ UTILLID::UTILLID_RC return_code = UTILLID_GET_RC( l_pMsg->data[0] );
+
+ if ( return_code )
+ {
+ UTIL_FT(ERR_MRK"getLidSize: rc 0x%x received from FSP for Sync to HB request",
+ return_code );
+
+ /*@
+ * @errortype
+ * @moduleid Util::UTIL_LIDMGR_GETLIDSIZE
+ * @reasoncode Util::UTIL_LIDMGR_RC_FAIL
+ * @userdata1 return code from FSP
+ * @userdata2 LID ID
+ * @devdesc The LID transfer code on the FSP side was
+ * unable to fulfill the LID GET_INFO request.
+ */
+ errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ Util::UTIL_LIDMGR_GETLIDSIZE,
+ Util::UTIL_LIDMGR_RC_FAIL,
+ return_code,
+ iv_lidId);
+ errl->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+ errl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+ // for a syncronous message we need to free the message
+ msg_free( l_pMsg );
+ l_pMsg = NULL;
+ break;
+ }
+
+ // Get the LID Size
+ iv_lidSize = UTILLID_GET_SIZE( l_pMsg->data[0] );
+
+ o_lidSize = iv_lidSize;
+
+ // for a syncronous message we need to free the message
+ msg_free( l_pMsg );
+ l_pMsg = NULL;
+
+ }while(0);
+
+ return errl;
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+errlHndl_t UtilLidMgr::getLidSizePnor(size_t& o_lidSize, bool& o_imgInPnor)
+{
+ errlHndl_t errl = NULL;
+ const char * lidAddr = NULL;
+
+ o_lidSize = 0;
+ o_imgInPnor = false;
+
+ do{
+
+ if(!VFS::module_exists(iv_lidFileName))
+ {
+ //Lid not in extended image
+ break;
+ }
+
+ // Load the file
+ UTIL_DT(INFO_MRK"getLidSizePnor: Try to load %s.", iv_lidFileName);
+ errl = VFS::module_load( iv_lidFileName );
+ if ( errl )
+ {
+ //Lid not in extended image
+ delete errl;
+ break;
+ }
+
+ errl = VFS::module_address( iv_lidFileName,
+ lidAddr,
+ o_lidSize );
+ if ( errl )
+ {
+ UTIL_FT(ERR_MRK"getLidSizePnor: getting address of file : %s",
+ iv_lidFileName );
+ break;
+ }
+ o_imgInPnor = true;
+
+ }while(0);
+
+ return errl;
+}
+
+errlHndl_t UtilLidMgr::getLidPnor(void* i_dest,
+ size_t i_destSize,
+ bool& o_imgInPnor)
+{
+ errlHndl_t errl = NULL;
+ const char * lidAddr = NULL;
+ size_t lidSize = 0;
+
+ o_imgInPnor = false; //assume not found to start.
+
+ do{
+ if(!VFS::module_exists(iv_lidFileName))
+ {
+ //Lid not in extended image
+ break;
+ }
+
+ if(!VFS::module_is_loaded(iv_lidFileName))
+ {
+ // Load the file
+ UTIL_DT(INFO_MRK"getLidPnor: Try to load %s.", iv_lidFileName);
+
+ errl = VFS::module_load( iv_lidFileName );
+ if ( errl )
+ {
+ //Lid not in extended image
+ delete errl;
+ break;
+ }
+ }
+
+ errl = VFS::module_address( iv_lidFileName,
+ lidAddr,
+ lidSize );
+ if ( errl )
+ {
+ UTIL_FT(ERR_MRK"getLidPnor: getting address of file : %s",
+ iv_lidFileName );
+ break;
+ }
+ o_imgInPnor = true;
+
+ if(lidSize > i_destSize)
+ {
+ UTIL_FT(ERR_MRK"getLidPnor: lid=%s found in Ext image has size=0x%.8X, which does not fit in provided space=0x%.8X",
+ iv_lidFileName, lidSize, i_destSize);
+
+ /*@
+ * @errortype
+ * @moduleid Util::UTIL_LIDMGR_GETLIDPNOR
+ * @reasoncode Util::UTIL_LIDMGR_INVAL_SIZE
+ * @userdata1[0:31] LID size found in Ext Img
+ * @userdata1[32:63] Reserved space provided
+ * @userdata2 LID ID
+ * @devdesc Insufficient space provided for LID by calling
+ * function.
+ */
+ errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ Util::UTIL_LIDMGR_GETLIDPNOR,
+ Util::UTIL_LIDMGR_INVAL_SIZE,
+ TWO_UINT32_TO_UINT64(lidSize,
+ i_destSize),
+ iv_lidId);
+ errl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+ break;
+ }
+
+ //Copy file to indicated offset.
+ memcpy(i_dest, lidAddr, lidSize);
+
+ }while(0);
+
+ return errl;
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+errlHndl_t UtilLidMgr::getLid(void* i_dest, size_t i_destSize)
+{
+ errlHndl_t errl = NULL;
+ uint32_t curLid = 0;
+ uint16_t pageNumber = 0;
+ size_t dataSize = 0;
+ size_t transferred_data = 0;
+ uint8_t* dataPtr = NULL;
+ void* copyOffset = NULL;
+ bool img_in_pnor = false;
+
+ do{
+ //////////////////////////////////////////////////
+ //Check if file is in the PNOR Extended image first.
+ //////////////////////////////////////////////////
+ errl = getLidPnor(i_dest, i_destSize, img_in_pnor);
+ if(errl || img_in_pnor)
+ {
+ //unexpected error encountered, or found size in PNOR
+ //either way, return to caller.
+ break;
+ }
+
+ //Image not in PNOR, request from FSP.
+
+ errl = createMsgQueue();
+ if(errl)
+ {
+ UTIL_FT(ERR_MRK"getLid: Error while creating message queue.");
+ break;
+ }
+
+ //Send message to FSP requesting the DMA up the LID in chunks
+
+ // allocate message buffer
+ // buffer will be initialized to zero by msg_allocate()
+ msg_t * l_pMsg = msg_allocate();
+
+ l_pMsg->type = UTILLID::SEND_TO_HB;
+
+ UTILLID_ADD_LID_ID( iv_lidId, l_pMsg->data[0] );
+ UTILLID_ADD_HEADER_FLAG( 0 , l_pMsg->data[0] );
+ //change to use TCE Window for improved performance. RTC: 68295
+ UTILLID_ADD_TCE_TOKEN( 0 , l_pMsg->data[1] );
+
+ errl = sendMboxMessage( SYNCHRONOUS, l_pMsg );
+ if(errl)
+ {
+ UTIL_FT(ERR_MRK"getLid: Error when calling sendMboxMessage(SYNCHRONOUS)");
+ break;
+ }
+
+ // see if there was an error on the other end
+ UTILLID::UTILLID_RC return_code = UTILLID_GET_RC( l_pMsg->data[0] );
+
+ if ( return_code )
+ {
+ UTIL_FT(ERR_MRK"getLid: rc 0x%x received from FSP for Sync to HB request",
+ return_code );
+
+ /*@
+ * @errortype
+ * @moduleid Util::UTIL_LIDMGR_GETLID
+ * @reasoncode Util::UTIL_LIDMGR_RC_FAIL
+ * @userdata1 return code from FSP
+ * @userdata2 LID ID
+ * @devdesc The LID transfer code on the FSP side was
+ * unable to fulfill the LID SEND_TO_HB request.
+ */
+ errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ Util::UTIL_LIDMGR_GETLID,
+ Util::UTIL_LIDMGR_RC_FAIL,
+ return_code,
+ iv_lidId);
+ errl->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+ errl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+
+ // for a syncronous message we need to free the message
+ msg_free( l_pMsg );
+ l_pMsg = NULL;
+ break;
+ }
+
+
+ //Now wait for FSP to send the LID page-by-page.
+ do{
+ //Wait for a message
+ msg_t * l_pMsg = msg_wait(iv_HbMsgQ);
+
+ //process received message
+ if( UTILLID::PAGE_TO_HB == l_pMsg->type )
+ {
+ UTIL_DT("getLid: received a page of data");
+
+ curLid = UTILLID_GET_LID_ID(l_pMsg->data[0]);
+ pageNumber = UTILLID_GET_PAGE_COUNT(l_pMsg->data[0]);
+ dataSize = UTILLID_GET_SIZE(l_pMsg->data[1]);
+ dataPtr = reinterpret_cast<uint8_t *> (l_pMsg->extra_data);
+
+ if((curLid != iv_lidId) ||
+ (NULL == dataPtr))
+ {
+ UTIL_FT(ERR_MRK"getLid: rc 0x%x received from FSP for Sync to HB request",
+ return_code );
+
+ /*@
+ * @errortype
+ * @moduleid Util::UTIL_LIDMGR_GETLID
+ * @reasoncode Util::UTIL_LIDMGR_INVAL_DATA
+ * @userdata1[0:31] received LID ID
+ * @userdata1[32:63] expected LID ID
+ * @userdata2[0:31] pointer to extra data
+ * @devdesc DMA message contains data for wrong LID.
+ */
+ errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ Util::UTIL_LIDMGR_GETLID,
+ Util::UTIL_LIDMGR_INVAL_DATA,
+ TWO_UINT32_TO_UINT64(curLid,
+ iv_lidId),
+ TWO_UINT32_TO_UINT64(*(dataPtr),
+ 0)
+ );
+
+ errl->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+
+ free(l_pMsg->extra_data);
+ l_pMsg->extra_data = NULL;
+ break;
+ }
+
+
+ //confirm that the data fits in the allocated space
+ uint32_t needed_size = ((static_cast<uint32_t>(pageNumber))*
+ (4*KILOBYTE)) + dataSize;
+ if( needed_size > i_destSize )
+ {
+ UTIL_FT(ERR_MRK"getLid: rc 0x%x received from FSP for Sync to HB request",
+ return_code );
+
+ /*@
+ * @errortype
+ * @moduleid Util::UTIL_LIDMGR_GETLID
+ * @reasoncode Util::UTIL_LIDMGR_INVAL_SIZE
+ * @userdata1[0:31] Allocated Size
+ * @userdata1[32:63] Size needed for current data page
+ * @userdata2[32:63] Lid ID
+ * @devdesc Insufficient space provided for LID by
+ * calling function.
+ */
+ errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ Util::UTIL_LIDMGR_GETLID,
+ Util::UTIL_LIDMGR_INVAL_SIZE,
+ TWO_UINT32_TO_UINT64(i_destSize,
+ needed_size),
+ iv_lidId
+ );
+
+ errl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+
+ free(l_pMsg->extra_data);
+ l_pMsg->extra_data = NULL;
+ break;
+
+ }
+ //copy the page into memory
+ copyOffset = (reinterpret_cast<uint8_t *>(i_dest)) + (pageNumber*PAGESIZE);
+
+ memcpy(copyOffset, dataPtr, dataSize);
+
+ transferred_data+=dataSize;
+
+ free(l_pMsg->extra_data);
+ l_pMsg->extra_data = NULL;
+
+
+ } //if UTILLID::PAGE_TO_HB
+ else
+ {
+ UTIL_FT(ERR_MRK"getLid: Invalid Message type (0x%x) received from FSP.",
+ l_pMsg->type );
+
+ /*@
+ * @errortype
+ * @moduleid Util::UTIL_LIDMGR_GETLID
+ * @reasoncode Util::UTIL_LIDMGR_UNSUP_MSG
+ * @userdata1 LID ID
+ * @userdata2 Message Type
+ * @devdesc Invalid Message type received from FSP when
+ * transferring LID pages.
+ */
+ errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ Util::UTIL_LIDMGR_GETLID,
+ Util::UTIL_LIDMGR_UNSUP_MSG,
+ iv_lidId,
+ l_pMsg->type);
+
+ errl->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+ }
+
+ }while(transferred_data < iv_lidSize);
+
+ if(errl)
+ {
+ break;
+ }
+
+
+ }while(0);
+
+ unregisterMsgQueue();
+
+ return errl;
+}
+
+errlHndl_t UtilLidMgr::sendMboxMessage( MBOX_MSG_TYPE type,
+ msg_t * i_msg )
+{
+ errlHndl_t errl = NULL;
+
+ UTIL_DT("type: 0x%04x", i_msg->type );
+ UTIL_DT("data0: 0x%016llx",i_msg->data[0] );
+ UTIL_DT("data1: 0x%016llx",i_msg->data[1] );
+ UTIL_DT("extra_data: %p",i_msg->extra_data );
+
+ // determine if its an async message or if we should wait
+ // for a response
+ if( type == ASYNCHRONOUS )
+ {
+ UTIL_DT("sendMboxMessage() - sending async mbox msg" );
+ errl = MBOX::send( MBOX::FSP_LID_MSGQ, i_msg );
+ }
+ else
+ {
+ UTIL_DT("sendMboxMessage() - sending sync mbox msg" );
+ errl = MBOX::sendrecv( MBOX::FSP_LID_MSGQ, i_msg );
+
+ }
+
+ if( errl )
+ {
+ UTIL_FT(ERR_MRK"sendMboxMessage() - failed sending mbox msg" );
+
+ // if the send failed and the message is still valid, check
+ // and free the extra data if it exists.
+ if( i_msg != NULL && i_msg->extra_data != NULL )
+ {
+ free( i_msg->extra_data );
+ }
+ }
+
+ return errl;
+}
+
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+errlHndl_t UtilLidMgr::createMsgQueue()
+{
+ errlHndl_t errl = NULL;
+
+ mutex_lock(&cv_mutex);
+ iv_needUnlock = true;
+
+ // create Hostboot message queue
+ iv_HbMsgQ = msg_q_create();
+
+ // register Hostboot message queue with mailbox to receive messages
+ errl = MBOX::msgq_register(MBOX::HB_LID_MSGQ, iv_HbMsgQ);
+ if (errl)
+ {
+ UTIL_FT(ERR_MRK"createMsgQueue() - Error registering message queue" );
+
+ //call unregister to ensure proper cleanup
+ unregisterMsgQueue();
+ }
+ else
+ {
+ iv_queueRegistered = true;
+ }
+
+ return errl;
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+void UtilLidMgr::unregisterMsgQueue()
+{
+ if(iv_queueRegistered)
+ {
+ // unregister the Hosboot message queue from the mailbox service.
+ MBOX::msgq_unregister(MBOX::HB_LID_MSGQ);
+ iv_queueRegistered = false;
+ }
+
+ if(iv_needUnlock)
+ {
+ mutex_unlock(&cv_mutex);
+ iv_needUnlock = false;
+ }
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+errlHndl_t UtilLidMgr::cleanup()
+{
+ errlHndl_t l_err = NULL;
+
+ iv_lidSize = 0;
+
+ //assert if not unregistered to catch bad code..
+ assert(!iv_queueRegistered);
+
+ //make sure we always unload the module
+ if (VFS::module_is_loaded(iv_lidFileName))
+ {
+ l_err = VFS::module_unload( iv_lidFileName );
+ if ( l_err )
+ {
+ UTIL_FT(ERR_MRK"getLidSizePnor: Error unloading module : %s",
+ iv_lidFileName );
+ }
+ }
+
+ return l_err;
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+errlHndl_t UtilLidMgr::setLidId(uint32_t i_lidId)
+{
+ errlHndl_t l_err = NULL;
+
+ //must call cleanup before updateLid
+ l_err = cleanup();
+
+ updateLid(i_lidId);
+
+ return l_err;
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+void UtilLidMgr::updateLid(uint32_t i_lidId)
+{
+ iv_lidId = i_lidId;
+
+ //if it's in PNOR, it's not technically lid, so use a slightly
+ //different extension.
+ sprintf(iv_lidFileName, "%x.lidbin", iv_lidId);
+
+ return;
+}
diff --git a/src/usr/util/utillidmgrdefs.H b/src/usr/util/utillidmgrdefs.H
new file mode 100644
index 000000000..50b87cf94
--- /dev/null
+++ b/src/usr/util/utillidmgrdefs.H
@@ -0,0 +1,134 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/util/utillidmgrdefs.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 */
+/* File utillidmgrdefs.H created by ADAM R. MUHLE on Fri Mar 22 2013. */
+
+/* Change Activity: */
+/* End Change Activity */
+
+#ifndef _UTILLIDMGRDEFS_H
+#define _UTILLIDMGRDEFS_H
+
+// gets the return code from the uint64_t returned by the mailbox message
+#define UTILLID_GET_RC( data0 ) ( static_cast<UTILLID::UTILLID_RC>( \
+ ( data0 & UTILLID::RETURN_CODE_MASK ) >> 48 ))
+
+// used to add the LID ID into the first data word of a
+// message - only modifies the first word of the uint64_t
+#define UTILLID_ADD_LID_ID( lidId, data0 ) \
+ ( data0 = ( data0 & ~UTILLID::LID_ID_MASK) | \
+ ( static_cast<uint64_t>(lidId) << 32 ) )
+
+// used to add the LID ID into the first data word of a
+// message - only modifies the second word of the uint64_t
+#define UTILLID_ADD_HEADER_FLAG( headerFlag, data0 ) \
+ ( data0 = ( data0 & ~UTILLID::LID_HEADER_MASK) | \
+ ( static_cast<uint64_t>(headerFlag) ) )
+
+// used to set TCE TOKEN into data1 of a
+// message - only modifies the second word of the uint64_t
+#define UTILLID_ADD_TCE_TOKEN( tecToken, data1 ) \
+ ( data1 = ( data1 & ~UTILLID::TCE_TOKEN_MASK) | \
+ ( static_cast<uint64_t>(tecToken) ) )
+
+
+// Used to get the LID ID from the first data word of a
+// message - only retrieves the first word of the uint64_t
+#define UTILLID_GET_LID_ID( data0 ) ( static_cast<uint32_t>( \
+ ( data0 & UTILLID::LID_ID_MASK ) >> 32 ) )
+
+// Used to get the page number of the current LID from the mailbox message.
+// The macro will extract the total page count from the last two bytes
+// of the data[0] uint64_t in the mailbox message.
+#define UTILLID_GET_PAGE_COUNT( data0 ) ( static_cast<uint16_t> ( \
+ ( data0 & UTILLID::PAGE_COUNT_MASK ) ) )
+
+// Used to get the size passed as part of the mailbox
+// message. The macro will extract the size from the last word
+// of the data uint64_t in the mailbox message.
+#define UTILLID_GET_SIZE( data ) ( static_cast<size_t> ( \
+ ( data & UTILLID::SIZE_MASK ) ) )
+
+namespace UTILLID
+{
+
+ //*******************************************************************
+ // Macros
+ //*******************************************************************
+ // constants for use in masking off corresponding bytes in message data
+ // words used for LID transfer mbox messages.
+
+ // mask to manipulate the return code field in the data returned in the
+ // response to LID related messages
+ const uint64_t RETURN_CODE_MASK = 0xFFFF000000000000;
+
+ // page count mask
+ const uint64_t PAGE_COUNT_MASK = 0x000000000000FFFF;
+
+ // LID ID Mask
+ const uint64_t LID_ID_MASK = 0xFFFFFFFF00000000;
+
+ // LID HEADER Mask
+ // 0 -> want LID without header
+ // 1 -> request LID with header - NOT currently supported
+ const uint64_t LID_HEADER_MASK = 0x000000000000FFFF;
+
+ // Size mask
+ const uint64_t SIZE_MASK = 0x00000000FFFFFFFF;
+
+ // TCE Token Mask
+ // 0 -> Use DMA
+ // != 0 -> Indicates TCE Token to use.
+ const uint64_t TCE_TOKEN_MASK = 0x00000000FFFFFFFF;
+
+ /**
+ * @enum UTILLID::MSG_TYPE
+ *
+ * @brief Targeting attribute sync service message types for use in the
+ * attribute sync messages between FSP and Hostboot
+ */
+ enum MSG_TYPE
+ {
+ //NOTE: Types cannot overlap with typs in attrsyncdefs.H
+ // due to common FSP message queue
+ NO_MSG = 0x00000000,
+ GET_INFO = 0x000000D1, //HB Request for information about a LID
+ SEND_TO_HB = 0x000000D2, //HB Request for a LID
+ PAGE_TO_HB = 0x000000D3, //FSP sending LID Page to HB
+ };
+
+ /**
+ * @enum UTILLID::UTILLID Return Codes
+ *
+ * @brief Return code values LID transfer messages used by Hostboot
+ * and the FSP during communication.
+ *
+ */
+ enum UTILLID_RC
+ {
+ UTILLID_SUCCESS = 0,
+ UTILLID_FAILURE = 1
+ };
+
+}; //end UTILLID namespace
+
+#endif /* _UTILLIDMGRDEFS_H */
OpenPOWER on IntegriCloud