Skip to content

Commit

Permalink
Set up HDAT HB Reserved Memory and load reserved memory data
Browse files Browse the repository at this point in the history
Change-Id: Ie8460ecdf67cd99ab422fe52c4ec936f4c0aa8f1
RTC:165514
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36117
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>
  • Loading branch information
cvswen authored and dcrowell77 committed Mar 8, 2017
1 parent ea41fff commit 8c15e09
Show file tree
Hide file tree
Showing 8 changed files with 621 additions and 78 deletions.
13 changes: 10 additions & 3 deletions src/include/usr/runtime/runtime.H
Expand Up @@ -98,6 +98,13 @@ errlHndl_t populate_RtDataByNode(uint64_t iNodeId);
// HOMER*8/OCC_Common/VPD/ATTR/HBRT_Image/Res/Res/Res
#define HB_RSV_MEM_NUM_PTRS 15

// Range types for HB reserved memory
#define RANGE_TYPE_PRIMARY 0
#define RANGE_TYPE_HBRT 1
#define RANGE_TYPE_VERIFIED_LIDS 2
#define RANGE_TYPE_TPM_LOG 3
#define RANGE_TYPE_HOMER_OCC 4

//Note this means the Reserved Mem sub-section is the 6th
//(0 based) of the MDT section (See HDAT spec)
#define MDT_RESERVED_HB_MEM_SECTION 5
Expand Down Expand Up @@ -163,7 +170,7 @@ void saveActualCount( RUNTIME::SectionId i_id,
*/
errlHndl_t writeActualCount( RUNTIME::SectionId i_id );

/*
/**
* @brief Retrieve and log FFDC data relevant to a given section of
* host data memory
*
Expand All @@ -175,13 +182,13 @@ errlHndl_t writeActualCount( RUNTIME::SectionId i_id );
void add_host_data_ffdc( SectionId i_section,
errlHndl_t& io_errlog );

/*
/**
* @brief Set the PAYLOAD_BASE attribute
* @param[in] i_payloadAddress in MEGABYTES
*/
void setPayloadBaseAddress(uint64_t i_payloadAddress);

/*
/**
* @brief Clear out any cached data and rediscover the location
* of the HDAT memory
*/
Expand Down
2 changes: 2 additions & 0 deletions src/include/usr/runtime/runtime_reasoncodes.H
Expand Up @@ -50,6 +50,8 @@ namespace RUNTIME
MOD_POPULATE_RTDATABYNODE = 0x14, /**< populate_hbruntime.C */
MOD_PM_RT_LOAD_PM_COMPLEX = 0x15, /**< rt_pm.C */
MOD_PM_RT_HCODE_UPDATE = 0x16, /**< rt_pm.C */
MOD_MAP_PHYS_ADDR = 0x17, /**< populate_hbruntime.C */
MOD_UNMAP_VIRT_ADDR = 0x18, /**< populate_hbruntime.C */
};

enum RuntimeReasonCode
Expand Down
51 changes: 25 additions & 26 deletions src/include/usr/vmmconst.h
Expand Up @@ -131,6 +131,10 @@ enum BlockPriority
/** Page Size in bits per SLBE */
#define SLBE_b 12

/** Hostboot reserved memory */
#define VMM_HRMOR_OFFSET 128*MEGABYTE
#define VMM_HB_RSV_MEM_SIZE 256*MEGABYTE

/** Hardwired offsets from HRMOR to HOMER images in real mem */
/** HOMER starts immediately after our HB memory */
/** <n0p0 HRMOR = 128MB> + <memory size = 32MB> = 160MB */
Expand Down Expand Up @@ -158,26 +162,34 @@ enum BlockPriority

/** Total Memory required for HOMERs and OCC Common */
#define VMM_ALL_HOMER_OCC_MEMORY_SIZE \
(VMM_OCC_COMMON_SIZE+VMM_HOMER_REGION_SIZE)

(VMM_OCC_COMMON_SIZE + VMM_HOMER_REGION_SIZE)

/** Reserved runtime VPD sizes in bytes */
// must be 64KB aligned
#define VMM_MODULE_VPD_SIZE 0x80000
#define VMM_CENTAUR_VPD_SIZE 0x40000
#define VMM_DIMM_JEDEC_VPD_SIZE 0x40000
/** Memory offset for runtime VPD image */
// Given value is number of bytes BELOW the top of memory to store
// the runtime image(s) Currently below the OCC HOMER IMAGE
#define VMM_RT_VPD_OFFSET (VMM_RT_VPD_SIZE + \
VMM_ALL_HOMER_OCC_MEMORY_SIZE)

/** Total VPD image size */
/** Memory for VPD */
#define VMM_VPD_START_OFFSET VMM_OCC_COMMON_END_OFFSET
#define VMM_MODULE_VPD_SIZE (512*KILOBYTE) /* must be 64KB aligned */
#define VMM_CENTAUR_VPD_SIZE (256*KILOBYTE) /* must be 64KB aligned */
#define VMM_DIMM_JEDEC_VPD_SIZE (256*KILOBYTE) /* must be 64KB aligned */
#define VMM_RT_VPD_SIZE (VMM_MODULE_VPD_SIZE + \
VMM_CENTAUR_VPD_SIZE + \
VMM_DIMM_JEDEC_VPD_SIZE)
/** End of VPD Area = 201MB */

