summaryrefslogtreecommitdiffstats
path: root/src/usr/vpd
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2018-02-13 14:31:21 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-03-13 14:52:06 -0400
commit5fc3b529c69246a6706577351bccd7898f1c227b (patch)
treea79f315686b7d189c452e67d1525b1f948017f3a /src/usr/vpd
parent27755fae10595e6e37314065c24046ea35f2829e (diff)
downloadtalos-hostboot-5fc3b529c69246a6706577351bccd7898f1c227b.tar.gz
talos-hostboot-5fc3b529c69246a6706577351bccd7898f1c227b.zip
Support multiple nodes in HBRT - VPD Image
Enable HBRT to find the location of the correct VPD image on a multiple node system. Change-Id: I712879cf2c58d71d55ba13b06285e41bbf4ea65d RTC: 186583 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53983 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/vpd')
-rw-r--r--src/usr/vpd/runtime/rt_vpd.C34
-rw-r--r--src/usr/vpd/vpd.H7
2 files changed, 31 insertions, 10 deletions
diff --git a/src/usr/vpd/runtime/rt_vpd.C b/src/usr/vpd/runtime/rt_vpd.C
index 42d7f0fa6..e10759b82 100644
--- a/src/usr/vpd/runtime/rt_vpd.C
+++ b/src/usr/vpd/runtime/rt_vpd.C
@@ -57,7 +57,7 @@ extern trace_desc_t* g_trac_vpd;
// Global variable to store the location of hbrt-vpd-image returned by the
// host interface get_reserved_mem function. We only want to call the
// function once as memory is allocated with every call.
-static uint64_t g_reserved_mem_addr = 0;
+static uint64_t g_reserved_mem_addr[] = {0, 0, 0, 0};
namespace VPD
@@ -97,20 +97,22 @@ rtVpdInit g_rtVpdInit;
// Fake getPnorAddr - VPD image is in memory
// ------------------------------------------------------------------
errlHndl_t getPnorAddr( pnorInformation & i_pnorInfo,
+ uint8_t i_instance,
uint64_t &io_cachedAddr,
mutex_t * i_mutex )
{
errlHndl_t err = NULL;
// Get the reserved_mem_addr only once
- if( g_reserved_mem_addr == 0 )
+ if( g_reserved_mem_addr[i_instance] == 0 )
{
uint64_t l_vpdSize;
- g_reserved_mem_addr = hb_get_rt_rsvd_mem(Util::HBRT_MEM_LABEL_VPD,
- 0,
- l_vpdSize);
+ g_reserved_mem_addr[i_instance] =
+ hb_get_rt_rsvd_mem(Util::HBRT_MEM_LABEL_VPD,
+ i_instance,
+ l_vpdSize);
- if( g_reserved_mem_addr == 0 )
+ if( g_reserved_mem_addr[i_instance] == 0 )
{
TRACFCOMP(g_trac_vpd,ERR_MRK"rt_vpd: Failed to get VPD addr. "
"vpd_type: %d",
@@ -120,14 +122,14 @@ errlHndl_t getPnorAddr( pnorInformation & i_pnorInfo,
* @moduleid VPD::VPD_RT_GET_ADDR
* @reasoncode VPD::VPD_RT_NULL_VPD_PTR
* @userdata1 VPD type
- * @userdata2 0
+ * @userdata2 Node ID
* @devdesc Hypervisor returned NULL address for VPD
*/
err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_INFORMATIONAL,
VPD::VPD_RT_GET_ADDR,
VPD::VPD_RT_NULL_VPD_PTR,
i_pnorInfo.pnorSection,
- 0);
+ i_instance);
err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_HIGH);
@@ -136,7 +138,7 @@ errlHndl_t getPnorAddr( pnorInformation & i_pnorInfo,
}
}
- uint64_t vpd_addr = g_reserved_mem_addr;
+ uint64_t vpd_addr = g_reserved_mem_addr[i_instance];
if(!err)
{
@@ -204,6 +206,7 @@ errlHndl_t readPNOR ( uint64_t i_byteAddr,
mutex_t * i_mutex )
{
errlHndl_t err = NULL;
+ TARGETING::NODE_ID l_nodeId = TARGETING::NODE0;
int64_t vpdLocation = 0;
uint64_t addr = 0x0;
const char * readAddr = NULL;
@@ -211,10 +214,16 @@ errlHndl_t readPNOR ( uint64_t i_byteAddr,
TRACSSCOMP( g_trac_vpd,
ENTER_MRK"RT fake readPNOR()" );
+ // Get AttrRP pointer
+ TARGETING::AttrRP *l_attrRP = &TARG_GET_SINGLETON(TARGETING::theAttrRP);
+ // Get the node ID associated with the input target
+ l_attrRP->getNodeId(i_target, l_nodeId);
+
do
{
// fake getPnorAddr gets memory address of VPD
err = getPnorAddr(i_pnorInfo,
+ l_nodeId,
io_cachedAddr,
i_mutex );
if(err)
@@ -267,6 +276,7 @@ errlHndl_t writePNOR ( uint64_t i_byteAddr,
{
errlHndl_t err = NULL;
+ TARGETING::NODE_ID l_nodeId = TARGETING::NODE0;
int64_t vpdLocation = 0;
uint64_t addr = 0x0;
const char * writeAddr = NULL;
@@ -274,6 +284,11 @@ errlHndl_t writePNOR ( uint64_t i_byteAddr,
TRACSSCOMP( g_trac_vpd,
ENTER_MRK"RT writePNOR()" );
+ // Get AttrRP pointer
+ TARGETING::AttrRP *l_attrRP = &TARG_GET_SINGLETON(TARGETING::theAttrRP);
+ // Get the node ID associated with the input target
+ l_attrRP->getNodeId(i_target, l_nodeId);
+
do
{
//----------------------------
@@ -281,6 +296,7 @@ errlHndl_t writePNOR ( uint64_t i_byteAddr,
//----------------------------
// Fake getPnorAddr gets memory address of VPD
err = getPnorAddr( i_pnorInfo,
+ l_nodeId,
io_cachedAddr,
i_mutex );
if(err)
diff --git a/src/usr/vpd/vpd.H b/src/usr/vpd/vpd.H
index c7fb329ae..22dd062fc 100644
--- a/src/usr/vpd/vpd.H
+++ b/src/usr/vpd/vpd.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2017 */
+/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -107,6 +107,8 @@ errlHndl_t getVpdLocation ( int64_t & o_vpdLocation,
* @param[in] i_pnorInfo - Structure of common PNOR information needed to
* query for the sections address.
*
+ * @param[in] i_instance -Reserved memory instance (Hostboot Runtime only).
+ *
* @param[in/out] io_cachedAddr - This parameter is a gloval variable in the
* calling code. It is the address that is obtained from the PNOR
* RP.
@@ -118,6 +120,9 @@ errlHndl_t getVpdLocation ( int64_t & o_vpdLocation,
* Error log.
*/
errlHndl_t getPnorAddr ( pnorInformation & i_pnorInfo,
+#ifdef __HOSTBOOT_RUNTIME
+ uint8_t i_instance,
+#endif
uint64_t &io_cachedAddr,
mutex_t * i_mutex );
OpenPOWER on IntegriCloud