diff options
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/fapi2/attribute_service.C | 21 | ||||
-rwxr-xr-x | src/usr/fapi2/fapi2.mk | 2 | ||||
-rw-r--r-- | src/usr/fapi2/plat_wof_access.C | 426 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2WOFTest.H | 75 | ||||
-rw-r--r-- | src/usr/isteps/istep06/call_host_voltage_config.C | 72 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 66 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/target_types.xml | 4 | ||||
-rw-r--r-- | src/usr/util/utillidpnor.H | 3 |
8 files changed, 648 insertions, 21 deletions
diff --git a/src/usr/fapi2/attribute_service.C b/src/usr/fapi2/attribute_service.C index 2261fed64..43ebb6bcb 100644 --- a/src/usr/fapi2/attribute_service.C +++ b/src/usr/fapi2/attribute_service.C @@ -417,7 +417,7 @@ ReturnCode platGetTargetPos(const Target<TARGET_TYPE_ALL>& i_pFapiTarget, if (l_errl) { - FAPI_ERR("getTargetName: Error from getTargetingTarget"); + FAPI_ERR("platGetTargetPos: Error from getTargetingTarget"); l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl)); } else @@ -459,7 +459,7 @@ ReturnCode platGetPoundVBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget, errlHndl_t l_errl = getTargetingTarget(i_fapiTarget, l_pTarget); if (l_errl) { - FAPI_ERR("getTargetingAttr: Error from getTargetingTarget"); + FAPI_ERR("platGetPoundVBucketData: Error from getTargetingTarget"); rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl)); } else @@ -488,7 +488,7 @@ ReturnCode platGetPoundWBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget, errlHndl_t l_errl = getTargetingTarget(i_fapiTarget, l_pTarget); if (l_errl) { - FAPI_ERR("getTargetingAttr: Error from getTargetingTarget"); + FAPI_ERR("platGetPoundWBucketData: Error from getTargetingTarget"); rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl)); } else @@ -500,6 +500,21 @@ ReturnCode platGetPoundWBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget, return rc; } +ReturnCode platParseWOFTables(uint8_t* o_wofData); + +//****************************************************************************** +// fapi2::platAttrSvc::platGetWOFTableData function +//****************************************************************************** +ReturnCode platGetWOFTableData(const Target<TARGET_TYPE_ALL>& i_fapiTarget, + uint8_t * o_wofTableData) +{ + fapi2::ReturnCode rc; + + // Parse the tables and return a single wof table + rc = platParseWOFTables(o_wofTableData); + + return rc; +} } // End platAttrSvc namespace diff --git a/src/usr/fapi2/fapi2.mk b/src/usr/fapi2/fapi2.mk index 50267aefa..1bbd111bd 100755 --- a/src/usr/fapi2/fapi2.mk +++ b/src/usr/fapi2/fapi2.mk @@ -40,6 +40,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ EXTRAINCDIR += $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/ EXTRAINCDIR += $(ROOTPATH)/src/import/chips/p9/procedures/hwp/sbe/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/accessors/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/lib/ include ${ROOTPATH}/src/build/mkrules/verbose.rules.mk define __CLEAN_TARGET @@ -57,6 +58,7 @@ OBJS += plat_hw_access.o OBJS += plat_spd_access.o OBJS += plat_mvpd_access.o OBJS += plat_vpd_access.o +OBJS += plat_wof_access.o #Required include before all the procedure.mk are included diff --git a/src/usr/fapi2/plat_wof_access.C b/src/usr/fapi2/plat_wof_access.C new file mode 100644 index 000000000..c1fd9983c --- /dev/null +++ b/src/usr/fapi2/plat_wof_access.C @@ -0,0 +1,426 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/fapi2/plat_wof_access.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +/** + * @file plat_wof_access.C + * + * @brief Implements the GetWofTables function + */ + +#include <stdint.h> +#include <fapi2.H> +#include <attribute_service.H> +#include <attributeenums.H> +#include <errl/errludattribute.H> +#include <errl/errlreasoncodes.H> +#include <util/utillidmgr.H> +#include <p9_pstates_common.h> + +namespace fapi2 +{ + +namespace platAttrSvc +{ + +const uint32_t WOF_IMAGE_MAGIC_VALUE = 0x57544948; // WTIH +const uint32_t WOF_TABLES_MAGIC_VALUE = 0x57465448; // WFTH +const uint32_t RES_VERSION_MASK = 0xFF; +const uint32_t WOF_IMAGE_VERSION = 1; +const uint32_t WOF_TABLES_VERSION = 1; + + +/* + WOF Tables In PNOR + --------------------------- + | Image Header | Points to Section Table + |-------------------------| + | Section Table Entry 1 | Section Table + | Section Table Entry 2 | Each entry points to + | ... | a WOF Table + |-------------------------| + | WOF Tables Header 1 | WOF Table + | VRFT 1 | Returned if match + | VRFT 2 | + | ... | + |-------------------------| + | WOF Tables Header 2 | WOF Table + | VRFT 1 | Returned if match + | VRFT 2 | + | ... | + |-------------------------| + | ... | + --------------------------- + + The structs for the Image Header and + Section Table Entry are defined below. + The struct for the WOF Tables Header + is defined in p9_pstates_common.h. +*/ + + +typedef struct __attribute__((__packed__)) wofImageHeader +{ + uint32_t magicNumber; + uint8_t version; + uint8_t entryCount; + uint32_t offset; +} wofImageHeader_t; + + +typedef struct __attribute__((__packed__)) wofSectionTableEntry +{ + uint32_t offset; + uint32_t size; +} wofSectionTableEntry_t; + + +fapi2::ReturnCode platParseWOFTables(uint8_t* o_wofData) +{ + FAPI_DBG("Entering platParseWOFTables ...."); + + errlHndl_t l_errl = nullptr; + fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS;; + + TARGETING::Target * l_sys = nullptr; + TARGETING::Target * l_mProc = nullptr; + TARGETING::targetService().getTopLevelTarget(l_sys); + TARGETING::targetService().masterProcChipTargetHandle( l_mProc ); + + // Get the number of present cores + TARGETING::TargetHandleList pECList; + getChildChiplets(pECList, l_mProc, TARGETING::TYPE_CORE, false); + uint32_t l_numCores = pECList.size(); + + // Get the socket power + uint32_t l_socketPower = 0; + uint8_t l_wofPowerLimit = + l_sys->getAttr<TARGETING::ATTR_WOF_POWER_LIMIT>(); + + if(l_wofPowerLimit == TARGETING::WOF_POWER_LIMIT_TURBO) + { + l_socketPower = + l_sys->getAttr<TARGETING::ATTR_SOCKET_POWER_TURBO>(); + } + else + { + l_socketPower = + l_sys->getAttr<TARGETING::ATTR_SOCKET_POWER_NOMINAL>(); + } + + // Get the frequencies + uint32_t l_nestFreq = + l_sys->getAttr<TARGETING::ATTR_FREQ_PB_MHZ>(); + uint32_t l_nomFreq = + l_sys->getAttr<TARGETING::ATTR_NOMINAL_FREQ_MHZ>(); + + // Trace the input params + FAPI_INF("WOF table search: " + "Cores %d SocketPower 0x%X NestFreq 0x%X NomFreq 0x%X", + l_numCores, l_socketPower, l_nestFreq, l_nomFreq); + + void* l_pWofImage = nullptr; + size_t l_lidImageSize = 0; + + do { + // @todo RTC 172776 Make WOF table parser PNOR accesses more efficient + // Lid number is system dependent + uint32_t l_lidNumber = + l_sys->getAttr<TARGETING::ATTR_WOF_TABLE_LID_NUMBER>(); + UtilLidMgr l_wofLidMgr(l_lidNumber); + + // Get the size of the full wof tables image + l_errl = l_wofLidMgr.getLidSize(l_lidImageSize); + if(l_errl) + { + FAPI_ERR("platParseWOFTables getLidSize failed"); + l_rc.setPlatDataPtr(reinterpret_cast<void *>(l_errl)); + break; + } + + // Allocate space, remember to free it later + l_pWofImage = static_cast<void*>(malloc(l_lidImageSize)); + + // Get the tables from pnor or lid + l_errl = l_wofLidMgr.getLid(l_pWofImage, l_lidImageSize); + if(l_errl) + { + FAPI_ERR("platParseWOFTables getLid failed " + "pLidImage %p imageSize %d", + l_pWofImage, l_lidImageSize); + l_rc.setPlatDataPtr(reinterpret_cast<void *>(l_errl)); + break; + } + + // Get the Image Header + wofImageHeader_t* l_img = + reinterpret_cast<wofImageHeader_t*>(l_pWofImage); + + // Check for the eyecatcher + if(l_img->magicNumber != WOF_IMAGE_MAGIC_VALUE) + { + FAPI_ERR("Image Header Magic Value != WTIH(0x%X)", + WOF_IMAGE_MAGIC_VALUE); + /*@ + * @errortype + * @moduleid fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES + * @reasoncode fapi2::RC_WOF_IMAGE_MAGIC_MISMATCH + * @userdata1[00:31] Image header magic value + * @userdata1[32:63] Expected magic value + * @userdata2[00:31] LID ID + * @userdata2[32:63] Image header version + * @devdesc Image header magic value mismatch + * @custdesc Firmware Error + */ + l_errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES, + fapi2::RC_WOF_IMAGE_MAGIC_MISMATCH, + TWO_UINT32_TO_UINT64( + l_img->magicNumber, + WOF_IMAGE_MAGIC_VALUE), + TWO_UINT32_TO_UINT64( + l_lidNumber, + l_img->version), + true); //software callout + l_rc.setPlatDataPtr(reinterpret_cast<void *>(l_errl)); + break; + } + + // Check for a valid image header version + if(l_img->version > WOF_IMAGE_VERSION) + { + FAPI_ERR("Image header version not supported: " + " Header Version %d Supported Version %d", + l_img->version, WOF_IMAGE_VERSION); + /*@ + * @errortype + * @moduleid fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES + * @reasoncode fapi2::RC_WOF_IMAGE_VERSION_MISMATCH + * @userdata1[00:31] Image header version + * @userdata1[32:63] Supported header version + * @userdata2 LID ID + * @devdesc Image header version not supported + * @custdesc Firmware Error + */ + l_errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES, + fapi2::RC_WOF_IMAGE_VERSION_MISMATCH, + TWO_UINT32_TO_UINT64( + l_img->version, + WOF_IMAGE_VERSION), + l_lidNumber, + true); //software callout + l_rc.setPlatDataPtr(reinterpret_cast<void *>(l_errl)); + break; + } + + // Image info + FAPI_INF("WOF Image: Magic 0x%X Version %d Entries %d Offset %p", + l_img->magicNumber, l_img->version, + l_img->entryCount, l_img->offset); + + // Get a pointer to the first section table entry + wofSectionTableEntry_t* l_ste = + reinterpret_cast<wofSectionTableEntry_t*> + (reinterpret_cast<uint8_t*>(l_pWofImage) + l_img->offset); + + WofTablesHeader_t* l_wth = nullptr; + std::vector<WofTablesHeader_t*> l_headers; + l_headers.clear(); + uint32_t l_ent = 0; + uint32_t l_ver = 0; + + // Loop through all section table entries + for( l_ent = 0; l_ent < l_img->entryCount; l_ent++ ) + { + // Get a pointer to the WOF table + l_wth = reinterpret_cast<WofTablesHeader_t*> + (reinterpret_cast<uint8_t*>(l_pWofImage) + + l_ste[l_ent].offset); + l_ver = l_wth->reserved_version & RES_VERSION_MASK; + + // Check for the eyecatcher + if(l_wth->magic_number != WOF_TABLES_MAGIC_VALUE) + { + FAPI_ERR("WOF Tables Header Magic Number != WFTH(0x%X)", + WOF_TABLES_MAGIC_VALUE); + /*@ + * @errortype + * @moduleid fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES + * @reasoncode fapi2::RC_WOF_TABLES_MAGIC_MISMATCH + * @userdata1[00:31] WOF tables header magic value + * @userdata1[32:63] Expected magic value + * @userdata2[00:31] WOF tables entry number + * @userdata2[32:63] WOF tables header version + * @devdesc WOF tables header magic value mismatch + * @custdesc Firmware Error + */ + l_errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES, + fapi2::RC_WOF_TABLES_MAGIC_MISMATCH, + TWO_UINT32_TO_UINT64( + l_wth->magic_number, + WOF_TABLES_MAGIC_VALUE), + TWO_UINT32_TO_UINT64( + l_ent, + l_ver), + true); //software callout + l_rc.setPlatDataPtr(reinterpret_cast<void *>(l_errl)); + break; + } + + // Check for a valid tables header version + if(l_ver > WOF_TABLES_VERSION) + { + FAPI_ERR("WOF tables header version not supported: " + " Header Version %d Supported Version %d", + l_ver, WOF_TABLES_VERSION); + /*@ + * @errortype + * @moduleid fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES + * @reasoncode fapi2::RC_WOF_TABLES_VERSION_MISMATCH + * @userdata1[00:31] WOF tables header version + * @userdata1[32:63] Supported header version + * @userdata2 WOF tables entry number + * @devdesc WOF tables header version not supported + * @custdesc Firmware Error + */ + l_errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES, + fapi2::RC_WOF_TABLES_VERSION_MISMATCH, + TWO_UINT32_TO_UINT64( + l_ver, + WOF_TABLES_VERSION), + l_ent, + true); //software callout + l_rc.setPlatDataPtr(reinterpret_cast<void *>(l_errl)); + break; + } + + // Trace the WOF table fields + FAPI_INF("WOF table fields " + "SectionTableEntry %d " + "SectionTableOffset 0x%X " + "SectionTableSize %d " + "Version %d Cores %d SocketPower 0x%X " + "NestFreq 0x%X NomFreq 0x%X", + l_ent, l_ste[l_ent].offset, l_ste[l_ent].size, + l_ver, l_wth->core_count, l_wth->socket_power_w, + l_wth->nest_frequency_mhz, l_wth->sort_power_freq_mhz); + + // Compare the fields + if( (l_wth->core_count == l_numCores) && + (l_wth->socket_power_w == l_socketPower) && + (l_wth->nest_frequency_mhz == l_nestFreq) && + (l_wth->sort_power_freq_mhz == l_nomFreq) ) + { + // Found a match + FAPI_INF("Found a WOF table match"); + + // Copy the WOF table to the ouput pointer + memcpy(o_wofData, + reinterpret_cast<uint8_t*>(l_wth), + l_ste[l_ent].size); + + break; + } + else + { + // Save the header for later + l_headers.push_back(l_wth); + } + } + + if(l_errl) + { + break; + } + + //Check for no match + if(l_ent == l_img->entryCount) + { + FAPI_ERR("No WOF table match found"); + /*@ + * @errortype + * @moduleid fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES + * @reasoncode fapi2::RC_WOF_TABLE_NOT_FOUND + * @userdata1[00:31] Number of cores + * @userdata1[32:63] Socket power + * @userdata2[00:31] Nest frequency + * @userdata2[32:63] Nominal frequency + * @devdesc No WOF table match found + * @custdesc Firmware Error + */ + l_errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi2::MOD_FAPI2_PLAT_PARSE_WOF_TABLES, + fapi2::RC_WOF_TABLE_NOT_FOUND, + TWO_UINT32_TO_UINT64( + l_numCores, + l_socketPower), + TWO_UINT32_TO_UINT64( + l_nestFreq, + l_nomFreq), + true); //software callout + l_errl->collectTrace(FAPI_TRACE_NAME); + + // Add data + ERRORLOG::ErrlUserDetailsAttribute( + l_sys, + TARGETING::ATTR_WOF_TABLE_LID_NUMBER) + .addToLog(l_errl); + while(l_headers.size()) + { + l_errl->addFFDC( + HWPF_COMP_ID, + l_headers.back(), + sizeof(WofTablesHeader_t), + 0, // version + ERRORLOG::ERRL_UDT_NOFORMAT, // parser ignores data + false ); // merge + l_headers.pop_back(); + } + + l_rc.setPlatDataPtr(reinterpret_cast<void *>(l_errl)); + break; + } + + } while(0); + + // Free the wof tables memory + if(l_pWofImage != nullptr) + { + free(l_pWofImage); + } + + FAPI_DBG("Exiting platParseWOFTables ...."); + + return l_rc; +} + +} // End platAttrSvc namespace +} // End fapi2 namespace diff --git a/src/usr/fapi2/test/fapi2WOFTest.H b/src/usr/fapi2/test/fapi2WOFTest.H new file mode 100644 index 000000000..e0b7745d8 --- /dev/null +++ b/src/usr/fapi2/test/fapi2WOFTest.H @@ -0,0 +1,75 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/fapi2/test/fapi2WOFTest.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __WOFTEST_H__ +#define __WOFTEST_H__ + +/** + * @file fapi2WOFTest.H + * + * @brief Test case for WOF access code + */ + +#include <stdio.h> +#include <cxxtest/TestSuite.H> +#include <errl/errlmanager.H> +#include <errl/errlentry.H> +#include <fapi2.H> +#include <devicefw/userif.H> +#include <utilFilter.H> + +using namespace TARGETING; + +class WOFTest: public CxxTest::TestSuite +{ +public: + + /** + * @brief Test WOF table access attribute + * + */ + void testWOFTableAccess (void) + { + //fapi2::ReturnCode l_rc; + fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> l_sysParent; + + FAPI_INF("testWOFTableAccess: ENTER"); + + // TODO RTC 172778 Enable WOF test and check for correct table data + /* + //Set up a char array to hold the data from an attr read + fapi2::ATTR_WOF_TABLE_DATA_Type l_wofAttrData; + + //Perform an ATTR_GET on sys target + FAPI_ATTR_GET(fapi2::ATTR_WOF_TABLE_DATA, + l_sysParent, + l_wofAttrData); + */ + FAPI_INF("testWOFTableAccess: EXIT !!"); + + } // testWOFTableAccess + +}; + +#endif diff --git a/src/usr/isteps/istep06/call_host_voltage_config.C b/src/usr/isteps/istep06/call_host_voltage_config.C index 467fb1bf8..651561ae0 100644 --- a/src/usr/isteps/istep06/call_host_voltage_config.C +++ b/src/usr/isteps/istep06/call_host_voltage_config.C @@ -117,6 +117,8 @@ void* call_host_voltage_config( void *io_pArgs ) uint32_t l_ultraTurboFreq = 0; //ATTR_ULTRA_TURBO_FREQ_MHZ uint32_t l_turboFreq = 0; //ATTR_FREQ_CORE_MAX uint32_t l_nestFreq = 0; //ATTR_FREQ_PB_MHZ + uint32_t l_powerModeNom = 0; //ATTR_SOCKET_POWER_NOMINAL + uint32_t l_powerModeTurbo = 0; //ATTR_SOCKET_POWER_TURBO bool l_firstPass = true; @@ -239,11 +241,13 @@ void* call_host_voltage_config( void *io_pArgs ) l_ceilingFreq = l_voltageData.turboFreq; l_ultraTurboFreq = l_voltageData.uTurboFreq; l_turboFreq = l_voltageData.turboFreq; + l_powerModeNom = l_voltageData.SortPowerNorm; + l_powerModeTurbo = l_voltageData.SortPowerTurbo; l_firstPass = false; } else { - // save it to variable and compare agains other nomFreq + // save it to variable and compare against other nomFreq // All of the buckets should report the same Nominal frequency if( l_nominalFreq != l_voltageData.nomFreq ) { @@ -251,6 +255,15 @@ void* call_host_voltage_config( void *io_pArgs ) "NOMINAL FREQ MISMATCH! expected: %d actual: %d", l_nominalFreq, l_voltageData.nomFreq ); + /*@ + * @errortype + * @moduleid ISTEP::MOD_VOLTAGE_CONFIG + * @reasoncode ISTEP::RC_NOMINAL_FREQ_MISMATCH + * @userdata1 Previous EQ nominal frequency + * @userdata2 Current EQ nominal frequency + * @devdesc Nominal Frequency mismatch + * @custdesc A problem occurred during the IPL of the system. + */ l_err = new ERRORLOG::ErrlEntry (ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM, ISTEP::MOD_VOLTAGE_CONFIG, @@ -264,7 +277,57 @@ void* call_host_voltage_config( void *io_pArgs ) HWAS::DECONFIG, HWAS::GARD_NULL ); - // Create IStep error log and cross reference occurred error + // Create IStep error log and + // cross reference occurred error + l_stepError.addErrorDetails( l_err ); + + // Commit Error + errlCommit( l_err, ISTEP_COMP_ID ); + + continue; + } + + // All of the buckets should report the same Sort Power + if( (l_powerModeNom != l_voltageData.SortPowerNorm) || + (l_powerModeTurbo != l_voltageData.SortPowerTurbo) ) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Power Mode MISMATCH! " + "expected Nominal %d actual Nominal %d " + "expected Turbo %d actual Turbo %d", + l_powerModeNom, l_voltageData.SortPowerNorm, + l_powerModeTurbo, l_voltageData.SortPowerTurbo); + + /*@ + * @errortype + * @moduleid ISTEP::MOD_VOLTAGE_CONFIG + * @reasoncode ISTEP::RC_POWER_MODE_MISMATCH + * @userdata1[00:31] Previous EQ nominal power mode + * @userdata1[32:63] Current EQ nominal power mode + * @userdata2[00:31] Previous EQ turbo power mode + * @userdata2[32:63] Current EQ turbo power mode + * @devdesc Power Mode mismatch + * @custdesc A problem occurred during the IPL of the system. + */ + l_err = new ERRORLOG::ErrlEntry + (ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM, + ISTEP::MOD_VOLTAGE_CONFIG, + ISTEP::RC_POWER_MODE_MISMATCH, + TWO_UINT32_TO_UINT64( + l_powerModeNom, + l_voltageData.SortPowerNorm), + TWO_UINT32_TO_UINT64( + l_powerModeTurbo, + l_voltageData.SortPowerTurbo), + false ); + + l_err->addHwCallout(l_proc, + HWAS::SRCI_PRIORITY_HIGH, + HWAS::DECONFIG, + HWAS::GARD_NULL ); + + // Create IStep error log and + // cross reference occurred error l_stepError.addErrorDetails( l_err ); // Commit Error @@ -301,7 +364,7 @@ void* call_host_voltage_config( void *io_pArgs ) // Don't set the boot voltage ATTR -- instead the // setup_evid will calculate from each chips #V and factor - // in loadline/distloss/etc + // in loadline/distloss/etc // call p9_setup_evid for each processor fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>l_fapiProc(l_proc); @@ -362,6 +425,9 @@ void* call_host_voltage_config( void *io_pArgs ) TARGETING::setFrequencyAttributes(l_sys, l_nestFreq); + l_sys->setAttr<ATTR_SOCKET_POWER_NOMINAL>(l_powerModeNom); + l_sys->setAttr<ATTR_SOCKET_POWER_TURBO>(l_powerModeTurbo); + } while( 0 ); if( l_err ) diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 4ad390838..990c02991 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -3838,6 +3838,42 @@ </attribute> <attribute> + <id>SOCKET_POWER_NOMINAL</id> + <description> + The socket power in nominal mode. + Controls how much power can be used. + This is the same for all cores in the system. + Data is provided by MVPD #V. + </description> + <simpleType><uint32_t></uint32_t></simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hwpfToHbAttrMap> + <id>ATTR_SOCKET_POWER_NOMINAL</id> + <macro>DIRECT</macro> + </hwpfToHbAttrMap> +</attribute> + +<attribute> + <id>SOCKET_POWER_TURBO</id> + <description> + The socket power in turbo mode. + Controls how much power can be used. + This is the same for all cores in the system. + Data is provided by MVPD #V. + </description> + <simpleType><uint32_t></uint32_t></simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hwpfToHbAttrMap> + <id>ATTR_SOCKET_POWER_TURBO</id> + <macro>DIRECT</macro> + </hwpfToHbAttrMap> +</attribute> + +<attribute> <id>MNFG_FLAGS</id> <description> Provides the manufacturing flags. This is a bitfield. @@ -20138,28 +20174,30 @@ Measured in GB</description> <default>0</default> </uint8_t> </simpleType> + <hwpfToHbAttrMap> + <id>ATTR_WOF_POWER_LIMIT</id> + <macro>DIRECT</macro> + </hwpfToHbAttrMap> <persistency>non-volatile</persistency> <readable/> <writeable/> </attribute> <attribute> - <id>WOF_TABLE_DATA</id> + <id>WOF_TABLE_LID_NUMBER</id> <description> - WOF data from PNOR which contains WOF header data + VFRT data (vfrt header + - data for 8 Vdn, 21Vdd and 6 Quads) - Consumed by p9_pstate_parameter_block procedure + LID id used to load tables for Workload Optimized + Frequency (WOF) algorithms. + Producer: TMGT + Consumers: FW that selects VFRT tables </description> <simpleType> - <uint8_t> - </uint8_t> - <array>131072</array> + <uint32_t> +<!-- @todo-RTC:172776-Get rid of default value that points to ZZ --> + <default>0x81E00440</default> + </uint32_t> </simpleType> - <hwpfToHbAttrMap> - <id>ATTR_WOF_TABLE_DATA</id> - <macro>DIRECT</macro> - </hwpfToHbAttrMap> - <persistency>volatile-zeroed</persistency> + <persistency>non-volatile</persistency> <readable/> <writeable/> </attribute> @@ -20178,7 +20216,9 @@ Measured in GB</description> --> </description> <simpleType> - <uint8_t></uint8_t> + <uint8_t> + <default>0</default> + </uint8_t> </simpleType> <persistency>non-volatile</persistency> <readable/> diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 16503c252..0f6a6e5c9 100755 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -756,6 +756,8 @@ <attribute><id>SYSTEM_IPL_PHASE</id></attribute> <attribute><id>FREQ_CORE_CEILING_MHZ</id></attribute> <attribute><id>ULTRA_TURBO_FREQ_MHZ</id></attribute> + <attribute><id>SOCKET_POWER_NOMINAL</id></attribute> + <attribute><id>SOCKET_POWER_TURBO</id></attribute> <attribute><id>PROC_FABRIC_A_BUS_WIDTH</id></attribute> <attribute><id>PROC_FABRIC_X_BUS_WIDTH</id></attribute> <attribute><id>PROC_FABRIC_CCSM_MODE</id></attribute> @@ -895,8 +897,8 @@ <attribute><id>MSS_VMEM_REGULATOR_MAX_DIMM_COUNT</id></attribute> <attribute><id>SYSTEM_WOF_ENABLED</id></attribute> <attribute><id>WOF_POWER_LIMIT</id></attribute> - <attribute><id>WOF_TABLE_DATA</id></attribute> <attribute><id>SYS_VFRT_STATIC_DATA_ENABLE</id></attribute> + <attribute><id>WOF_TABLE_LID_NUMBER</id></attribute> <attribute><id>AVSBUS_FREQUENCY</id></attribute> <attribute><id>PROC_FABRIC_ASYNC_SAFE_MODE</id></attribute> <attribute><id>VDM_ENABLE</id></attribute> diff --git a/src/usr/util/utillidpnor.H b/src/usr/util/utillidpnor.H index 267703f81..acec01462 100644 --- a/src/usr/util/utillidpnor.H +++ b/src/usr/util/utillidpnor.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2016 */ +/* Contributors Listed Below - COPYRIGHT 2014,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -59,6 +59,7 @@ const std::pair<uint32_t, PNOR::SectionId> { std::make_pair(Util::TEST_LIDID, PNOR::TESTRO), // 0x00000111 std::make_pair(Util::OCC_LIDID, PNOR::OCC), // 0x81e00430 + std::make_pair(Util::WOF_LIDID, PNOR::WOFDATA), // 0x81e00440 std::make_pair(Util::NIMBUS_HCODE_LIDID, PNOR::HCODE), // 0x81e00602 std::make_pair(Util::CUMULUS_HCODE_LIDID, PNOR::HCODE) // 0x81e00603 }; |