From 47a4947613f8e39e6bb569844b712a04586416f5 Mon Sep 17 00:00:00 2001 From: Sheldon Bailey Date: Mon, 23 Oct 2017 10:34:01 -0500 Subject: HTMGT:OP910:No change in processor speed turbo or non-turbo Witherspoon Change-Id: I06eb243497a56302ff1aed86a844729da3407d09 CQ:SW400066 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48752 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Martha Broyles Tested-by: FSP CI Jenkins Reviewed-by: Christopher J. Cain Reviewed-by: William G. Hoffa --- src/usr/htmgt/htmgt_cfgdata.C | 164 ++++++++++++++------- .../common/xmltohb/attribute_types_hb.xml | 4 + 2 files changed, 115 insertions(+), 53 deletions(-) diff --git a/src/usr/htmgt/htmgt_cfgdata.C b/src/usr/htmgt/htmgt_cfgdata.C index cc1e724c5..71dbc9dfe 100644 --- a/src/usr/htmgt/htmgt_cfgdata.C +++ b/src/usr/htmgt/htmgt_cfgdata.C @@ -1148,6 +1148,50 @@ void getGPUConfigMessageData(const TargetHandle_t i_occ, } // end getGPUConfigMessageData() +// Determine if the BMC will allow turbo to be used. +// Returns true if BMC suppoted and turbo is allowed. +// true if BMC Unsupported +// false if supported and not allowed. +// else false +bool bmcAllowsTurbo(Target* i_sys) +{ + bool turboAllowed = true; + + uint32_t sensorNum = UTIL::getSensorNumber(i_sys, + SENSOR_NAME_TURBO_ALLOWED); + // VALID IPMI sensors are 0-0xFE + if (sensorNum != 0xFF) + { + // Check if turbo frequency is allowed on BMC + SENSOR::getSensorReadingData turboSupportData; + SENSOR::SensorBase turboSensor(SENSOR_NAME_TURBO_ALLOWED, i_sys); + errlHndl_t err = turboSensor.readSensorData(turboSupportData); + + if (NULL == err) + { + // 0x02 == Asserted bit (turbo frequency is allowed) + if ((turboSupportData.event_status & 0x02) == 0x02) + { + TMGT_INF("bmcAllowsTurbo: turbo is allowed"); + } + else + { + turboAllowed = false; + } + } + else + { + // error reading sensor, assume turbo is allowed + TMGT_ERR("bmcAllowsTurbo: unable to read turbo support sensor " + " from BMC, rc=0x%04X", + err->reasonCode()); + delete err; + } + } + // else, sensor not supported on this platform so turbo is allowed + + return turboAllowed; +} void getFrequencyPointMessageData(uint8_t* o_data, @@ -1176,6 +1220,7 @@ void getFrequencyPointMessageData(uint8_t* o_data, check_wof_support(turbo, ultra); if (turbo == 0) { + // If turbo not supported, send nominal for turbo // and reason code for ultra-turbo (no WOF support) turbo = nominal; @@ -1321,73 +1366,86 @@ bool check_wof_support(uint16_t & o_turbo, uint16_t & o_ultra) targetService().getTopLevelTarget(sys); assert(sys != nullptr); + // Check if MRW allows turbo uint8_t turboAllowed = sys->getAttr(); if (turboAllowed) { - o_turbo = sys->getAttr(); + const uint16_t nominal = sys->getAttr(); - //Ultra Turbo Frequency in MHz - ATTR_SYSTEM_WOF_DISABLE_type wofSupported; - if (!sys->tryGetAttr(wofSupported)) - { - o_ultra = WOF_SYSTEM_DISABLED; - G_wofSupported = false; - } - else + // Check if BMC allows turbo + if (bmcAllowsTurbo(sys)) { - // Loop through all functional OCCs - uint8_t largest_wof_reset_count = 0; - uint8_t occ_instance = 0; - std::vector occList = OccManager::getOccArray(); - for ( const auto & occ : occList ) - { - if (occ->wofResetCount() > largest_wof_reset_count) - { - occ_instance = occ->getInstance(); - largest_wof_reset_count = occ->wofResetCount(); - } - } - const uint16_t nominal = sys->getAttr(); - const uint16_t tempUt = sys->getAttr(); - if( wofSupported == SYSTEM_WOF_DISABLE_ON ) + o_turbo = sys->getAttr(); + + //Ultra Turbo Frequency in MHz + ATTR_SYSTEM_WOF_DISABLE_type wofSupported; + if (!sys->tryGetAttr(wofSupported)) { - TMGT_INF("System does not support WOF"); - G_wofSupported = false; o_ultra = WOF_SYSTEM_DISABLED; - } - else if( tempUt == 0 ) - { - TMGT_INF("Missing Ultra Turbo VPD point. WOF disabled."); - G_wofSupported = false; - o_ultra = WOF_MISSING_ULTRA_TURBO; - } - else if( largest_wof_reset_count >= WOF_RESET_COUNT_THRESHOLD ) - { - TMGT_INF("WOF reset count reached for OCC%d. WOF disabled.", - occ_instance); G_wofSupported = false; - o_ultra = WOF_RESET_COUNT_REACHED; - } - else if( o_turbo <= nominal ) - { - TMGT_INF("Turbo (%d) < nominal (%d). WOF disabled.", - o_turbo, nominal); - G_wofSupported = false; - o_ultra = WOF_UNSUPPORTED_FREQ; - } - else if( tempUt <= o_turbo ) - { - TMGT_INF("Ultra Turbo (%d) < Turbo (%d). WOF disabled.", - tempUt, o_turbo); - G_wofSupported = false; - o_ultra = WOF_UNSUPPORTED_FREQ; } else { - o_ultra = tempUt; + // Loop through all functional OCCs + uint8_t largest_wof_reset_count = 0; + uint8_t occ_instance = 0; + std::vector occList = OccManager::getOccArray(); + for ( const auto & occ : occList ) + { + if (occ->wofResetCount() > largest_wof_reset_count) + { + occ_instance = occ->getInstance(); + largest_wof_reset_count = occ->wofResetCount(); + } + } + const uint16_t tempUt=sys->getAttr(); + if( wofSupported == SYSTEM_WOF_DISABLE_ON ) + { + TMGT_INF("System does not support WOF"); + G_wofSupported = false; + o_ultra = WOF_SYSTEM_DISABLED; + } + else if( tempUt == 0 ) + { + TMGT_INF("Missing Ultra Turbo VPD point. WOF disabled."); + G_wofSupported = false; + o_ultra = WOF_MISSING_ULTRA_TURBO; + } + else if( largest_wof_reset_count >= WOF_RESET_COUNT_THRESHOLD ) + { + TMGT_INF("WOF reset count reached for OCC%d. WOF disabled.", + occ_instance); + G_wofSupported = false; + o_ultra = WOF_RESET_COUNT_REACHED; + } + else if( o_turbo <= nominal ) + { + TMGT_INF("Turbo (%d) < nominal (%d). WOF disabled.", + o_turbo, nominal); + G_wofSupported = false; + o_ultra = WOF_UNSUPPORTED_FREQ; + } + else if( tempUt <= o_turbo ) + { + TMGT_INF("Ultra Turbo (%d) < Turbo (%d). WOF disabled.", + tempUt, o_turbo); + G_wofSupported = false; + o_ultra = WOF_UNSUPPORTED_FREQ; + } + else + { + o_ultra = tempUt; + } } } + else + { + TMGT_INF("getFrequencyPoint: Turbo/WOF not allowed by BMC"); + TMGT_CONSOLE("Turbo frequency not allowed due to BMC limit"); + o_turbo = nominal; + G_wofSupported = false; + } if( !G_wofSupported ) { diff --git a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml index b8780cbd3..41dede5d6 100755 --- a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml @@ -556,6 +556,10 @@ REDUNDANT_PS_POLICY 0xCA22 + + TURBO_ALLOWED + 0xCB03 + TPM_REQUIRED 0xCC03 -- cgit v1.2.1