diff options
author | Matt Derksen <mderkse1@us.ibm.com> | 2017-07-28 10:46:18 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-08-12 21:17:36 -0400 |
commit | 64c5f756d00f902ce974306c783cd4f1464b3159 (patch) | |
tree | b89a509a2e083f0ae45f581ac8dde2c5caac531b /src/usr/hdat | |
parent | 42ecd455ada336844fe97f710250813e0d47b08f (diff) | |
download | talos-hostboot-64c5f756d00f902ce974306c783cd4f1464b3159.tar.gz talos-hostboot-64c5f756d00f902ce974306c783cd4f1464b3159.zip |
Hostboot HDAT: update to match section 19 in HDAT spec
Add new i2cLabel string
Change-Id: I007441e3973a16eaae4dbdbe703297f0f6978c8f
RTC: 176759
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/44301
Reviewed-by: Martin Gloff <mgloff@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>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/hdat')
-rw-r--r-- | src/usr/hdat/hdatutil.C | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/usr/hdat/hdatutil.C b/src/usr/hdat/hdatutil.C index 0e2ba3605..f13a4e89e 100644 --- a/src/usr/hdat/hdatutil.C +++ b/src/usr/hdat/hdatutil.C @@ -290,7 +290,7 @@ void hdatPopulateMTMAndSerialNumber() { const uint8_t l_mtmSize= 0x08; //phyp would requre just 8 character of MTM - strncpy(l_rawMTM,reinterpret_cast<const char*>(l_vpddata), + strncpy(l_rawMTM,reinterpret_cast<const char*>(l_vpddata), l_mtmSize); for(uint8_t i=0; i<sizeof(l_rawMTM); i++) { @@ -612,7 +612,7 @@ errlHndl_t hdatGetAsciiKwdForPvpd(TARGETING::Target * i_target, theKeyword = i_fetchVpd[curCmd].keyword; //this conidtion is , if in the top loop there is a fail then - //theSize[curCmd] will be 0. + //theSize[curCmd] will be 0. if( theSize[curCmd] == 0) { continue; @@ -1183,7 +1183,7 @@ errlHndl_t hdatGetAsciiKwdForCvpd(TARGETING::Target * i_target, theKeyword = i_fetchVpd[curCmd].keyword; //this conidtion is , if in the top loop there is a fail then - //theSize[curCmd] will be 0. + //theSize[curCmd] will be 0. if( theSize[curCmd] == 0) { continue; @@ -1372,9 +1372,9 @@ void hdatPrintKwd(const char *i_kwd, for (l_cnt = 0; l_cnt < l_lines; l_cnt++) { HDAT_INF( "0X %08X %08X %08X %08X", - (*(reinterpret_cast<uint32_t *>(l_kwd ))) , + (*(reinterpret_cast<uint32_t *>(l_kwd ))) , (*(reinterpret_cast<uint32_t *>(l_kwd + 4))), - (*(reinterpret_cast<uint32_t *>(l_kwd + 8))) , + (*(reinterpret_cast<uint32_t *>(l_kwd + 8))) , (*(reinterpret_cast<uint32_t *>(l_kwd + 12))) ); i_kwd += 16; @@ -1392,22 +1392,22 @@ void hdatPrintKwd(const char *i_kwd, else if ( l_rem < 9 ) { HDAT_INF( "0X %08X %08X ", - (*(reinterpret_cast<uint32_t *>(l_kwd ))) , + (*(reinterpret_cast<uint32_t *>(l_kwd ))) , (*(reinterpret_cast<uint32_t *>(l_kwd + 4))) ); } else if ( l_rem < 13 ) { HDAT_INF( "0X %08X %08X %08X ", - (*(reinterpret_cast<uint32_t *>(l_kwd ))) , + (*(reinterpret_cast<uint32_t *>(l_kwd ))) , (*(reinterpret_cast<uint32_t *>(l_kwd + 4))), (*(reinterpret_cast<uint32_t *>(l_kwd + 8))) ); } else { // remainder is up to 15 bytes HDAT_INF( "0X %08X %08X %08X %08X", - (*(reinterpret_cast<uint32_t *>(l_kwd ))) , + (*(reinterpret_cast<uint32_t *>(l_kwd ))) , (*(reinterpret_cast<uint32_t *>(l_kwd + 4))), - (*(reinterpret_cast<uint32_t *>(l_kwd + 8))) , + (*(reinterpret_cast<uint32_t *>(l_kwd + 8))) , (*(reinterpret_cast<uint32_t *>(l_kwd + 12))) ); } @@ -1592,7 +1592,7 @@ errlHndl_t hdatformatAsciiKwd(const struct vpdData i_fetchVpd[], l_loc += 2; uint8_t l_var = theSize[curCmd]; - memcpy(reinterpret_cast<void *>(o_fmtKwd + l_loc),&l_var, + memcpy(reinterpret_cast<void *>(o_fmtKwd + l_loc),&l_var, sizeof(uint8_t)); l_loc += sizeof(uint8_t); @@ -1624,7 +1624,7 @@ errlHndl_t hdatGetFullEepromVpd(TARGETING::Target * i_target, HDAT_ENTER(); if(i_target != NULL) { - o_data = new char[io_dataSize]; + o_data = new char[io_dataSize]; //Collecting Full module VPD data err = deviceOp( DeviceFW::READ, @@ -1760,11 +1760,10 @@ void hdatGetI2cDeviceInfo( l_hostI2cObj.hdatI2cSlavePort = i2cDevice.slavePort; l_hostI2cObj.hdatI2cSlaveDevPurp = i2cDevice.devicePurpose; l_hostI2cObj.hdatI2cLinkId = linkId.val; - - // @TODO RTC 176759 Populate SLCA and I2C label - l_hostI2cObj.hdatI2cSlcaIndex = 0; - memset(&l_hostI2cObj.hdatI2cLabel,0x00, - sizeof(l_hostI2cObj.hdatI2cLabel)); + strncpy(l_hostI2cObj.hdatI2cLabel, + i2cDevice.deviceLabel, + sizeof(l_hostI2cObj.hdatI2cLabel)-1); + // SLCA Index will be filled in by HDAT code // Don't include the device if the slave address is // invalid |