diff options
-rw-r--r-- | src/include/usr/initservice/initsvcreasoncodes.H | 3 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/sync_attributes.xml | 43 | ||||
-rw-r--r-- | src/usr/hwpf/makefile | 5 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepWorker.C | 103 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.C | 15 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.H | 19 | ||||
-rw-r--r-- | src/usr/targeting/attrsync.C | 56 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 26 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/common.mk | 2 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/target_types.xml | 3 |
10 files changed, 205 insertions, 70 deletions
diff --git a/src/include/usr/initservice/initsvcreasoncodes.H b/src/include/usr/initservice/initsvcreasoncodes.H index ac7da0296..ae23a5d2a 100644 --- a/src/include/usr/initservice/initsvcreasoncodes.H +++ b/src/include/usr/initservice/initsvcreasoncodes.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -72,6 +72,7 @@ enum InitServiceReasonCode LAST_ISTEP_FAILED = INITSVC_COMP_ID | 0x11, NO_MSG_PRESENT = INITSVC_COMP_ID | 0x12, ISTEP_INVALID_ISTEP = INITSVC_COMP_ID | 0x13, + ISTEP_FAPI_ATTR_READ_FAILED = INITSVC_COMP_ID | 0x14, }; diff --git a/src/usr/hwpf/hwp/sync_attributes.xml b/src/usr/hwpf/hwp/sync_attributes.xml new file mode 100644 index 000000000..fabb28908 --- /dev/null +++ b/src/usr/hwpf/hwp/sync_attributes.xml @@ -0,0 +1,43 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: src/usr/hwpf/hwp/sync_attributes.xml $ --> +<!-- --> +<!-- 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 --> +<!-- + XML file specifying HWPF attribute +--> + +<attributes> + <!-- ********************************************************************* --> + <attribute> + <id>ATTR_SYNC_BETWEEN_STEPS</id> + <targetType>TARGET_TYPE_SYSTEM</targetType> + <description> + Attribute to enable targetting attribute sync when in istep mode. + This value should be altered using the fapi attribute overide tools. + 0 = Disabled (default) + 1 = Enabled + </description> + <valueType>uint8</valueType> + <platInit/> + <writeable/> + </attribute> + <!-- ********************************************************************* --> +</attributes> diff --git a/src/usr/hwpf/makefile b/src/usr/hwpf/makefile index 6c5cf51dc..92d195b70 100644 --- a/src/usr/hwpf/makefile +++ b/src/usr/hwpf/makefile @@ -79,8 +79,8 @@ HWP_ERROR_XML_FILES = hwp/fapiHwpErrorInfo.xml \ hwp/proc_fab_iovalid_errors.xml \ hwp/nest_chiplets/proc_chiplet_scominit/proc_abus_scominit_errors.xml \ hwp/nest_chiplets/proc_chiplet_scominit/proc_xbus_scominit_errors.xml - - + + ## these get generated into obj/genfiles/AttributeIds.H HWP_ATTR_XML_FILES = hwp/memory_attributes.xml \ hwp/L2_L3_attributes.xml \ @@ -96,6 +96,7 @@ HWP_ATTR_XML_FILES = hwp/memory_attributes.xml \ hwp/chip_ec_attributes.xml \ hwp/centaur_ec_attributes.xml \ hwp/common_attributes.xml \ + hwp/sync_attributes.xml \ hwp/dram_initialization/proc_setup_bars/proc_setup_bars_memory_attributes.xml \ hwp/dram_initialization/proc_setup_bars/proc_setup_bars_l3_attributes.xml \ hwp/dram_initialization/proc_setup_bars/proc_setup_bars_mmio_attributes.xml \ diff --git a/src/usr/initservice/istepdispatcher/istepWorker.C b/src/usr/initservice/istepdispatcher/istepWorker.C index b42fa1949..0a42be139 100644 --- a/src/usr/initservice/istepdispatcher/istepWorker.C +++ b/src/usr/initservice/istepdispatcher/istepWorker.C @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/initservice/istepdispatcher/istepWorker.C $ - * - * 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/usr/initservice/istepdispatcher/istepWorker.C $ */ +/* */ +/* 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 */ /** * @file istepWorker.C * @@ -47,6 +46,12 @@ //#include <initservice/initsvcudistep.H> // InitSvcUserDetailsIstep +#include <targeting/attrsync.H> + +#include <targeting/common/attributes.H> + +#include <fapiAttributeService.H> + #include "istep_mbox_msgs.H" #include "istepWorker.H" #include "istepdispatcher.H" @@ -59,6 +64,7 @@ namespace INITSERVICE /******************************************************************************/ extern trace_desc_t *g_trac_initsvc; +bool getSyncEnabledAttribute(); // ---------------------------------------------------------------------------- // startIStepWorkerThread @@ -93,11 +99,14 @@ void iStepWorkerThread ( void * i_msgQ ) uint32_t istep = 0x0; uint32_t substep = 0x0; uint64_t progressCode = 0x0; - bool first = true; + bool first = true; TRACDCOMP( g_trac_initsvc, ENTER_MRK"iStepWorkerThread()" ); + // cache the value, it wont change during ipl. + bool step_mode = IStepDispatcher::getTheInstance().getIStepMode(); + while( 1 ) { // Send More Work Needed msg to the main thread. @@ -152,13 +161,35 @@ void iStepWorkerThread ( void * i_msgQ ) if( NULL != theStep ) { TRACFCOMP( g_trac_initsvc, - "IStepDispatcher (worker): Run Istep (%d), substep(%d), " - "- %s", + "IStepDispatcher (worker): Run Istep (%d), substep(%d), " + "- %s", istep, substep, theStep->taskname ); err = InitService::getTheInstance().executeFn( theStep, NULL ); + // sync the attributes to fsp in single step mode but only + // after step 6 is complete to allow discoverTargets() to + // run before the sync is done. + if( step_mode && istep > 6 ) + { + // this value can change between steps, so read now + if( getSyncEnabledAttribute() ) + { + TRACFCOMP( g_trac_initsvc, "sync attributes to FSP"); + + errlHndl_t l_errl = TARGETING::syncAllAttributesToFsp(); + + if(l_errl) + { + TRACFCOMP(g_trac_initsvc, "Attribute sync between steps failed, see" + "%x for details", l_errl->eid()); + + errlCommit(l_errl, INITSVC_COMP_ID); + } + } + } + if( err ) { TRACFCOMP( g_trac_initsvc, @@ -217,6 +248,8 @@ void iStepWorkerThread ( void * i_msgQ ) #endif } + + // flush contTrace after each istep/substep returns TRAC_FLUSH_BUFFERS(); @@ -332,5 +365,23 @@ const TaskInfo * findTaskInfo( const uint32_t i_IStep, return l_pistep; } +// $TODO - temporary implementation for bringup +bool getSyncEnabledAttribute() +{ + uint8_t l_syncEnabled = 0; + + // $TODO RTC Issue 64008 - update to use targeting attribute accessors + fapi::ReturnCode l_rc; + l_rc = FAPI_ATTR_GET(ATTR_SYNC_BETWEEN_STEPS, NULL, l_syncEnabled); + if (l_rc) + { + // trace for now, elog with new implementation + TRACFCOMP(g_trac_initsvc,"failed to read ATTR_SYNC_BETWEEN_STEPS, default" + " to no sync"); + + } + + return ( (l_syncEnabled) ? true : false ); +} } // namespace diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C index 7d8febd9a..3ee4818b6 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.C +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C @@ -51,6 +51,7 @@ #include <targeting/common/attributes.H> // ISTEP_MODE attribute #include <targeting/common/targetservice.H> +#include <targeting/attrsync.H> #include <hwpf/plat/fapiPlatAttributeService.H> @@ -213,8 +214,22 @@ void IStepDispatcher::init ( errlHndl_t &io_rtaskRetErrl ) // Execute all Isteps sequentially in 'normal' mode err = executeAllISteps(); + if( err ) { + // per interlock meeting, adding sync after ipl failure in + // normal IPL mode + TRACFCOMP( g_trac_initsvc, "sync attributes to FSP"); + + errlHndl_t l_errl = TARGETING::syncAllAttributesToFsp(); + + if(l_errl) + { + TRACFCOMP(g_trac_initsvc, "Attribute sync failed, see" + "%x for details", l_errl->eid()); + errlCommit(l_errl, INITSVC_COMP_ID); + } + break; } } diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H index 91d5c1503..152935521 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.H +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -181,6 +181,15 @@ public: */ bool isMpiplMode( void ) const; + /** + * @brief getIStepMode - return value of IStep Mode + * + * @return bool - value of iv_istepmodeflag + * @retval false if IStep Mode is "OFF" + * true if IStep Mode is "ON" + */ + bool getIStepMode( ) const; + protected: /** @@ -202,14 +211,6 @@ private: IStepDispatcher(const IStepDispatcher& i_right); IStepDispatcher& operator=(const IStepDispatcher& i_right); - /** - * @brief getIStepMode - return value of IStep Mode - * - * @return bool - value of iv_istepmodeflag - * @retval false if IStep Mode is "OFF" - * true if IStep Mode is "ON" - */ - bool getIStepMode( ) const; /** * @brief This function will start at istep 0, substep 0, and cycle diff --git a/src/usr/targeting/attrsync.C b/src/usr/targeting/attrsync.C index ca5da0140..4dd43cc55 100644 --- a/src/usr/targeting/attrsync.C +++ b/src/usr/targeting/attrsync.C @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/targeting/attrsync.C $ - * - * 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/usr/targeting/attrsync.C $ */ +/* */ +/* 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 */ #include <targeting/attrsync.H> #include <targeting/common/targreasoncodes.H> #include <targeting/common/trace.H> @@ -64,7 +63,7 @@ namespace TARGETING iv_section_to_sync = i_section_to_sync; - do{ + do{ // set up the pointers to the data area getSectionData(); @@ -89,12 +88,12 @@ namespace TARGETING msg->extra_data = malloc( PAGESIZE ); // copy the attributes from mem to our buffer. - memcpy( msg->extra_data, + memcpy( msg->extra_data, iv_pages[iv_current_page].dataPtr, PAGESIZE ); - TRACFCOMP(g_trac_targeting, + TRACFCOMP(g_trac_targeting, "syncSectionToFsp() - copy %d bytes from %p to %p", - PAGESIZE, iv_pages[iv_current_page].dataPtr, + PAGESIZE, iv_pages[iv_current_page].dataPtr, msg->extra_data); // mailbox code will free both the msg and the extra data @@ -109,7 +108,8 @@ namespace TARGETING } - if( l_errl == NULL ) + // if there was no error and there was data to send + if(( l_errl == NULL ) && ( iv_total_pages != 0 )) { // tell fsp to commit the last section of data we sent l_errl = sendSyncCompleteMessage(); diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index d5496a7de..a4e7274a8 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -9883,7 +9883,6 @@ Measured in GB</description> <!-- ===== End supporting poreve_memory_attributes.xml ===== --> - <!-- ===== Supporting A/X bus enable in p8_xip_customize_attributes.xml ===== --> <attribute> <id>PROC_A_ENABLE</id> @@ -9898,7 +9897,7 @@ Measured in GB</description> <default>1</default> </uint8_t> </simpleType> - <persistency>volatile</persistency> + <persistency>volatile</persistency> <readable/> <writeable/> <hwpfToHbAttrMap> @@ -9931,5 +9930,26 @@ Measured in GB</description> <!-- ===== End supporting A/X bus enable in p8_xip_customize_attributes.xml ===== --> - +<!-- Support for sync_attributes.xml --> +<attribute> + <id>SYNC_BETWEEN_STEPS</id> + <description> + Attribute to enable targetting attribute sync when in istep mode. + 1 = sync will occur following each substep when ipl'ing in single step mode + 0 = sync will not be done after each step + </description> + <simpleType> + <uint8_t> + <default>0</default> + </uint8_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hwpfToHbAttrMap> + <id>ATTR_SYNC_BETWEEN_STEPS</id> + <macro>DIRECT</macro> + </hwpfToHbAttrMap> +</attribute> +<!-- End support for sync_attributes.xml --> </attributes> diff --git a/src/usr/targeting/common/xmltohb/common.mk b/src/usr/targeting/common/xmltohb/common.mk index 45bc475a2..f33852729 100644 --- a/src/usr/targeting/common/xmltohb/common.mk +++ b/src/usr/targeting/common/xmltohb/common.mk @@ -77,8 +77,10 @@ FAPI_ATTR_SOURCES = \ common_attributes.xml \ build_winkle_images/p8_slw_build/proc_pll_ring_attributes.xml \ build_winkle_images/p8_slw_build/p8_xip_customize_attributes.xml \ + sync_attributes.xml \ poreve_memory_attributes.xml + XMLTOHB_GENERIC_XML = generic.xml XMLTOHB_FAPI_XML = fapiattrs.xml XMLTOHB_MERGE_SCRIPT = mergexml.sh diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 660f9a5dc..84969da3d 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -96,7 +96,7 @@ <attribute><id>FREQ_A</id></attribute> <attribute><id>FREQ_X</id></attribute> <attribute><id>SP_FUNCTIONS</id></attribute> - <attribute><id>HB_SETTINGS</id></attribute> + <attribute><id>HB_SETTINGS</id></attribute> <attribute><id>PAYLOAD_KIND</id></attribute> <attribute><id>PAYLOAD_BASE</id></attribute> <attribute><id>PAYLOAD_ENTRY</id></attribute> @@ -137,6 +137,7 @@ <attribute><id>PIB_I2C_NEST_PLL</id></attribute> <attribute><id>SBE_IMAGE_OFFSET</id></attribute> <attribute><id>BOOT_VOLTAGE</id></attribute> + <attribute><id>SYNC_BETWEEN_STEPS</id></attribute> </targetType> <targetType> |