Skip to content

Commit

Permalink
Consolidating HBRT reserved memory (ATTR,ATTR_OVERRIDE,VPD) into a si…
Browse files Browse the repository at this point in the history
…ngle entry

Change-Id: I9fc5846d9901ac79c59bb149b8f55b5c7ca2fa73
RTC: 171863
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41141
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mderkse1 authored and dcrowell77 committed Jun 12, 2017
1 parent 1c2fceb commit 9401084
Show file tree
Hide file tree
Showing 18 changed files with 793 additions and 368 deletions.
2 changes: 2 additions & 0 deletions src/include/runtime/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ enum MemoryError_t
#define HBRT_RSVD_MEM__SBE_COMM "ibm,sbe-comm"
#define HBRT_RSVD_MEM__SBE_FFDC "ibm,sbe-ffdc"
#define HBRT_RSVD_MEM__SECUREBOOT "ibm,secure-crypt-algo-code"
#define HBRT_RSVD_MEM__DATA "ibm,hbrt-data"



/**
Expand Down
2 changes: 2 additions & 0 deletions src/include/usr/runtime/runtime_reasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ namespace RUNTIME
MOD_MAP_PHYS_ADDR = 0x17, /**< populate_hbruntime.C */
MOD_UNMAP_VIRT_ADDR = 0x18, /**< populate_hbruntime.C */
MOD_POPULATE_TPMINFOBYNODE = 0x19, /**< populate_hbruntime.C */
MOD_FILL_RSVMEM_HBDATA = 0x20, /**< populate_hbruntime.C */
};

enum RuntimeReasonCode
Expand Down Expand Up @@ -98,6 +99,7 @@ namespace RUNTIME
RC_I2C_DEVICE_DUPLICATE_IN_MRW = RUNTIME_COMP_ID | 0x24,
RC_EXTRA_I2C_DEVICE_IN_MRW = RUNTIME_COMP_ID | 0x25,
RC_GETTUPLE_UNSUPPORTED = RUNTIME_COMP_ID | 0x26,
RC_EXCEEDED_MEMORY = RUNTIME_COMP_ID | 0x27,
};

enum UserDetailsTypes
Expand Down
16 changes: 16 additions & 0 deletions src/include/usr/targeting/attrrp.H
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ class AttrRP
*/
static void* save(uint64_t& io_addr);

/**
* @brief Copies all present attribute sections to memory.
*
* @param[in] i_dest
* Physical address to copy override data into
* @param[in,out] io_size
* in: Maximum size of allocated space in bytes
* out: Actual number of bytes used (zero means no overrides)
*
* @return Error log
*/
static errlHndl_t save(uint8_t * i_dest, size_t & io_size);

/**
* @brief Returns size needed to save all attributes
*
Expand Down Expand Up @@ -328,6 +341,9 @@ class AttrRP
/** Internal implementation of save function. */
void* _save(uint64_t&);

/** Internal implementation of save function. */
errlHndl_t _save(uint8_t* i_dest, size_t& io_size );

/** Internal implementation of saveOverrides function. */
errlHndl_t _saveOverrides( uint8_t* i_dest,
size_t& io_size );
Expand Down
1 change: 1 addition & 0 deletions src/include/usr/targeting/targplatreasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ enum PlatTargetingModuleId
TARG_MOD_SET_MASTER_NODE = 0x81,
TARG_MOD_ATTRRP_RT = 0x82,
TARG_MOD_SAVE_OVERRIDE_TANK = 0x83,
TARG_MOD_SAVE_ATTR_TANK = 0x84,
};

/**
Expand Down
84 changes: 84 additions & 0 deletions src/include/usr/util/runtime/util_rt.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/include/usr/util/runtime/util_rt.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
/* implied. See the License for the specific language governing */
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */

#include <limits.h> // for KILOBYTE definition


/**
* 8-byte ascii entry labels for hbrt TOC
*/
typedef uint64_t hbrt_mem_label_t;

// Ascii label "VPD " in hex
constexpr hbrt_mem_label_t HBRT_MEM_LABEL_VPD = 0x5650442020202020;

// Ascii label "ATTR " in hex
constexpr hbrt_mem_label_t HBRT_MEM_LABEL_ATTR = 0x4154545220202020;

// Ascii label "ATTROVER" in hex
constexpr hbrt_mem_label_t HBRT_MEM_LABEL_ATTROVER = 0x415454524F564552;

