Skip to content

Commit

Permalink
Add mising pieces to read DVPD from HW
Browse files Browse the repository at this point in the history
- Added support for MCS target to access EEPROM device
- Added EEPROM_VPD_PRIMARY_INFO attribute for MCS target
- Fixup caching of DVPD in PNOR

Change-Id: I9fb2de82b16eb017517f5addf361c4a90b3edf30
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35767
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
Prachi Gupta authored and wghoffa committed Feb 7, 2017
1 parent 4bca31c commit f986133
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 20 deletions.
6 changes: 5 additions & 1 deletion src/usr/i2c/eepromdd.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2016 */
/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -103,6 +103,10 @@ DEVICE_REGISTER_ROUTE( DeviceFW::WILDCARD,
TARGETING::TYPE_NODE,
eepromPerformOp );

DEVICE_REGISTER_ROUTE( DeviceFW::WILDCARD,
DeviceFW::EEPROM,
TARGETING::TYPE_MCS,
eepromPerformOp );
// ------------------------------------------------------------------
// eepromPerformOp
// ------------------------------------------------------------------
Expand Down
19 changes: 19 additions & 0 deletions src/usr/targeting/common/Targets.pm
Expand Up @@ -1659,6 +1659,25 @@ sub copyAttribute
$self->log($dest_target, "Copy Attribute: $attribute=$value");
}

## copy an attribute between targets
sub copyAttributeFields
{
my $self = shift;
my $source_target = shift;
my $dest_target = shift;
my $attribute = shift;

foreach my $f(sort keys
%{$self->{data}->{TARGETS}->{$source_target}->{ATTRIBUTES}->{$attribute}->{default}->{field}})
{
my $field_val = $self->getAttributeField($source_target,
$attribute, $f);
$self->setAttributeField($dest_target,$attribute,$f,
$field_val);
$self->log($dest_target, "Copy Attribute Field:$attribute($f)=$field_val");
}
}

