summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/usr/mbox/mbox_queues.H2
-rw-r--r--src/include/usr/mbox/mboxif.H54
-rw-r--r--src/include/usr/targeting/attrrp.H84
-rw-r--r--src/include/usr/targeting/attrsync.H209
-rw-r--r--src/include/usr/targeting/common/attrsyncdefs.H99
-rw-r--r--src/include/usr/targeting/common/targetservice.H121
-rw-r--r--src/include/usr/targeting/common/targreasoncodes.H2
7 files changed, 503 insertions, 68 deletions
diff --git a/src/include/usr/mbox/mbox_queues.H b/src/include/usr/mbox/mbox_queues.H
index 6c7134061..a940c1098 100644
--- a/src/include/usr/mbox/mbox_queues.H
+++ b/src/include/usr/mbox/mbox_queues.H
@@ -42,6 +42,7 @@ namespace MBOX
NOT_FOUND = 0,
HB_MAILBOX_MSGQ,
HB_ISTEP_MSGQ,
+ HB_ATTR_SYNC_MSGQ,
// Add HB services here:
HB_TEST_MSGQ = 0x7FFFFFFF,
@@ -53,6 +54,7 @@ namespace MBOX
FSP_TRACE_MSGQ,
FSP_ERRL_MSGQ,
IPL_SERVICE_QUEUE = 0x80000008, // Defined by Fsp team
+ FSP_ATTR_SYNC_MSGQ = 0x80000009,
// Add FSP services here:
FSP_ECHO_MSGQ = 0xFFFFFFFF, // Fake FSP for test
};
diff --git a/src/include/usr/mbox/mboxif.H b/src/include/usr/mbox/mboxif.H
index fc321f757..d427e5e28 100644
--- a/src/include/usr/mbox/mboxif.H
+++ b/src/include/usr/mbox/mboxif.H
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/mbox/mboxif.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2012
-//
-// 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 other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/mbox/mboxif.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2012
+ *
+ * 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 other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
#ifndef __MBOX_MBOXIF_H
#define __MBOX_MBOXIF_H
@@ -85,6 +86,15 @@ namespace MBOX
*/
errlHndl_t sendrecv(queue_id_t i_q_id, msg_t * io_msg);
+ /**
+ * Determine if the mailbox is enabled
+ *
+ * @return bool
+ * true -> mailbox is enabled
+ * flalse -> mailbox is disabled (spless system)
+ */
+ bool mailbox_enabled();
+
}; // end namespace MBOX
#endif
diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H
index d5a4775a0..ffa615580 100644
--- a/src/include/usr/targeting/attrrp.H
+++ b/src/include/usr/targeting/attrrp.H
@@ -1,26 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/targeting/attrrp.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// 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 other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
-
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/targeting/attrrp.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2011-2012
+ *
+ * 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 other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
#ifndef __TARGETING_ATTRRP_H
#define __TARGETING_ATTRRP_H
@@ -38,6 +38,9 @@
#include <initservice/taskargs.H>
#include <sys/msg.h>
#include <targeting/adapters/types.H>
+#include <targeting/common/targetservice.H>
+#include <targeting/attrsync.H>
+
namespace TARGETING
{
@@ -59,6 +62,15 @@ struct AttrRP_Section;
*/
class AttrRP
{
+
+ // add some friends for the attribute sync features
+ friend bool TargetService::writeSectionData(
+ const std::vector<sectionRefData>& i_pages );
+
+ friend void TargetService::readSectionData(
+ std::vector<sectionRefData>& o_pages,
+ const SECTION_TYPE i_sectionId);
+
public:
/**
@@ -129,6 +141,32 @@ class AttrRP
*/
~AttrRP();
+ /**
+ * @brief Copies the section data buffer from the vector to the
+ * appropriate section offset with respect to the node target ptr
+ * and section id.
+ *
+ * @param[in] i_pages, vector of sectionRefData struct
+ *
+ * @return void
+ */
+
+ void writeSectionData(
+ const std::vector <sectionRefData>& i_pages);
+
+ /**
+ * @brief Populates the output vector with the correct information
+ * for the data pages specified by the selected section
+ *
+ * @param[out] o_pages, vector of sectionRefData struct
+ *
+ * @return void
+ */
+ void readSectionData(
+ std::vector <sectionRefData>& o_pages,
+ const SECTION_TYPE i_sectionType);
+
+
private:
/**
diff --git a/src/include/usr/targeting/attrsync.H b/src/include/usr/targeting/attrsync.H
new file mode 100644
index 000000000..274674382
--- /dev/null
+++ b/src/include/usr/targeting/attrsync.H
@@ -0,0 +1,209 @@
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/targeting/attrsync.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2012
+ *
+ * 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 other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
+#ifndef __ATTRSYNC_H_
+#define __ATTRSYNC_H_
+/**
+ * @file targeting/attsync.H
+ *
+ * @brief Interface to support syncing the targeting attributes between the
+ * FSP and Hostboot. Sync operations can be either direction, HB->FSP
+ * or FSP->HB however for sprint 7.12 only HB->FSP support will be
+ * added.
+ */
+//******************************************************************************
+// Includes
+//******************************************************************************
+#include <mbox/mbox_queues.H>
+#include <mbox/mboxif.H>
+#include <errl/errlentry.H>
+#include <sys/msg.h>
+#include <pnortargeting.H>
+#include <stddef.h>
+#include <targeting/common/targetservice.H>
+#include <targeting/common/attrsyncdefs.H>
+
+
+namespace TARGETING
+{
+
+ /**
+ * @class AttributeSync
+ *
+ * @brief Targeting attribute sync class
+ *
+ * @par Detailed Description:
+ * Provides all the functionality to synchronize the targetting
+ * attributes from the Hostboot area down to the FSP
+ */
+ class AttributeSync
+ {
+
+ public:
+
+ /**
+ * @brief Initialize the attribute synchronization object
+ *
+ * @par Detailed Description
+ * Ensures member variables are initialized to sane values.
+ */
+ AttributeSync();
+
+ /**
+ * @brief Destroy the attribute sync object resources
+ *
+ * @par Detailed Description:
+ * Frees any memory allocated by the attribute sync object
+ *
+ */
+ ~AttributeSync();
+
+ /**
+ * @brief Setup the internal variables to point to the correct
+ * attribute section.
+ *
+ * @par Detailed Description:
+ * This funciton will call into the AttRP:: to have the
+ * correct attribute section paged into accessable memory.
+ * this function may be called multiple times with different
+ * section names.
+ *
+ * @pre None:
+ *
+ * @post The entire section from the HB attribute section
+ * passed in has been synchronized to the FSP memory area.
+ *
+ * @param[in] i_section_to_sync
+ * TARGETING::SECTION_TYPE is passed in to
+ * identify the section to be synced to the
+ * FSP.
+ *
+ * @return errlHndl_t
+ * return errl == NULL -> success
+ * return errl != NULL -> failure
+ *
+ */
+ errlHndl_t syncSectionToFsp(
+ TARGETING::SECTION_TYPE i_section_to_sync );
+
+ private:
+
+ /**
+ * @enum TARGETING::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 Setup the internal variables to point to the correct
+ * attribute section.
+ *
+ * @par Detailed Description:
+ * This funciton will call into the AttRP:: to have the
+ * correct attribute section paged into accessable memory
+ *
+ */
+ void getSectionData();
+
+ /**
+ * @brief Uses the internal mailbox to send a message to the FSP
+ *
+ *
+ * @par Detailed Description:
+ * This funciton will call into mailboxsp code using the
+ * FSP_ATTR_SYNC_MSGQ as a target message queue..
+ *
+ * @param[in] i_type
+ * TARGETING::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 Sends the sync complete message to the FSP indicating
+ * the operation has completed.
+ *
+ * @return errlHndl_t
+ * return errl == NULL -> success
+ * return errl != NULL -> failure
+ */
+ errlHndl_t sendSyncCompleteMessage();
+
+ private:
+
+ // id of the section being updated
+ TARGETING::SECTION_TYPE iv_section_to_sync;
+
+
+ // count of total pages, calculated from data supplied by the
+ // attribute resource provider code;
+ uint16_t iv_total_pages;
+
+ // maintiains the current page number being sync'ed.
+ uint16_t iv_current_page;
+
+ // vector of structures to hold the location info for each section
+ // we would like to sync. Data is filled in by the attrrp code
+ // when we call AttRP::readSectionData(...
+ std::vector <TARGETING::sectionRefData>iv_pages;
+
+ };
+
+ /**
+ * @brief Handles synchronization of all RW targeting attributes from
+ * hostboot to the fsp; the following section are are
+ * synchronized.
+ *
+ * 1). SECTION_TYPE_PNOR_RW
+ * 2). SECTION_TYPE_HEAP_PNOR_INIT
+ * 3). SECTION_TYPE_HEAP_PNOR_ZERO_INIT
+ *
+ *
+ * @return errlHndl_t
+ * return errl == NULL -> success
+ * return errl != NULL -> failure
+ */
+ errlHndl_t syncAllAttributesToFsp();
+
+} // namespace
+#endif
diff --git a/src/include/usr/targeting/common/attrsyncdefs.H b/src/include/usr/targeting/common/attrsyncdefs.H
new file mode 100644
index 000000000..74103a268
--- /dev/null
+++ b/src/include/usr/targeting/common/attrsyncdefs.H
@@ -0,0 +1,99 @@
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/targeting/common/attrsyncdefs.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2012
+ *
+ * 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 other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
+#ifndef __ATTRSYNC_DEFS_H__
+#define __ATTRSYNC_DEFS_H__
+
+//******************************************************************************
+// Macros
+//******************************************************************************
+// constants for use in masking off corresponding bytes in message data words
+// used for attribute synchronization mbox messages, sectoin ID and page
+// number are used in the sync messages
+const uint64_t SECTIONID_MASK = 0xFFFF000000000000;
+const uint64_t PAGE_NUMBER_MASK = 0x0000FFFF00000000;
+
+// page count mask, used in attribute sync commit message
+const uint64_t PAGE_COUNT_MASK = 0xFFFF000000000000;
+
+// mask to manipulate the return code field in the data returned in the
+// response to an attribute sync commit message
+const uint64_t RETURN_CODE_MASK = 0xFFFF000000000000;
+
+
+// used to add the section into the first data word of an attribute sync
+// message - only modifies the first two bytes of the uint64_t
+#define ATTR_SYNC_ADD_SECTION_ID( sectionId, data0 ) \
+ ( data0 = ( data0 & ~SECTIONID_MASK) | \
+ ( static_cast<uint64_t>(sectionId) << 48 ) )
+
+// used to add the number of the current page to by sync'd. used in the
+// attribute sync message code. Only modifies the second two bytes
+// of the uint64_t
+#define ATTR_SYNC_ADD_PAGE_NUMBER( pageNumber, data0 ) \
+ ( data0 = ( data0 & ~PAGE_NUMBER_MASK) | \
+ ( static_cast<uint64_t>(pageNumber) << 32 ) )
+
+// Used in the commit message sent after all the pages of the current section
+// oare sent, the macro will add the total page count to the first two bytes
+// of the data[0] uint64_t in the mailbox message.
+#define ATTR_SYNC_ADD_PAGE_COUNT( pageCount, data0 ) \
+ ( data0 = ( data0 & ~PAGE_COUNT_MASK) | \
+ ( static_cast<uint64_t>(pageCount) << 48 ) )
+
+// grabs the return code from the uint64_t returned by the mailbox message
+#define ATTR_SYNC_GET_RC( data0 ) ( static_cast<ATTR_SYNC_RC>( \
+ ( data0 & RETURN_CODE_MASK ) >> 48 ))
+
+namespace TARGETING
+{
+ /**
+ * @enum TARGETING::ATTR_SYNC_MSG_TYPE
+ *
+ * @brief Targeting attribute sync service message types for use in the
+ * attribute sync messges between FSP and Hostboot
+ */
+ enum ATTR_SYNC_MSG_TYPE
+ {
+ ATTR_SYNC_NO_MSG = 0,
+ ATTR_SYNC_SECTION = 0x000000A1,
+ ATTR_SYNC_COMPLETE = 0x000000A2,
+ };
+
+
+ /**
+ * @enum TARGETING::ATTR_SYNC_RC
+ *
+ * @brief Return code values for the sync complete message used by HB
+ * and the FSP when the sync has been completed.
+ *
+ */
+ enum ATTR_SYNC_RC
+ {
+ ATTR_SYNC_SUCCESS = 0,
+ ATTR_SYNC_FAILURE = 1
+ };
+
+}; // end namespace
+
+#endif
diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H
index 444dbc472..d9610e84a 100644
--- a/src/include/usr/targeting/common/targetservice.H
+++ b/src/include/usr/targeting/common/targetservice.H
@@ -1,26 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/targeting/targetservice.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// 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 other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
-
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/targeting/common/targetservice.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2011-2012
+ *
+ * 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 other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
#ifndef __TARGETING_COMMON_TARGETSERVICE_H
#define __TARGETING_COMMON_TARGETSERVICE_H
@@ -48,6 +48,7 @@
#include <targeting/common/iterators/iterators.H>
#include <targeting/common/predicates/predicates.H>
#include <targeting/adapters/types.H>
+#include <pnortargeting.H>
//******************************************************************************
// Interface Definitions
@@ -62,6 +63,33 @@ namespace TARGETING
class TargetService;
/**
+ * @brief Struct specifying different parameters required for section data
+ * update on the sectionId/NodePtr.
+ *
+ * Given a struct with the following elements required to point to a
+ * specific section in a given node and the dataPtr to be updated.
+ * Size of the data is always the Page size i.e. 4K
+ *
+ * Struct element details -
+ * sectionId - Section Id
+ * pageNumber - PageNumber for the section.
+ * padBytes - PadBytes to fill in 2 extra bytes
+ * dataPtr - Data Ptr
+ * pNodeTarget - Node Targeting Ptr
+ *
+ */
+
+ struct sectionRefData
+ {
+ uint8_t sectionId;
+ uint8_t pageNumber;
+ uint8_t padBytes[2];
+ uint8_t* dataPtr;
+ Target* pNodeTarget;
+ };
+
+
+ /**
* @brief Returns a reference to the targeting service singleton
*
* @return Reference to the targeting service
@@ -386,6 +414,53 @@ class TargetService
*/
void dump() const;
+ /**
+ * @brief Updates the targeting/attribute section data with the
+ * specified vector parameters.
+ *
+ * This is the top level interface, would basically call the lower
+ * level attribute resource provider interface. The lower level
+ * interface would fetch each vector element and update each section
+ * with corresponding data from the offset specified.
+ *
+ * @param[in] i_pages, vector of sectionRefData struct
+ *
+ * @pre N/A
+ *
+ * @post See "return"
+ *
+ * @return bool indicates whether the write to section data is
+ * successful or not.
+ *
+ * @retval true Section Data update successful
+ * @retval false Section Data update failed.
+ */
+ bool writeSectionData(const std::vector<sectionRefData>& i_pages);
+
+ /**
+ * @brief Fill up the vector with the targeting/attribute section
+ * data specified in the sectionId parameter.
+ *
+ * This is the top level interface, would basically call the lower
+ * level attribute resource provider interface. The lower level
+ * interface would fetch section data as per the sectionId specified
+ * and push to vector reference.
+ *
+ * @param[out] o_pages, vector of sectionRefData struct
+ * @param[in] i_sectionId, section type
+ *
+ * @pre N/A
+ *
+ * @post See "return"
+ *
+ * @return void would fill up the vectore refernce with complete
+ * section data in pages.
+ *
+ */
+
+ void readSectionData(std::vector<sectionRefData>& o_pages,
+ const SECTION_TYPE i_sectionId);
+
private:
/**
diff --git a/src/include/usr/targeting/common/targreasoncodes.H b/src/include/usr/targeting/common/targreasoncodes.H
index 16be43e01..0e60da298 100644
--- a/src/include/usr/targeting/common/targreasoncodes.H
+++ b/src/include/usr/targeting/common/targreasoncodes.H
@@ -39,6 +39,7 @@ enum TargetingModuleId
{
TARG_MOD_TEST = 0x01,
TARG_MOD_ATTRRP = 0x02,
+ TARG_MOD_ATTR_SYNC = 0x03,
};
enum TargetingReasonCode
@@ -49,6 +50,7 @@ enum TargetingReasonCode
TARG_RC_MM_PERM_FAIL = TARG_COMP_ID | 0x04,
TARG_RC_ATTR_MSG_FAIL = TARG_COMP_ID | 0x05,
TARG_RC_UNHANDLED_ATTR_SEC_TYPE = TARG_COMP_ID | 0x06,
+ TARG_RC_ATTR_SYNC_FAIL = TARG_COMP_ID | 0x07,
};
}; // End TARGETING namespace
OpenPOWER on IntegriCloud