summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C
diff options
context:
space:
mode:
authorDoug Gilbert <dgilbert@us.ibm.com>2014-05-16 15:16:15 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-06-30 20:08:27 -0500
commit11d47db77ef4d118c75e9e23ad8c4ca9663d0fff (patch)
treedc0e09e93de108dc2cf44ef69d2688f7ab40944c /src/usr/hwpf/hwp/dram_training/hbVddrMsg.C
parent61a956f980a4be2f19d33067236018e7efd074e7 (diff)
downloadtalos-hostboot-11d47db77ef4d118c75e9e23ad8c4ca9663d0fff.tar.gz
talos-hostboot-11d47db77ef4d118c75e9e23ad8c4ca9663d0fff.zip
Merge GPIO commits from Stradale code base
Change-Id: Ibadeb72f563d86aa933734c7db20a50b19485ac7 RTC: 97490 Origin: Google Shared Technology Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11501 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/dram_training/hbVddrMsg.C')
-rw-r--r--src/usr/hwpf/hwp/dram_training/hbVddrMsg.C119
1 files changed, 101 insertions, 18 deletions
diff --git a/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C b/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C
index 3e4fa82ac..f585de1a2 100644
--- a/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C
+++ b/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C
@@ -5,7 +5,10 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* [+] Google Inc. */
+/* [+] 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. */
@@ -36,6 +39,7 @@
#include <initservice/initserviceif.H>
#include <pnor/pnorif.H>
#include <fapi.H>
+#include "platform_vddr.H"
using namespace ERRORLOG;
@@ -303,7 +307,8 @@ errlHndl_t HBVddrMsg::sendMsg(uint32_t i_msgType) const
{
errlHndl_t l_err = NULL;
- TRACFCOMP(g_trac_volt, ENTER_MRK "hbVddrMsg::sendMsg msg_type =0x%08X",i_msgType);
+ TRACFCOMP(g_trac_volt, ENTER_MRK
+ "hbVddrMsg::sendMsg msg_type =0x%08X",i_msgType);
do
{
@@ -378,7 +383,8 @@ errlHndl_t HBVddrMsg::sendMsg(uint32_t i_msgType) const
l_err = MBOX::sendrecv( MBOX::FSP_VDDR_MSGQ, l_msg );
if (l_err)
{
- TRACFCOMP(g_trac_volt, ERR_MRK "Failed sending VDDR message to FSP");
+ TRACFCOMP(g_trac_volt,
+ ERR_MRK "Failed sending VDDR message to FSP");
}
else
{
@@ -419,7 +425,8 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const
if (l_extraData==NULL)
{
//an error occred in obtaining the extra data from the response msg
- TRACFCOMP( g_trac_volt, ERR_MRK "HBVddrMsg::processVDDRmsg: l_extraData = NULL");
+ TRACFCOMP( g_trac_volt, ERR_MRK
+ "HBVddrMsg::processVDDRmsg: l_extraData = NULL");
//create an errorlog
/*@
* @errortype
@@ -464,9 +471,11 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const
}
else
{
- //error occured so break out of the loop and indicate an error was present
- TRACFCOMP( g_trac_volt, ERR_MRK "HBVddrMsg::processVDDRmsg: error occured "
- "on the powr function called in hwsv");
+ //error occured so break out of the loop and indicate
+ //an error was present
+ TRACFCOMP( g_trac_volt, ERR_MRK
+ "HBVddrMsg::processVDDRmsg: error occured "
+ "on the powr function called in hwsv");
//create an errorlog
/*@
* @errortype
@@ -475,9 +484,10 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const
* @userdata1 l_errPlid
* @userdata2 0
*
- * @devdesc The hwsv returned a message where there was an error
- * when the powr function was called. userdata1 contains
- * the errorlog plid from hwsv generated by the powr function
+ * @devdesc The hwsv returned a message where there was
+ * an error when the powr function was called.
+ * userdata1 contains the errorlog plid from
+ * hwsv generated by the powr function
*/
createErrLog(l_errLog, fapi::MOD_VDDR_PROC_VDDR_MSG,
fapi::RC_VDDR_POWR_ERR, l_errPlid);
@@ -502,8 +512,9 @@ errlHndl_t HBVddrMsg::processMsg(msg_t* i_Msg) const
do
{
- //check to see if the data[0] =0 or contains a value. A value of 0 means its a
- //response to a request and a value not equal to zero means that its an error coming back
+ //check to see if the data[0] =0 or contains a value.
+ //A value of 0 means its a response to a request and a value not equal
+ //to zero means that its an error coming back
uint16_t l_value1=i_Msg->data[0];
if (l_value1 ==0)
@@ -511,8 +522,10 @@ 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) )
+ 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) )
{
//process a VDDR message
l_errLog=processVDDRmsg(i_Msg);
@@ -524,7 +537,8 @@ errlHndl_t HBVddrMsg::processMsg(msg_t* i_Msg) const
}
else
{
- TRACFCOMP( g_trac_volt, ERR_MRK "HBVddrMsg::processMsg recv'd a non valid type");
+ TRACFCOMP( g_trac_volt, ERR_MRK
+ "HBVddrMsg::processMsg recv'd a non valid type");
//generate errorLog;
/*@
* @errortype
@@ -533,8 +547,9 @@ errlHndl_t HBVddrMsg::processMsg(msg_t* i_Msg) const
* @userdata1 0
* @userdata2 0
*
- * @devdesc HB got an incorrect type message. HWSV did not populate
- * the message correctly or mbox corrupted the message
+ * @devdesc HB got an incorrect type message.
+ * HWSV did not populate the message correctly
+ * or mbox corrupted the message
*/
createErrLog(l_errLog, fapi::MOD_VDDR_PROC_MSG,
fapi::RC_INCORRECT_MSG_TYPE);
@@ -543,7 +558,8 @@ errlHndl_t HBVddrMsg::processMsg(msg_t* i_Msg) const
else
{
//an error occurred so should stop the IPL
- TRACFCOMP( g_trac_volt, ERR_MRK "HBVddrMsg::RecvMsgHndlr recv'd an error message" );
+ TRACFCOMP( g_trac_volt, ERR_MRK
+ "HBVddrMsg::RecvMsgHndlr recv'd an error message" );
//generate an errorlog
/*@
* @errortype
@@ -589,4 +605,71 @@ void HBVddrMsg::createErrLog(errlHndl_t& io_err,
return;
}
+// External interfaces
+
+errlHndl_t platform_enable_vspd()
+{
+ // noop on FSP based system
+ return NULL;
+}
+
+errlHndl_t platform_enable_vddr()
+{
+ errlHndl_t l_err = NULL;
+ if(INITSERVICE::spBaseServicesEnabled())
+ {
+ HBVddrMsg l_hbVddr;
+
+ l_err = l_hbVddr.sendMsg(HBVddrMsg::HB_VDDR_ENABLE);
+ if (l_err)
+ {
+ TRACFCOMP(g_trac_volt,
+ "ERROR 0x%.8X: call_host_enable_vddr to sendMsg"
+ " returns error",
+ l_err->reasonCode());
+ }
+ else
+ {
+ TRACFCOMP( g_trac_volt,
+ "SUCCESS : host_enable_vddr()" );
+ }
+ }
+ else // simics stand-alone TULETTA
+ {
+ TRACFCOMP(g_trac_volt,"call_host_enable_vddr"
+ "no-op because mbox not available");
+ }
+
+ return l_err;
+}
+
+errlHndl_t platform_disable_vddr()
+{
+ errlHndl_t l_err = NULL;
+ if(INITSERVICE::spBaseServicesEnabled())
+ {
+ HBVddrMsg l_hbVddr;
+
+ l_err = l_hbVddr.sendMsg(HBVddrMsg::HB_VDDR_DISABLE);
+ if (l_err)
+ {
+ TRACFCOMP(g_trac_volt,
+ "ERROR 0x%.8X: call_host_disable_vddr to sendMsg"
+ " returns error",
+ l_err->reasonCode());
+ }
+ else
+ {
+ TRACFCOMP( g_trac_volt,
+ "SUCCESS : host_disable_vddr()" );
+ }
+ }
+ else // simics stand-along TULETTA
+ {
+ TRACFCOMP(g_trac_volt,"call_host_disable_vddr"
+ "no-op because mbox not available");
+ }
+
+ return l_err;
+}
OpenPOWER on IntegriCloud