summaryrefslogtreecommitdiffstats
path: root/src/usr/runtime/populate_hbruntime.C
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2018-06-18 23:05:31 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-07-03 09:18:52 -0400
commite5dfc3ab0ec51ee63205c7064b7b4a4c4b8ba46f (patch)
tree76ccf82718d46c0bb7bbb5cbcf451d2bbd03aaf6 /src/usr/runtime/populate_hbruntime.C
parent691894a135de3e81f4318a5498c4a964fdebb8ae (diff)
downloadtalos-hostboot-e5dfc3ab0ec51ee63205c7064b7b4a4c4b8ba46f.tar.gz
talos-hostboot-e5dfc3ab0ec51ee63205c7064b7b4a4c4b8ba46f.zip
Allow SPDX override as part of FW load
Memory VPD contents have changed since the cards have been built so we need to provide a method to override the data as part of a FW build. We have done the same thing previously for the MEMD record on the Nimbus machines so will use the same design here for SPDX. As part of this change, the previous MEMD support was refactored to be completely generic so a single code path can be used for any arbitrary record. Change-Id: I5af5e965429c881be3de0d18c82b1d7918ac9c22 CQ: SW430659 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61190 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> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60980
Diffstat (limited to 'src/usr/runtime/populate_hbruntime.C')
-rw-r--r--src/usr/runtime/populate_hbruntime.C98
1 files changed, 97 insertions, 1 deletions
diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C
index 4d26bce26..bf891b09c 100644
--- a/src/usr/runtime/populate_hbruntime.C
+++ b/src/usr/runtime/populate_hbruntime.C
@@ -443,9 +443,12 @@ errlHndl_t setNextHbRsvMemEntry(const HDAT::hdatMsVpdRhbAddrRangeType i_type,
* ----- HB Data Layout -------
* io_start_address
* -- HB Table of Contents
- * -- ATTR Override Data
+ * -- ATTR Override Data (optional)
* -- ATTR Data
* -- VPD
+ * -- HYPCOMM
+ * -- VPD Overrides
+ * -- HBRT Trace Area (master node only)
* -- Padding
* io_end_address
*
@@ -564,6 +567,21 @@ errlHndl_t fill_RsvMem_hbData(uint64_t & io_start_address,
ALIGN_PAGE(l_hbTOC.entry[l_hbTOC.total_entries].size);
l_hbTOC.total_entries++;
+ // Fill in VPD_XXXX sizes (if there are any)
+ VPD::OverrideRsvMemMap_t l_vpdOverrides;
+ VPD::getListOfOverrideSections( l_vpdOverrides );
+ for( auto l_over : l_vpdOverrides )
+ {
+ // Or in the specific label with the "VPD_" prefix
+ l_hbTOC.entry[l_hbTOC.total_entries].label =
+ Util::HBRT_MEM_LABEL_VPD_XXXX | l_over.first;
+ l_hbTOC.entry[l_hbTOC.total_entries].offset = 0;
+ l_hbTOC.entry[l_hbTOC.total_entries].size = l_over.second.size;
+ l_totalSectionSize +=
+ ALIGN_PAGE(l_hbTOC.entry[l_hbTOC.total_entries].size);
+ l_hbTOC.total_entries++;
+ }
+
// Fill in the TRACEBUF only for Master Node
if(i_master_node == true )
{
@@ -778,7 +796,84 @@ errlHndl_t fill_RsvMem_hbData(uint64_t & io_start_address,
memset(reinterpret_cast<uint8_t*>(l_prevDataAddr),0,aligned_size);
break;
+ case Util::HBRT_MEM_LABEL_VPD_MEMD:
+ {
+ TRACFCOMP( g_trac_runtime, "fill_RsvMem_hbData> VPD_MEMD v address 0x%.16llX, size: %lld", l_prevDataAddr, aligned_size);
+
+ VPD::OverrideSpecifier_t l_over =
+ l_vpdOverrides[l_hbTOC.entry[i].label
+ & Util::HBRT_MEM_LABEL_VPD_MASK];
+
+#ifdef CONFIG_SECUREBOOT
+ // load the section in, copy the data, then unload it
+ l_elog = PNOR::loadSecureSection(l_over.pnorId);
+ if(l_elog)
+ {
+ TRACFCOMP( g_trac_runtime,
+ "fill_RsvMem_hbData> failed secure load call" );
+ break;
+ }
+#endif
+
+ PNOR::SectionInfo_t l_memd_info;
+ l_elog = PNOR::getSectionInfo(l_over.pnorId,l_memd_info);
+ if( l_elog )
+ {
+ TRACFCOMP( g_trac_runtime,
+ "fill_RsvMem_hbData> failed getSectionInfo call" );
+ break;
+ }
+
+#ifdef CONFIG_SECUREBOOT
+ memcpy(reinterpret_cast<uint8_t*>(l_prevDataAddr),
+ reinterpret_cast<uint8_t *>(l_memd_info.vaddr),
+ l_memd_info.secureProtectedPayloadSize);
+#else
+ memcpy(reinterpret_cast<uint8_t*>(l_prevDataAddr),
+ reinterpret_cast<uint8_t *>(l_memd_info.vaddr),
+ l_memd_info.size);
+#endif
+
+
+#ifdef CONFIG_SECUREBOOT
+ l_elog = PNOR::unloadSecureSection(l_over.pnorId);
+ if(l_elog)
+ {
+ TRACFCOMP( g_trac_runtime,
+ "fill_RsvMem_hbData> failed secure unload call" );
+ break;
+ }
+#endif
+
+ TRACFCOMP( g_trac_runtime, "fill_RsvMem_hbData> VPD v address 0x%.16llX, size: %lld done", l_prevDataAddr, aligned_size);
+ break;
+ }
+
+ case(Util::HBRT_MEM_LABEL_PADDING):
+ // NOOP
+ break;
+
default:
+ TRACFCOMP( g_trac_runtime, "fill_RsvMem_hbData> Unrecognized label 0x%.ll16X", l_hbTOC.entry[i].label );
+ /*@
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid RUNTIME::MOD_FILL_RSVMEM_HBDATA
+ * @reasoncode RUNTIME::RC_UNKNOWN_LABEL
+ * @userdata1 Unknown Label
+ * @userdata2 <unused>
+ *
+ * @devdesc Unknown reserved memory label attempted
+ * @custdesc Firmware error initializing system
+ * data structures during boot
+ */
+ l_elog = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ RUNTIME::MOD_FILL_RSVMEM_HBDATA,
+ RUNTIME::RC_UNKNOWN_LABEL,
+ l_hbTOC.entry[i].label,
+ 0,
+ ERRORLOG::ErrlEntry::ADD_SW_CALLOUT );
+ l_elog->collectTrace(RUNTIME_COMP_NAME);
break;
}
i++;
@@ -3138,6 +3233,7 @@ errlHndl_t populate_hbRuntimeData( void )
if(l_elog != nullptr)
{
TRACFCOMP( g_trac_runtime, "fill_RsvMem_hbData failed" );
+ break;
}
// Get list of processor chips
OpenPOWER on IntegriCloud