## sets an attribute
sub setAttribute
{
Expand Down
15 changes: 15 additions & 0 deletions src/usr/targeting/common/processMrw.pl
Expand Up @@ -708,6 +708,21 @@ sub processMcs
my $group = shift;
my $proc = shift;

#@FIXME RTC:168611 To decouple DVPD from PVPD
#parentTarget == MCBIST
#parent(MCBIST) = Proc
#parent(proc) = module
#parent(module) = socket
#parent(socket) = motherboard
#parent(motherboard) = node
my $node = $targetObj->getTargetParent( #node
$targetObj->getTargetParent( #motherboard
$targetObj->getTargetParent #socket
($targetObj->getTargetParent #module
($targetObj->getTargetParent($parentTarget)))));
my $name = "EEPROM_VPD_PRIMARY_INFO";
$targetObj->copyAttributeFields($node, $target, "EEPROM_VPD_PRIMARY_INFO");

#@TODO RTC:163874 -- maybe needed for centaur support


Expand Down
1 change: 1 addition & 0 deletions src/usr/targeting/common/xmltohb/target_types.xml
Expand Up @@ -1408,6 +1408,7 @@
<attribute><id>HWAS_STATE_CHANGED_SUBSCRIPTION_MASK</id>
<default>0x00000003</default> <!-- GARD | MEMDIAG -->
</attribute>
<attribute><id>EEPROM_VPD_PRIMARY_INFO</id></attribute>
<attribute><id>IBSCOM_MCS_BASE_ADDR</id></attribute>
<attribute><id>EI_BUS_TX_MSBSWAP</id></attribute>
<attribute><id>SCRATCH_UINT8_1</id><default>5</default></attribute>
Expand Down
20 changes: 4 additions & 16 deletions src/usr/vpd/dvpd.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -45,9 +45,6 @@
#include "vpd.H"
#include "pvpd.H"
#include <initservice/initserviceif.H>
#ifdef CONFIG_PVPD_READ_FROM_PNOR
#include "pvpd.H"
#endif

// ----------------------------------------------
// Trace definitions
Expand Down Expand Up @@ -252,18 +249,9 @@ errlHndl_t directMemoryPresenceDetect(DeviceFW::OperationType i_opType,

dvpd_present = DVPD::dvpdPresent( i_target );
#if defined(CONFIG_MEMVPD_READ_FROM_HW) && defined(CONFIG_MEMVPD_READ_FROM_PNOR)
if( dvpd_present )
{
// Check if the VPD data in the PNOR matches the SEEPROM
l_errl = VPD::ensureCacheIsInSync( i_target );
if( l_errl )
{
TRACFCOMP(g_trac_vpd,ERR_MRK "nodePresenceDetect>"
" Error during ensureCacheIsInSync (DVPD)" );
errlCommit( l_errl, FSI_COMP_ID );
}
}
else
//skipping cache sync when dvpd is present as it will be taken care by node
//vpd
if( !dvpd_present )
{
TRACFCOMP(g_trac_vpd,
ERR_MRK "directMemoryPresenceDetect> failed presence detect");
Expand Down
3 changes: 3 additions & 0 deletions src/usr/vpd/pvpd.C
Expand Up @@ -372,6 +372,9 @@ void PvpdFacade::getRecordLists(
#ifdef CONFIG_MEMVPD_READ_FROM_PNOR
o_altVpdRecords = Singleton<CvpdFacade>::instance().iv_vpdRecords;
o_altRecSize = Singleton<CvpdFacade>::instance().iv_recSize;
#elif CONFIG_MEMVPD_READ_FROM_HW
o_altVpdRecords = Singleton<DvpdFacade>::instance().iv_vpdRecords;
o_altRecSize = Singleton<DvpdFacade>::instance().iv_recSize;
#else
o_altVpdRecords = NULL;
o_altRecSize = 0;
Expand Down
14 changes: 11 additions & 3 deletions src/usr/vpd/vpd.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -37,6 +37,7 @@
#include "pvpd.H"
#include "spd.H"
#include "ipvpd.H"
#include "dvpd.H"
#include <map>

// ----------------------------------------------
Expand Down Expand Up @@ -579,6 +580,12 @@ errlHndl_t getPnAndSnRecordAndKeywords( TARGETING::Target * i_target,
io_keywordSN = PVPD::SN;
#endif
}
else if( i_type == TARGETING::TYPE_MCS )
{
io_record = DVPD::VINI;
io_keywordPN = DVPD::PN;
io_keywordSN = DVPD::SN;
}
else
{
TRACFCOMP(g_trac_vpd,ERR_MRK"VPD::getPnAndSnRecordAndKeywords() Unexpected target type, huid=0x%X",TARGETING::get_huid(i_target));
Expand Down Expand Up @@ -629,6 +636,7 @@ errlHndl_t ensureCacheIsInSync ( TARGETING::Target * i_target )
{
l_ipvpd = &(Singleton<PvpdFacade>::instance());
}

do
{
// Get the correct Part and serial numbers
Expand All @@ -648,7 +656,7 @@ errlHndl_t ensureCacheIsInSync ( TARGETING::Target * i_target )
bool l_matchPN = false;
if( ( l_type == TARGETING::TYPE_PROC ) ||
( l_type == TARGETING::TYPE_NODE ) ||
( l_type == TARGETING::TYPE_MEMBUF ) )
( l_type == TARGETING::TYPE_MEMBUF ))
{
l_err = l_ipvpd->cmpPnorToSeeprom( i_target,
l_record,
Expand Down Expand Up @@ -705,7 +713,7 @@ errlHndl_t ensureCacheIsInSync ( TARGETING::Target * i_target )
// Load the PNOR data from the SEEPROM
if( ( l_type == TARGETING::TYPE_PROC ) ||
( l_type == TARGETING::TYPE_NODE ) ||
( l_type == TARGETING::TYPE_MEMBUF ) )
( l_type == TARGETING::TYPE_MEMBUF ))
{
l_err = l_ipvpd->loadPnor( i_target );
}
Expand Down

0 comments on commit f986133

Please sign in to comment.