// Ascii label "PADDING " in hex
constexpr hbrt_mem_label_t HBRT_MEM_LABEL_PADDING = 0x50414444494E4720;

/** @brief A 32 byte table of contents entry */
struct hbrtTableOfContentsEntry_t
{
uint64_t label; // ASCII HBRT_LABEL_x constants
uint64_t size; // data entry size in bytes
uint64_t offset; // offset into section
uint64_t reserved; // incase of future change
} __attribute__ ((packed));

// MAX ENTRIES = (4 KB - 64 byte header) / 32 bytes per entry = 126
#define HBRT_TOC_MAX_ENTRIES \
(((4*KILOBYTE) - 64) / sizeof(hbrtTableOfContentsEntry_t))

/** @brief A 4KB Table of Contents */
struct hbrtTableOfContents_t
{
char toc_header[32]; // "Hostboot Table of Contents"
uint8_t toc_version; // version
uint16_t total_entries; // Total entries in TOC
uint64_t total_size; // Total data section size (64k aligned)
uint8_t rsvd[21]; // reserved
hbrtTableOfContentsEntry_t entry[HBRT_TOC_MAX_ENTRIES];
} __attribute__ ((packed));

// Versions of table of contents
const uint8_t HBRT_TOC_VERSION_1 = 0x01;

/**
* @brief Get the address of a reserved hostboot memory region by its label
* @param[in] i_label HBRT_MEM_LABEL_... constant
* @param[in] i_instance instance number
* @param[out] o_size size of returned region in bytes
* @return virtual address of region or 0
* @platform FSP, OpenPOWER
**/
uint64_t hb_get_rt_rsvd_mem( hbrt_mem_label_t i_label,
uint32_t i_instance,
uint64_t & o_size );

9 changes: 9 additions & 0 deletions src/include/usr/vmmconst.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ enum BlockPriority
#define DUMP_TEST_MEMORY_ADDR \
(VMM_ATTR_DATA_START_OFFSET + VMM_ATTR_DATA_SIZE) /* currently 202MB */
#define DUMP_TEST_MEMORY_SIZE (4*MEGABYTE)
/** End of Dump Source Table = 206MB */

/** Memory for hostboot data Table of Contents */
#define VMM_HB_DATA_TOC_START_OFFSET \
(DUMP_TEST_MEMORY_ADDR + DUMP_TEST_MEMORY_SIZE) /* currently 206MB */
#define VMM_HB_DATA_TOC_END_OFFSET (VMM_HB_DATA_TOC_START_OFFSET + (4*KILOBYTE))
/** End of HB DATA TOC Area = 206MB + 4KB */



/** Internode communication area outside of the HB image.
* Preserved between mpipl.
Expand Down
8 changes: 5 additions & 3 deletions src/include/usr/vpd/vpd_if.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -49,10 +49,12 @@ namespace VPD

/**
* @brief Load the runtime VPD image into memory
* @param[out] The physical address of the VPD image
* @param[in/out] The physical or virtual address of the VPD image
* @param[in] Is the address virtual?
* @return error handle if there was an error
*/
errlHndl_t vpd_load_rt_image(uint64_t & o_vpd_addr);
errlHndl_t vpd_load_rt_image(uint64_t & io_vpd_addr,
bool i_virtualAddr = false);

/**
* @brief This function checks to see if the given mvpd target
Expand Down
23 changes: 12 additions & 11 deletions src/usr/isteps/istep21/call_host_runtime_setup.C
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,21 @@ void* call_host_runtime_setup (void *io_pArgs)
"Failed hbTpmInfo setup" );
break;
}
}

// Fill in Hostboot runtime data for all nodes
// (adjunct partition)
// Write the HB runtime data into mainstore
l_err = RUNTIME::populate_hbRuntimeData();
if ( l_err )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Failed hbRuntimeData setup" );
// break from do loop if error occured
break;
}
// Fill in Hostboot runtime data for all nodes
// (adjunct partition)
// Write the HB runtime data into mainstore
l_err = RUNTIME::populate_hbRuntimeData();
if ( l_err )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Failed hbRuntimeData setup" );
// break from do loop if error occurred
break;
}


#ifdef CONFIG_START_OCC_DURING_BOOT
bool l_activatePM = TARGETING::is_sapphire_load();
#else
Expand Down

0 comments on commit 9401084

Please sign in to comment.