diff options
author | Chris Cain <cjcain@us.ibm.com> | 2015-06-18 12:46:05 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-08-18 19:35:23 -0500 |
commit | 275ea30364bf2d831f213f9a73b5f8fa8ef851af (patch) | |
tree | 448949765c96bd8c4c83a109cb6ee8f7ca729c39 | |
parent | 6ff3e00062b894a880937ce41f748e26105b579a (diff) | |
download | talos-hostboot-275ea30364bf2d831f213f9a73b5f8fa8ef851af.tar.gz talos-hostboot-275ea30364bf2d831f213f9a73b5f8fa8ef851af.zip |
HTMGT support for Pstate Table Biasing
Change-Id: I96aff34fb9b588d8546575b77655a6cf167469fb
RTC: 128436
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/18789
Tested-by: Jenkins Server
Tested-by: Jenkins OP Build CI
Tested-by: Jenkins OP HW
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
24 files changed, 702 insertions, 105 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h index a7177a000..055f751a5 100644 --- a/src/include/runtime/interface.h +++ b/src/include/runtime/interface.h @@ -466,6 +466,32 @@ typedef struct runtimeInterfaces int (*apply_attr_override)(uint8_t* i_data, size_t i_size ); + /** + * @brief Send a pass-through command to HTMGT + * + * @details This is a blocking call that will send a command + * to HTMGT. + * + * @note If o_rspLength is returned with a non-zero value, + * the data at the o_rspData should be dumped to + * stdout in a hex dump format. + * @note The maximum response data returned will be 4096 bytes + * + * @param[in] i_cmdLength number of bytes in pass-thru command data + * @param[in] *i_cmdData pointer to pass-thru command data + * @param[out] *o_rspLength pointer to number of bytes returned + * in o_rspData + * @param[out] *o_rspData pointer to a 4096 byte buffer that will + * contain the response data from the command + * + * @returns 0 on success, or return code if the command failed + * @platform OpenPower + */ + int (*mfg_htmgt_pass_thru)(uint16_t i_cmdLength, + uint8_t * i_cmdData, + uint16_t * o_rspLength, + uint8_t * o_rspData); + // Reserve some space for future growth. void (*reserved[32])(void); diff --git a/src/include/usr/htmgt/htmgt.H b/src/include/usr/htmgt/htmgt.H index de7cfd2fb..8fbdf21c9 100755 --- a/src/include/usr/htmgt/htmgt.H +++ b/src/include/usr/htmgt/htmgt.H @@ -107,6 +107,30 @@ namespace HTMGT */ errlHndl_t enableOccActuation(bool i_occActivation); + + + /** + * @brief Send a pass-through command to HTMGT + * + * @details This is a blocking call that will send a command + * to HTMGT. + * + * @note The maximum response data returned will be 4096 bytes + * + * @param[in] i_cmdLength number of bytes in pass-thru command data + * @param[in] *i_cmdData pointer to pass-thru command data + * @param[out] o_rspLength number of bytes returned in o_rspData + * @param[out] *o_rspData pointer to a 4096 byte buffer that will + * contain the response data from the command + * + * @returns NULL on success, or an error handle if the state did not + * change. + */ + errlHndl_t passThruCommand(uint16_t i_cmdLength, + uint8_t * i_cmdData, + uint16_t & o_rspLength, + uint8_t * o_rspData); + } #endif // HTMGT_H diff --git a/src/include/usr/htmgt/htmgt_reasoncodes.H b/src/include/usr/htmgt/htmgt_reasoncodes.H index 18c4da539..5fc1b9638 100644 --- a/src/include/usr/htmgt/htmgt_reasoncodes.H +++ b/src/include/usr/htmgt/htmgt_reasoncodes.H @@ -40,6 +40,8 @@ namespace HTMGT HTMGT_MOD_PROCESS_OCC_RESET = 0x06, HTMGT_MOD_OCC_RESET = 0x07, HTMGT_MOD_BUILD_OCCS = 0x08, + HTMGT_MOD_PASS_THRU = 0x09, + HTMGT_MOD_CFG_FREQ_POINTS = 0x0A, HTMGT_MOD_OCC_POLL = 0x76, HTMGT_MOD_BAD_FRU_CALLOUTS = 0x7D, HTMGT_MOD_MISMATCHING_SEVERITY = 0x7F, @@ -54,11 +56,13 @@ namespace HTMGT enum htmgtReasonCode { + HTMGT_RC_NO_ERROR = 0x00, HTMGT_RC_INTERNAL_ERROR = HTMGT_COMP_ID | 0x01, HTMGT_RC_THROTTLE_UTIL_ERROR = HTMGT_COMP_ID | 0x02, HTMGT_RC_THROTTLE_INVALID_N = HTMGT_COMP_ID | 0x03, HTMGT_RC_OT_THROTTLE_INVALID_N = HTMGT_COMP_ID | 0x04, HTMGT_RC_OCC_NOT_READY = HTMGT_COMP_ID | 0x05, + HTMGT_RC_ATTRIBUTE_ERROR = HTMGT_COMP_ID | 0x06, HTMGT_RC_NO_SUPPORT = HTMGT_COMP_ID | 0x0F, HTMGT_RC_OCC_RESET = HTMGT_COMP_ID | 0x15, HTMGT_RC_OCC_CRIT_FAILURE = HTMGT_COMP_ID | 0x16, diff --git a/src/makefile b/src/makefile index 8fcdac8c5..84f4a9c44 100644 --- a/src/makefile +++ b/src/makefile @@ -232,6 +232,7 @@ RUNTIME_MODULES += hwp_rt RUNTIME_MODULES += plat_rt RUNTIME_MODULES += build_winkle_images_rt RUNTIME_MODULES += occ_rt +RUNTIME_MODULES += pstates RUNTIME_MODULES += $(if $(CONFIG_HTMGT),htmgt_rt) RUNTIME_MODULES += $(if $(CONFIG_HBRT_PRD),bus_training_rt) RUNTIME_MODULES += $(if $(CONFIG_HBRT_PRD),attn_rt) diff --git a/src/usr/htmgt/genPstate.C b/src/usr/htmgt/genPstate.C index 9eaae1747..a4fb2680f 100644 --- a/src/usr/htmgt/genPstate.C +++ b/src/usr/htmgt/genPstate.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014 */ +/* Contributors Listed Below - COPYRIGHT 2014,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -41,10 +41,16 @@ using namespace TARGETING; namespace HTMGT { -errlHndl_t genPstateTables() +errlHndl_t genPstateTables(bool i_normalTables) { errlHndl_t err = NULL; + // pstate table attribute must be big enough to hold the pstate structure + CPPASSERT(sizeof(ATTR_PSTATE_TABLE_type) >= sizeof(PstateSuperStructure)); + // normal and mfg pstate tables are the same size + CPPASSERT(sizeof(ATTR_PSTATE_TABLE_type) == + sizeof(ATTR_PSTATE_TABLE_MFG_type)); + TargetHandleList processors; getChipResources(processors, @@ -66,18 +72,20 @@ errlHndl_t genPstateTables() if(occs.size() > 0) { + const char * tableType = i_normalTables?"normal":"mfg"; PstateSuperStructure pstate_data; Target * occTarget = occs[0]; ATTR_HUID_type huid = occTarget->getAttr<ATTR_HUID>(); - TMGT_INF("Building pstate table for huid 0x%x", huid); + TMGT_INF("genPstateTables: Building %s pstate tables for " + "huid 0x%x", tableType, huid); err = FREQVOLTSVC::runP8BuildPstateDataBlock( procTarget, &pstate_data); if(err) { - TMGT_ERR( "tmgtProcessAppGenPstateTable: Failed to" + TMGT_ERR( "genPstateTables: Failed to" " generate PSTATE data for OCC " "(huid=%x).", huid @@ -89,14 +97,24 @@ errlHndl_t genPstateTables() } else { - ATTR_PSTATE_TABLE_type * pstateData = - reinterpret_cast<ATTR_PSTATE_TABLE_type*> - (&pstate_data); - - CPPASSERT(sizeof(ATTR_PSTATE_TABLE_type) == - sizeof(PstateSuperStructure)); - - occTarget->setAttr<ATTR_PSTATE_TABLE>(*pstateData); + TMGT_INF("genPstateTables: %s pstate tables completed for " + "huid 0x%x", tableType, huid); + if (i_normalTables) + { + ATTR_PSTATE_TABLE_type * pstateData = + reinterpret_cast<ATTR_PSTATE_TABLE_type*> + (&pstate_data); + + occTarget->setAttr<ATTR_PSTATE_TABLE>(*pstateData); + } + else + { + ATTR_PSTATE_TABLE_MFG_type * pstateData = + reinterpret_cast<ATTR_PSTATE_TABLE_MFG_type*> + (&pstate_data); + + occTarget->setAttr<ATTR_PSTATE_TABLE_MFG>(*pstateData); + } } } } diff --git a/src/usr/htmgt/genPstate.H b/src/usr/htmgt/genPstate.H index 71106de27..6b302131f 100644 --- a/src/usr/htmgt/genPstate.H +++ b/src/usr/htmgt/genPstate.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014 */ +/* Contributors Listed Below - COPYRIGHT 2014,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -36,9 +36,11 @@ namespace HTMGT * @note Attributes will not be written if the corresponding pstate table * could not be generated. * @note this function is only available at IPL time + * @param[in] i_normalTables true to generate normal pstate tables + * false to generate mfg pstate tables * @return error log handle on error, otherwise NULL */ -errlHndl_t genPstateTables(); +errlHndl_t genPstateTables(bool i_normalTables); }; #endif diff --git a/src/usr/htmgt/htmgt.C b/src/usr/htmgt/htmgt.C index d92f7a315..257f2df04 100644 --- a/src/usr/htmgt/htmgt.C +++ b/src/usr/htmgt/htmgt.C @@ -28,9 +28,7 @@ #include "htmgt_activate.H" #include "htmgt_cfgdata.H" #include "htmgt_utility.H" -#ifndef __HOSTBOOT_RUNTIME #include "genPstate.H" -#endif #include "htmgt_memthrottles.H" #include "htmgt_poll.H" #include <devicefw/userif.H> @@ -78,8 +76,8 @@ namespace HTMGT do { #ifndef __HOSTBOOT_RUNTIME - // Build pstate tables (once per IPL) - l_err = genPstateTables(); + // Build normal pstate tables (once per IPL) + l_err = genPstateTables(true); if(l_err) { break; @@ -143,12 +141,12 @@ namespace HTMGT * @errortype * @reasoncode HTMGT_RC_OCC_MASTER_NOT_FOUND * @moduleid HTMGT_MOD_LOAD_START_STATUS - * @userdata1[0:7] number of OCCs + * @userdata1 number of OCCs * @devdesc No OCC master was found */ bldErrLog(l_err, HTMGT_MOD_LOAD_START_STATUS, HTMGT_RC_OCC_MASTER_NOT_FOUND, - OccManager::getNumOccs(), 0, 0, 0, + 0, OccManager::getNumOccs(), 0, 0, ERRORLOG::ERRL_SEV_INFORMATIONAL); } } @@ -172,7 +170,7 @@ namespace HTMGT */ bldErrLog(l_err, HTMGT_MOD_LOAD_START_STATUS, HTMGT_RC_OCC_START_FAIL, - l_huid, 0, 0, 0, + 0, l_huid, 0, 0, ERRORLOG::ERRL_SEV_INFORMATIONAL); } @@ -328,13 +326,13 @@ namespace HTMGT * @errortype * @reasoncode HTMGT_RC_INVALID_PARAMETER * @moduleid HTMGT_MOD_PROCESS_OCC_RESET - * @userdata1[0:7] Processor HUID + * @userdata1 Processor HUID * @devdesc No OCC target found for proc Target, */ bldErrLog(errl, HTMGT_MOD_PROCESS_OCC_RESET, HTMGT_RC_INVALID_PARAMETER, - huid, 0, 0, 1, + 0, huid, 0, 1, ERRORLOG::ERRL_SEV_INFORMATIONAL); // Add HB firmware callout @@ -438,5 +436,113 @@ namespace HTMGT } // end enableOccActuation() + + // Send pass-thru command to HTMGT + errlHndl_t passThruCommand(uint16_t i_cmdLength, + uint8_t * i_cmdData, + uint16_t & o_rspLength, + uint8_t * o_rspData) + { + errlHndl_t err = NULL; + htmgtReasonCode failingSrc = HTMGT_RC_NO_ERROR; + o_rspLength = 0; + + if ((i_cmdLength > 0) && (NULL != i_cmdData)) + { + switch (i_cmdData[0]) + { + case PASSTHRU_OCC_STATUS: + TMGT_INF("passThruCommand: OCC Status"); + OccManager::getOccData(o_rspLength, o_rspData); + break; + + case PASSTHRU_GENERATE_MFG_PSTATE: + if (i_cmdLength == 1) + { + TMGT_INF("passThruCommand: Generate MFG pstate tables", + i_cmdData[1]); + err = genPstateTables(false); + } + else + { + TMGT_ERR("passThruCommand: invalid generate pstate " + "command length %d", i_cmdLength); + /*@ + * @errortype + * @reasoncode HTMGT_RC_INVALID_LENGTH + * @moduleid HTMGT_MOD_PASS_THRU + * @userdata1 command data[0-7] + * @userdata2 command data length + * @devdesc Invalid pass thru command data length + */ + failingSrc = HTMGT_RC_INVALID_LENGTH; + } + break; + + case PASSTHRU_LOAD_PSTATE: + if (i_cmdLength == 2) + { + const uint8_t pstateType = i_cmdData[1]; + if ((0 == pstateType) || (1 == pstateType)) + { + TMGT_INF("passThruCommand: Load pstate tables " + "(type: %d)", pstateType); + // 0 = Normal Pstate Tables + err = OccManager::loadPstates(0 == pstateType); + } + else + { + TMGT_ERR("passThruCommand: invalid pstate type " + "specified: %d", pstateType); + /*@ + * @errortype + * @reasoncode HTMGT_RC_INVALID_PARAMETER + * @moduleid HTMGT_MOD_PASS_THRU + * @userdata1 command data[0-7] + * @userdata2 command data length + * @devdesc Invalid load pstate table type + */ + failingSrc = HTMGT_RC_INVALID_PARAMETER; + } + } + else + { + TMGT_ERR("passThruCommand: invalid load pstate " + "command length %d", i_cmdLength); + failingSrc = HTMGT_RC_INVALID_LENGTH; + } + break; + + default: + TMGT_ERR("passThruCommand: Invalid command 0x%08X " + "(%d bytes)", UINT32_GET(i_cmdData), i_cmdLength); + /*@ + * @errortype + * @reasoncode HTMGT_RC_INVALID_DATA + * @moduleid HTMGT_MOD_PASS_THRU + * @userdata1 command data[0-7] + * @userdata2 command data length + * @devdesc Invalid pass thru command + */ + failingSrc = HTMGT_RC_INVALID_DATA; + break; + } + + if ((HTMGT_RC_NO_ERROR != failingSrc) && (NULL == err)) + { + bldErrLog(err, HTMGT_MOD_PASS_THRU, + failingSrc, + UINT32_GET(i_cmdData), + UINT32_GET(&i_cmdData[4]), + 0, i_cmdLength, + ERRORLOG::ERRL_SEV_INFORMATIONAL); + } + } + + return err; + + } // end passThruCommand() + + } diff --git a/src/usr/htmgt/htmgt_activate.C b/src/usr/htmgt/htmgt_activate.C index 54a3695f4..f8417d577 100644 --- a/src/usr/htmgt/htmgt_activate.C +++ b/src/usr/htmgt/htmgt_activate.C @@ -232,7 +232,7 @@ namespace HTMGT } else { - //The OCC knows it isn't active by getting a value of 0. + //The OCC knows cap isn't active by getting a value of 0. limit = 0; } diff --git a/src/usr/htmgt/htmgt_cfgdata.C b/src/usr/htmgt/htmgt_cfgdata.C index f4bcfd8a6..155fa64fb 100644 --- a/src/usr/htmgt/htmgt_cfgdata.C +++ b/src/usr/htmgt/htmgt_cfgdata.C @@ -29,6 +29,8 @@ #include "htmgt_utility.H" #include "htmgt_poll.H" #include "ipmi/ipmisensor.H" +#include "fapiPlatAttributeService.H" +#include <htmgt/htmgt_reasoncodes.H> using namespace TARGETING; @@ -38,6 +40,8 @@ using namespace TARGETING; //#define TRACUCOMP(args...) TMGT_INF(args) #define TRACUCOMP(args...) +#define FRAC(f) ( int((f - int(f)) * 100.0) ) + namespace HTMGT { // Send config format data to all OCCs @@ -663,16 +667,89 @@ void getFrequencyPointMessageData(uint8_t* o_data, assert(sys != NULL); assert(o_data != NULL); + int32_t biasFactor = 0; + if (false == OccManager::isNormalPstate()) + { + // Only apply bias if using mfg pstate tables + Occ *master = OccManager::getMasterOcc(); + if (NULL != master) + { + errlHndl_t err = NULL; + TARGETING::TargetHandle_t occTarget = master->getTarget(); + ConstTargetHandle_t procTarget = getParentChip(occTarget); + assert(procTarget != NULL); + const fapi::Target fapiTarget(fapi::TARGET_TYPE_PROC_CHIP, + &procTarget); + uint32_t biasUp = 0; + uint32_t biasDown = 0; + int rc = FAPI_ATTR_GET(ATTR_FREQ_EXT_BIAS_UP,&fapiTarget,biasUp); + rc |= FAPI_ATTR_GET(ATTR_FREQ_EXT_BIAS_DOWN,&fapiTarget,biasDown); + if (0 == rc) + { + if ((biasDown > 0) && (biasUp == 0)) + { + TMGT_INF("FREQ_EXT_BIAS_DOWN=%d (in 0.5% units)", biasDown); + biasFactor = -(biasDown); + } + else if ((biasUp > 0) && (biasDown == 0)) + { + biasFactor = biasUp; + TMGT_INF("FREQ_EXT_BIAS_UP=%d (in 0.5% units)", biasUp); + } + else if ((biasUp > 0) && (biasDown > 0)) + { + TMGT_ERR("Invalid bias values: BIAS_UP=%d and BIAS_DOWN=%d", + biasUp, biasDown); + /*@ + * @errortype + * @reasoncode HTMGT_RC_INVALID_PARAMETER + * @moduleid HTMGT_MOD_CFG_FREQ_POINTS + * @userdata1 ATTR_FREQ_EXT_BIAS_UP + * @userdata2 ATTR_FREQ_EXT_BIAS_DOWN + * @devdesc Invalid ATTR_FREQ_EXT_BIAS attribute values + */ + bldErrLog(err, HTMGT_MOD_CFG_FREQ_POINTS, + HTMGT_RC_INVALID_PARAMETER, + 0, biasUp, 0, biasDown, + ERRORLOG::ERRL_SEV_UNRECOVERABLE); + ERRORLOG::errlCommit(err, HTMGT_COMP_ID); + } + } + else + { + TMGT_ERR("Unable to read ATTR_FREQ_EXT_BIAS values rc=%d", rc); + /*@ + * @errortype + * @reasoncode HTMGT_RC_ATTRIBUTE_ERROR + * @moduleid HTMGT_MOD_CFG_FREQ_POINTS + * @userdata1[0-31] rc + * @userdata1[32-63] ATTR_FREQ_EXT_BIAS_UP + * @userdata2 ATTR_FREQ_EXT_BIAS_DOWN + * @devdesc Unable to read FREQ_EXT_BIAS attributes + */ + bldErrLog(err, HTMGT_MOD_CFG_FREQ_POINTS, + HTMGT_RC_ATTRIBUTE_ERROR, + rc, biasUp, 0, biasDown, + ERRORLOG::ERRL_SEV_UNRECOVERABLE); + ERRORLOG::errlCommit(err, HTMGT_COMP_ID); + } + } + } + o_data[index++] = OCC_CFGDATA_FREQ_POINT; o_data[index++] = OCC_CFGDATA_FREQ_POINT_VERSION; - //Nominal Frequency in MHz nominal = sys->getAttr<ATTR_NOMINAL_FREQ_MHZ>(); + if (biasFactor) + { + TMGT_INF("Pre-biased Nominal=%dMhz", nominal); + // % change = (biasFactor/2) / 100 + nominal += ((nominal * biasFactor) / 200); + } memcpy(&o_data[index], &nominal, 2); index += 2; - //Maximum Frequency in MHz uint8_t turboAllowed = sys->getAttr<ATTR_OPEN_POWER_TURBO_MODE_SUPPORTED>(); @@ -687,6 +764,12 @@ void getFrequencyPointMessageData(uint8_t* o_data, { max = nominal; } + if (biasFactor) + { + TMGT_INF("Pre-biased Max=%dMhz", max); + // % change = (biasFactor/2) / 100 + max += ((max * biasFactor) / 200); + } memcpy(&o_data[index], &max, 2); index += 2; @@ -694,6 +777,12 @@ void getFrequencyPointMessageData(uint8_t* o_data, //Minimum Frequency in MHz min = sys->getAttr<ATTR_MIN_FREQ_MHZ>(); + if (biasFactor) + { + TMGT_INF("Pre-biased Min=%dMhz", min); + // % change = (biasFactor/2) / 100 + min += ((min * biasFactor) / 200); + } memcpy(&o_data[index], &min, 2); index += 2; @@ -708,6 +797,7 @@ void getPstateTableMessageData(const TargetHandle_t i_occTarget, uint8_t* o_data, uint64_t & io_size) { + // normal and mfg pstate tables are the same size: see genPstateTables() uint64_t msg_size = sizeof(ATTR_PSTATE_TABLE_type) + 4; assert(io_size >= msg_size); @@ -721,11 +811,23 @@ void getPstateTableMessageData(const TargetHandle_t i_occTarget, o_data[2] = 0; // reserved o_data[3] = 0; // reserved - // Read data from attribute for specified occ - ATTR_PSTATE_TABLE_type * pstateDataPtr = - reinterpret_cast<ATTR_PSTATE_TABLE_type*>(o_data + 4); + if (OccManager::isNormalPstate()) + { + TMGT_INF("getPstateTableMessageData: Sending normal tables"); + // Read data from attribute for specified occ + ATTR_PSTATE_TABLE_type * pstateDataPtr = + reinterpret_cast<ATTR_PSTATE_TABLE_type*>(o_data + 4); - i_occTarget->tryGetAttr<ATTR_PSTATE_TABLE>(*pstateDataPtr); + i_occTarget->tryGetAttr<ATTR_PSTATE_TABLE>(*pstateDataPtr); + } + else + { + TMGT_INF("getPstateTableMessageData: Sending MFG tables"); + ATTR_PSTATE_TABLE_MFG_type * pstateDataPtr = + reinterpret_cast<ATTR_PSTATE_TABLE_MFG_type*>(o_data + 4); + + i_occTarget->tryGetAttr<ATTR_PSTATE_TABLE_MFG>(*pstateDataPtr); + } } diff --git a/src/usr/htmgt/htmgt_common.mk b/src/usr/htmgt/htmgt_common.mk index 5b33c6097..1be6ad42e 100644 --- a/src/usr/htmgt/htmgt_common.mk +++ b/src/usr/htmgt/htmgt_common.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2014 +# Contributors Listed Below - COPYRIGHT 2014,2015 # [+] International Business Machines Corp. # # @@ -22,6 +22,15 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG + +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/mc_config/mss_eff_config +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/pstates/pstates + # common objects between hostboot and hbrt OBJS += htmgt.o OBJS += htmgt_occ.o @@ -31,9 +40,4 @@ OBJS += htmgt_poll.o OBJS += htmgt_utility.o OBJS += htmgt_cfgdata.o OBJS += occError.o - -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp -EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/mc_config/mss_eff_config +OBJS += genPstate.o diff --git a/src/usr/htmgt/htmgt_occ.C b/src/usr/htmgt/htmgt_occ.C index 7dd5c2d1a..52a27c14b 100644 --- a/src/usr/htmgt/htmgt_occ.C +++ b/src/usr/htmgt/htmgt_occ.C @@ -122,10 +122,10 @@ namespace HTMGT * @errortype * @moduleid HTMGT_MOD_OCC_SET_STATE * @reasoncode HTMGT_RC_OCC_CMD_FAIL - * @userdata1[0-15] OCC instance - * @userdata1[16-31] Requested state - * @userdata2[0-15] OCC response status - * @userdata2[16-31] current OCC state + * @userdata1[0-31] OCC instance + * @userdata1[32-63] Requested state + * @userdata2[0-31] OCC response status + * @userdata2[32-63] current OCC state * @devdesc Set of OCC state failed */ bldErrLog(l_err, HTMGT_MOD_OCC_SET_STATE, @@ -143,13 +143,13 @@ namespace HTMGT * @errortype * @moduleid HTMGT_MOD_OCC_SET_STATE * @reasoncode HTMGT_RC_INTERNAL_ERROR - * @userdata1[0-15] OCC instance - * @userdata1[16-31] Requested state + * @userdata1 OCC instance + * @userdata2 Requested state * @devdesc Set state only allowed on master OCC */ bldErrLog(l_err, HTMGT_MOD_OCC_SET_STATE, HTMGT_RC_INTERNAL_ERROR, - iv_instance, i_state, 0, 0, + 0, iv_instance, 0, i_state, ERRORLOG::ERRL_SEV_INFORMATIONAL); } @@ -250,7 +250,8 @@ namespace HTMGT :iv_occMaster(NULL), iv_state(OCC_STATE_UNKNOWN), iv_targetState(OCC_STATE_ACTIVE), - iv_resetCount(0) + iv_resetCount(0), + iv_normalPstateTables(true) { } @@ -603,15 +604,15 @@ namespace HTMGT * @errortype * @moduleid HTMGT_MOD_OCCMGR_SET_STATE * @reasoncode HTMGT_RC_OCC_UNEXPECTED_STATE - * @userdata1[0-15] requested state - * @userdata1[16-31] OCC state - * @userdata2[0-15] OCC instance + * @userdata1[0-31] requested state + * @userdata1[32-63] OCC state + * @userdata2 OCC instance * @devdesc OCC did not change to requested state */ bldErrLog(l_err, HTMGT_MOD_OCCMGR_SET_STATE, HTMGT_RC_OCC_UNEXPECTED_STATE, requestedState, (*pOcc)->getState(), - (*pOcc)->getInstance(), 0, + 0, (*pOcc)->getInstance(), ERRORLOG::ERRL_SEV_INFORMATIONAL); break; } @@ -645,12 +646,12 @@ namespace HTMGT * @errortype * @moduleid HTMGT_MOD_OCCMGR_SET_STATE * @reasoncode HTMGT_RC_INVALID_DATA - * @userdata1[0-15] requested state + * @userdata1 requested state * @devdesc Invalid OCC state requested */ bldErrLog(l_err, HTMGT_MOD_OCCMGR_SET_STATE, HTMGT_RC_INVALID_DATA, - requestedState, 0, 0, 0, + 0, requestedState, 0, 0, ERRORLOG::ERRL_SEV_INFORMATIONAL); } @@ -659,7 +660,8 @@ namespace HTMGT } // end OccManager::_setOccState() - errlHndl_t OccManager::_resetOccs(TARGETING::Target * i_failedOccTarget) + errlHndl_t OccManager::_resetOccs(TARGETING::Target * i_failedOccTarget, + bool i_skipCountIncrement) { errlHndl_t err = NULL; bool atThreshold = false; @@ -699,7 +701,7 @@ namespace HTMGT } } - if (false == _occFailed()) + if ((false == i_skipCountIncrement) && (false == _occFailed())) { // No OCC has been marked failed, increment system reset count ++iv_resetCount; @@ -947,6 +949,97 @@ namespace HTMGT } + // Collect HTMGT Status Information for debug + // NOTE: o_data is pointer to 4096 byte buffer + void OccManager::_getOccData(uint16_t & o_length, uint8_t *o_data) + { + uint16_t index = 0; + + // If the system is in safemode then can't talk to OCCs (no build/poll) + TARGETING::Target* sys = NULL; + TARGETING::targetService().getTopLevelTarget(sys); + uint8_t safeMode = 0; + if (sys && + sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode) && + (0 == safeMode)) + { + // Make sure OCCs were built first (so data is valid) + errlHndl_t err = _buildOccs(); // if not a already built. + if (err) + { + TMGT_ERR("_getOccData: failed to build OCC structures " + "rc=0x%04X", err->reasonCode()); + ERRORLOG::errlCommit(err, HTMGT_COMP_ID); + } + // Send poll to confirm comm, update states and flush errors + err = _sendOccPoll(true, NULL); + if (err) + { + TMGT_ERR("_getOccData: Poll OCCs failed."); + ERRORLOG::errlCommit(err, HTMGT_COMP_ID); + } + } + + // First add HTMGT specific data + o_data[index++] = _getNumOccs(); + o_data[index++] = (NULL!=iv_occMaster)?iv_occMaster->getInstance():0xFF; + o_data[index++] = iv_state; + o_data[index++] = iv_targetState; + o_data[index++] = iv_resetCount; + o_data[index++] = iv_normalPstateTables ? 0 : 1; + index += 1; // reserved for expansion + o_data[index++] = safeMode; + UINT32_PUT(&o_data[index], cv_safeReturnCode); + index += 4; + UINT32_PUT(&o_data[index], cv_safeOccInstance); + index += 4; + + // Now add OCC specific data (for each OCC) + for (std::vector<Occ*>::iterator pOcc = iv_occArray.begin(); + (pOcc < iv_occArray.end()) && (index+16 < 4096); + pOcc++) + { + o_data[index++] = (*pOcc)->getInstance(); + o_data[index++] = (*pOcc)->getState(); + o_data[index++] = (*pOcc)->getRole(); + o_data[index++] = (*pOcc)->iv_masterCapable; + o_data[index++] = (*pOcc)->iv_commEstablished; + index += 3; // reserved for expansion + o_data[index++] = (*pOcc)->iv_failed; + o_data[index++] = (*pOcc)->needsReset(); + o_data[index++] = (*pOcc)->iv_resetReason; + o_data[index++] = (*pOcc)->iv_resetCount; + if ((*pOcc)->iv_lastPollValid) + { + memcpy(&o_data[index], (*pOcc)->iv_lastPollResponse, 4); + } + else + { + memset(&o_data[index], 0xFF, 4); + } + index += 4; + } + + o_length = index; + } + + + // Set default pstate table type and reset all OCCs to pick them up + errlHndl_t OccManager::_loadPstates(bool i_normalPstates) + { + errlHndl_t err = NULL; + + // Set default pstate table type + _setPstateTable(i_normalPstates); + + // Reset OCCs to pick up new tables (skip incrementing reset count) + TMGT_INF("_loadPstates: Resetting OCCs"); + err = _resetOccs(NULL, true); + + return err; + } + + uint8_t OccManager::getNumOccs() { return Singleton<OccManager>::instance()._getNumOccs(); @@ -1011,6 +1104,27 @@ namespace HTMGT return Singleton<OccManager>::instance()._occFailed(); } + void OccManager::getOccData(uint16_t & o_length, uint8_t *o_data) + { + Singleton<OccManager>::instance()._getOccData(o_length, o_data); + } + + errlHndl_t OccManager::loadPstates(bool i_normalPstates) + { + return Singleton<OccManager>::instance()._loadPstates(i_normalPstates); + } + + bool OccManager::isNormalPstate() + { + return Singleton<OccManager>::instance()._isNormalPstate(); + } + + void OccManager::setPstateTable(bool i_useNormal) + { + Singleton<OccManager>::instance()._setPstateTable(i_useNormal); + } + + } // end namespace diff --git a/src/usr/htmgt/htmgt_occ.H b/src/usr/htmgt/htmgt_occ.H index f91cfdb38..267da6896 100644 --- a/src/usr/htmgt/htmgt_occ.H +++ b/src/usr/htmgt/htmgt_occ.H @@ -499,6 +499,46 @@ namespace HTMGT /** + * @brief Collect FFDC debug data for HTMGT and OCCs + * + * @param[out] o_length Length of data returned in o_data + * @param[out] o_data Buffer of 256 bytes where data will + * be copied + */ + static void getOccData(uint16_t & o_length, uint8_t *o_data); + + + /** + * @brief Load specified pstate tables for all OCCs. + * This will reset all OCCs so they pick up the new + * tables. + * + * @param[in] i_normalPstates true to generate normal pstate tables + * false to generate mfg pstate tables + * + * @return NULL on success, else error handle + */ + static errlHndl_t loadPstates(bool i_normalPstates); + + + /** + * @brief Determine if normal pstate tables should be used + * + * @return true if normal pstates should be used + */ + static bool isNormalPstate(); + + + /** + * @brief Determine if normal pstate tables should be used + * + * @param[in] i_useNormal Set to true if normal pstate table + * should be used (vs MFG table) + */ + static void setPstateTable(bool i_useNormal); + + + /** * @brief Update error log with safe mode callouts and set * attribute indicating system is in safe mode. * @@ -524,6 +564,8 @@ namespace HTMGT occStateId iv_state; occStateId iv_targetState; uint8_t iv_resetCount; + bool iv_normalPstateTables; + /** * @brief SRC that caused system to enter safe mode @@ -582,8 +624,13 @@ namespace HTMGT void _waitForOccCheckpoint(); - /** See resetOccs() above */ - errlHndl_t _resetOccs(TARGETING::Target * i_failedOccTarget); + /* See resetOccs() above */ + /* @param[in] i_skipCountIncrement true will prevent incrementing + * the system reset count (used in loadPstate) + * false (default) will increment counts as normal + */ + errlHndl_t _resetOccs(TARGETING::Target * i_failedOccTarget, + bool i_skipCountIncrement = false); /** See sendOccPoll() above */ errlHndl_t @@ -599,6 +646,25 @@ namespace HTMGT /** See occFailed() above */ bool _occFailed(); + + /** See getOccData() above */ + void _getOccData(uint16_t & o_length, uint8_t *o_data); + + /** See loadPstates() above */ + errlHndl_t _loadPstates(bool i_normalPstates); + + /** See isNormalPstate() above */ + bool _isNormalPstate() + { + return(true == iv_normalPstateTables); + }; + + /** See setPstateTable() above */ + void _setPstateTable(bool i_useNormal) + { + iv_normalPstateTables = i_useNormal; + }; + }; typedef Singleton<OccManager> occMgr; diff --git a/src/usr/htmgt/htmgt_occcmd.C b/src/usr/htmgt/htmgt_occcmd.C index f5b9726a0..3752bdd92 100644 --- a/src/usr/htmgt/htmgt_occcmd.C +++ b/src/usr/htmgt/htmgt_occcmd.C @@ -811,20 +811,23 @@ namespace HTMGT // TODO RTC 124739 - HB elogs are only 4K } + TMGT_BIN("OCC Exception Data (up to 64 bytes)", + sramRspPtr, std::min(exceptionLength,(uint32_t)64)); /*@ * @errortype * @reasoncode HTMGT_RC_INTERNAL_ERROR * @moduleid HTMGT_MOD_HANLDE_OCC_EXCEPTION - * @userdata1[0-15] rsp status - * @userdata1[16-31] exception data length - * @userdata2[0-15] OCC instance + * @userdata1[0-31] rsp status + * @userdata1[32-63] exception data length + * @userdata2[0-31] OCC instance + * @userdata2[32-63] exception data * @devdesc OCC reported exception */ errlHndl_t l_excErr = NULL; bldErrLog(l_excErr, HTMGT_MOD_HANLDE_OCC_EXCEPTION, (htmgtReasonCode)(OCCC_COMP_ID | exceptionType), exceptionType, exceptionDataLength, - iv_Occ->iv_instance, 0, + iv_Occ->iv_instance, UINT32_GET(&sramRspPtr[5]), ERRORLOG::ERRL_SEV_UNRECOVERABLE); l_excErr->addFFDC(OCCC_COMP_ID, sramRspPtr, diff --git a/src/usr/htmgt/htmgt_utility.C b/src/usr/htmgt/htmgt_utility.C index 8125a7567..e880d5a0c 100644 --- a/src/usr/htmgt/htmgt_utility.C +++ b/src/usr/htmgt/htmgt_utility.C @@ -106,6 +106,7 @@ namespace HTMGT {OCC_CMD_CLEAR_ERROR_LOG, "CLEAR_ELOG"}, {OCC_CMD_SET_STATE, "SET_STATE"}, {OCC_CMD_SETUP_CFG_DATA, "SET_CFG_DATA"}, + {OCC_CMD_SET_POWER_CAP, "SET_POWER_CAP"}, {OCC_CMD_RESET_PREP, "RESET_PREP"}, {OCC_CMD_GET_FIELD_DEBUG_DATA, "GET_FIELD_DEBUG_DATA"}, // OCC_CMD_END_OF_TABLE should be the last entry diff --git a/src/usr/htmgt/htmgt_utility.H b/src/usr/htmgt/htmgt_utility.H index 3b1c217d6..ab7c4f6e0 100644 --- a/src/usr/htmgt/htmgt_utility.H +++ b/src/usr/htmgt/htmgt_utility.H @@ -49,7 +49,7 @@ #define TMGT_BIN( _fmt_, _args_...) \ TRACFBIN( g_trac_htmgt, _fmt_, ##_args_ ) -#ifndef __HOSTBOOT_RUNTIME +#if defined(CONFIG_CONSOLE) && !defined(__HOSTBOOT_RUNTIME) #define TMGT_CONSOLE( _fmt_, _args_...) \ CONSOLE::displayf( HTMGT_COMP_NAME, _fmt_, ##_args_ ) #else @@ -119,6 +119,12 @@ namespace HTMGT // 0xE0-0xEF are reserved for OCC Exceptions }; + enum htmgtPassThruCmds + { + PASSTHRU_OCC_STATUS = 0x01, + PASSTHRU_GENERATE_MFG_PSTATE = 0x81, + PASSTHRU_LOAD_PSTATE = 0x82 + }; /** * @brief Create/Build an Error log and add HTMGT component trace diff --git a/src/usr/htmgt/makefile b/src/usr/htmgt/makefile index 174f207a1..81f6b1196 100644 --- a/src/usr/htmgt/makefile +++ b/src/usr/htmgt/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2014 +# Contributors Listed Below - COPYRIGHT 2014,2015 # [+] International Business Machines Corp. # # @@ -25,21 +25,13 @@ ROOTPATH = ../../.. MODULE = htmgt -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp -EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include -EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/mc_config/mss_eff_config EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ -EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/pstates/pstates # objects common to hostboot and hbrt include htmgt_common.mk # objects unique to hostboot OBJS += htmgt_memthrottles.o -OBJS += genPstate.o SUBDIRS += test.d SUBDIRS += runtime.d diff --git a/src/usr/htmgt/runtime/makefile b/src/usr/htmgt/runtime/makefile index e996c938e..0a512ec6f 100644 --- a/src/usr/htmgt/runtime/makefile +++ b/src/usr/htmgt/runtime/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2014 +# Contributors Listed Below - COPYRIGHT 2014,2015 # [+] International Business Machines Corp. # # @@ -28,7 +28,7 @@ HOSTBOOT_RUNTIME = 1 ROOTPATH = ../../../.. MODULE = htmgt_rt -#include common ojects between hostboot and runtime hostboot +#include common objects between hostboot and hostboot runtime include ../htmgt_common.mk #include unique object modules diff --git a/src/usr/htmgt/test/pstatetest.H b/src/usr/htmgt/test/pstatetest.H index 1255b76a3..ed67f6bb6 100644 --- a/src/usr/htmgt/test/pstatetest.H +++ b/src/usr/htmgt/test/pstatetest.H @@ -89,12 +89,22 @@ class pstateTest: public CxxTest::TestSuite } } - l_errl = genPstateTables(); + // generate normal pstate tables + l_errl = genPstateTables(true); if( l_errl ) { errlCommit(l_errl,HTMGT_COMP_ID); - TS_FAIL("verifyPstate failed"); + TS_FAIL("verifyNormalPstate failed"); + } + + // generate mfg pstate tables + l_errl = genPstateTables(false); + + if( l_errl ) + { + errlCommit(l_errl,HTMGT_COMP_ID); + TS_FAIL("verifyMfgPstate failed"); } // TODO RTC 123180 check eyecatcher in pstate table diff --git a/src/usr/hwpf/hwp/occ/runtime/rt_occ.C b/src/usr/hwpf/hwp/occ/runtime/rt_occ.C index 6d3407677..cb68f46f6 100644 --- a/src/usr/hwpf/hwp/occ/runtime/rt_occ.C +++ b/src/usr/hwpf/hwp/occ/runtime/rt_occ.C @@ -140,6 +140,39 @@ namespace RT_OCC //------------------------------------------------------------------------ + int htmgt_pass_thru (uint16_t i_cmdLength, + uint8_t * i_cmdData, + uint16_t * o_rspLength, + uint8_t * o_rspData) + { + int rc = 0; +#ifdef CONFIG_HTMGT + errlHndl_t err = HTMGT::passThruCommand(i_cmdLength, i_cmdData, + *o_rspLength, o_rspData); + if (err) + { + rc = err->reasonCode(); + if (0 == rc) + { + // If there was a failure, be sure to return non-zero status + rc = -1; + } + if ((i_cmdLength > 0) && (NULL != i_cmdData)) + { + TRACFCOMP (g_fapiTd,ERR_MRK"htmgt_pass_thru: command 0x%02X" + " (%d bytes) failed with rc=0x%04X", + i_cmdData[0], i_cmdLength, err->reasonCode()); + } + errlCommit (err, HWPF_COMP_ID); + } +#else + o_rspLength = 0; +#endif + return rc; + } + + //------------------------------------------------------------------------ + int executeLoadOCC(uint64_t i_homer_addr_phys, uint64_t i_homer_addr_va, uint64_t i_common_addr_phys, @@ -427,6 +460,7 @@ namespace RT_OCC rt_intf->process_occ_error = &process_occ_error; rt_intf->process_occ_reset = &process_occ_reset; rt_intf->enable_occ_actuation = &enable_occ_actuation; + rt_intf->mfg_htmgt_pass_thru = &htmgt_pass_thru; // If we already loaded OCC during the IPL we need to fix up // the virtual address because we're now not using virtual diff --git a/src/usr/hwpf/hwp/pstates/makefile b/src/usr/hwpf/hwp/pstates/makefile index dbfe05529..ef68862cf 100644 --- a/src/usr/hwpf/hwp/pstates/makefile +++ b/src/usr/hwpf/hwp/pstates/makefile @@ -27,39 +27,11 @@ ROOTPATH = ../../../../.. MODULE = pstates -## support for Targeting and fapi -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/initservice +SUBDIRS += runtime.d -## pointer to common HWP files -EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include +# objects common to hostboot and hbrt +include pstates_common.mk -## NOTE: add the base istep dir here. -##@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/@istepname -EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/pstates -EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe -## Include sub dirs -## NOTE: add a new EXTRAINCDIR when you add a new HWP -##@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/??? -EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/pstates/pstates -EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/ - - -## NOTE: add new object files when you add a new HWP -OBJS += gpstCheckByte.o -OBJS += lab_pstates.o -OBJS += p8_build_pstate_datablock.o -OBJS += proc_get_voltage.o -OBJS += pstates.o -OBJS += pstate_tables.o -OBJS += freqVoltageSvc.o -OBJS += proc_set_max_pstate.o - -## NOTE: add a new directory onto the vpaths when you add a new HWP -##@ VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/??? -VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/pstates/pstates +# objects unique to hostboot include ${ROOTPATH}/config.mk diff --git a/src/usr/hwpf/hwp/pstates/pstates_common.mk b/src/usr/hwpf/hwp/pstates/pstates_common.mk new file mode 100644 index 000000000..bded93134 --- /dev/null +++ b/src/usr/hwpf/hwp/pstates/pstates_common.mk @@ -0,0 +1,59 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/hwpf/hwp/pstates/pstates_common.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2013,2015 +# [+] 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 + +## support for Targeting and fapi +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/initservice + +## pointer to common HWP files +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include + +## NOTE: add the base istep dir here. +##@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/@istepname +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/pstates +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe +## Include sub dirs +## NOTE: add a new EXTRAINCDIR when you add a new HWP +##@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/??? +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/pstates/pstates +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/ + + +## NOTE: add new object files when you add a new HWP +OBJS += gpstCheckByte.o +OBJS += lab_pstates.o +OBJS += p8_build_pstate_datablock.o +OBJS += proc_get_voltage.o +OBJS += pstates.o +OBJS += pstate_tables.o +OBJS += freqVoltageSvc.o +OBJS += proc_set_max_pstate.o + +## NOTE: add a new directory onto the vpaths when you add a new HWP +##@ VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/??? +VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/pstates/pstates diff --git a/src/usr/hwpf/hwp/pstates/runtime/makefile b/src/usr/hwpf/hwp/pstates/runtime/makefile new file mode 100644 index 000000000..004996877 --- /dev/null +++ b/src/usr/hwpf/hwp/pstates/runtime/makefile @@ -0,0 +1,38 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/hwpf/hwp/pstates/runtime/makefile $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2015 +# [+] 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 + +HOSTBOOT_RUNTIME = 1 + +ROOTPATH = ../../../../../.. +VPATH += ../ + +MODULE = pstates_rt + +## Objects unique to HBRT + +## Objects common to HBRT and HB IPL +include ../pstates_common.mk + +include ${ROOTPATH}/config.mk diff --git a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml index 361d4d3c6..cad6fa13b 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml @@ -705,6 +705,18 @@ </attribute> <attribute> + <id>PSTATE_TABLE_MFG</id> + <description>HTMGT PSTATE data for mfg</description> + <simpleType> + <uint8_t></uint8_t> + <array>1904</array> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> +</attribute> + +<attribute> <id>OCC_CONTROL_DATA</id> <description>OCC operational data </description> diff --git a/src/usr/targeting/common/xmltohb/target_types_hb.xml b/src/usr/targeting/common/xmltohb/target_types_hb.xml index e26a257ce..c42b21897 100644 --- a/src/usr/targeting/common/xmltohb/target_types_hb.xml +++ b/src/usr/targeting/common/xmltohb/target_types_hb.xml @@ -210,6 +210,9 @@ <attribute> <id>PSTATE_TABLE</id> </attribute> + <attribute> + <id>PSTATE_TABLE_MFG</id> + </attribute> <attribute><id>IPMI_SENSORS</id></attribute> </targetTypeExtension> |