/** Memory offset for runtime VPD image */
// Given value is number of bytes BELOW the top of memory to store
// the runtime image(s) Currently below the OCC HOMER IMAGE
#define VMM_RT_VPD_OFFSET (VMM_RT_VPD_SIZE + \
VMM_ALL_HOMER_OCC_MEMORY_SIZE)
/** Memory for attribute data */
#define VMM_ATTR_DATA_START_OFFSET \
(VMM_VPD_START_OFFSET + VMM_RT_VPD_SIZE)
#define VMM_ATTR_DATA_SIZE (1*MEGABYTE)
/** End of Attr Area = 202MB */

/** Chunk of physical memory used for Dump Source Table */
#define DUMP_TEST_MEMORY_ADDR \
(VMM_ATTR_DATA_START_OFFSET + VMM_ATTR_DATA_SIZE) /* currently 202MB */
#define DUMP_TEST_MEMORY_SIZE (4*MEGABYTE)

/** Internode communication area outside of the HB image.
* Preserved between mpipl.
Expand Down Expand Up @@ -215,19 +227,6 @@ enum BlockPriority
/** Block size used in remove pages test */
#define VMM_SIZE_RMVPAGE_TEST (8 * PAGESIZE)

/** Chunk of physical memory to use for HostServices Attributes */
#define MPIPL_ATTR_DATA_ADDR \
VMM_OCC_COMMON_END_OFFSET + VMM_OCC_COMMON_SIZE /* currently 200MB */
#define MPIPL_SYSDATA_SIZE (4*KILOBYTE) /* match FSP HDAT code */
#define MPIPL_NODEDATA_SIZE (256000) /* match FSP HDAT code */
#define MPIPL_ATTR_DATA_SIZE \
ALIGN_PAGE((MPIPL_SYSDATA_SIZE+MPIPL_NODEDATA_SIZE))
#define MPIPL_ATTR_VMM_SIZE (1*MEGABYTE)

/* Chunk of physical memory used for Dump Source Table */
#define DUMP_TEST_MEMORY_ADDR (MPIPL_ATTR_DATA_ADDR + MPIPL_ATTR_DATA_SIZE)
#define DUMP_TEST_MEMORY_SIZE (4*MEGABYTE)

/** Physical memory location of the TCE Table */
/** - needs to be aligned on 4MB boundary */
#define TCE_TABLE_ADDR (88*MEGABYTE)
Expand Down
23 changes: 6 additions & 17 deletions src/usr/runtime/hdatservice.C
Expand Up @@ -272,18 +272,7 @@ errlHndl_t hdatService::get_standalone_section(
{
errlHndl_t errhdl = NULL;

if( RUNTIME::HSVC_SYSTEM_DATA == i_section )
{
o_dataAddr = reinterpret_cast<uint64_t>(iv_mem_regions[0].virt_addr);
o_dataSize = MPIPL_SYSDATA_SIZE;
}
else if( RUNTIME::HSVC_NODE_DATA == i_section )
{
o_dataAddr = reinterpret_cast<uint64_t>(iv_mem_regions[0].virt_addr)
+ MPIPL_SYSDATA_SIZE;
o_dataSize = MPIPL_NODEDATA_SIZE;
}
else if( RUNTIME::MS_DUMP_SRC_TBL == i_section )
if( RUNTIME::MS_DUMP_SRC_TBL == i_section )
{
o_dataAddr = reinterpret_cast<uint64_t>(iv_mem_regions[1].virt_addr);
o_dataSize = DUMP_TEST_SRC_MEM_SIZE;
Expand Down Expand Up @@ -519,12 +508,12 @@ errlHndl_t hdatService::loadHostData(void)
FakePayload::load();

// Map in some arbitrary memory for the HostServices code to use
TRACFCOMP( g_trac_runtime, "load_host_data> STANDALONE: Mapping in 0x%X-0x%X (%d MB)", MPIPL_ATTR_DATA_ADDR,
MPIPL_ATTR_DATA_ADDR+MPIPL_ATTR_DATA_SIZE,
MPIPL_ATTR_DATA_SIZE);
TRACFCOMP( g_trac_runtime, "load_host_data> STANDALONE: Mapping in 0x%X-0x%X (%d MB)", VMM_ATTR_DATA_START_OFFSET,
VMM_ATTR_DATA_START_OFFSET+VMM_ATTR_DATA_SIZE,
VMM_ATTR_DATA_SIZE);

errhdl = mapRegion(MPIPL_ATTR_DATA_ADDR,
MPIPL_ATTR_DATA_SIZE, l_dummy);
errhdl = mapRegion(VMM_ATTR_DATA_START_OFFSET,
VMM_ATTR_DATA_SIZE, l_dummy);
if(errhdl)
{
break;
Expand Down

0 comments on commit 8c15e09

Please sign in to comment.