Skip to content

Commit

Permalink
Save space in Bootloader image with minimized section ID array
Browse files Browse the repository at this point in the history
The PNOR section ID array takes a large amount of space to store
the character strings and pointers to them.  Space can be reclaimed
by just storing the HBB ID.  One trace is also turned off for
Bootloader since it is then hit for all the other PNOR sections.

Change-Id: I59585c2b976aa0351e75f477532415c669447541
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40330
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: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mgloff authored and dcrowell77 committed May 23, 2017
1 parent 0010d98 commit da19466
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/include/usr/pnor/pnor_const.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ enum SectionId
{
TOC, /**< Table of Contents */
// Value of HB_EXT_CODE must be 1 for debug framework.
#ifndef BOOTLOADER
HB_EXT_CODE, /**< Hostboot Extended Image */
GLOBAL_DATA, /**< Global Data */
#endif
HB_BASE_CODE, /**< Hostboot Base Image */
#ifndef BOOTLOADER
CENTAUR_SBE, /**< Centaur Self-Boot Engine image */
SBE_IPL, /**< Self-Boot Engine IPL image */
HCODE, /**< HCODE Reference image */
Expand All @@ -68,6 +71,7 @@ enum SectionId
RINGOVD, /**< Ring override data */
WOFDATA, /**< VFRT data tables for WOF */
SBKT, /**< SecureBoot Key Transition */
#endif
NUM_SECTIONS, /**< Number of defined sections */

FIRST_SECTION = TOC, /**< First section (for looping) */
Expand Down
16 changes: 11 additions & 5 deletions src/usr/pnor/pnor_utils.C
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@
extern trace_desc_t* g_trac_pnor;
#define PNOR_UTIL_TRACE(arg0, args...) TRACFCOMP(g_trac_pnor, args)
#define PNOR_UTIL_TRACE_W_BRK(arg0, args...) TRACFCOMP(g_trac_pnor, args)
#define PNOR_UTIL_TRACE_BL_SKIP(arg0, args...) TRACFCOMP(g_trac_pnor, args)
#else
#include <bootloader/bootloader_trace.H>
#include <bootloader/bootloader.H>
#include <bootloader/hbblreasoncodes.H>
#define PNOR_UTIL_TRACE(arg0, args...) BOOTLOADER_TRACE(arg0)
#define PNOR_UTIL_TRACE_W_BRK(arg0, args...) BOOTLOADER_TRACE_W_BRK(arg0)
#define PNOR_UTIL_TRACE_BL_SKIP(arg0, args...)
#endif


Expand Down Expand Up @@ -272,11 +274,11 @@ PNOR::parseEntries (ffs_hdr* i_ffs_hdr,

if(secId == PNOR::INVALID_SECTION)
{
PNOR_UTIL_TRACE(BTLDR_TRC_UTILS_PARSE_INVALID_SECTION,
"PNOR::parseEntries: "
"Unsupported section found while parsing entry ",
"%d in TOC \n Entry name is \"%s\"", i,
cur_entry->name);
PNOR_UTIL_TRACE_BL_SKIP(BTLDR_TRC_UTILS_PARSE_INVALID_SECTION,
"PNOR::parseEntries: "
"Unsupported section found while parsing ",
"entry %d in TOC \n Entry name is \"%s\"",
i, cur_entry->name);
//continue to skip invalid section
continue;
}
Expand Down Expand Up @@ -409,9 +411,12 @@ const char * PNOR::SectionIdToString( uint32_t i_secIdIndex )
static const char* SectionIdToStringArr[] =
{
"part", /**< PNOR::TOC : Table of Contents */
#ifndef BOOTLOADER
"HBI", /**< PNOR::HB_EXT_CODE : Hostboot Extended Image */
"GLOBAL", /**< PNOR::GLOBAL_DATA : Global Data */
#endif
"HBB", /**< PNOR::HB_BASE_CODE : Hostboot Base Image */
#ifndef BOOTLOADER
"SBEC", /**< PNOR::CENTAUR_SBE : Centaur Self-Boot Engine image */
"SBE", /**< PNOR::SBE_IPL : Self-Boot Enginer IPL image */
"HCODE", /**< PNOR::HCODE : HCODE Reference image */
Expand All @@ -438,6 +443,7 @@ const char * PNOR::SectionIdToString( uint32_t i_secIdIndex )
"RINGOVD", /**< PNOR::RINGOVD : Ring overrides */
"WOFDATA", /**< PNOR::WOFDATA : VFRT data tables for WOF */
"SBKT", /**< PNOR::SBKT : SecureBoot Key Transition */
#endif
};

// Get actual number of entries of array.
Expand Down

0 comments on commit da19466

Please sign in to comment.