summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/vpd/vpdreasoncodes.H3
-rwxr-xr-xsrc/usr/i2c/eepromdd.C6
-rwxr-xr-xsrc/usr/i2c/i2c.C6
-rw-r--r--src/usr/vpd/HBconfig2
-rw-r--r--src/usr/vpd/errlud_vpd.C79
-rw-r--r--src/usr/vpd/errlud_vpd.H44
-rw-r--r--src/usr/vpd/ipvpd.C182
-rw-r--r--src/usr/vpd/ipvpd.H8
-rw-r--r--src/usr/vpd/plugins/errludP_vpd.H74
-rw-r--r--src/usr/vpd/plugins/vpdUdParserFactory.H6
-rw-r--r--src/usr/vpd/spd.C59
-rwxr-xr-xsrc/usr/vpd/vpd.C22
-rw-r--r--src/usr/vpd/vpd.H12
13 files changed, 410 insertions, 93 deletions
diff --git a/src/include/usr/vpd/vpdreasoncodes.H b/src/include/usr/vpd/vpdreasoncodes.H
index 4ac5361b9..68dc00c2b 100644
--- a/src/include/usr/vpd/vpdreasoncodes.H
+++ b/src/include/usr/vpd/vpdreasoncodes.H
@@ -57,6 +57,7 @@ enum vpdModuleId
VPD_IPVPD_CHECK_BUFFER_SIZE = 0x24,
VPD_IPVPD_FIND_RECORD_OFFSET_SEEPROM = 0x30,
VPD_IPVPD_FETCH_DATA = 0x31,
+ VPD_IPVPD_WRITE_KEYWORD = 0x32,
// DIMM SPD
@@ -127,6 +128,7 @@ enum vpdReasonCode
VPD_READ_SOURCE_UNRESOLVED = VPD_COMP_ID | 0x31,
VPD_REMOVE_PAGES_FAIL = VPD_COMP_ID | 0x32,
VPD_UNEXPECTED_TARGET_TYPE = VPD_COMP_ID | 0x33,
+ VPD_WRITE_DEST_UNRESOLVED = VPD_COMP_ID | 0x34,
};
@@ -141,6 +143,7 @@ enum UserDetailsTypes
{
VPD_UDT_NO_FORMAT = 0x0,
VPD_UDT_PARAMETERS = 0x1,
+ VPD_UDT_CONFIG_PARMS = 0x2,
};
}; // end MVPD
diff --git a/src/usr/i2c/eepromdd.C b/src/usr/i2c/eepromdd.C
index 4fddd2d22..82945a856 100755
--- a/src/usr/i2c/eepromdd.C
+++ b/src/usr/i2c/eepromdd.C
@@ -1065,6 +1065,12 @@ errlHndl_t eepromReadAttributes ( TARGETING::Target * i_target,
o_i2cInfo.devSize_KB = eepromData.maxMemorySizeKB;
o_i2cInfo.writeCycleTime = eepromData.writeCycleTime;
+ // @todo RTC:119764 remove when correct data is in the MRW
+ if( o_i2cInfo.writePageSize == 0 )
+ {
+ o_i2cInfo.writePageSize = 256;
+ }
+
// @todo RTC:116428 - forcing the attribute data for now
// until we can pull it from the MRW
if( TARGETING::TYPE_MEMBUF ==
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index 95471f13e..0fbabed73 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -2484,6 +2484,12 @@ errlHndl_t i2cSetBusVariables ( TARGETING::Target * i_target,
{
io_args.bus_speed = speed_array[io_args.engine][io_args.port];
+ // @todo RTC:119764 remove when I2C_BUS_SPEED_ARRAY attr fixed
+ if (io_args.bus_speed == 0)
+ {
+ io_args.bus_speed = I2C_BUS_SPEED_400KHZ;
+ }
+
assert(io_args.bus_speed,
"i2cSetBusVariables: bus_speed array[%d][%d] for "
"tgt 0x%X is 0",
diff --git a/src/usr/vpd/HBconfig b/src/usr/vpd/HBconfig
index 3995b1982..f0ab90311 100644
--- a/src/usr/vpd/HBconfig
+++ b/src/usr/vpd/HBconfig
@@ -34,7 +34,6 @@ config MVPD_READ_FROM_HW
config MVPD_WRITE_TO_PNOR
default y if MVPD_READ_FROM_PNOR
- depends on MVPD_READ_FROM_PNOR
help
Write Module VPD data to PNOR cache
@@ -56,7 +55,6 @@ config DJVPD_READ_FROM_HW
config DJVPD_WRITE_TO_PNOR
default y if DJVPD_READ_FROM_PNOR
- depends on DJVPD_READ_FROM_PNOR
help
Write Dimm JEDEC VPD/SPD data to PNOR cache
diff --git a/src/usr/vpd/errlud_vpd.C b/src/usr/vpd/errlud_vpd.C
index c129ff0d1..f24a5a030 100644
--- a/src/usr/vpd/errlud_vpd.C
+++ b/src/usr/vpd/errlud_vpd.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] 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. */
@@ -34,7 +36,7 @@ namespace VPD
{
//------------------------------------------------------------------------------
-// VPD
+// UdVpdParms
//------------------------------------------------------------------------------
UdVpdParms::UdVpdParms( TARGETING::Target * i_target,
uint64_t i_buflen,
@@ -92,4 +94,77 @@ UdVpdParms::~UdVpdParms()
}
+//------------------------------------------------------------------------------
+// UdConfigParms
+//------------------------------------------------------------------------------
+UdConfigParms::UdConfigParms( TARGETING::Target * i_target,
+ uint64_t i_record,
+ uint64_t i_keyword,
+ uint64_t i_location,
+ uint64_t i_readPnor,
+ uint64_t i_readHw,
+ uint64_t i_writePnor,
+ uint64_t i_writeHw )
+{
+ // Set up Ud instance variables
+ iv_CompId =VPD_COMP_ID;
+ iv_Version = 1;
+ iv_SubSection = VPD_UDT_CONFIG_PARMS;
+
+ //***** Memory Layout *****
+ // 4 bytes : Target HUID
+ // 8 bytes : Record
+ // 8 bytes : Keyword
+ // 8 bytes : Location
+ // 8 bytes : Read PNOR Config
+ // 8 bytes : Read HW Config
+ // 8 bytes : Write PNOR Config
+ // 8 bytes : Write HW Config
+
+ char * l_pBuf = reinterpret_cast<char *>(
+ reallocUsrBuf(sizeof(uint32_t)
+ +sizeof(uint64_t)*7));
+ uint32_t tmp64 = 0;
+ uint16_t tmp32 = 0;
+
+ tmp32 = TARGETING::get_huid(i_target);
+ memcpy(l_pBuf, &tmp32, sizeof(tmp32));
+ l_pBuf += sizeof(tmp32);
+
+ tmp64 = i_record;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_keyword;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_location;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_readPnor;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_readHw;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_writePnor;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_writeHw;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+}
+
+//------------------------------------------------------------------------------
+UdConfigParms::~UdConfigParms()
+{
+
+}
+
+
}
diff --git a/src/usr/vpd/errlud_vpd.H b/src/usr/vpd/errlud_vpd.H
index c23d8901c..f3b01eed2 100644
--- a/src/usr/vpd/errlud_vpd.H
+++ b/src/usr/vpd/errlud_vpd.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] 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. */
@@ -70,6 +72,46 @@ class UdVpdParms : public ERRORLOG::ErrlUserDetails
};
+/**
+ * @class UdConfigParms
+ *
+ * Adds VPD parameters/config information to an error log as user detail data
+ */
+class UdConfigParms : public ERRORLOG::ErrlUserDetails
+{
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param i_target Target being detected/acted upon
+ * @param i_record Record
+ * @param i_keyword Keyword
+ * @param i_location Location - PNOR/EEPROM
+ * @param i_readPnor Read PNOR config
+ * @param i_readHw Read HW config
+ * @param i_writePnor Write PNOR config
+ * @param i_writeHw Write HW config
+ */
+ UdConfigParms( TARGETING::Target * i_target,
+ uint64_t i_record,
+ uint64_t i_keyword,
+ uint64_t i_location,
+ uint64_t i_readPnor,
+ uint64_t i_readHw,
+ uint64_t i_writePnor,
+ uint64_t i_writeHw );
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdConfigParms();
+
+ private:
+ // Disabled
+ UdConfigParms(UdConfigParms &);
+ UdConfigParms & operator=(UdConfigParms &);
+};
+
}
#endif
diff --git a/src/usr/vpd/ipvpd.C b/src/usr/vpd/ipvpd.C
index f1ef73053..8e7e4a301 100644
--- a/src/usr/vpd/ipvpd.C
+++ b/src/usr/vpd/ipvpd.C
@@ -139,6 +139,8 @@ errlHndl_t IpVpdFacade::read ( TARGETING::Target * i_target,
// Get the offset of the record requested
err = findRecordOffset( recordName,
recordOffset,
+ iv_configInfo.vpdReadPNOR,
+ iv_configInfo.vpdReadHW,
i_target,
i_args );
if( err )
@@ -208,7 +210,6 @@ errlHndl_t IpVpdFacade::write ( TARGETING::Target * i_target,
err = translateKeyword( i_args.keyword,
keywordName );
-
if( err )
{
break;
@@ -218,31 +219,70 @@ errlHndl_t IpVpdFacade::write ( TARGETING::Target * i_target,
INFO_MRK"IpVpdFacade::Write: Record (%s) and Keyword (%s)",
recordName, keywordName );
- // Get the offset of the record requested
- err = findRecordOffset( recordName,
- recordOffset,
- i_target,
- i_args );
-
- if( err )
+ // If writes to PNOR and SEEPROM are both enabled and
+ // the write location is not specified, then call
+ // write() recursively for each location
+ if ( iv_configInfo.vpdWritePNOR &&
+ iv_configInfo.vpdWriteHW &&
+ i_args.location == VPD::AUTOSELECT )
{
- break;
- }
+ input_args_t l_args;
+ l_args.record = i_args.record;
+ l_args.keyword = i_args.keyword;
- // use record offset to find/write the keyword
- err = writeKeyword( keywordName,
- recordName,
- recordOffset,
- i_target,
- io_buffer,
- io_buflen,
- i_args );
+ l_args.location = VPD::SEEPROM;
+ err = write( i_target,
+ io_buffer,
+ io_buflen,
+ l_args );
+ if( err )
+ {
+ break;
+ }
- if( err )
- {
- break;
+ // PNOR needs to be loaded before we can write it
+ TARGETING::ATTR_VPD_SWITCHES_type vpdSwitches =
+ i_target->getAttr<TARGETING::ATTR_VPD_SWITCHES>();
+ if( vpdSwitches.pnorLoaded )
+ {
+ l_args.location = VPD::PNOR;
+ err = write( i_target,
+ io_buffer,
+ io_buflen,
+ l_args );
+ if( err )
+ {
+ break;
+ }
+ }
}
+ else
+ {
+ // Get the offset of the record requested
+ err = findRecordOffset( recordName,
+ recordOffset,
+ iv_configInfo.vpdWritePNOR,
+ iv_configInfo.vpdWriteHW,
+ i_target,
+ i_args );
+ if( err )
+ {
+ break;
+ }
+ // Use record offset to find/write the keyword
+ err = writeKeyword( keywordName,
+ recordName,
+ recordOffset,
+ i_target,
+ io_buffer,
+ io_buflen,
+ i_args );
+ if( err )
+ {
+ break;
+ }
+ }
} while( 0 );
// If there is an error, add parameter info to log
@@ -707,6 +747,8 @@ errlHndl_t IpVpdFacade::translateKeyword ( VPD::vpdKeyword i_keyword,
// ------------------------------------------------------------------
errlHndl_t IpVpdFacade::findRecordOffset ( const char * i_record,
uint16_t & o_offset,
+ bool i_rwPnorEnabled,
+ bool i_rwHwEnabled,
TARGETING::Target * i_target,
input_args_t i_args )
{
@@ -716,8 +758,8 @@ errlHndl_t IpVpdFacade::findRecordOffset ( const char * i_record,
VPD::vpdCmdTarget vpdSource = VPD::AUTOSELECT;
bool configError = false;
configError = VPD::resolveVpdSource( i_target,
- iv_configInfo.vpdReadPNOR,
- iv_configInfo.vpdReadHW,
+ i_rwPnorEnabled,
+ i_rwHwEnabled,
i_args.location,
vpdSource );
// Get the record offset
@@ -751,8 +793,8 @@ errlHndl_t IpVpdFacade::findRecordOffset ( const char * i_record,
* @moduleid VPD::VPD_IPVPD_FIND_RECORD_OFFSET
* @userdata1[0:31] Target HUID
* @userdata1[32:63] Requested VPD Source Location
- * @userdata2[0:31] CONFIG_<vpd>_READ_FROM_PNOR
- * @userdata2[32:63] CONFIG_<vpd>_READ_FROM_HW
+ * @userdata2[0:31] CONFIG_<vpd>_READ_WRITE_CONFIG_PNOR
+ * @userdata2[32:63] CONFIG_<vpd>_READ_WRITE_CONFIG_HW
* @devdesc Unable to resolve the VPD
* source (PNOR or SEEPROM)
*/
@@ -763,9 +805,18 @@ errlHndl_t IpVpdFacade::findRecordOffset ( const char * i_record,
TARGETING::get_huid(i_target),
i_args.location ),
TWO_UINT32_TO_UINT64(
- iv_configInfo.vpdReadPNOR,
- iv_configInfo.vpdReadHW ),
+ i_rwPnorEnabled,
+ i_rwHwEnabled ),
true /*Add HB SW Callout*/ );
+ VPD::UdConfigParms( i_target,
+ i_args.record,
+ i_args.keyword,
+ i_args.location,
+ iv_configInfo.vpdReadPNOR,
+ iv_configInfo.vpdReadHW,
+ iv_configInfo.vpdWritePNOR,
+ iv_configInfo.vpdWriteHW
+ ).addToLog(err);
err->collectTrace( "VPD", 256 );
}
@@ -1620,17 +1671,25 @@ errlHndl_t IpVpdFacade::writeKeyword ( const char * i_keywordName,
{
break;
}
- if ( iv_configInfo.vpdWriteHW )
- {
- // @todo RTC 106884 - Need to handle vpd write to HW
- }
- if ( iv_configInfo.vpdWritePNOR )
+
+ // Determine the VPD destination (PNOR/SEEPROM)
+ VPD::vpdCmdTarget vpdDest = VPD::AUTOSELECT;
+ bool configError = false;
+ configError = VPD::resolveVpdSource( i_target,
+ iv_configInfo.vpdWritePNOR,
+ iv_configInfo.vpdWriteHW,
+ i_args.location,
+ vpdDest );
+
+ // Write the data
+ if ( vpdDest == VPD::PNOR )
{
- // Setup info needed to write from PNOR
+ // Setup info needed to write to PNOR
VPD::pnorInformation info;
info.segmentSize = iv_vpdSectionSize;
info.maxSegments = iv_vpdMaxSections;
info.pnorSection = iv_pnorSection;
+
err = VPD::writePNOR( i_offset+byteAddr,
keywordSize,
i_buffer,
@@ -1643,6 +1702,12 @@ errlHndl_t IpVpdFacade::writeKeyword ( const char * i_keywordName,
break;
}
+ // If we are writing both we don't have an FSP, skip the mbox msg
+ if ( iv_configInfo.vpdWriteHW )
+ {
+ break;
+ }
+
VPD::VpdWriteMsg_t msgdata;
// Quick double-check that our constants agree with the values
@@ -1659,7 +1724,21 @@ errlHndl_t IpVpdFacade::writeKeyword ( const char * i_keywordName,
i_target,
iv_vpdMsgType,
msgdata );
-
+ if( err )
+ {
+ break;
+ }
+ }
+ else if ( vpdDest == VPD::SEEPROM )
+ {
+ // Write directly to target's EEPROM.
+ err = DeviceFW::deviceOp( DeviceFW::WRITE,
+ i_target,
+ i_buffer,
+ keywordSize,
+ DEVICE_EEPROM_ADDRESS(
+ EEPROM::VPD_PRIMARY,
+ i_offset+byteAddr ) );
if( err )
{
break;
@@ -1667,10 +1746,37 @@ errlHndl_t IpVpdFacade::writeKeyword ( const char * i_keywordName,
}
else
{
- // No PNOR, just eat the write attempt.
- TRACFCOMP(g_trac_vpd, "VPD record %s:%s - write ignored",
- i_keywordName, i_recordName);
- break;
+ configError = true;
+ }
+
+ if( configError )
+ {
+ TRACFCOMP( g_trac_vpd, ERR_MRK"IpVpdFacade::fetchData: "
+ "Error resolving VPD source (PNOR/SEEPROM)");
+
+ /*@
+ * @errortype
+ * @reasoncode VPD::VPD_WRITE_DEST_UNRESOLVED
+ * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid VPD::VPD_IPVPD_WRITE_KEYWORD
+ * @userdata1[0:31] Target HUID
+ * @userdata1[32:63] Requested VPD Destination
+ * @userdata2[0:31] CONFIG_<vpd>_WRITE_TO_PNOR
+ * @userdata2[32:63] CONFIG_<vpd>_WRITE_TO_HW
+ * @devdesc Unable to resolve the VPD
+ * destination (PNOR or SEEPROM)
+ */
+ err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ VPD::VPD_IPVPD_WRITE_KEYWORD,
+ VPD::VPD_WRITE_DEST_UNRESOLVED,
+ TWO_UINT32_TO_UINT64(
+ TARGETING::get_huid(i_target),
+ i_args.location ),
+ TWO_UINT32_TO_UINT64(
+ iv_configInfo.vpdWritePNOR,
+ iv_configInfo.vpdWriteHW ),
+ true /*Add HB SW Callout*/ );
+ err->collectTrace( "VPD", 256 );
}
} while(0);
diff --git a/src/usr/vpd/ipvpd.H b/src/usr/vpd/ipvpd.H
index 7b01f86a4..aa0bf8c81 100644
--- a/src/usr/vpd/ipvpd.H
+++ b/src/usr/vpd/ipvpd.H
@@ -314,6 +314,12 @@ class IpVpdFacade
*
* @param[out] o_offset - The offset where the record is located.
*
+ * @param[in] i_rwPnorEnabled - Config value specifying
+ * whether PNOR reads/writes are enabled for this VPD type
+ *
+ * @param[in] i_rwHwEnabled - Config value specifying
+ * whether SEEPROM reads/writes are enabled for this VPD type
+ *
* @param[in] i_target - The target to retrieve the data for.
*
* @param[in] i_args - The input arguments.
@@ -323,6 +329,8 @@ class IpVpdFacade
*/
errlHndl_t findRecordOffset ( const char * i_record,
uint16_t & o_offset,
+ bool i_rwPnorEnabled,
+ bool i_rwHwEnabled,
TARGETING::Target * i_target,
input_args_t i_args );
diff --git a/src/usr/vpd/plugins/errludP_vpd.H b/src/usr/vpd/plugins/errludP_vpd.H
index 8a76a8bdd..19f89f14f 100644
--- a/src/usr/vpd/plugins/errludP_vpd.H
+++ b/src/usr/vpd/plugins/errludP_vpd.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] 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. */
@@ -118,6 +120,76 @@ private:
};
+/**
+ * @class UdParserConfigParms
+ *
+ * Parses UdParserConfigParms
+ */
+class UdParserConfigParms : public ERRORLOG::ErrlUserDetailsParser
+{
+public:
+ /**
+ * @brief Constructor
+ */
+ UdParserConfigParms() {}
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdParserConfigParms() {}
+
+ /**
+ * @brief Parses string user detail data from an error log
+ *
+ * @param i_version Version of the data
+ * @param i_parse ErrlUsrParser object for outputting information
+ * @param i_pBuffer Pointer to buffer containing detail data
+ * @param i_buflen Length of the buffer
+ */
+ virtual void parse(errlver_t i_version,
+ ErrlUsrParser & i_parser,
+ void * i_pBuffer,
+ const uint32_t i_buflen) const
+ {
+ char* l_databuf = static_cast<char*>(i_pBuffer);
+ i_parser.PrintHeading("VPD Config Parameters");
+
+ //***** Memory Layout *****
+ // 4 bytes : Target HUID
+ // 8 bytes : Record
+ // 8 bytes : Keyword
+ // 8 bytes : Location
+ // 8 bytes : Read PNOR Config
+ // 8 bytes : Read HW Config
+ // 8 bytes : Write PNOR Config
+ // 8 bytes : Write HW Config
+
+ i_parser.PrintNumber("Target","%.8lX",TO_UINT32(l_databuf));
+ l_databuf += sizeof(uint32_t);
+ i_parser.PrintNumber("Record","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Keyword","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Location","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Read PNOR Config","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Read HW Config","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Write PNOR Config","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Write HW Config","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+
+ }
+
+private:
+ // Disabled
+ UdParserConfigParms(const UdParserConfigParms&);
+ UdParserConfigParms & operator=(const UdParserConfigParms&);
+};
+
+
}
#endif
diff --git a/src/usr/vpd/plugins/vpdUdParserFactory.H b/src/usr/vpd/plugins/vpdUdParserFactory.H
index 38bfcd478..cae4c3473 100644
--- a/src/usr/vpd/plugins/vpdUdParserFactory.H
+++ b/src/usr/vpd/plugins/vpdUdParserFactory.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] 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 +38,8 @@ namespace VPD
{
registerParser<VPD::UdParserVpdParms>
(VPD_UDT_PARAMETERS);
+ registerParser<VPD::UdParserConfigParms>
+ (VPD_UDT_CONFIG_PARMS);
}
private:
diff --git a/src/usr/vpd/spd.C b/src/usr/vpd/spd.C
index 27b34f643..b4b6a18a9 100644
--- a/src/usr/vpd/spd.C
+++ b/src/usr/vpd/spd.C
@@ -531,7 +531,25 @@ errlHndl_t spdWriteData ( uint64_t i_offset,
do
{
- if( likely( g_usePNOR ) )
+#ifdef CONFIG_DJVPD_WRITE_TO_HW
+ if( i_location != VPD::PNOR )
+ {
+ // Write directly to target's EEPROM.
+ err = DeviceFW::deviceOp( DeviceFW::WRITE,
+ i_target,
+ i_data,
+ i_numBytes,
+ DEVICE_EEPROM_ADDRESS(
+ EEPROM::VPD_PRIMARY,
+ i_offset ) );
+ if( err )
+ {
+ break;
+ }
+ }
+#endif
+#ifdef CONFIG_DJVPD_WRITE_TO_PNOR
+ if( i_location != VPD::SEEPROM )
{
// Setup info needed to write from PNOR
VPD::pnorInformation info;
@@ -545,40 +563,12 @@ errlHndl_t spdWriteData ( uint64_t i_offset,
info,
g_spdPnorAddr,
&g_spdMutex );
-
if( err )
{
break;
}
}
- else
- {
- TRACFCOMP( g_trac_spd, ERR_MRK"spdWriteData: "
- "There is no way to write SPD when not using PNOR!" );
-
- /*@
- * @errortype
- * @reasoncode VPD::VPD_INVALID_WRITE_METHOD
- * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
- * @moduleid VPD::VPD_SPD_WRITE_DATA
- * @userdata1 Write Offset
- * @userdata2 Number of Bytes to Write
- * @devdesc g_usePNOR is false, but there isn't an
- * alternate way to write PNOR.
- * @custdesc A problem occurred during the IPL
- * of the system.
- */
- err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- VPD::VPD_SPD_WRITE_DATA,
- VPD::VPD_INVALID_WRITE_METHOD,
- i_offset,
- i_numBytes,
- true /*Add HB SW Callout*/ );
-
- err->collectTrace( "SPD", 256);
-
- break;
- }
+#endif
} while( 0 );
TRACSSCOMP( g_trac_spd,
@@ -889,6 +879,13 @@ errlHndl_t spdWriteValue ( VPD::vpdKeyword i_keyword,
break;
}
+ // Don't send mbox msg for seeprom
+ if ( i_location == VPD::SEEPROM )
+ {
+ break;
+ }
+
+#ifndef CONFIG_DJVPD_WRITE_TO_HW
// Send mbox message with new data to Fsp
VPD::VpdWriteMsg_t msgdata;
msgdata.rec_num = i_target->getAttr<TARGETING::ATTR_VPD_REC_NUM>();
@@ -900,11 +897,11 @@ errlHndl_t spdWriteValue ( VPD::vpdKeyword i_keyword,
i_target,
VPD::VPD_WRITE_DIMM,
msgdata );
-
if( err )
{
break;
}
+#endif
} while( 0 );
TRACSSCOMP( g_trac_spd,
diff --git a/src/usr/vpd/vpd.C b/src/usr/vpd/vpd.C
index d12d821f5..af278b8cb 100755
--- a/src/usr/vpd/vpd.C
+++ b/src/usr/vpd/vpd.C
@@ -359,8 +359,8 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
// resolveVpdSource
// ------------------------------------------------------------------
bool resolveVpdSource( TARGETING::Target * i_target,
- bool i_readFromPnorEnabled,
- bool i_readFromHwEnabled,
+ bool i_rwPnorEnabled,
+ bool i_rwHwEnabled,
vpdCmdTarget i_vpdCmdTarget,
vpdCmdTarget& o_vpdSource )
{
@@ -369,32 +369,32 @@ bool resolveVpdSource( TARGETING::Target * i_target,
if( i_vpdCmdTarget == VPD::PNOR )
{
- if( i_readFromPnorEnabled )
+ if( i_rwPnorEnabled )
{
o_vpdSource = VPD::PNOR;
}
else
{
badConfig = true;
- TRACFCOMP(g_trac_vpd,"resolveVpdSource: VpdCmdTarget=PNOR but READ_FROM_PNOR is disabled");
+ TRACFCOMP(g_trac_vpd,"resolveVpdSource: VpdCmdTarget=PNOR but READ/WRITE PNOR CONFIG is disabled");
}
}
else if( i_vpdCmdTarget == VPD::SEEPROM )
{
- if( i_readFromHwEnabled )
+ if( i_rwHwEnabled )
{
o_vpdSource = VPD::SEEPROM;
}
else
{
badConfig = true;
- TRACFCOMP(g_trac_vpd,"resolveVpdSource: VpdCmdTarget=SEEPROM but READ_FROM_HW is disabled");
+ TRACFCOMP(g_trac_vpd,"resolveVpdSource: VpdCmdTarget=SEEPROM but READ/WRITE HW CONFIG is disabled");
}
}
else // i_vpdCmdTarget == VPD::AUTOSELECT
{
- if( i_readFromPnorEnabled &&
- i_readFromHwEnabled )
+ if( i_rwPnorEnabled &&
+ i_rwHwEnabled )
{
// PNOR needs to be loaded before we can use it
TARGETING::ATTR_VPD_SWITCHES_type vpdSwitches =
@@ -408,18 +408,18 @@ bool resolveVpdSource( TARGETING::Target * i_target,
o_vpdSource = VPD::SEEPROM;
}
}
- else if( i_readFromPnorEnabled )
+ else if( i_rwPnorEnabled )
{
o_vpdSource = VPD::PNOR;
}
- else if( i_readFromHwEnabled )
+ else if( i_rwHwEnabled )
{
o_vpdSource = VPD::SEEPROM;
}
else
{
badConfig = true;
- TRACFCOMP(g_trac_vpd,"resolveVpdSource: READ_FROM_PNOR and READ_FROM_HW disabled");
+ TRACFCOMP(g_trac_vpd,"resolveVpdSource: READ/WRITE PNOR CONFIG and READ/WRITE HW CONFIG disabled");
}
}
diff --git a/src/usr/vpd/vpd.H b/src/usr/vpd/vpd.H
index d8972fb46..96c42c7eb 100644
--- a/src/usr/vpd/vpd.H
+++ b/src/usr/vpd/vpd.H
@@ -199,11 +199,11 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
*
* @param[in] i_target - Target device.
*
- * @param[in] i_readFromPnorEnabled - Config value specifying
- * whether PNOR reads are enabled for this VPD type
+ * @param[in] i_rwPnorEnabled - Config value specifying
+ * whether PNOR reads/writes are enabled for this VPD type
*
- * @param[in] i_readFromHwEnabled - Config value specifying
- * whether SEEPROM reads are enabled for this VPD type
+ * @param[in] i_rwHwEnabled - Config value specifying
+ * whether SEEPROM reads/writes are enabled for this VPD type
*
* @param[in] i_location - The requested VPD source location
* (PNOR/SEEPROM) from the caller
@@ -214,8 +214,8 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
* error log.
*/
bool resolveVpdSource( TARGETING::Target * i_target,
- bool i_readFromPnorEnabled,
- bool i_readFromHwEnabled,
+ bool i_rwPnorEnabled,
+ bool i_rwHwEnabled,
vpdCmdTarget i_vpdCmdTarget,
vpdCmdTarget& o_vpdSource );
OpenPOWER on IntegriCloud