diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2017-07-27 16:56:12 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-08-11 10:09:54 -0400 |
commit | ca30e6bf9ea440ba1fd8c7fb5092b9fe6e18aba0 (patch) | |
tree | 9a8028d226e4c24071fb216c47cb49f6faaa0e8b /src/include | |
parent | a0e8246b27da999d4d8beba64994daef6333a442 (diff) | |
download | talos-hostboot-ca30e6bf9ea440ba1fd8c7fb5092b9fe6e18aba0.tar.gz talos-hostboot-ca30e6bf9ea440ba1fd8c7fb5092b9fe6e18aba0.zip |
Refactor lid to pnor mapping and add pnor to lid pair mapping
Change-Id: Ib4f3afef44cdab96c66b13426da86049b896757a
RTC: 175115
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43809
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: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/usr/util/utillidmgr.H | 22 | ||||
-rw-r--r-- | src/include/usr/util/utillidpnor.H | 79 |
2 files changed, 94 insertions, 7 deletions
diff --git a/src/include/usr/util/utillidmgr.H b/src/include/usr/util/utillidmgr.H index 6e0c95d2f..f6a4762f4 100644 --- a/src/include/usr/util/utillidmgr.H +++ b/src/include/usr/util/utillidmgr.H @@ -41,17 +41,24 @@ namespace Util { -// Lid id's + +// Lid Ids +// A Container Lid can be referred to as a Secure Header. The Container Lid ID +// is associated with the header data that sits in front of an image. enum LidId { TEST_LIDID = 0x00000111, OCC_LIDID = 0x81e00430, + OCC_CONTAINER_LIDID = 0x80d0000b, // TODO RTC 172767 Make utillidmgr LIDID structure attribute driven WOF_LIDID = 0x81e00440, + WOF_CONTAINER_LIDID = 0x80d00015, // Hcode Reference Image LIDs NIMBUS_HCODE_LIDID = 0x81e00602, CUMULUS_HCODE_LIDID = 0x81e00603, + HCODE_CONTAINER_LIDID = 0x80d0000c, HWREFIMG_RINGOVD_LIDID = 0x81e00620, + INVALID_LIDID = 0xFFFFFFFF }; } @@ -415,16 +422,17 @@ class UtilLidMgr #endif // __HOSTBOOT_RUNTIME /** - * @brief search lidToPnor array for the pnor section for the given lid - * lidToPnor array does not includes the ext img section + * @brief Determines if a Lid Id has a corresponding PNOR section ID + * and sets PNOR info if it exists * - * @param[in] i_lidId - provide lid id to search for - * @param[out] o_lidPnorInfo - pnor section that the lid is in + * @param[in] i_lidId - lid id to search for + * @param[out] o_lidPnorInfo - pnor section info associated with the lid + * if it exists in pnor * * @return bool - True if lid is in a section, false otherwise */ - bool getLidPnorSection(uint32_t i_lidId, - PNOR::SectionInfo_t &o_lidPnorInfo); + bool getLidPnorSectionInfo(uint32_t i_lidId, + PNOR::SectionInfo_t &o_lidPnorInfo); /** * @brief LID fileName */ diff --git a/src/include/usr/util/utillidpnor.H b/src/include/usr/util/utillidpnor.H new file mode 100644 index 000000000..c7daa00b7 --- /dev/null +++ b/src/include/usr/util/utillidpnor.H @@ -0,0 +1,79 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/util/utillidpnor.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014,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 */ +#ifndef _UTILLIDPNOR_H +#define _UTILLIDPNOR_H + +#include <util/utillidmgr.H> +#include <utility> +#include <map> + +namespace Util +{ + +/** @struct LidAndContainerLid + * @brief Stores the Lid ID and corresponding Container Lid ID for a lid + * + * A Container Lid can be referred to as a Secure Header. The Container Lid ID + * is associated with the header data that sits in front of an image. + */ +struct LidAndContainerLid +{ + // Lid ID for content + LidId lid; + // Lid ID for Container Lid (Secure Header) + LidId containerLid; + LidAndContainerLid() : lid(INVALID_LIDID),containerLid(INVALID_LIDID) {} + LidAndContainerLid(LidId i_lid, LidId i_containerLid) : + lid(i_lid), containerLid(i_containerLid) {} +}; + +typedef std::map<PNOR::SectionId, LidAndContainerLid > PnorLidsMap; +typedef std::pair<PNOR::SectionId, LidAndContainerLid> PnorLidsPair; + +/** + * @brief Returns Lid and ContainerLid (Secure Header) Ids associated with a + * PNOR section. + * + * @param[in] i_sec Pnor section to find associated LIDs for + * + * @return LidAndContainerLid - If found, valid LidIds + * else, invalid LidIds + * Note: May return valid LidId with an invalid ContainerLid +*/ +LidAndContainerLid getPnorSecLidIds(PNOR::SectionId i_sec); + +/** + * @brief Returns PNOR section ID associated with a LidID. + * + * @param[in] i_lid LidId to find associated PNOR section for + * + * @return PNOR::SectionId - If found, valid PNOR section + * else, INVALID_SECTION +*/ +PNOR::SectionId getLidPnorSection(LidId i_lid); + +} + +#endif |