summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/dram_training
diff options
context:
space:
mode:
authorNick Bofferding <bofferdn@us.ibm.com>2014-05-13 14:59:42 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-06-23 18:18:39 -0500
commitf81a76dc1e804534b3190b4aa64b83f707bd24a3 (patch)
tree8937c6d2e2cb31c65d02f1d6642e01c9503b884f /src/usr/hwpf/hwp/dram_training
parent2351fe8a6a86cce8480ee83b9e3eaed107aefe3e (diff)
downloadtalos-hostboot-f81a76dc1e804534b3190b4aa64b83f707bd24a3.tar.gz
talos-hostboot-f81a76dc1e804534b3190b4aa64b83f707bd24a3.zip
Support dynamic VID for AVDD, VPP, VCS, VDD memory voltage domains
- Added AVDD, VPP, VCS, VPP voltage domain ID attributes - Added offset voltage attributes for all 5 memory voltage domains - Added VPP base voltage attribute - Added HWP attributes for all 5 memory voltage domain offset calcs - Added all new attributes to appropriate targets - Updated MRW parser to populate voltage domain ID attributes - Updated MRW parser to populate HWP related optional system attributes - Updated mss_volt istep to set offset voltages for all domains/membufs - Updated VID compare/equality operators to handle voltage domain type - Updated VID populator to add VID programming info from all domains - Updated VID messages to populate and receive voltage domain type - Added dynamic VID HWPs, attributes, error XML files Change-Id: I58f9eb13e4083b192d99308b8314cda0c1078800 RTC: 99246 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11091 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/dram_training')
-rw-r--r--src/usr/hwpf/hwp/dram_training/hbVddrMsg.C281
-rw-r--r--src/usr/hwpf/hwp/dram_training/hbVddrMsg.H193
2 files changed, 362 insertions, 112 deletions
diff --git a/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C b/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C
index 9938f916a..3e4fa82ac 100644
--- a/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C
+++ b/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C
@@ -67,77 +67,231 @@ HBVddrMsg::~HBVddrMsg()
///////////////////////////////////////////////////////////////////////////////
-// compareVids
+// compareVids
///////////////////////////////////////////////////////////////////////////////
-bool compareVids( HBVddrMsg::hwsvPowrVmemRequest_t i_req1,
- HBVddrMsg::hwsvPowrVmemRequest_t i_req2)
+
+bool compareVids(
+ HBVddrMsg::hwsvPowrMemVoltDomainRequest_t i_lhs,
+ HBVddrMsg::hwsvPowrMemVoltDomainRequest_t i_rhs)
{
- return( static_cast<uint16_t>(i_req1.VmemId) <
- static_cast<uint16_t>(i_req2.VmemId));
+ bool lhsLogicallyBeforeRhs = (i_lhs.domain < i_rhs.domain);
+
+ if (i_lhs.domain == i_rhs.domain)
+ {
+ lhsLogicallyBeforeRhs = ( static_cast<uint16_t>(i_lhs.domainId)
+ < static_cast<uint16_t>(i_rhs.domainId) );
+ }
+
+ return lhsLogicallyBeforeRhs;
}
///////////////////////////////////////////////////////////////////////////////
-// areVidEqual
+// areVidsEqual
///////////////////////////////////////////////////////////////////////////////
-bool areVidsEqual(HBVddrMsg::hwsvPowrVmemRequest_t i_req1,
- HBVddrMsg::hwsvPowrVmemRequest_t i_req2)
+
+bool areVidsEqual(
+ HBVddrMsg::hwsvPowrMemVoltDomainRequest_t i_lhs,
+ HBVddrMsg::hwsvPowrMemVoltDomainRequest_t i_rhs)
+{
+ return( ( i_lhs.domain
+ == i_rhs.domain)
+ && ( static_cast<uint16_t>(i_lhs.domainId)
+ == static_cast<uint16_t>(i_rhs.domainId)) );
+}
+
+//******************************************************************************
+// addMemoryVoltageDomains (templated)
+//******************************************************************************
+
+template<
+ const ATTRIBUTE_ID OFFSET_DISABLEMENT_ATTR,
+ const ATTRIBUTE_ID VOLTAGE_ATTR_WHEN_OFFSET_ENABLED,
+ const ATTRIBUTE_ID VOLTAGE_ATTR_WHEN_OFFSET_DISABLED,
+ const ATTRIBUTE_ID VOLTAGE_DOMAIN_ID_ATTR >
+void HBVddrMsg::addMemoryVoltageDomains(
+ const TARGETING::Target* const i_pMembuf,
+ HBVddrMsg::RequestContainer& io_domains) const
{
- return( static_cast<uint16_t>(i_req1.VmemId) ==
- static_cast<uint16_t>(i_req2.VmemId));
+ assert(
+ (i_pMembuf != NULL),
+ "HBVddrMsg::addMemoryVoltageDomains: Code bug! Caller passed NULL "
+ "memory buffer target handle.");
+
+ assert(
+ ( ( i_pMembuf->getAttr<TARGETING::ATTR_CLASS>()
+ == TARGETING::CLASS_CHIP)
+ && ( i_pMembuf->getAttr<TARGETING::ATTR_TYPE>()
+ == TARGETING::TYPE_MEMBUF)),
+ "HBVddrMsg::addMemoryVoltageDomains: Code bug! Caller passed non-"
+ "memory buffer target handle of class = 0x%08X and type of 0x%08X.",
+ i_pMembuf->getAttr<TARGETING::ATTR_CLASS>(),
+ i_pMembuf->getAttr<TARGETING::ATTR_TYPE>());
+
+ TARGETING::Target* pSysTarget = NULL;
+ TARGETING::targetService().getTopLevelTarget(pSysTarget);
+
+ assert(
+ (pSysTarget != NULL),
+ "HBVddrMsg::addMemoryVoltageDomains: Code bug! System target was "
+ "NULL.");
+
+ typename AttributeTraits< OFFSET_DISABLEMENT_ATTR >::Type
+ disableOffsetVoltage =
+ pSysTarget->getAttr< OFFSET_DISABLEMENT_ATTR >();
+
+ assert(
+ (disableOffsetVoltage <= true),
+ "HBVddrMsg::addMemoryVoltageDomains: Code Bug! Unsupported "
+ "value of 0x%02X for attribute ID of 0x%08X.",
+ disableOffsetVoltage,
+ OFFSET_DISABLEMENT_ATTR);
+
+ // Initialized by constructor to invalid defaults
+ HBVddrMsg::hwsvPowrMemVoltDomainRequest_t entry;
+
+ switch(VOLTAGE_DOMAIN_ID_ATTR)
+ {
+ case TARGETING::ATTR_VMEM_ID:
+ entry.domain = MEM_VOLTAGE_DOMAIN_VDDR;
+ break;
+ case TARGETING::ATTR_VCS_ID:
+ entry.domain = MEM_VOLTAGE_DOMAIN_VCS;
+ break;
+ case TARGETING::ATTR_VPP_ID:
+ entry.domain = MEM_VOLTAGE_DOMAIN_VPP;
+ break;
+ case TARGETING::ATTR_AVDD_ID:
+ entry.domain = MEM_VOLTAGE_DOMAIN_AVDD;
+ break;
+ case TARGETING::ATTR_VDD_ID:
+ entry.domain = MEM_VOLTAGE_DOMAIN_VDD;
+ break;
+ default:
+ assert(
+ 0,
+ "HBVddrMsg::addMemoryVoltageDomains: Code Bug! Unsupported "
+ "voltage domain of 0x%08X.",
+ VOLTAGE_DOMAIN_ID_ATTR);
+ break;
+ }
+
+ // There is no reasonable check to validate if a voltage ID we're reading
+ // is valid so it has to be assumed good
+ entry.domainId = i_pMembuf->getAttr< VOLTAGE_DOMAIN_ID_ATTR >();
+
+ // There is no reasonable check to validate if a voltage we're
+ // reading is valid so it has to be assumed good for the cases below
+ if(!disableOffsetVoltage)
+ {
+ typename
+ TARGETING::AttributeTraits< VOLTAGE_ATTR_WHEN_OFFSET_ENABLED >::Type
+ voltageMillivolts
+ = i_pMembuf->getAttr< VOLTAGE_ATTR_WHEN_OFFSET_ENABLED >();
+
+ entry.voltageMillivolts = static_cast<uint32_t>(voltageMillivolts);
+ io_domains.push_back(entry);
+ }
+ else if( VOLTAGE_ATTR_WHEN_OFFSET_DISABLED
+ != VOLTAGE_ATTR_WHEN_OFFSET_ENABLED)
+ {
+ typename
+ TARGETING::AttributeTraits< VOLTAGE_ATTR_WHEN_OFFSET_DISABLED >::Type
+ voltageMillivolts
+ = i_pMembuf->getAttr< VOLTAGE_ATTR_WHEN_OFFSET_DISABLED >();
+
+ entry.voltageMillivolts = static_cast<uint32_t>(voltageMillivolts);
+ io_domains.push_back(entry);
+ }
}
///////////////////////////////////////////////////////////////////////////////
// HBVddrMsg::createVddrData
///////////////////////////////////////////////////////////////////////////////
+
void HBVddrMsg::createVddrData(
- RequestContainer& io_request) const
+ const VDDR_MSG_TYPE i_requestType,
+ RequestContainer& io_request) const
{
TRACFCOMP( g_trac_volt, ENTER_MRK "HBVddrMsg::createVddrData" );
- //go through all the centaurs and gather the Voltage IDs and voltages
+ // Go through all the memory buffers and gather their domains, domain
+ // specific IDs, and domain specific voltages
io_request.clear();
do{
-
- TARGETING::TargetHandleList l_membufTargetList;
- getAllChips(l_membufTargetList, TYPE_MEMBUF);
-
- TARGETING::Target* l_Target =NULL;
- hwsvPowrVmemRequest_t l_entry;
+ TARGETING::TargetHandleList membufTargetList;
+ getAllChips(membufTargetList, TYPE_MEMBUF);
+ TARGETING::Target* pMembuf =NULL;
for (TARGETING::TargetHandleList::const_iterator
- membufIter = l_membufTargetList.begin();
- membufIter != l_membufTargetList.end();
- ++membufIter)
+ ppMembuf = membufTargetList.begin();
+ ppMembuf != membufTargetList.end();
+ ++ppMembuf)
{
- l_Target = *membufIter;
-
- TARGETING::ATTR_VMEM_ID_type l_VmemId=
- l_Target->getAttr<TARGETING::ATTR_VMEM_ID>();
- TARGETING::ATTR_MSS_VOLT_type l_voltage =
- l_Target->getAttr<TARGETING::ATTR_MSS_VOLT>();
+ pMembuf = *ppMembuf;
- l_entry.VmemId = l_VmemId;
- l_entry.Voltage = static_cast<uint32_t>(l_voltage);
+ if(i_requestType == HB_VDDR_ENABLE)
+ {
+ (void)addMemoryVoltageDomains<
+ TARGETING::ATTR_MSS_CENT_VDD_OFFSET_DISABLE,
+ TARGETING::ATTR_MEM_VDD_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_MEM_VDD_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_VDD_ID>(
+ pMembuf,
+ io_request);
+
+ (void)addMemoryVoltageDomains<
+ TARGETING::ATTR_MSS_CENT_AVDD_OFFSET_DISABLE,
+ TARGETING::ATTR_MEM_AVDD_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_MEM_AVDD_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_AVDD_ID>(
+ pMembuf,
+ io_request);
+
+ (void)addMemoryVoltageDomains<
+ TARGETING::ATTR_MSS_CENT_VCS_OFFSET_DISABLE,
+ TARGETING::ATTR_MEM_VCS_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_MEM_VCS_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_VCS_ID>(
+ pMembuf,
+ io_request);
+
+ // VPP programming not supported in 820
+ // TODO via RTC: 110388
+ //(void)addMemoryVoltageDomains<
+ // TARGETING::ATTR_MSS_VOLT_VPP_OFFSET_DISABLE,
+ // TARGETING::ATTR_MEM_VPP_OFFSET_MILLIVOLTS,
+ // TARGETING::ATTR_VPP_BASE,
+ // TARGETING::ATTR_VPP_ID>(
+ // pMembuf,
+ // io_request);
+ }
- io_request.push_back(l_entry);
+ (void)addMemoryVoltageDomains<
+ TARGETING::ATTR_MSS_VOLT_VDDR_OFFSET_DISABLE,
+ TARGETING::ATTR_MEM_VDDR_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_MSS_VOLT,
+ TARGETING::ATTR_VMEM_ID>(
+ pMembuf,
+ io_request);
}
- if (l_membufTargetList.size() >1)
+ if (membufTargetList.size() > 1)
{
- //take out the duplicates Voltage IDs in io_request by first sorting
- //and then removing the duplicates
-
+ // 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<hwsvPowrVmemRequest_t>::iterator it;
- it=std::unique(io_request.begin(), io_request.end(), areVidsEqual);
- io_request.erase(it,io_request.end());
+ std::vector<hwsvPowrMemVoltDomainRequest_t>::iterator
+ pInvalidEntries = std::unique(
+ io_request.begin(),
+ io_request.end(),
+ areVidsEqual);
+ io_request.erase(pInvalidEntries,io_request.end());
}
- }while(0);
-
+ } while(0);
+
TRACFCOMP( g_trac_volt, EXIT_MRK "HBVddrMsg::createVddrData" );
return;
}
@@ -157,7 +311,9 @@ errlHndl_t HBVddrMsg::sendMsg(uint32_t i_msgType) const
if ( (i_msgType == HB_VDDR_ENABLE) || (i_msgType == HB_VDDR_DISABLE) )
{
- createVddrData(l_request);
+ VDDR_MSG_TYPE msgType = (i_msgType == HB_VDDR_ENABLE)
+ ? HB_VDDR_ENABLE : HB_VDDR_DISABLE;
+ createVddrData(msgType, l_request);
}
else
{
@@ -184,7 +340,8 @@ errlHndl_t HBVddrMsg::sendMsg(uint32_t i_msgType) const
// Only send a message if there is data to send
if (l_dataCount)
{
- uint32_t l_msgSize = l_dataCount*sizeof(hwsvPowrVmemRequest_t);
+ uint32_t l_msgSize = l_dataCount *
+ sizeof(hwsvPowrMemVoltDomainRequest_t);
// Create the message to send to HWSV
msg_t* l_msg = msg_allocate();
@@ -192,21 +349,26 @@ errlHndl_t HBVddrMsg::sendMsg(uint32_t i_msgType) const
l_msg->data[0] = 0;
l_msg->data[1] = l_msgSize;
- TRACFCOMP(g_trac_volt, INFO_MRK "hbVddrMsg::l_dataCount=%d,l_msgSize=%d",
+ TRACFCOMP(g_trac_volt, INFO_MRK "hbVddrMsg::l_dataCount=%d, "
+ "l_msgSize=%d",
l_dataCount, l_msgSize);
void* l_data = malloc(l_msgSize);
- hwsvPowrVmemRequest_t* l_ptr =
- reinterpret_cast<hwsvPowrVmemRequest_t*>(l_data);
+ hwsvPowrMemVoltDomainRequest_t* l_ptr =
+ reinterpret_cast<hwsvPowrMemVoltDomainRequest_t*>(l_data);
for (size_t j =0; j<l_dataCount; ++j)
{
- l_ptr->VmemId=l_request.at(j).VmemId;
- l_ptr->Voltage=l_request.at(j).Voltage;
+ l_ptr->domain=l_request.at(j).domain;
+ l_ptr->domainId=l_request.at(j).domainId;
+ l_ptr->voltageMillivolts=l_request.at(j).voltageMillivolts;
TRACFCOMP(g_trac_volt, ENTER_MRK "hbVddrMsg::sendMsg "
- "VmemId=0x%04X, Voltage=%d, index=%d",
- l_ptr->VmemId, l_ptr->Voltage,j);
+ "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++;
}
@@ -249,7 +411,7 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const
//and is inside the message
uint32_t l_msgSize = i_recvMsg->data[1];
- uint16_t l_elementCount = l_msgSize/sizeof(hwsvPowrVmemReply_t);
+ uint16_t l_elementCount = l_msgSize/sizeof(hwsvPowrMemVoltDomainReply_t);
const uint8_t* l_extraData = NULL;
l_extraData=static_cast<uint8_t*>(i_recvMsg->extra_data);
@@ -274,26 +436,31 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const
fapi::RC_VDDR_EMPTY_MSG);
break;
}
- TARGETING::ATTR_VMEM_ID_type l_VmemId =0x0;
+
+ MEM_VOLTAGE_DOMAIN domain = MEM_VOLTAGE_DOMAIN_UNKNOWN;
+ TARGETING::ATTR_VMEM_ID_type l_domainId =0x0;
uint32_t l_errPlid =0x0;
TRACFCOMP( g_trac_volt, INFO_MRK "HBVddrMsg::processVDDRmsg: "
"l_elementCount=%d, l_msgSize =%d",
l_elementCount, l_msgSize);
- const hwsvPowrVmemReply_t* l_ptr=
- reinterpret_cast<const hwsvPowrVmemReply_t*>(l_extraData);
+ const hwsvPowrMemVoltDomainReply_t* l_ptr=
+ reinterpret_cast<const hwsvPowrMemVoltDomainReply_t*>(l_extraData);
for (size_t i=0; i<l_elementCount; ++i)
{
- l_VmemId = l_ptr->VmemId;
+ domain = l_ptr->domain;
+ l_domainId = l_ptr->domainId;
l_errPlid = l_ptr->plid;
TRACFCOMP( g_trac_volt, INFO_MRK "HBVddrMsg::processVDDRmsg: "
- "l_VmemId=0x%08X, l_errPlid=0x%08X", l_VmemId,l_errPlid);
+ "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: no plid "
- "error found for l_VmemId=0x%08X", l_VmemId);
+ TRACFCOMP( g_trac_volt, INFO_MRK "HBVddrMsg::processVDDRmsg: "
+ "no plid error found for domain = 0x%08X, "
+ "l_domainId=0x%08X", domain, l_domainId);
}
else
{
diff --git a/src/usr/hwpf/hwp/dram_training/hbVddrMsg.H b/src/usr/hwpf/hwp/dram_training/hbVddrMsg.H
index 4d71237cf..f04019919 100644
--- a/src/usr/hwpf/hwp/dram_training/hbVddrMsg.H
+++ b/src/usr/hwpf/hwp/dram_training/hbVddrMsg.H
@@ -45,6 +45,7 @@
#include <targeting/common/targetservice.H>
#include <targeting/common/utilFilter.H>
#include <hwpf/hwpf_reasoncodes.H>
+#include <attributeenums.H>
/*****************************************************************************/
// Forward class declarations
@@ -61,44 +62,69 @@ class HBVddrMsg
{
public:
+
/**
- * @struct hwsvPowrVmemRequest_t
- *
- * @brief structure to contain the Vmem Voltage rail ID and
- * its corresponding voltage
+ * @brief Enum specifying a memory voltage domain type
+ */
+ enum MEM_VOLTAGE_DOMAIN
+ {
+ // For unknown / uninitialized values
+ MEM_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,
+
+ // 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,
+ };
+
+ /**
+ * @struct hwsvPowrMemVoltDomainRequest_t
*
+ * @brief Structure containing a memory voltage domain type, ID, and
+ * voltage in mV
*/
- struct hwsvPowrVmemRequest_t
+ struct hwsvPowrMemVoltDomainRequest_t
{
- TARGETING::ATTR_VMEM_ID_type VmemId;
- TARGETING::ATTR_MSS_VOLT_type Voltage;
-
- hwsvPowrVmemRequest_t()
+ MEM_VOLTAGE_DOMAIN domain;
+ TARGETING::ATTR_VMEM_ID_type domainId;
+ TARGETING::ATTR_MSS_VOLT_type voltageMillivolts;
+
+ hwsvPowrMemVoltDomainRequest_t()
+ : domain(MEM_VOLTAGE_DOMAIN_UNKNOWN),
+ domainId(0x0000),
+ voltageMillivolts(0x00000000)
{
- VmemId=0x0;
- Voltage=0;
}
- }__attribute__ ((packed));
+
+ } __attribute__ ((packed));
/**
- * @struct hwsvPowrVmemReply_t
- *
- * @brief structure to contain the Vmem Voltage rail ID and
- * its corresponding errorlog plid from the powr function
- * call
+ * @struct hwsvPowrMemVoltDomainReply_t
*
+ * @brief Structure containing a memory voltage domain type, ID, and error
+ * log PLID as returned by the FSP POWR function when it tried to set
+ * the implied voltage regulator to the specified voltage.
*/
- struct hwsvPowrVmemReply_t
+ struct hwsvPowrMemVoltDomainReply_t
{
- TARGETING::ATTR_VMEM_ID_type VmemId;
- uint32_t plid;
-
- hwsvPowrVmemReply_t()
+ MEM_VOLTAGE_DOMAIN domain;
+ TARGETING::ATTR_VMEM_ID_type domainId;
+ uint32_t plid;
+
+ hwsvPowrMemVoltDomainReply_t()
+ : domain(MEM_VOLTAGE_DOMAIN_UNKNOWN),
+ domainId(0x0000),
+ plid(0x00000000)
{
- VmemId=0x0;
- plid=0x0;
}
- }__attribute__ ((packed));
+
+ } __attribute__ ((packed));
/**
* @enum VDDR_MSG_TYPE
@@ -112,45 +138,50 @@ public:
HB_VDDR_DISABLE = 0x40000042,
};
- /**
+ /**
* @brief typedefs for containers for structures
*/
- typedef std::vector<hwsvPowrVmemReply_t> ResponseContainer;
- typedef std::vector<hwsvPowrVmemRequest_t> RequestContainer;
+ typedef std::vector<hwsvPowrMemVoltDomainReply_t> ResponseContainer;
+ typedef std::vector<hwsvPowrMemVoltDomainRequest_t> RequestContainer;
/**
* @brief Default constructor
*/
HBVddrMsg();
-
+
/**
* @brief Destructor
*
- * Releases all resources owned by the handle.
+ * Releases all resources owned by the handle.
*
* @return None
*
*/
~HBVddrMsg();
-
/**
- * @brief Uses the internal mailbox to send a message to the FSP
- *
- *
- * @par Detailed Description:
- * This funciton will create the request message by
- * going through the attributes and correlating the
- * VID and Voltage into the final message for all the
- * VIDs in the system
- *
- * @param[in/out] io_request
- * Contains the voltage and VID pairs to be passed
- * to hwsvd on the FSP.
- *
- * @return None
- */
- void createVddrData(RequestContainer& io_request)const;
+ * @brief Accumulates memory voltage domain type/ID/voltage records and
+ * appends them to the provided container
+ *
+ * @par Detailed Description:
+ * This function will accumulates memory voltage domain type/ID/voltage
+ * records and appends them to the provided container. If an "enable"
+ * request, adds records from all memory voltage domains. If a
+ * "disable" message, only adds records from the VDDR (a.k.a. VMEM)
+ * voltage domain.
+ *
+ * @param[in] i_requestType
+ * Type of data accumulation request
+ *
+ * @param[in/out] io_request
+ * On input, a container to hold the memory voltage domain programming
+ * records. On output, the container holds the relevant records.
+ *
+ * @return N/A
+ */
+ void createVddrData(
+ const VDDR_MSG_TYPE i_requestType,
+ RequestContainer& io_request) const;
/**
* @brief Uses the internal mailbox to send a message to the FSP
@@ -170,14 +201,66 @@ public:
*/
errlHndl_t sendMsg(uint32_t i_msgType) const;
+private:
-protected:
+ /**
+ * @brief For a given memory buffer and memory voltage domain, adds a
+ * voltage programming request record to the input list
+ *
+ * @tparam OFFSET_DISABLEMENT_ATTR
+ * ID of the attribute to read to determine if a given memory voltage
+ * domain offset voltage should be applied or not. Should be one of
+ * the TARGETING::ATTR_*_ID attribute IDs, where * = VMEM, VPP, VCS,
+ * VDD, or AVDD.
+ *
+ * @tparam VOLTAGE_ATTR_WHEN_OFFSET_ENABLED
+ * ID of the attribute which should be read to obtain the given memory
+ * voltage domain's offset voltage to program. In this case the offset
+ * voltage acts as the actual voltage. Should be one of the
+ * TARGETING::ATTR_MEM_*_OFFSET_MILLIVOLTS attribute IDs, where
+ * * = VMEM, VPP, VCS, VDD, or AVDD. Only used when the memory voltage
+ * domain's offset voltage is enabled. Otherwise the parameter, below,
+ * controls how the voltage, if any, is programmed.
+ *
+ * @tparam VOLTAGE_ATTR_WHEN_OFFSET_DISABLED
+ * ID of the attribute which should be read to obtain the given memory
+ * voltage domain's voltage to program. Only applied if the memory
+ * voltage domain's offset voltage is disabled -AND- the attribute ID
+ * is different than the one given by
+ * VOLTAGE_ATTR_WHEN_OFFSET_ENABLED. Should be one of
+ * TARGETING::ATTR_VPP_BASE, TARGETING::ATTR_MSS_VOLT, or
+ * TARGETING::ATTR_MEM_*_OFFSET_MILLIVOLTS where * = VPP, AVDD, or
+ * VCS.
+ *
+ * @note: This function does not ensure that all permutations of the above
+ * template parameters are valid.
+ *
+ * @param[in] i_pMembuf
+ * Handle to a memory buffer target. Function will assert if NULL or
+ * not a memory buffer target.
+ *
+ * @param[in,out] io_domains
+ * On input, an existing list of 0 or more voltage domain records. On
+ * output, that same list with up to 1 additional voltage domain
+ * record.
+ *
+ * @return N/A
+ */
+ template<
+ const TARGETING::ATTRIBUTE_ID OFFSET_DISABLEMENT_ATTR,
+ const TARGETING::ATTRIBUTE_ID VOLTAGE_ATTR_WHEN_OFFSET_ENABLED,
+ const TARGETING::ATTRIBUTE_ID VOLTAGE_ATTR_WHEN_OFFSET_DISABLED,
+ const TARGETING::ATTRIBUTE_ID VOLTAGE_DOMAIN_ID_ATTR >
+ void addMemoryVoltageDomains(
+ const TARGETING::Target* const i_pMembuf,
+ HBVddrMsg::RequestContainer& io_domains) const;
+protected:
/**
* @brief function to process a generic message recieved from the FSP
*
- * @param[in] i_recvMsg The message from the message queue.
+ * @param[in] i_recvMsg The message from the message queue.
* It contains the response data from the FSP
*
* @return errlHndl_t
@@ -189,11 +272,11 @@ protected:
/**
* @brief function to process a power Vmem message recieved from the FSP
*
- * @param[in] i_recvMsg The message from the message queue.
+ * @param[in] i_recvMsg The message from the message queue.
* It contains the response data from the FSP
*
- * @param[out] i_passed indicates if powr function succeeded or failed on the
- * FSP.
+ * @param[out] i_passed indicates if powr function succeeded or failed on
+ * the FSP.
*
* @return errlHndl_t
* return errl == NULL -> success
@@ -204,9 +287,9 @@ protected:
/**
* @brief function to create error logs for errors that occured in FSP side
*
- * @param[in/out] io_err. Error log to generate indicating that an error has
- * has occured on HB or in the powr messages. This error
- * should stop the IPL from processing further.
+ * @param[in/out] io_err. Error log to generate indicating that an error
+ * has has occured on HB or in the powr messages. This error
+ * should stop the IPL from processing further.
*
* @param[in] i_mod. The module where the error occured
*
OpenPOWER on IntegriCloud