diff options
-rw-r--r-- | src/usr/isteps/hbToHwsvVoltageMsg.C (renamed from src/usr/isteps/istep13/hbVddrMsg.C) | 516 | ||||
-rw-r--r-- | src/usr/isteps/hbToHwsvVoltageMsg.H (renamed from src/usr/isteps/istep13/hbVddrMsg.H) | 98 | ||||
-rw-r--r-- | src/usr/isteps/istep08/call_host_set_voltages.C | 34 | ||||
-rw-r--r-- | src/usr/isteps/istep08/makefile | 1 | ||||
-rw-r--r-- | src/usr/isteps/istep13/makefile | 2 | ||||
-rw-r--r-- | src/usr/isteps/makefile | 1 | ||||
-rw-r--r-- | src/usr/isteps/openpower_vddr.C (renamed from src/usr/isteps/istep13/openpower_vddr.C) | 2 | ||||
-rw-r--r-- | src/usr/isteps/platform_vddr.H (renamed from src/usr/isteps/istep13/platform_vddr.H) | 2 | ||||
-rwxr-xr-x | src/usr/targeting/common/genHwsvMrwXml.pl | 152 |
9 files changed, 598 insertions, 210 deletions
diff --git a/src/usr/isteps/istep13/hbVddrMsg.C b/src/usr/isteps/hbToHwsvVoltageMsg.C index eb747925d..ab9d47029 100644 --- a/src/usr/isteps/istep13/hbVddrMsg.C +++ b/src/usr/isteps/hbToHwsvVoltageMsg.C @@ -1,12 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/isteps/istep13/hbVddrMsg.C $ */ +/* $Source: src/usr/isteps/hbToHwsvVoltageMsg.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2012,2016 */ -/* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -34,13 +33,11 @@ #include <trace/trace.H> #include <mbox/mbox_queues.H> #include <mbox/mboxif.H> - -#include "hbVddrMsg.H" #include <initservice/initserviceif.H> #include <pnor/pnorif.H> -#include "platform_vddr.H" -#include <istepHelperFuncs.H> #include <targeting/common/target.H> +#include "hbToHwsvVoltageMsg.H" +#include "istepHelperFuncs.H" using namespace ERRORLOG; @@ -48,25 +45,25 @@ using namespace ERRORLOG; using namespace TARGETING; // Trace definition -trace_desc_t* g_trac_volt = NULL; -TRAC_INIT(&g_trac_volt, "HB_VDDR", 1024); +trace_desc_t* g_trac_volt = nullptr; +TRAC_INIT(&g_trac_volt, "HB_VOLT", 1024); /////////////////////////////////////////////////////////////////////////////// -// HBVddrMsg::HBVddrMsg() +// HBToHwsvVoltageMsg::HBToHwsvVoltageMsg() /////////////////////////////////////////////////////////////////////////////// -HBVddrMsg::HBVddrMsg() +HBToHwsvVoltageMsg::HBToHwsvVoltageMsg() { - TRACDCOMP( g_trac_volt, ENTER_MRK "HBVddrMsg::HBVddrMsg()" ); - TRACDCOMP( g_trac_volt, EXIT_MRK "HBVddrMsg::HBVddrMsg()" ); + TRACDCOMP( g_trac_volt, ENTER_MRK "HBToHwsvVoltageMsg::HBToHwsvVoltageMsg()" ); + TRACDCOMP( g_trac_volt, EXIT_MRK "HBToHwsvVoltageMsg::HBToHwsvVoltageMsg()" ); }; /////////////////////////////////////////////////////////////////////////////// -// HBVddrMsg::~HBVddrMsg() +// HBToHwsvVoltageMsg::~HBToHwsvVoltageMsg() /////////////////////////////////////////////////////////////////////////////// -HBVddrMsg::~HBVddrMsg() +HBToHwsvVoltageMsg::~HBToHwsvVoltageMsg() { - TRACDCOMP( g_trac_volt, ENTER_MRK "HBVddrMsg::~HBVddrMsg()" ); - TRACDCOMP( g_trac_volt, EXIT_MRK "HBVddrMsg::~HBVddrMsg()" ); + TRACDCOMP( g_trac_volt, ENTER_MRK "HBToHwsvVoltageMsg::~HBToHwsvVoltageMsg()" ); + TRACDCOMP( g_trac_volt, EXIT_MRK "HBToHwsvVoltageMsg::~HBToHwsvVoltageMsg()" ); }; @@ -75,8 +72,8 @@ HBVddrMsg::~HBVddrMsg() /////////////////////////////////////////////////////////////////////////////// bool compareVids( - HBVddrMsg::hwsvPowrMemVoltDomainRequest_t i_lhs, - HBVddrMsg::hwsvPowrMemVoltDomainRequest_t i_rhs) + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t i_lhs, + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t i_rhs) { bool lhsLogicallyBeforeRhs = (i_lhs.domain < i_rhs.domain); @@ -90,12 +87,33 @@ bool compareVids( } /////////////////////////////////////////////////////////////////////////////// +// compareSequenceOrder +/////////////////////////////////////////////////////////////////////////////// +bool compareSequenceOrder( + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t i_lhs, + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t i_rhs) +{ + // Sequencing order is VDN->VDD->VCS + // true means lhs should be ordered before rhs + // + // if both values are the same, preserve order: true + // if lhs is VDN, we know it goes first, order stays the same: true + // if rhs is VCS, we know it goes last, order stays the same: true + // else, lhs needs to be swapped with rhs + return ( (i_lhs.domainId == i_rhs.domainId) || + (i_lhs.domainId == HBToHwsvVoltageMsg::VOLTAGE_DOMAIN_NEST_VDN) || + (i_rhs.domainId == HBToHwsvVoltageMsg::VOLTAGE_DOMAIN_NEST_VCS) ); + +} + + +/////////////////////////////////////////////////////////////////////////////// // areVidsEqual /////////////////////////////////////////////////////////////////////////////// bool areVidsEqual( - HBVddrMsg::hwsvPowrMemVoltDomainRequest_t i_lhs, - HBVddrMsg::hwsvPowrMemVoltDomainRequest_t i_rhs) + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t i_lhs, + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t i_rhs) { return( ( i_lhs.domain == i_rhs.domain) @@ -103,16 +121,57 @@ bool areVidsEqual( == static_cast<uint16_t>(i_rhs.domainId)) ); } + + /////////////////////////////////////////////////////////////////////////////// // isUnusedVoltageDomain /////////////////////////////////////////////////////////////////////////////// bool isUnusedVoltageDomain( - HBVddrMsg::hwsvPowrMemVoltDomainRequest_t i_vid) + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t i_vid) { return (!i_vid.voltageMillivolts); } + + + +/////////////////////////////////////////////////////////////////////////////// +// removeExtraRequests +/////////////////////////////////////////////////////////////////////////////// +void removeExtraRequests( HBToHwsvVoltageMsg::RequestContainer & io_requests, + HBToHwsvVoltageMsg::VOLT_MSG_TYPE i_requestType, + size_t i_targetListSize ) +{ + if( i_targetListSize > 1 ) + { + // Take out the duplicate records in io_requests by first + // sorting and then removing the duplicates + std::sort(io_requests.begin(), io_requests.end(), compareVids); + std::vector<HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t>::iterator + pInvalidEntries = std:: unique( + io_requests.begin(), + io_requests.end(), + areVidsEqual); + io_requests.erase(pInvalidEntries, io_requests.end()); + } + + + if( ( (i_requestType == HBToHwsvVoltageMsg::HB_VOLT_ENABLE) || + (i_requestType == HBToHwsvVoltageMsg::HB_VOLT_POST_DRAM_INIT_ENABLE) ) + && (i_targetListSize > 1 ) ) + { + // Inhibit sending any request to turn on a domain with no voltage. + // When disabling we don't need to do this because the voltage is + // ignored. + io_requests.erase( + std::remove_if(io_requests.begin(), io_requests.end(), + isUnusedVoltageDomain),io_requests.end()); + } + +} + + //****************************************************************************** // addMemoryVoltageDomains (templated) //****************************************************************************** @@ -122,13 +181,13 @@ template< const ATTRIBUTE_ID VOLTAGE_ATTR_STATIC, const ATTRIBUTE_ID VOLTAGE_ATTR_DYNAMIC, const ATTRIBUTE_ID VOLTAGE_DOMAIN_ID_ATTR > -void HBVddrMsg::addMemoryVoltageDomains( +void HBToHwsvVoltageMsg::addMemoryVoltageDomains( const TARGETING::Target* const i_pMcbist, - HBVddrMsg::RequestContainer& io_domains) const + HBToHwsvVoltageMsg::RequestContainer& io_domains) const { assert( - (i_pMcbist != NULL), - "HBVddrMsg::addMemoryVoltageDomains: Code bug! Caller passed NULL " + (i_pMcbist != nullptr), + "HBToHwsvVoltageMsg::addMemoryVoltageDomains: Code bug! Caller passed NULL " "MCBIST target handle."); assert( @@ -136,7 +195,7 @@ void HBVddrMsg::addMemoryVoltageDomains( == TARGETING::CLASS_UNIT) && ( i_pMcbist->getAttr<TARGETING::ATTR_TYPE>() == TARGETING::TYPE_MCBIST)), - "HBVddrMsg::addMemoryVoltageDomains: Code bug! Caller passed non-" + "HBToHwsvVoltageMsg::addMemoryVoltageDomains: Code bug! Caller passed non-" "MCBIST target handle of class = 0x%08X and type of 0x%08X.", i_pMcbist->getAttr<TARGETING::ATTR_CLASS>(), i_pMcbist->getAttr<TARGETING::ATTR_TYPE>()); @@ -146,7 +205,7 @@ void HBVddrMsg::addMemoryVoltageDomains( assert( (pSysTarget != nullptr), - "HBVddrMsg::addMemoryVoltageDomains: Code bug! System target was " + "HBToHwsvVoltageMsg::addMemoryVoltageDomains: Code bug! System target was " "NULL."); typename AttributeTraits< MSS_DOMAIN_PROGRAM >::Type @@ -154,29 +213,29 @@ void HBVddrMsg::addMemoryVoltageDomains( // Initialized by constructor to invalid defaults - HBVddrMsg::hwsvPowrMemVoltDomainRequest_t entry; + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t entry; switch(VOLTAGE_DOMAIN_ID_ATTR) { case TARGETING::ATTR_VDDR_ID: - entry.domain = MEM_VOLTAGE_DOMAIN_VDDR; + entry.domain = VOLTAGE_DOMAIN_MEM_VDDR; break; case TARGETING::ATTR_VCS_ID: - entry.domain = MEM_VOLTAGE_DOMAIN_VCS; + entry.domain = VOLTAGE_DOMAIN_MEM_VCS; break; case TARGETING::ATTR_VPP_ID: - entry.domain = MEM_VOLTAGE_DOMAIN_VPP; + entry.domain = VOLTAGE_DOMAIN_MEM_VPP; break; case TARGETING::ATTR_AVDD_ID: - entry.domain = MEM_VOLTAGE_DOMAIN_AVDD; + entry.domain = VOLTAGE_DOMAIN_MEM_AVDD; break; case TARGETING::ATTR_VDD_ID: - entry.domain = MEM_VOLTAGE_DOMAIN_VDD; + entry.domain = VOLTAGE_DOMAIN_MEM_VDD; break; default: assert( 0, - "HBVddrMsg::addMemoryVoltageDomains: Code Bug! Unsupported " + "HBToHwsvVoltageMsg::addMemoryVoltageDomains: Code Bug! Unsupported " "voltage domain of 0x%08X.", VOLTAGE_DOMAIN_ID_ATTR); break; @@ -211,14 +270,14 @@ void HBVddrMsg::addMemoryVoltageDomains( } /////////////////////////////////////////////////////////////////////////////// -// HBVddrMsg::createVddrData +// HBToHwsvVoltageMsg::createVddrData /////////////////////////////////////////////////////////////////////////////// -void HBVddrMsg::createVddrData( - VDDR_MSG_TYPE i_requestType, +void HBToHwsvVoltageMsg::createVddrData( + VOLT_MSG_TYPE i_requestType, RequestContainer& io_request) const { - TRACFCOMP( g_trac_volt, ENTER_MRK "HBVddrMsg::createVddrData" ); + TRACFCOMP( g_trac_volt, ENTER_MRK "HBToHwsvVoltageMsg::createVddrData" ); // Go through all the mcbist targets and gather their domains, domain // specific IDs, and domain specific voltages @@ -233,7 +292,7 @@ void HBVddrMsg::createVddrData( for (const auto & pMcbist: l_mcbistTargetList) { - if(i_requestType == HB_VDDR_ENABLE) + if(i_requestType == HB_VOLT_ENABLE) { (void)addMemoryVoltageDomains< TARGETING::ATTR_MSS_VDD_PROGRAM, @@ -277,115 +336,79 @@ void HBVddrMsg::createVddrData( io_request); } - if (l_mcbistTargetList.size() > 1) - { - // Take out the duplicate records in io_request by first - // sorting and then removing the duplicates - std::sort(io_request.begin(), io_request.end(), compareVids); - std::vector<hwsvPowrMemVoltDomainRequest_t>::iterator - pInvalidEntries = std::unique( - io_request.begin(), - io_request.end(), - areVidsEqual); - io_request.erase(pInvalidEntries,io_request.end()); - } - - if( ( (i_requestType == HB_VDDR_ENABLE) || - (i_requestType == HB_VDDR_POST_DRAM_INIT_ENABLE) ) - && (!l_mcbistTargetList.empty()) ) - { - // Inhibit sending any request to turn on a domain with no voltage. - // When disabling we don't need to do this because the voltage is - // ignored. - io_request.erase( - std::remove_if(io_request.begin(), io_request.end(), - isUnusedVoltageDomain),io_request.end()); - } + // Remove duplicate records and requests containing invalid voltages + removeExtraRequests( io_request, + i_requestType, + l_mcbistTargetList.size()); } while(0); - TRACFCOMP( g_trac_volt, EXIT_MRK "HBVddrMsg::createVddrData" ); + TRACFCOMP( g_trac_volt, EXIT_MRK "HBToHwsvVoltageMsg::createVddrData" ); return; } + /////////////////////////////////////////////////////////////////////////////// -// HBVddrMsg::sendMsg +// HBToHwsvVoltageMsg::sendRequestData /////////////////////////////////////////////////////////////////////////////// -errlHndl_t HBVddrMsg::sendMsg(VDDR_MSG_TYPE i_msgType) const +errlHndl_t HBToHwsvVoltageMsg::sendRequestData( RequestContainer & i_requests, + VOLT_MSG_TYPE i_msgType ) const { - errlHndl_t l_err = NULL; - TRACFCOMP(g_trac_volt, ENTER_MRK - "hbVddrMsg::sendMsg msg_type =0x%08X",i_msgType); + errlHndl_t l_err = nullptr; do { - RequestContainer l_request; - if (TARGETING::is_vpo()) - { - TRACFCOMP(g_trac_volt, - "hbVddrMsg::sendMsg skipped because of VPO environment"); - break; - } + size_t l_numRequests = i_requests.size(); + TRACDCOMP(g_trac_volt, + "sendRequestData::l_numRequests = %d", + l_numRequests); + - if ( ! ( (i_msgType == HB_VDDR_ENABLE) || - (i_msgType == HB_VDDR_DISABLE) || - (i_msgType == HB_VDDR_POST_DRAM_INIT_ENABLE) ) ) + // Skip sending message if VPO + if( TARGETING::is_vpo()) { - TRACFCOMP(g_trac_volt, ERR_MRK "hbVddrMsg::send msg with non-" - "valid msg type%08X",i_msgType); - /*@ - * @errortype - * @moduleid fapi::MOD_VDDR_SEND_MSG - * @reasoncode fapi::RC_INCORRECT_MSG_TYPE - * @userdata1 i_msgType - * @userdata2 0 - * - * @devdesc HB got an incorrect type message. HB did not - * provide the correct message type in the istep. - * Userdata1 shows the message type passed in - */ - createErrLog(l_err, fapi::MOD_VDDR_SEND_MSG, - fapi::RC_INCORRECT_MSG_TYPE, i_msgType); + TRACFCOMP( g_trac_volt, + "hbToHwsvVoltageMsg::sendRequestData skipped because of" + " VPO environment!" ); break; } - createVddrData(i_msgType, l_request); - size_t l_dataCount = l_request.size(); // Only send a message if there is data to send - // Skip sending message if VPO - if ( l_dataCount ) + if( l_numRequests ) { - uint32_t l_msgSize = l_dataCount * - sizeof(hwsvPowrMemVoltDomainRequest_t); + uint32_t l_msgSize = l_numRequests * + sizeof(hwsvPowrMemVoltDomainRequest_t); // Create the message to send to HWSV - msg_t* l_msg = msg_allocate(); + msg_t * l_msg = msg_allocate(); l_msg->type = i_msgType; l_msg->data[0] = 0; l_msg->data[1] = l_msgSize; - TRACFCOMP(g_trac_volt, INFO_MRK "hbVddrMsg::l_dataCount=%d, " + TRACDCOMP(g_trac_volt, INFO_MRK "hbToHwsvVoltageMsg::l_numRequests=%d, " "l_msgSize=%d", - l_dataCount, l_msgSize); + l_numRequests, l_msgSize); void* l_data = malloc(l_msgSize); hwsvPowrMemVoltDomainRequest_t* l_ptr = reinterpret_cast<hwsvPowrMemVoltDomainRequest_t*>(l_data); - for (size_t j = 0; j<l_dataCount; ++j) + for (size_t j = 0; j<l_numRequests; ++j) { - l_ptr->domain=l_request.at(j).domain; - l_ptr->domainId=l_request.at(j).domainId; - l_ptr->voltageMillivolts=l_request.at(j).voltageMillivolts; + l_ptr->domain = i_requests.at(j).domain; + l_ptr->domainId = i_requests.at(j).domainId; + l_ptr->voltageMillivolts = i_requests.at(j).voltageMillivolts; - TRACFCOMP(g_trac_volt, ENTER_MRK "hbVddrMsg::sendMsg " + TRACFCOMP(g_trac_volt, ENTER_MRK "hbToHwsvVoltageMsg::sendRequestData " "Voltage domain type = 0x%08X, " "Voltage domain ID = 0x%04X, " "Voltage (mV) = %d, index = %d", l_ptr->domain, - l_ptr->domainId, l_ptr->voltageMillivolts,j); + l_ptr->domainId, + l_ptr->voltageMillivolts, + j); l_ptr++; } @@ -396,20 +419,74 @@ errlHndl_t HBVddrMsg::sendMsg(VDDR_MSG_TYPE i_msgType) const if (l_err) { TRACFCOMP(g_trac_volt, - ERR_MRK "Failed sending VDDR message to FSP"); + ERR_MRK "Failed sending voltage message to FSP"); } else { - l_err=processMsg(l_msg); + l_err = processMsg(l_msg); } - // If sendrecv returns error then it may not have freed the - // extra_data, else need to free the response message extra_data - free(l_msg->extra_data); - l_msg->extra_data = NULL; + // If there is still data in l_msg->extra_data + if( l_msg->extra_data ) + { + free(l_msg->extra_data); + l_msg->extra_data = nullptr; - msg_free(l_msg); - l_msg = NULL; + msg_free(l_msg); + l_msg = nullptr; + } + } + } while( 0 ); + + return l_err; +} + + +/////////////////////////////////////////////////////////////////////////////// +// HBToHwsvVoltageMsg::sendMsg +/////////////////////////////////////////////////////////////////////////////// +errlHndl_t HBToHwsvVoltageMsg::sendMsg(VOLT_MSG_TYPE i_msgType) const +{ + errlHndl_t l_err = nullptr; + + TRACFCOMP(g_trac_volt, ENTER_MRK + "hbToHwsvVoltageMsg::sendMsg msg_type =0x%08X",i_msgType); + + do + { + RequestContainer l_request; + + if ( ! ( (i_msgType == HB_VOLT_ENABLE) || + (i_msgType == HB_VOLT_DISABLE) || + (i_msgType == HB_VOLT_POST_DRAM_INIT_ENABLE) ) ) + { + TRACFCOMP(g_trac_volt, ERR_MRK "hbToHwsvVoltageMsg::send msg with non-" + "valid msg type%08X",i_msgType); + /*@ + * @errortype + * @moduleid fapi::MOD_VDDR_SEND_MSG + * @reasoncode fapi::RC_INCORRECT_MSG_TYPE + * @userdata1 i_msgType + * @userdata2 0 + * + * @devdesc HB got an incorrect type message. HB did not + * provide the correct message type in the istep. + * Userdata1 shows the message type passed in + */ + createErrLog(l_err, fapi::MOD_VDDR_SEND_MSG, + fapi::RC_INCORRECT_MSG_TYPE, i_msgType); + break; + } + createVddrData(i_msgType, l_request); + + // Send the request data + l_err = sendRequestData( l_request, i_msgType ); + + if( l_err ) + { + TRACFCOMP( g_trac_volt, "hbToHwsvVoltageMsg::sendMsg" + "An error occurred when sending request data" ); + break; } } while(0); @@ -439,7 +516,7 @@ void calloutMcbistChildDimms( errlHndl_t & io_errl, for (const auto & l_dimm : l_dimmList) { TRACFCOMP( g_trac_volt, INFO_MRK - "HBVddrMsg::calloutMcbistChildDimms Target HUID = 0x%08X" , + "HBToHwsvVoltageMsg::calloutMcbistChildDimms Target HUID = 0x%08X" , TARGETING::get_huid(l_dimm) ); io_errl->addHwCallout( l_dimm, @@ -458,26 +535,26 @@ void calloutMcbistChildDimms( errlHndl_t & io_errl, } /////////////////////////////////////////////////////////////////////////////// -// HBVddrMsg::processVDDRmsg +// HBToHwsvVoltageMsg::processVOLTmsg /////////////////////////////////////////////////////////////////////////////// -errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const +errlHndl_t HBToHwsvVoltageMsg::processVOLTmsg(msg_t* i_recvMsg) const { - TRACFCOMP(g_trac_volt, ENTER_MRK "HBVddrMsg::processVDDRmsg"); - errlHndl_t l_errLog = NULL; + TRACFCOMP(g_trac_volt, ENTER_MRK "HBToHwsvVoltageMsg::processVOLTmsg"); + errlHndl_t l_errLog = nullptr; //check to see if an error occurred from the powr Enable/Disable functions //and is inside the message uint32_t l_msgSize = i_recvMsg->data[1]; uint16_t l_elementCount = l_msgSize/sizeof(hwsvPowrMemVoltDomainReply_t); - const uint8_t* l_extraData = NULL; + const uint8_t* l_extraData = nullptr; l_extraData=static_cast<uint8_t*>(i_recvMsg->extra_data); do{ - if (l_extraData==NULL) + if (l_extraData==nullptr) { //an error occurred in obtaining the extra data from the response msg TRACFCOMP( g_trac_volt, ERR_MRK - "HBVddrMsg::processVDDRmsg: l_extraData = NULL"); + "HBToHwsvVoltageMsg::processVOLTmsg: l_extraData = NULL"); //create an errorlog /*@ * @errortype @@ -495,11 +572,11 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const break; } - MEM_VOLTAGE_DOMAIN domain = MEM_VOLTAGE_DOMAIN_UNKNOWN; + VOLTAGE_DOMAIN domain = VOLTAGE_DOMAIN_UNKNOWN; TARGETING::ATTR_VDDR_ID_type l_domainId =0x0; uint32_t l_errPlid =0x0; - TRACFCOMP( g_trac_volt, INFO_MRK "HBVddrMsg::processVDDRmsg: " + TRACFCOMP( g_trac_volt, INFO_MRK "HBToHwsvVoltageMsg::processVOLTmsg: " "l_elementCount=%d, l_msgSize =%d", l_elementCount, l_msgSize); const hwsvPowrMemVoltDomainReply_t* l_ptr= @@ -511,12 +588,12 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const l_domainId = l_ptr->domainId; l_errPlid = l_ptr->plid; - TRACFCOMP( g_trac_volt, INFO_MRK "HBVddrMsg::processVDDRmsg: " + TRACFCOMP( g_trac_volt, INFO_MRK "HBToHwsvVoltageMsg::processVOLTmsg: " "domain = 0x%08X, l_domainId=0x%08X, l_errPlid=0x%08X", domain,l_domainId,l_errPlid); if (l_errPlid == 0x0) { - TRACFCOMP( g_trac_volt, INFO_MRK "HBVddrMsg::processVDDRmsg: " + TRACFCOMP( g_trac_volt, INFO_MRK "HBToHwsvVoltageMsg::processVOLTmsg: " "no plid error found for domain = 0x%08X, " "l_domainId=0x%08X", domain, l_domainId); } @@ -525,7 +602,7 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const //error occurred so break out of the loop and indicate //an error was present TRACFCOMP( g_trac_volt, ERR_MRK - "HBVddrMsg::processVDDRmsg: error occurred " + "HBToHwsvVoltageMsg::processVOLTmsg: error occurred " "on the powr function called in hwsv"); //create an errorlog /*@ @@ -560,23 +637,23 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const switch(domain) { // Add hw callouts for child DIMMs - case MEM_VOLTAGE_DOMAIN_VDDR: + case VOLTAGE_DOMAIN_MEM_VDDR: l_attr_domainId = pMcbist->getAttr< TARGETING::ATTR_VDDR_ID >(); break; - case MEM_VOLTAGE_DOMAIN_VCS: + case VOLTAGE_DOMAIN_MEM_VCS: l_attr_domainId = pMcbist->getAttr< TARGETING::ATTR_VCS_ID>(); break; - case MEM_VOLTAGE_DOMAIN_VPP: + case VOLTAGE_DOMAIN_MEM_VPP: l_attr_domainId = pMcbist->getAttr< TARGETING::ATTR_VPP_ID>(); break; - case MEM_VOLTAGE_DOMAIN_AVDD: + case VOLTAGE_DOMAIN_MEM_AVDD: l_attr_domainId = pMcbist->getAttr< TARGETING::ATTR_AVDD_ID>(); break; - case MEM_VOLTAGE_DOMAIN_VDD: + case VOLTAGE_DOMAIN_MEM_VDD: l_attr_domainId = pMcbist->getAttr< TARGETING::ATTR_VDD_ID>(); break; @@ -592,7 +669,7 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const if((l_domain_found) && ( l_attr_domainId == l_domainId )) { TRACFCOMP( g_trac_volt, INFO_MRK - "HBVddrMsg::processVDDRmsg MCBIST Target HUID = 0x%08X" + "HBToHwsvVoltageMsg::processVOLTmsg MCBIST Target HUID = 0x%08X" " matches failing domain 0x%08X and ID = 0x%08X", TARGETING::get_huid(pMcbist), domain, l_domainId ); @@ -607,17 +684,17 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const l_ptr++; } }while(0); - TRACFCOMP(g_trac_volt, EXIT_MRK "HBVddrMsg::processVDDRmsg"); + TRACFCOMP(g_trac_volt, EXIT_MRK "HBToHwsvVoltageMsg::processVOLTmsg"); return l_errLog; } /////////////////////////////////////////////////////////////////////////////// -// HBVddrMsg::processMsg +// HBToHwsvVoltageMsg::processMsg /////////////////////////////////////////////////////////////////////////////// -errlHndl_t HBVddrMsg::processMsg(msg_t* i_Msg) const +errlHndl_t HBToHwsvVoltageMsg::processMsg(msg_t* i_Msg) const { - TRACFCOMP(g_trac_volt, ENTER_MRK "HBVddrMsg::processMsg"); - errlHndl_t l_errLog = NULL; + TRACFCOMP(g_trac_volt, ENTER_MRK "HBToHwsvVoltageMsg::processMsg"); + errlHndl_t l_errLog = nullptr; do { @@ -631,13 +708,13 @@ errlHndl_t HBVddrMsg::processMsg(msg_t* i_Msg) const //process a response to a request uint32_t l_msgType =i_Msg->type; TRACFCOMP( g_trac_volt, INFO_MRK - "HBVddrMsg::processMsg l_msgType=x%08X",l_msgType ); - if ( (l_msgType == HB_VDDR_ENABLE) || - (l_msgType == HB_VDDR_DISABLE)|| - (l_msgType == HB_VDDR_POST_DRAM_INIT_ENABLE) ) + "HBToHwsvVoltageMsg::processMsg l_msgType=x%08X",l_msgType ); + if ( (l_msgType == HB_VOLT_ENABLE) || + (l_msgType == HB_VOLT_DISABLE)|| + (l_msgType == HB_VOLT_POST_DRAM_INIT_ENABLE) ) { - //process a VDDR message - l_errLog=processVDDRmsg(i_Msg); + //process a voltage message + l_errLog=processVOLTmsg(i_Msg); if (l_errLog) { break; @@ -646,7 +723,7 @@ errlHndl_t HBVddrMsg::processMsg(msg_t* i_Msg) const else { TRACFCOMP( g_trac_volt, ERR_MRK - "HBVddrMsg::processMsg recv'd a non valid type"); + "HBToHwsvVoltageMsg::processMsg recv'd a non valid type"); //generate errorLog; /*@ * @errortype @@ -667,7 +744,7 @@ errlHndl_t HBVddrMsg::processMsg(msg_t* i_Msg) const { //an error occurred so should stop the IPL TRACFCOMP( g_trac_volt, ERR_MRK - "HBVddrMsg::RecvMsgHndlr recv'd an error message" ); + "HBToHwsvVoltageMsg::RecvMsgHndlr recv'd an error message" ); //generate an errorlog /*@ @@ -690,19 +767,19 @@ errlHndl_t HBVddrMsg::processMsg(msg_t* i_Msg) const }while(0); - TRACFCOMP(g_trac_volt, EXIT_MRK "HBVddrMsg::processMsg"); + TRACFCOMP(g_trac_volt, EXIT_MRK "HBToHwsvVoltageMsg::processMsg"); return l_errLog; } /////////////////////////////////////////////////////////////////////////////// -// HBVddrMsg::createErrLog +// HBToHwsvVoltageMsg::createErrLog /////////////////////////////////////////////////////////////////////////////// -void HBVddrMsg::createErrLog(errlHndl_t& io_err, +void HBToHwsvVoltageMsg::createErrLog(errlHndl_t& io_err, fapi::hwpfModuleId i_mod, fapi::hwpfReasonCode i_rc, uint32_t i_userData1) const { - if (io_err == NULL) + if (io_err == nullptr) { io_err = new ErrlEntry(ERRL_SEV_UNRECOVERABLE, i_mod, @@ -715,9 +792,12 @@ void HBVddrMsg::createErrLog(errlHndl_t& io_err, } // External interfaces +//////////////////////////////////////////////////////////////////////////////// +// platform_enable_vddr +//////////////////////////////////////////////////////////////////////////////// errlHndl_t platform_enable_vddr() { - errlHndl_t l_err = NULL; + errlHndl_t l_err = nullptr; TARGETING::Target* pSysTarget = nullptr; TARGETING::targetService().getTopLevelTarget(pSysTarget); @@ -729,9 +809,9 @@ errlHndl_t platform_enable_vddr() if((pSysTarget->getAttr< TARGETING::ATTR_SUPPORTS_DYNAMIC_MEM_VOLT >() == 1) && (INITSERVICE::spBaseServicesEnabled())) { - HBVddrMsg l_hbVddr; + HBToHwsvVoltageMsg l_hbVddr; - l_err = l_hbVddr.sendMsg(HBVddrMsg::HB_VDDR_ENABLE); + l_err = l_hbVddr.sendMsg(HBToHwsvVoltageMsg::HB_VOLT_ENABLE); if (l_err) { TRACFCOMP(g_trac_volt, @@ -755,14 +835,18 @@ errlHndl_t platform_enable_vddr() return l_err; } + +//////////////////////////////////////////////////////////////////////////////// +// platform_disable_vddr +//////////////////////////////////////////////////////////////////////////////// errlHndl_t platform_disable_vddr() { - errlHndl_t l_err = NULL; + errlHndl_t l_err = nullptr; if(INITSERVICE::spBaseServicesEnabled()) { - HBVddrMsg l_hbVddr; + HBToHwsvVoltageMsg l_hbToHwsv; - l_err = l_hbVddr.sendMsg(HBVddrMsg::HB_VDDR_DISABLE); + l_err = l_hbToHwsv.sendMsg(HBToHwsvVoltageMsg::HB_VOLT_DISABLE); if (l_err) { TRACFCOMP(g_trac_volt, @@ -785,14 +869,18 @@ errlHndl_t platform_disable_vddr() return l_err; } + +//////////////////////////////////////////////////////////////////////////////// +// platform_adjust_vddr_post_dram_init +//////////////////////////////////////////////////////////////////////////////// errlHndl_t platform_adjust_vddr_post_dram_init() { - errlHndl_t l_err = NULL; + errlHndl_t l_err = nullptr; if(INITSERVICE::spBaseServicesEnabled()) { - HBVddrMsg l_hbVddr; + HBToHwsvVoltageMsg l_hbVddr; - l_err = l_hbVddr.sendMsg(HBVddrMsg::HB_VDDR_POST_DRAM_INIT_ENABLE); + l_err = l_hbVddr.sendMsg(HBToHwsvVoltageMsg::HB_VOLT_POST_DRAM_INIT_ENABLE); if (l_err) { TRACFCOMP(g_trac_volt, @@ -815,3 +903,107 @@ errlHndl_t platform_adjust_vddr_post_dram_init() return l_err; } +//////////////////////////////////////////////////////////////////////////////// +// platform_set_nest_voltages +//////////////////////////////////////////////////////////////////////////////// +errlHndl_t platform_set_nest_voltages() +{ + errlHndl_t l_err = nullptr; + + TARGETING::TargetHandleList l_procList; + + HBToHwsvVoltageMsg::RequestContainer l_requests; + + HBToHwsvVoltageMsg::VOLT_MSG_TYPE l_requestType = + HBToHwsvVoltageMsg::HB_VOLT_POST_DRAM_INIT_ENABLE; + + // Get the system's processors + TARGETING::getAllChips( l_procList, + TARGETING::TYPE_PROC, + true ); // true: return functional procs + + for( const auto & l_procTarget : l_procList ) + { + + // Only send Voltage Rail data if not connected by AVSBus + // -Denoted with a value of 0xFF in the Busnum for the rail + + // VDN Rail + if( l_procTarget->getAttr<TARGETING::ATTR_VDN_AVSBUS_BUSNUM>() == 0xff ) + { + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t l_vdnRequest; + + // Populate VDN request + l_vdnRequest.domain = HBToHwsvVoltageMsg::VOLTAGE_DOMAIN_NEST_VDN; + l_vdnRequest.domainId = l_procTarget->getAttr<TARGETING::ATTR_NEST_VDN_ID>(); + l_vdnRequest.voltageMillivolts = + l_procTarget->getAttr<TARGETING::ATTR_VDN_BOOT_VOLTAGE>(); + l_requests.push_back( l_vdnRequest ); + } + + // VDD Rail + if( l_procTarget->getAttr<TARGETING::ATTR_VDD_AVSBUS_BUSNUM>() == 0xff) + { + // Create VRD Requests + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t l_vddRequest; + + // Populate VDD request + l_vddRequest.domain = HBToHwsvVoltageMsg::VOLTAGE_DOMAIN_NEST_VDD; + l_vddRequest.domainId = l_procTarget->getAttr<TARGETING::ATTR_NEST_VDD_ID>(); + l_vddRequest.voltageMillivolts = + l_procTarget->getAttr<TARGETING::ATTR_VDD_BOOT_VOLTAGE>(); + l_requests.push_back( l_vddRequest ); + } + + + // VCS Rail + if( l_procTarget->getAttr<TARGETING::ATTR_VCS_AVSBUS_BUSNUM>() == 0xff ) + { + HBToHwsvVoltageMsg::hwsvPowrMemVoltDomainRequest_t l_vcsRequest; + // Populate VCS request + l_vcsRequest.domain = HBToHwsvVoltageMsg::VOLTAGE_DOMAIN_NEST_VCS; + l_vcsRequest.domainId = l_procTarget->getAttr<TARGETING::ATTR_NEST_VCS_ID>(); + l_vcsRequest.voltageMillivolts = + l_procTarget->getAttr<TARGETING::ATTR_VCS_BOOT_VOLTAGE>(); + l_requests.push_back( l_vcsRequest ); + } + + } // Processor Loop + + + //Remove duplicate records and requests with invalid voltages + removeExtraRequests( l_requests, + l_requestType, + l_procList.size() ); + TRACDCOMP(g_trac_volt, + "platform_set_nest_voltages - Sending %d requests", l_requests.size()); + + + // Sort the list based on sequencing order + std::sort(l_requests.begin(), l_requests.end(), compareSequenceOrder ); + + size_t l_requestsSize = l_requests.size(); + for( size_t i = 0; i < l_requestsSize ; i++ ) + { + TRACDCOMP(g_trac_volt, + "Rail data: domain = 0x%x, domainId = %d, mV = %d", + l_requests.at(i).domain, + l_requests.at(i).domainId, + l_requests.at(i).voltageMillivolts ); + } + //Send the actual data to HWSV + HBToHwsvVoltageMsg l_hbToHwsv; + l_err = l_hbToHwsv.sendRequestData(l_requests, + HBToHwsvVoltageMsg::HB_VOLT_POST_DRAM_INIT_ENABLE ); + + if( l_err ) + { + TRACFCOMP(g_trac_volt, + ERR_MRK"hbToHwsvVoltageMsg.C::platform_set_nest_voltages - " + "Failed to send the Request Data to HWSV!" ); + } + + + return l_err; +} + diff --git a/src/usr/isteps/istep13/hbVddrMsg.H b/src/usr/isteps/hbToHwsvVoltageMsg.H index 1f491b7b5..5f66a2a9d 100644 --- a/src/usr/isteps/istep13/hbVddrMsg.H +++ b/src/usr/isteps/hbToHwsvVoltageMsg.H @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/isteps/istep13/hbVddrMsg.H $ */ +/* $Source: src/usr/isteps/hbToHwsvVoltageMsg.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ @@ -23,8 +23,8 @@ /* */ /* IBM_PROLOG_END_TAG */ -#ifndef __HB_VDDR_MSG_H -#define __HB_VDDR_MSG_H +#ifndef __HB_VOLT_MSG_H +#define __HB_VOLT_MSG_H /*****************************************************************************/ // I n c l u d e s @@ -52,15 +52,15 @@ /*****************************************************************************/ // Forward class declarations /*****************************************************************************/ -class HBVddrMsg; +class HBToHwsvVoltageMsg; /** - * @brief HBVddrMsg + * @brief HBToHwsvVoltageMsg * This class provides interfaces to send and process messages to and from * hwsv with respect to powr. It also indicates when to stop the IPL via * errorlogs */ -class HBVddrMsg +class HBToHwsvVoltageMsg { public: @@ -68,21 +68,26 @@ public: /** * @brief Enum specifying a memory voltage domain type */ - enum MEM_VOLTAGE_DOMAIN + enum VOLTAGE_DOMAIN { // For unknown / uninitialized values - MEM_VOLTAGE_DOMAIN_UNKNOWN = 0x00, + VOLTAGE_DOMAIN_UNKNOWN = 0x00, // Valid values - MEM_VOLTAGE_DOMAIN_VDD = 0x01, - MEM_VOLTAGE_DOMAIN_AVDD = 0x02, - MEM_VOLTAGE_DOMAIN_VCS = 0x03, - MEM_VOLTAGE_DOMAIN_VPP = 0x04, - MEM_VOLTAGE_DOMAIN_VDDR = 0x05, // aka VMEM + VOLTAGE_DOMAIN_MEM_VDD = 0x01, + VOLTAGE_DOMAIN_MEM_AVDD = 0x02, + VOLTAGE_DOMAIN_MEM_VCS = 0x03, + VOLTAGE_DOMAIN_MEM_VPP = 0x04, + VOLTAGE_DOMAIN_MEM_VDDR = 0x05, // aka VMEM + VOLTAGE_DOMAIN_NEST_VDD = 0x06, + VOLTAGE_DOMAIN_NEST_VDN = 0x07, + VOLTAGE_DOMAIN_NEST_VCS = 0x08, + VOLTAGE_DOMAIN_NEST_VIO = 0x09, + VOLTAGE_DOMAIN_NEST_VDDR = 0x0A, // Good range markers - Need to be adjusted if the above change - MEM_VOLTAGE_DOMAIN_MIN_VALUE = MEM_VOLTAGE_DOMAIN_VDD, - MEM_VOLTAGE_DOMAIN_MAX_VALUE = MEM_VOLTAGE_DOMAIN_VDDR, + VOLTAGE_DOMAIN_MIN_VALUE = VOLTAGE_DOMAIN_MEM_VDD, + VOLTAGE_DOMAIN_MAX_VALUE = VOLTAGE_DOMAIN_NEST_VDDR, }; /** @@ -93,12 +98,12 @@ public: */ struct hwsvPowrMemVoltDomainRequest_t { - MEM_VOLTAGE_DOMAIN domain; - TARGETING::ATTR_VDDR_ID_type domainId; - TARGETING::ATTR_MSS_VOLT_VDDR_MILLIVOLTS_type voltageMillivolts; + VOLTAGE_DOMAIN domain; + uint16_t domainId; + uint32_t voltageMillivolts; hwsvPowrMemVoltDomainRequest_t() - : domain(MEM_VOLTAGE_DOMAIN_UNKNOWN), + : domain(VOLTAGE_DOMAIN_UNKNOWN), domainId(0x0000), voltageMillivolts(0x00000000) { @@ -115,12 +120,12 @@ public: */ struct hwsvPowrMemVoltDomainReply_t { - MEM_VOLTAGE_DOMAIN domain; - TARGETING::ATTR_VDDR_ID_type domainId; - uint32_t plid; + VOLTAGE_DOMAIN domain; + uint16_t domainId; + uint32_t plid; hwsvPowrMemVoltDomainReply_t() - : domain(MEM_VOLTAGE_DOMAIN_UNKNOWN), + : domain(VOLTAGE_DOMAIN_UNKNOWN), domainId(0x0000), plid(0x00000000) { @@ -129,16 +134,16 @@ public: } __attribute__ ((packed)); /** - * @enum VDDR_MSG_TYPE + * @enum VOLT_MSG_TYPE * * @brief Message enum to determine how the msg should be processed * */ - enum VDDR_MSG_TYPE + enum VOLT_MSG_TYPE { - HB_VDDR_ENABLE = 0x40000041, - HB_VDDR_DISABLE = 0x40000042, - HB_VDDR_POST_DRAM_INIT_ENABLE = 0x40000043, + HB_VOLT_ENABLE = 0x40000041, + HB_VOLT_DISABLE = 0x40000042, + HB_VOLT_POST_DRAM_INIT_ENABLE = 0x40000043, }; /** @@ -150,7 +155,7 @@ public: /** * @brief Default constructor */ - HBVddrMsg(); + HBToHwsvVoltageMsg(); /** * @brief Destructor @@ -160,7 +165,7 @@ public: * @return None * */ - ~HBVddrMsg(); + ~HBToHwsvVoltageMsg(); /** * @brief Accumulates memory voltage domain type/ID/voltage records and @@ -183,7 +188,7 @@ public: * @return N/A */ void createVddrData( - VDDR_MSG_TYPE i_requestType, + VOLT_MSG_TYPE i_requestType, RequestContainer& io_request) const; /** @@ -195,14 +200,30 @@ public: * FSP_VDDR_MSGQ as the message queue.. * * @param[in] i_msgType - * HBVddrMsg::VDDR_MSG_TYPE passed in to define the + * HBToHwsvVoltageMsg::VDDR_MSG_TYPE passed in to define the * message policy. * * @return errlHndl_t * return errl == NULL -> success * return errl != NULL -> failure */ - errlHndl_t sendMsg(VDDR_MSG_TYPE i_msgType) const; + errlHndl_t sendMsg(VOLT_MSG_TYPE i_msgType) const; + + + /** + * @brief Appropriately formats the request data and sends it to the FSP + * + * @param[in] i_requests - A vector of requests + * @param[in] i_msgType - the type of message we are sending + * + * @ return errlHndl_t + * return errl == NULL -> success + * return errl != NULL -> failure + */ + errlHndl_t sendRequestData( RequestContainer & i_requests, + VOLT_MSG_TYPE i_msgType ) const; + + private: @@ -254,7 +275,7 @@ private: const TARGETING::ATTRIBUTE_ID VOLTAGE_DOMAIN_ID_ATTR > void addMemoryVoltageDomains( const TARGETING::Target* const i_pMcbist, - HBVddrMsg::RequestContainer& io_domains) const; + HBToHwsvVoltageMsg::RequestContainer& io_domains) const; protected: @@ -283,7 +304,7 @@ protected: * return errl == NULL -> success * return errl != NULL -> failure */ - errlHndl_t processVDDRmsg(msg_t* i_recvMsg)const; + errlHndl_t processVOLTmsg(msg_t* i_recvMsg)const; /** * @brief function to create error logs for errors that occured in FSP side @@ -303,7 +324,14 @@ protected: fapi::hwpfReasonCode i_rc, uint32_t i_userData1=0x0) const; + }; +//External Interfaces +/** + * @brief Send processor voltage rail data to HWSV + * @return NULL | error handle on error + */ +errlHndl_t platform_set_nest_voltages(); #endif diff --git a/src/usr/isteps/istep08/call_host_set_voltages.C b/src/usr/isteps/istep08/call_host_set_voltages.C index bbe6f10cf..a791fac39 100644 --- a/src/usr/isteps/istep08/call_host_set_voltages.C +++ b/src/usr/isteps/istep08/call_host_set_voltages.C @@ -29,6 +29,7 @@ #include <trace/interface.H> #include <errl/errlentry.H> #include <initservice/isteps_trace.H> +#include <initservice/initserviceif.H> #include <isteps/hwpisteperror.H> // targeting support #include <targeting/common/commontargeting.H> @@ -37,10 +38,11 @@ #include <fapi2/target.H> #include <fapi2/plat_hwp_invoker.H> - #include <p9_setup_evid.H> +#include <hbToHwsvVoltageMsg.H> + using namespace TARGETING; using namespace ERRORLOG; using namespace ISTEP_ERROR; @@ -59,10 +61,10 @@ void* call_host_set_voltages(void *io_pArgs) errlHndl_t l_err = NULL; TargetHandleList l_procList; IStepError l_stepError; - + bool l_noError = true; do { - // Get the systems procs + // Get the system's procs getAllChips( l_procList, TYPE_PROC, true ); // true: return functional procs @@ -91,9 +93,33 @@ void* call_host_set_voltages(void *io_pArgs) l_stepError.addErrorDetails( l_err ); errlCommit( l_err, HWPF_COMP_ID ); + l_noError = false; } - } // Processor loop + } // Processor Loop + + if( l_noError ) + { +#if 0 // TODO RTC: 160517 - Uncomment the call to send processor voltage data to HWSV + //If FSP is present, send voltage information to HWSV + if( INITSERVICE::spBaseServicesEnabled() ) + { + l_err = platform_set_nest_voltages(); + + if( l_err ) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Error in call_host_set_voltages::platform_set_nest_voltages()") + + // Create IStep error log and cross reference occurred error + l_stepError.addErrorDetails( l_err ); + //Commit Error + errlCommit( l_err, ISTEP_COMP_ID ); + + } + } +#endif + } }while( 0 ); diff --git a/src/usr/isteps/istep08/makefile b/src/usr/isteps/istep08/makefile index af1eb8796..f95e2b97f 100644 --- a/src/usr/isteps/istep08/makefile +++ b/src/usr/isteps/istep08/makefile @@ -68,7 +68,6 @@ VPATH += ${PROCEDURES_PATH}/hwp/sbe/ VPATH += ${PROCEDURES_PATH}/hwp/pm/ VPATH += ${PROCEDURES_PATH}/hwp/lib - include ${ROOTPATH}/procedure.rules.mk # host_slave_sbe_config include ${PROCEDURES_PATH}/hwp/perv/p9_setup_sbe_config.mk diff --git a/src/usr/isteps/istep13/makefile b/src/usr/isteps/istep13/makefile index cad151156..1ba3369a0 100644 --- a/src/usr/isteps/istep13/makefile +++ b/src/usr/isteps/istep13/makefile @@ -46,7 +46,6 @@ EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/nest EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/initfiles - # from src/usr/isteps/istep13 OBJS += call_host_disable_memvolt.o OBJS += call_mem_pll_reset.o @@ -61,7 +60,6 @@ OBJS += call_mss_draminit_training.o OBJS += call_mss_draminit_trainadv.o OBJS += call_mss_draminit_mc.o -OBJS += $(if $(CONFIG_OPENPOWER_VDDR),openpower_vddr.o,hbVddrMsg.o) #HWP build tool include ${ROOTPATH}/procedure.rules.mk diff --git a/src/usr/isteps/makefile b/src/usr/isteps/makefile index ac376aab2..fcef26385 100644 --- a/src/usr/isteps/makefile +++ b/src/usr/isteps/makefile @@ -48,6 +48,7 @@ OBJS += hwpistepud.o OBJS += istepHelperFuncs.o OBJS += pbusLinkSvc.o +OBJS += $(if $(CONFIG_OPENPOWER_VOLTMSG),openpower_vddr.o,hbToHwsvVoltageMsg.o) EXTRAINCDIR += ${ROOTPATH}/src/usr/initservice/istepdispatcher EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/ diff --git a/src/usr/isteps/istep13/openpower_vddr.C b/src/usr/isteps/openpower_vddr.C index 5d8b4c8fc..e05c1fd1d 100644 --- a/src/usr/isteps/istep13/openpower_vddr.C +++ b/src/usr/isteps/openpower_vddr.C @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/isteps/istep13/openpower_vddr.C $ */ +/* $Source: src/usr/isteps/openpower_vddr.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ diff --git a/src/usr/isteps/istep13/platform_vddr.H b/src/usr/isteps/platform_vddr.H index 81520bb9a..a9b44a96e 100644 --- a/src/usr/isteps/istep13/platform_vddr.H +++ b/src/usr/isteps/platform_vddr.H @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/isteps/istep13/platform_vddr.H $ */ +/* $Source: src/usr/isteps/platform_vddr.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl index 390798e84..57a7ee01c 100755 --- a/src/usr/targeting/common/genHwsvMrwXml.pl +++ b/src/usr/targeting/common/genHwsvMrwXml.pl @@ -31,6 +31,7 @@ # --system=systemname # Specify which system MRW XML to be generated # --systemnodes=systemnodesinbrazos + # Specify number of nodes for brazos system, by default it is 4 # --mrwdir=pathname # Specify the complete dir pathname of the MRW. Colon-delimited @@ -942,6 +943,93 @@ foreach my $dmi (@{$dmibus->{'dmi-bus'}}) } #------------------------------------------------------------------------------ +# Process the proc-vrds MRW file +#------------------------------------------------------------------------------ +my $proc_vrds_file = open_mrw_file($mrwdir, "${sysname}-proc-vrds.xml"); +my $mrwProcVoltageDomains = parse_xml_file($proc_vrds_file, + forcearray=>['proc-vrd-connection']); +our %vrdHash = (); +my %procVrdUuidHash; +my %procVrdIdHash; +my %validProcVrdTypes + = ('VCS' => 1, 'VDN' => 1, 'VIO' => 1, 'VDDR' => 1, 'VDD' => 1); + +use constant VRD_PROC_I2C_DEVICE_PATH => 'vrdProcI2cDevicePath'; +use constant VRD_PROC_I2C_ADDRESS => 'vrdProcI2cAddress'; +use constant VRD_PROC_DOMAIN_TYPE => 'vrdProcDomainType'; +use constant VRD_PROC_DOMAIN_ID => 'vrdProcDomainId'; +use constant VRD_PROC_UUID => 'vrdProcUuid'; + +foreach my $mrwProcVoltageDomain ( + @{$mrwProcVoltageDomains->{'proc-vrd-connection'}}) +{ + + if( (!exists $mrwProcVoltageDomain->{'vrd'}->{'i2c-dev-path'}) + ||(!exists $mrwProcVoltageDomain->{'vrd'}->{'i2c-address'}) + ||(ref($mrwProcVoltageDomain->{'vrd'}->{'i2c-dev-path'}) eq "HASH") + || (ref($mrwProcVoltageDomain->{'vrd'}->{'i2c-address'}) eq "HASH") + || ($mrwProcVoltageDomain->{'vrd'}->{'i2c-dev-path'} eq "") + || ($mrwProcVoltageDomain->{'vrd'}->{'i2c-address'} eq "")) + { + next; + } + + my $procVrdDev = $mrwProcVoltageDomain->{'vrd'}->{'i2c-dev-path'}; + my $procVrdAddr = $mrwProcVoltageDomain->{'vrd'}->{'i2c-address'}; + my $procVrdType = uc $mrwProcVoltageDomain->{'vrd'}->{'type'}; + my $procInstance = + "n" . $mrwProcVoltageDomain->{'proc'}->{'target'}->{'node'} . + ":p" . $mrwProcVoltageDomain->{'proc'}->{'target'}->{'position'}; + + + if(!exists $validProcVrdTypes{$procVrdType}) + { + print STDOUT "Illegal VRD type of $procVrdType used\n"; + next; + } + + if(!exists $procVrdIdHash{$procVrdType}) + { + $procVrdIdHash{$procVrdType} = 1; # changed to 1 as 0 = invalid + } + my $uuid = -1; + foreach my $vrd (keys %vrdHash ) + { + if( ($vrdHash{$vrd}{VRD_PROC_I2C_DEVICE_PATH} eq $procVrdDev ) + && ($vrdHash{$vrd}{VRD_PROC_I2C_ADDRESS} eq $procVrdAddr) + && ($vrdHash{$vrd}{VRD_PROC_DOMAIN_TYPE} eq $procVrdType) ) + { + # print STDOUT "-> Duplicate VRD: $vrd ($procInstance)\n"; + # print STDOUT "-> Device path: $procVrdDev + Address: $procVrdAddr\n"; + # print STDOUT "-> VR Domain Type: $procVrdType\n"; + # print STDOUT "-> VR Domain ID: $vrdHash{$vrd}{VRD_PROC_DOMAIN_ID}\n"; + $uuid = $vrd; + last; + } + } + + if($uuid == -1) + { + my $vrd = scalar keys %vrdHash; + $vrdHash{$vrd}{VRD_PROC_I2C_DEVICE_PATH} = $procVrdDev; + $vrdHash{$vrd}{VRD_PROC_I2C_ADDRESS} = $procVrdAddr; + $vrdHash{$vrd}{VRD_PROC_DOMAIN_TYPE} = $procVrdType; + $vrdHash{$vrd}{VRD_PROC_DOMAIN_ID} = + $procVrdIdHash{$procVrdType}++; + $uuid = $vrd; + if(0) + { + print STDOUT "** New vrd: $vrd ($procInstance)\n"; + print STDOUT "Device path: $procVrdDev + Address: $procVrdAddr\n"; + print STDOUT "VRD Domain Type: $procVrdType\n"; + print STDOUT "VRD Domain ID: $vrdHash{$vrd}{VRD_PROC_DOMAIN_ID}\n"; + } + } + $procVrdUuidHash{$procInstance}{$procVrdType}{VRD_PROC_UUID} = $uuid; +} + + +#------------------------------------------------------------------------------ # Process the dimm-vrds MRW file #------------------------------------------------------------------------------ my $dimm_vrds_file = open_mrw_file($mrwdir, "${sysname}-dimm-vrds.xml"); @@ -2541,6 +2629,60 @@ sub byNodePos($$) return $retVal; } +sub addProcVrdIds +{ + my($node, $proc) = @_; + my %o_vrd_uuids; + my $procInstance = "n0:p$proc"; + my %vrd_ids = + ( + "VCS" => -1, + "VDN" => -1, + "VIO" => -1, + "VDDR" => -1, + "VDD" => -1, + ); + + +# print "\n<!-- addProcVrdIds for proc $proc" . +# "--n".$node."p".$proc." -->\n"; + + + + foreach my $procVrdType ( keys %{$procVrdUuidHash{$procInstance}} ) + { + my $key = $procVrdUuidHash{$procInstance}{$procVrdType}{VRD_PROC_UUID}; + my $domain_id = $vrdHash{$key}{VRD_PROC_DOMAIN_ID}; + + if( ($vrd_ids{ $procVrdType } != $domain_id) && + ($vrd_ids{ $procVrdType } == -1) ) + { + print "\n" + . " <attribute>\n" + . " <id>NEST_$procVrdType" . "_ID</id>\n" + . " <default>$domain_id</default>\n" + . " </attribute>"; + $vrd_ids{ $procVrdType } = $domain_id; + $o_vrd_uuids{ $procVrdType } = $key; + } + elsif (!exists($vrd_ids{$procVrdType})) + { + die "Unkown vrd type $procVrdType for proc $proc\n"; + } + elsif ($vrd_ids{ $procVrdType } != $domain_id) + { + die "PROC $proc: $procVrdType"."_ID has a different DomainID then expected". + " (found " . $domain_id . ", expected ". $vrd_ids{ $procVrdType } . ")\n"; + } + } + print "\n"; + # print "\n<!-- end addProcVrdIds for proc $proc" . + # "--n".$node."p".$proc." -->\n"; + + return %o_vrd_uuids; +} + + sub addVoltageDomainIDs { my ($node, $proc, $mcbist) = @_; @@ -2559,16 +2701,16 @@ sub addVoltageDomainIDs ); #print "\n<!-- addVoltageDomainIDs for mcbist $mcbist" . - # "-- n".$node."p".$proc." -->\n"; + "-- n".$node."p".$proc." -->\n"; foreach my $dimm (@dimms) { - # print "\n<!-- DIMM $dimm -->"; +# print "\n<!-- DIMM $dimm -->"; foreach my $vrmType ( keys %{$dimmVrmUuidHash{$dimm}} ) { my $key = $dimmVrmUuidHash{$dimm}{$vrmType}{VRM_UUID}; my $domain_id = $vrmHash{$key}{VRM_DOMAIN_ID}; - # print "\n<!-- Key $key: Domain $domain_id -->\n"; + # print "\n<!-- Key $key: Domain $domain_id -->\n"; if ( ($vrm_ids{ $vrmType } != $domain_id) && ($vrm_ids{ $vrmType } == -1) ) { @@ -3509,6 +3651,8 @@ sub generate_proc # add I2C_BUS_SPEED_ARRAY attribute addI2cBusSpeedArray($sys, $node, $proc, "pu"); + #add Voltage Rail Domain IDs + my %proc_vrd_hash = addProcVrdIds($node, $proc); print " <!-- Nest Voltage Rails --> @@ -3544,7 +3688,7 @@ sub generate_proc $node, $proc, $fruid, $ipath, $hwTopology, $mboxFspApath, $mboxFspAsize, $mboxFspBpath, $mboxFspBsize, $ordinalId, $sbefifoFspApath, $sbefifoFspAsize, $sbefifoFspBpath, - $sbefifoFspBsize, \%nestRails ); + $sbefifoFspBsize, \%proc_vrd_hash, \%nestRails ); # Data from PHYP Memory Map print "\n"; |