Skip to content

Commit

Permalink
Revert "Enhance RAS for case where boot firmware image is too big to …
Browse files Browse the repository at this point in the history
…load"

This reverts commit ee1cd5b.
We overran our size constraint in the bootloader.

Change-Id: Ib579b5971e5f03131a0b6580cd698e7f725dd383
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72401
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
dcrowell77 committed Feb 23, 2019
1 parent 2a2071c commit a48f4e9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 43 deletions.
37 changes: 3 additions & 34 deletions src/bootloader/bootloader.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -456,42 +456,11 @@ namespace Bootloader{
bool l_hbbEcc =
( g_blData->bl_hbbSection.integrity == FFS_INTEG_ECC_PROTECT);

uint32_t workingLength= (l_hbbEcc) ?
(l_hbbLength * LENGTH_W_ECC)/LENGTH_WO_ECC : l_hbbLength;

// handleMMIO below always moves WORDSIZE chunks at a time, even
// if there is just one byte left, so subtract WORDSIZE from the
// limit to compensate
if(workingLength > (MEGABYTE-WORDSIZE))
{
BOOTLOADER_TRACE(BTLDR_TRC_BAD_WORK_LEN);
/*@
* @errortype
* @moduleid Bootloader::MOD_BOOTLOADER_MAIN
* @reasoncode Bootloader::RC_BAD_WORK_LEN
* @userdata1[0:15] TI_WITH_SRC
* @userdata1[16:31] TI_BOOTLOADER
* @userdata1[32:63] Failing address = 0
* @userdata2[0:31] Length of data from TOC (bytes)
* @userdata2[32:63] Working length (bytes)
* @errorInfo[0:31] Max space available (bytes)
* @devdesc Not enough memory to load boot firmware
* @custdesc Failed to load boot firmware
*/
bl_terminate(
MOD_BOOTLOADER_MAIN,
RC_BAD_WORK_LEN,
l_hbbLength,
workingLength,
true,
0,
(MEGABYTE-WORDSIZE));
}

// Copy HB base code from PNOR to working location
handleMMIO(l_pnorStart + l_hbbFlashOffset,
(l_hbbEcc) ? HBB_ECC_WORKING_ADDR : HBB_WORKING_ADDR,
workingLength,
(l_hbbEcc) ? (l_hbbLength * LENGTH_W_ECC)/LENGTH_WO_ECC
: l_hbbLength,
WORDSIZE);
BOOTLOADER_TRACE(BTLDR_TRC_MAIN_WORKING_HANDLEMMIO_RTN);

Expand Down
2 changes: 1 addition & 1 deletion src/build/buildpnor/genPnorImages.pl
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ sub manipulateImages
# Ensure there is enough room at the end of the HBBL partition
# to store the HW keys' hash.
my $hbblRawSize = (-s $bin_file or die "Cannot get size of file $bin_file");
print "HBBL raw size (no padding/ecc) = $hbblRawSize/$MAX_HBBL_SIZE\n";
print "HBBL raw size ($bin_file) (no padding/ecc) = $hbblRawSize/$MAX_HBBL_SIZE\n";
if ($hbblRawSize > $MAX_HBBL_SIZE - HW_KEYS_HASH_SIZE)
{
die "HBBL cannot fit HW Keys' Hash (64 bytes) at the end without overwriting real data";
Expand Down
3 changes: 1 addition & 2 deletions src/build/debug/Hostboot/BlTrace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016,2018
# Contributors Listed Below - COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -43,7 +43,6 @@ my %traceText = (
"19" => "Main verify skip verification - SAB unset ",
"1A" => "Main verify component ID succeeded",
"1B" => "Main verify component ID failed",
"1C" => "Main working length too big",
"20" => "HandleMMIO started",
"21" => "HandleMMIO started using BYTESIZE",
"24" => "HandleMMIO started using WORDSIZE",
Expand Down
5 changes: 1 addition & 4 deletions src/include/bootloader/bootloader_trace.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -79,9 +79,6 @@ enum BootloaderTraces
/** Bootloader main verifyComponentId failed */
BTLDR_TRC_COMP_ID_VERIFY_FAILED = 0x1B,

/** Bootloader main working length too big */
BTLDR_TRC_BAD_WORK_LEN = 0x1C,

/** Bootloader handleMMIO started */
BTLDR_TRC_HANDLEMMIO_START = 0x20,

Expand Down
3 changes: 1 addition & 2 deletions src/include/bootloader/hbblreasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -74,7 +74,6 @@ namespace Bootloader
RC_NO_HBB_IN_TOC = HBBL_COMP_ID | 0x0C, /**< No HBB Sect in TOC */
RC_PNOR_SECID_OUT_OF_RANGE = HBBL_COMP_ID | 0x0D, /**< Requested PNOR SecId DNE in string array */
RC_PNOR_NULLPTR = HBBL_COMP_ID | 0x0E, /**< Requested address to compare is a nullptr */
RC_BAD_WORK_LEN = HBBL_COMP_ID | 0x0F, /**< Working length too large */
};

}; // end Bootloader
Expand Down

0 comments on commit a48f4e9

Please sign in to comment.