summaryrefslogtreecommitdiffstats
path: root/src/usr/hdat
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2019-06-06 15:11:43 -0500
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-07-16 10:15:03 -0500
commita22884e079eb16b2aaac1ae06c7a5963943ee2eb (patch)
treef83861998b49a97ed534c1c103fb2046440baae6 /src/usr/hdat
parent8abecc2fde6d8e28be10869d5c662f8182fb81ea (diff)
downloadtalos-hostboot-a22884e079eb16b2aaac1ae06c7a5963943ee2eb.tar.gz
talos-hostboot-a22884e079eb16b2aaac1ae06c7a5963943ee2eb.zip
Correctly form LX record/keyword for OpenPOWER
Current OpenPOWER code doesn't properly form the LX VPD record and instead tacks it into the VINI record. This causes PowerVM to fail to boot. Correct this by fully forming a LXR0 record, populate the LX keyword from the value in the system MRW, and then append the fully formed LXR0 record to the HDAT VPD. Change-Id: I2128e4ddef8e3c5c1373fd4c6b5bf6de50901ef1 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78489 Tested-by: Jenkins Server <pfd-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/hdatiohub.C4
-rwxr-xr-xsrc/usr/hdat/hdatvpd.C79
2 files changed, 49 insertions, 34 deletions
diff --git a/src/usr/hdat/hdatiohub.C b/src/usr/hdat/hdatiohub.C
index c2f5d7eea..ea0a3ff54 100644
--- a/src/usr/hdat/hdatiohub.C
+++ b/src/usr/hdat/hdatiohub.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -54,7 +54,6 @@ vpdData mvpdData[] =
{ PVPD::VINI, PVPD::B4 },
{ PVPD::VINI, PVPD::B7 },
{ PVPD::VINI, PVPD::PF },
- { PVPD::VINI, PVPD::LX },
};
const HdatKeywordInfo l_pvpdKeywords[] =
@@ -74,7 +73,6 @@ const HdatKeywordInfo l_pvpdKeywords[] =
{ PVPD::B4, "B4" },
{ PVPD::B7, "B7" },
{ PVPD::PF, "PF" },
- { PVPD::LX, "LX" },
};
extern trace_desc_t *g_trac_hdat;
diff --git a/src/usr/hdat/hdatvpd.C b/src/usr/hdat/hdatvpd.C
index a07996921..8a76bf842 100755
--- a/src/usr/hdat/hdatvpd.C
+++ b/src/usr/hdat/hdatvpd.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -58,6 +58,13 @@ extern trace_desc_t * g_hdatTraceDesc;
/*----------------------------------------------------------------------------*/
const uint16_t HDAT_VPD_VERSION = 0x0020;
+const uint8_t LX_RECORD_TEMPLATE[] =
+{0x84, 0x1C, 0x00, 0x52, 0x54, 0x04, 0x4C, 0x58,
+ 0x52, 0x30, 0x56, 0x5A, 0x02, 0x30, 0x31, 0x4C,
+ 0x58, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x50, 0x46, 0x02, 0x00, 0x00, 0x78};
+const uint16_t LX_RECORD_SIZE = 32;
+const uint16_t LX_KEYWORD_OFFSET= 18;
/** @brief See the prologue in hdatvpd.H
*/
@@ -118,6 +125,19 @@ iv_kwdSize(0), iv_kwd(NULL)
HDAT_DBG("hdatGetAsciiKwd returned kwd size =%d",iv_kwdSize);
+ char *o_fmtKwd;
+ uint32_t o_fmtkwdSize;
+ o_errlHndl = hdatformatAsciiKwd(i_fetchVpd, i_num, theSize, iv_kwd,
+ iv_kwdSize, o_fmtKwd, o_fmtkwdSize, i_pvpdKeywords);
+ if( o_fmtKwd != NULL )
+ {
+ delete[] iv_kwd;
+ iv_kwd = new char [o_fmtkwdSize];
+ memcpy(iv_kwd,o_fmtKwd,o_fmtkwdSize);
+ iv_kwdSize = o_fmtkwdSize;
+ delete[] o_fmtKwd;
+ }
+
if(strcmp(i_eyeCatcher,"IO KID")==0)
{
using namespace TARGETING;
@@ -130,30 +150,23 @@ iv_kwdSize(0), iv_kwd(NULL)
//fetching lx data
uint64_t l_LXvalue = l_sysTarget->getAttr<ATTR_ASCII_VPD_LX_KEYWORD>();
- char *temp_kwd = new char [iv_kwdSize];
- uint32_t temp_kwdSize = iv_kwdSize;
- memcpy(temp_kwd, iv_kwd,iv_kwdSize);
- delete[] iv_kwd;
- iv_kwdSize +=sizeof(uint64_t);
- iv_kwd = new char [iv_kwdSize];
- memcpy(iv_kwd,temp_kwd,temp_kwdSize);
- memcpy((void *)(iv_kwd+temp_kwdSize),&l_LXvalue,sizeof(uint64_t));
- theSize[i_num-1] = sizeof(uint64_t);
- delete[] temp_kwd;
- }
- char *o_fmtKwd;
- uint32_t o_fmtkwdSize;
- o_errlHndl = hdatformatAsciiKwd(i_fetchVpd, i_num, theSize, iv_kwd,
- iv_kwdSize, o_fmtKwd, o_fmtkwdSize, i_pvpdKeywords);
- if( o_fmtKwd != NULL )
- {
+ char *temp_lx = new char[LX_RECORD_SIZE];
+ memcpy(temp_lx, LX_RECORD_TEMPLATE, LX_RECORD_SIZE);
+ memcpy((void*)(temp_lx + LX_KEYWORD_OFFSET), &l_LXvalue, sizeof(uint64_t));
+
+ //append LXR0 record to VINI record
+ size_t combined_size = iv_kwdSize + LX_RECORD_SIZE;
+ char * temp_buf = new char[combined_size];
+ memcpy(temp_buf,iv_kwd,iv_kwdSize);
+ memcpy((void *)(temp_buf+iv_kwdSize),temp_lx, LX_RECORD_SIZE);
+
+ delete[] temp_lx;
delete[] iv_kwd;
- iv_kwd = new char [o_fmtkwdSize];
- memcpy(iv_kwd,o_fmtKwd,o_fmtkwdSize);
- iv_kwdSize = o_fmtkwdSize;
- delete[] o_fmtKwd;
+ iv_kwd = temp_buf;
+ iv_kwdSize = combined_size;
}
+
if (NULL == o_errlHndl)
{
iv_fru.hdatSlcaIdx = l_slcaIdx;
@@ -238,16 +251,20 @@ iv_kwdSize(0), iv_kwd(NULL)
//fetching lx data
uint64_t l_LXvalue = l_sysTarget->getAttr<ATTR_ASCII_VPD_LX_KEYWORD>();
- char *temp_kwd = new char [iv_kwdSize];
- uint32_t temp_kwdSize = iv_kwdSize;
- memcpy(temp_kwd, iv_kwd,iv_kwdSize);
+ char *temp_lx = new char[LX_RECORD_SIZE];
+ memcpy(temp_lx, LX_RECORD_TEMPLATE, LX_RECORD_SIZE);
+ memcpy((void*)(temp_lx + LX_KEYWORD_OFFSET), &l_LXvalue, sizeof(uint64_t));
+
+ //append LXR0 record to VINI record
+ size_t combined_size = iv_kwdSize + LX_RECORD_SIZE;
+ char * temp_buf = new char[combined_size];
+ memcpy(temp_buf,iv_kwd,iv_kwdSize);
+ memcpy((void *)(temp_buf+iv_kwdSize),temp_lx, LX_RECORD_SIZE);
+
+ delete[] temp_lx;
delete[] iv_kwd;
- iv_kwdSize +=sizeof(uint64_t);
- iv_kwd = new char [iv_kwdSize];
- memcpy(iv_kwd,temp_kwd,temp_kwdSize);
- memcpy((void *)(iv_kwd+temp_kwdSize),&l_LXvalue,sizeof(uint64_t));
- theSize[i_num-1] = sizeof(uint64_t);
- delete[] temp_kwd;
+ iv_kwd = temp_buf;
+ iv_kwdSize = combined_size;
}
if (NULL == o_errlHndl)
{
OpenPOWER on IntegriCloud