diff options
author | CamVan Nguyen <ctnguyen@us.ibm.com> | 2012-12-04 10:57:51 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-02-20 16:32:05 -0600 |
commit | dc3be407b9bbe715a23ef2e55900a4240158cfdd (patch) | |
tree | 5d9e1e48fe27a0899229523bf3b2206d302d6a9e /src/include/usr | |
parent | 7ef3dfebf8e2a38b4b810b07600c9c49921a870f (diff) | |
download | talos-hostboot-dc3be407b9bbe715a23ef2e55900a4240158cfdd.tar.gz talos-hostboot-dc3be407b9bbe715a23ef2e55900a4240158cfdd.zip |
Attribute sync from FSP to HB
Change-Id: Ia177f591c9bb295d0435ed913d11bac7a0601405
RTC: 51687
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2964
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r-- | src/include/usr/hwas/common/hwas_reasoncodes.H | 8 | ||||
-rw-r--r-- | src/include/usr/targeting/attrrp.H | 9 | ||||
-rw-r--r-- | src/include/usr/targeting/attrsync.H | 124 | ||||
-rw-r--r-- | src/include/usr/targeting/common/attrsyncdefs.H | 84 | ||||
-rw-r--r-- | src/include/usr/targeting/common/targreasoncodes.H | 18 | ||||
-rw-r--r-- | src/include/usr/targeting/common/trace.H | 47 |
6 files changed, 197 insertions, 93 deletions
diff --git a/src/include/usr/hwas/common/hwas_reasoncodes.H b/src/include/usr/hwas/common/hwas_reasoncodes.H index 774708cde..e8f08125f 100644 --- a/src/include/usr/hwas/common/hwas_reasoncodes.H +++ b/src/include/usr/hwas/common/hwas_reasoncodes.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -27,8 +27,9 @@ namespace HWAS { enum HwasModuleID { - MOD_DECONFIG_GARD = 0x01, - MOD_PROCESS_CALLOUT = 0x02, + MOD_DECONFIG_GARD = 0x01, + MOD_PROCESS_CALLOUT = 0x02, + MOD_HOST_DISCOVER_TARGETS = 0x03, }; enum HwasReasonCode @@ -40,6 +41,7 @@ namespace HWAS RC_GARD_REPOSITORY_FULL = 0x03, RC_TARGET_NOT_FOUND_FOR_GARD_RECORD = 0x04, RC_INVALID_TARGET = 0x05, + RC_TOP_LEVEL_TARGET_NULL = 0x06, // if more are added, modify each hwasPlatError.C file as appropriate. }; }; diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H index 82046b337..80394cb9b 100644 --- a/src/include/usr/targeting/attrrp.H +++ b/src/include/usr/targeting/attrrp.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -147,11 +147,12 @@ class AttrRP * * @param[in] i_pages, vector of sectionRefData struct * - * @return void + * @return true successful in writing Section Data + * @return false failed writing Section Data */ - void writeSectionData( - const std::vector <sectionRefData>& i_pages); + bool writeSectionData( + const std::vector <sectionRefData>& i_pages) const; /** * @brief Populates the output vector with the correct information diff --git a/src/include/usr/targeting/attrsync.H b/src/include/usr/targeting/attrsync.H index 274674382..cba459622 100644 --- a/src/include/usr/targeting/attrsync.H +++ b/src/include/usr/targeting/attrsync.H @@ -1,26 +1,25 @@ -/* 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 - */ +/* 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,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 __ATTRSYNC_H_ #define __ATTRSYNC_H_ /** @@ -83,7 +82,7 @@ namespace TARGETING * attribute section. * * @par Detailed Description: - * This funciton will call into the AttRP:: to have the + * This function 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. @@ -106,6 +105,38 @@ namespace TARGETING errlHndl_t syncSectionToFsp( TARGETING::SECTION_TYPE i_section_to_sync ); + /** + * @brief Sends a request to the FSP to sync its data to Hostboot + * for a specific attribute section. Write the data + * received from the FSP to the attribute section. + * + * @par Detailed Description: + * This function will call into the AttRP:: to have the + * correct attribute section updated. This function may be + * called multiple times with different section names. + * + * @pre None: + * + * @post The entire section from the FSP attribute section + * passed in has been synchronized to the HB memory area. + * + * @param[in] i_section_to_sync + * TARGETING::SECTION_TYPE is passed in to + * identify the section to be synced from the + * FSP. + * i_msgQ + * the message queue which FSP will use to send + * the attribute data + * + * @return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + * + */ + errlHndl_t syncSectionFromFsp( + TARGETING::SECTION_TYPE i_section_to_sync, + msg_q_t i_pMsgQ ); + private: /** @@ -126,13 +157,27 @@ namespace TARGETING * attribute section. * * @par Detailed Description: - * This funciton will call into the AttRP:: to have the + * This function will call into the AttRP:: to have the * correct attribute section paged into accessable memory * */ void getSectionData(); /** + * @brief Write the attribute data received from the FSP to + * the attribute section. + * + * @par Detailed Description: + * This function will call into the AttRP:: to have the + * correct attribute section written + * + * @return ATTR_SYNC_SUCCESS -> success + * ATTR_SYNC_FAILURE -> failure + * + */ + ATTR_SYNC_RC updateSectionData() const; + + /** * @brief Uses the internal mailbox to send a message to the FSP * * @@ -169,6 +214,17 @@ namespace TARGETING */ errlHndl_t sendSyncCompleteMessage(); + /** + * @brief Sends the sync to HB request message to the FSP + * requesting the FSP to sync it's attribute data + * to Hostboot. + * + * @return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + */ + errlHndl_t sendSyncToHBRequestMessage(); + private: // id of the section being updated @@ -191,7 +247,7 @@ namespace TARGETING /** * @brief Handles synchronization of all RW targeting attributes from - * hostboot to the fsp; the following section are are + * hostboot to the fsp; the following sections are * synchronized. * * 1). SECTION_TYPE_PNOR_RW @@ -205,5 +261,21 @@ namespace TARGETING */ errlHndl_t syncAllAttributesToFsp(); + /** + * @brief Handles synchronization of all RW targeting attributes from + * the fsp to hostboot; the following sections 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 syncAllAttributesFromFsp(); + } // namespace #endif diff --git a/src/include/usr/targeting/common/attrsyncdefs.H b/src/include/usr/targeting/common/attrsyncdefs.H index 74103a268..f435ca2d6 100644 --- a/src/include/usr/targeting/common/attrsyncdefs.H +++ b/src/include/usr/targeting/common/attrsyncdefs.H @@ -1,26 +1,25 @@ -/* 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 - */ +/* 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,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 __ATTRSYNC_DEFS_H__ #define __ATTRSYNC_DEFS_H__ @@ -47,21 +46,43 @@ const uint64_t RETURN_CODE_MASK = 0xFFFF000000000000; ( 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 +// used to get the section from the first data word of an attribute sync +// message - only retrieves the first two bytes of the uint64_t +#define ATTR_SYNC_GET_SECTION_ID( data0 ) ( static_cast<SECTION_TYPE>( \ + ( data0 & SECTIONID_MASK ) >> 48 ) ) + +// used to add the number of the current page to be 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 to get the number of the current page to be sync'd. used in the +// attribute sync message code. Only retrieves the second two bytes +// of the uint64_t +#define ATTR_SYNC_GET_PAGE_NUMBER( data0 ) ( static_cast<uint16_t>( \ + ( data0 & PAGE_NUMBER_MASK ) >> 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 +// are 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 +// Used in the commit message sent after all the pages of the current section +// are sent, the macro will extract the total page count from the first two bytes +// of the data[0] uint64_t in the mailbox message. +#define ATTR_SYNC_GET_PAGE_COUNT( data0 ) ( static_cast<uint16_t> ( \ + ( data0 & PAGE_COUNT_MASK ) >> 48 ) ) + +// sets the return code in the first 2 bytes of the mailbox message +#define ATTR_SYNC_ADD_RC( rc, data0 ) \ + ( data0 = (data0 & ~RETURN_CODE_MASK) | \ + ( static_cast<uint64_t>(rc) << 48 ) ) + +// gets 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 )) @@ -71,13 +92,16 @@ 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 + * attribute sync messages between FSP and Hostboot */ enum ATTR_SYNC_MSG_TYPE { - ATTR_SYNC_NO_MSG = 0, - ATTR_SYNC_SECTION = 0x000000A1, - ATTR_SYNC_COMPLETE = 0x000000A2, + ATTR_SYNC_NO_MSG = 0, + ATTR_SYNC_SECTION_TO_FSP = 0x000000A1, + ATTR_SYNC_COMPLETE_TO_FSP = 0x000000A2, + ATTR_SYNC_REQUEST_TO_HB = 0x000000A3, + ATTR_SYNC_SECTION_TO_HB = 0x000000A4, + ATTR_SYNC_COMPLETE_TO_HB = 0x000000A5, }; diff --git a/src/include/usr/targeting/common/targreasoncodes.H b/src/include/usr/targeting/common/targreasoncodes.H index 804745fc0..fcd45ae95 100644 --- a/src/include/usr/targeting/common/targreasoncodes.H +++ b/src/include/usr/targeting/common/targreasoncodes.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -43,13 +43,15 @@ enum TargetingModuleId enum TargetingReasonCode { - TARG_RC_TEST_TARGET_FFDC = TARG_COMP_ID | 0x01, - TARG_RC_BAD_EYECATCH = TARG_COMP_ID | 0x02, - TARG_RC_MM_BLOCK_FAIL = TARG_COMP_ID | 0x03, - 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, + TARG_RC_TEST_TARGET_FFDC = TARG_COMP_ID | 0x01, + TARG_RC_BAD_EYECATCH = TARG_COMP_ID | 0x02, + TARG_RC_MM_BLOCK_FAIL = TARG_COMP_ID | 0x03, + 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_TO_FSP_FAIL = TARG_COMP_ID | 0x07, + TARG_RC_ATTR_SYNC_REQUEST_TO_HB_FAIL = TARG_COMP_ID | 0x08, + TARG_RC_ATTR_SYNC_TO_HB_FAIL = TARG_COMP_ID | 0x09, }; }; // End TARGETING namespace diff --git a/src/include/usr/targeting/common/trace.H b/src/include/usr/targeting/common/trace.H index c298eb9ab..82a05586b 100644 --- a/src/include/usr/targeting/common/trace.H +++ b/src/include/usr/targeting/common/trace.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/targeting/trace.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/trace.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,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 __TARGETING_COMMON_TRACE_H #define __TARGETING_COMMON_TRACE_H @@ -59,6 +59,9 @@ #define TARG_INF(args...) \ TRACFCOMP(TARGETING::g_trac_targeting,TARG_TAG " " INFO_MRK " " args) +#define TARG_DBG(args...) \ + TRACDCOMP(TARGETING::g_trac_targeting,TARG_TAG " " INFO_MRK " " args) + #define TARG_BIN(args...) \ TRACFBIN(TARGETING::g_trac_targeting,TARG_TAG " " args) |