summaryrefslogtreecommitdiffstats
path: root/src/usr/runtime/hdatservice.C
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2016-12-05 17:15:29 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-12-20 11:54:41 -0500
commitc2dd21c843eaa6b136388ec3ec910944e88ce681 (patch)
tree2fb854639b1d62da88afef8b6cfe0cd7ba1d5fde /src/usr/runtime/hdatservice.C
parent7c8bb50ef4e2f3e75bb5fb7d8c32f929599f4ca0 (diff)
downloadtalos-hostboot-c2dd21c843eaa6b136388ec3ec910944e88ce681.tar.gz
talos-hostboot-c2dd21c843eaa6b136388ec3ec910944e88ce681.zip
Add option to get reserved mem section from hdat service
In the future, attribute/targeting hdat data will be stored in main store memory and hdat will just have a pointer to the memory location. This is setting up the ability for hdat service to provide the memory locations. Change-Id: I3d6748cb496c79465602d89e3c4f6d4508a68b35 RTC:165369 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33436 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@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/runtime/hdatservice.C')
-rw-r--r--src/usr/runtime/hdatservice.C57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C
index 88475e0c4..205c6e006 100644
--- a/src/usr/runtime/hdatservice.C
+++ b/src/usr/runtime/hdatservice.C
@@ -52,6 +52,12 @@ namespace RUNTIME
/********************
Local Constants used for sanity checks
********************/
+const hdatHeaderExp_t MDT_HEADER = {
+ 0xD1F0, //id
+ "MS VPD", //name
+ 0x0024 //version
+};
+
const hdatHeaderExp_t HBRT_DATA_HEADER = {
0xD1F0, //id
"HBRT ", //name
@@ -673,6 +679,57 @@ errlHndl_t hdatService::getHostDataSection( SectionId i_section,
o_dataSize = 0;
}
}
+ else if (RUNTIME::RESERVED_MEM == i_section)
+ {
+ // Find the right tuple and verify it makes sense
+ hdat5Tuple_t* tuple = NULL;
+ if( iv_spiraS )
+ {
+ tuple = &(iv_spiraS->hdatDataArea[SPIRAS_MDT]);
+ }
+ else if( unlikely(iv_spiraL != NULL) )
+ {
+ tuple = &(iv_spiraL->hdatDataArea[SPIRAL_MDT]);
+ }
+ TRACUCOMP(g_trac_runtime, "MDT_DATA tuple=%p", tuple);
+ errhdl = check_tuple( i_section,
+ tuple );
+ if( errhdl ) { break; }
+
+ uint64_t base_addr;
+ errhdl = getSpiraTupleVA(tuple, base_addr);
+ if( errhdl ) { break; }
+
+ hdatHDIF_t* mdt_header =
+ reinterpret_cast<hdatHDIF_t*>(base_addr);
+ TRACUCOMP( g_trac_runtime, "mdt_header=%p", mdt_header );
+
+ // Check the headers and version info
+ errhdl = check_header( mdt_header,
+ MDT_HEADER );
+ if( errhdl ) { break; }
+
+ hdatHDIFDataHdr_t* mdt_data_header =
+ reinterpret_cast<hdatHDIFDataHdr_t*>
+ (mdt_header->hdatDataPtrOffset + base_addr);
+
+ errhdl = verify_hdat_address(mdt_data_header,
+ mdt_header->hdatDataPtrCnt * sizeof(hdatHDIFDataHdr_t) );
+ if( errhdl ) { break; }
+
+ uint64_t resvMemHdatAddr = mdt_data_header[MDT_RESERVED_HB_MEM_SECTION].hdatOffset + base_addr;
+
+ hdatMsReservedMemArrayHeader_t* reservedMemArrayHeader =
+ reinterpret_cast<hdatMsReservedMemArrayHeader_t *>(resvMemHdatAddr);
+
+ assert(i_instance < reservedMemArrayHeader->arrayEntryCount,
+ "Instance entered exceeds max reserved mem entry count");
+
+ o_dataAddr = reinterpret_cast<uint64_t>(
+ resvMemHdatAddr + reservedMemArrayHeader->offsetToArray + (i_instance * sizeof(hdatMsVpdRhbAddrRange_t)));
+ //Array Header addr
+ o_dataSize = sizeof(hdatMsVpdRhbAddrRange_t);
+ }
// HB Runtime Data
else if ( (RUNTIME::HBRT == i_section) ||
(RUNTIME::HBRT_DATA == i_section) )
OpenPOWER on IntegriCloud