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/usr/pnor/pnor_utils.C | |
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/usr/pnor/pnor_utils.C')
-rw-r--r-- | src/usr/pnor/pnor_utils.C | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/usr/pnor/pnor_utils.C b/src/usr/pnor/pnor_utils.C index 1ee89e349..9945edada 100644 --- a/src/usr/pnor/pnor_utils.C +++ b/src/usr/pnor/pnor_utils.C @@ -471,8 +471,8 @@ const char * PNOR::SectionIdToString( uint32_t i_secIdIndex ) static_assert (numEntries == (PNOR::NUM_SECTIONS), "Mismatch between number of SectionIds and correlating strings"); - // Assert if accessing index out of array. - assert(i_secIdIndex < (PNOR::NUM_SECTIONS), + // Assert if accessing index out of array or not INVALID section + assert(i_secIdIndex <= (PNOR::NUM_SECTIONS), #ifdef BOOTLOADER BTLDR_TRC_UTILS_PNOR_SECID_OUT_OF_RANGE, Bootloader::RC_PNOR_SECID_OUT_OF_RANGE @@ -481,7 +481,13 @@ const char * PNOR::SectionIdToString( uint32_t i_secIdIndex ) #endif ); - return SectionIdToStringArr[i_secIdIndex]; + const char * l_str = "INVALID_SECTION"; + if(i_secIdIndex < PNOR::INVALID_SECTION) + { + l_str = SectionIdToStringArr[i_secIdIndex]; + } + + return l_str; } bool PNOR::cmpSecurebootMagicNumber(const uint8_t* i_vaddr) |