Skip to content

Commit d52fed6

Browse files
stewartsmithdcrowell77
authored andcommitted
bootloader: skip secureboot header if exists and not secure booting
To enable some level of compatibility for systems *not* booting in secure boot with firmware built for (and not for) secure boot, look for the secure boot header and skip over it if not secure boot. Resolves #194 Signed-off-by: Stewart Smith <stewart@flamingspork.com> Change-Id: I9451eaecca0e78e8ea9928f312b10f688958568c Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/96037 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: Nicholas E Bofferding <bofferdn@us.ibm.com> Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
1 parent 5e5e739 commit d52fed6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/bootloader/bootloader.C

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
8+
/* Contributors Listed Below - COPYRIGHT 2015,2020 */
99
/* [+] International Business Machines Corp. */
10+
/* [+] Stewart Smith */
1011
/* */
1112
/* */
1213
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -521,6 +522,10 @@ namespace Bootloader{
521522
reinterpret_cast<uint64_t*>(HBB_RUNNING_ADDR |
522523
IGNORE_HRMOR_MASK);
523524

525+
ROM_container_raw *l_hbb_container =
526+
reinterpret_cast<ROM_container_raw*>(
527+
HBB_WORKING_ADDR | IGNORE_HRMOR_MASK);
528+
524529
// Get Secure Data from SBE HBBL communication area
525530
setSecureData(l_src_addr);
526531

@@ -532,8 +537,10 @@ namespace Bootloader{
532537
// ROM verification of HBB image
533538
verifyContainer(l_src_addr);
534539

535-
// Increment past secure header
536-
if (isEnforcedSecureSection(PNOR::HB_BASE_CODE))
540+
// Increment past secure header,
541+
// even if built without secure boot
542+
if (isEnforcedSecureSection(PNOR::HB_BASE_CODE) ||
543+
l_hbb_container->magic_number == ROM_MAGIC_NUMBER)
537544
{
538545
l_src_addr += PAGE_SIZE/sizeof(uint64_t);
539546
l_hbbLength -= PAGE_SIZE;

0 commit comments

Comments
 (0)