summaryrefslogtreecommitdiffstats
path: root/src/usr/vpd/spd.C
diff options
context:
space:
mode:
authorCorey Swenson <cswenson@us.ibm.com>2014-09-28 17:10:55 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-12-16 08:30:12 -0600
commit9e91fa4f9e2ce76c458f8839e2f573c3cbc90797 (patch)
tree6ca16ad86148a6b4cd167711781ad64044864aaa /src/usr/vpd/spd.C
parent6f296e894cfd30142b625b5ab12fb3226a57c06b (diff)
downloadtalos-hostboot-9e91fa4f9e2ce76c458f8839e2f573c3cbc90797.tar.gz
talos-hostboot-9e91fa4f9e2ce76c458f8839e2f573c3cbc90797.zip
BMC VPD hardware write support
Also contains I2C attribute work-arounds. Change-Id: I6d1164cfefe4edcc6631e8cf51c288ce25489fab RTC: 113492 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13665 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Michael Baiocchi <baiocchi@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/vpd/spd.C')
-rw-r--r--src/usr/vpd/spd.C59
1 files changed, 28 insertions, 31 deletions
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,
OpenPOWER on IntegriCloud