From f0d7c809d23c2cf44c0be0ff594c14aff22d6f04 Mon Sep 17 00:00:00 2001 From: Stephen Cprek Date: Mon, 6 Feb 2017 12:31:42 -0600 Subject: Add SecureROM version info and Change SBE update to use max HBBL size The HBBL also contains the securerom code and hw keys' hash for verification purposes. So looking for the end of the HBBL code leaves out those sections Change-Id: I73a1b5c50e3a5b3f642ca569b90e79dbe4c4ba1e Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35979 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Reviewed-by: Martin Gloff Reviewed-by: Nicholas E. Bofferding Reviewed-by: Daniel M. Crowell --- src/include/bootloader/bootloader.H | 7 ++----- src/include/bootloader/bootloader_trace.H | 25 ++++++++++++---------- src/include/bootloader/bootloaderif.H | 35 +++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 src/include/bootloader/bootloaderif.H (limited to 'src/include/bootloader') diff --git a/src/include/bootloader/bootloader.H b/src/include/bootloader/bootloader.H index ac10628fb..102d23a77 100644 --- a/src/include/bootloader/bootloader.H +++ b/src/include/bootloader/bootloader.H @@ -38,6 +38,7 @@ #include #include #include +#include extern "C" void task_end_stub(); extern "C" void enterHBB(uint64_t i_hbb_hrmor, uint64_t i_hbb_offset); @@ -166,15 +167,11 @@ namespace Bootloader{ * HBB is copied to its running location and its execution is started. */ - /** Max size of HBBL without ECC. Must match PNOR layout for eyeCatch HBBL*/ -#define MAX_HBBL_SIZE (20 * KILOBYTE) - /** Size of exception vector reserved space at start of the HBBL section*/ -#define HBBL_EXCEPTION_VECTOR_SIZE (12 * KILOBYTE) /** HW Keys hash is placed in the last 64 bytes of the HBBL */ #define HW_KEYS_HASH_ADDR (getHRMOR() + HBBL_EXCEPTION_VECTOR_SIZE \ + MAX_HBBL_SIZE - 64) /** Location of working copy of HBB with ECC */ -#define HBB_ECC_WORKING_ADDR (getHRMOR() - ( 1*MEGABYTE)) +#define HBB_ECC_WORKING_ADDR (getHRMOR() + ( 1*MEGABYTE)) /** Location of working copy of HBB without ECC */ #define HBB_WORKING_ADDR (getHRMOR() - ( 1*MEGABYTE)) diff --git a/src/include/bootloader/bootloader_trace.H b/src/include/bootloader/bootloader_trace.H index 93b937308..980f90881 100644 --- a/src/include/bootloader/bootloader_trace.H +++ b/src/include/bootloader/bootloader_trace.H @@ -60,18 +60,21 @@ enum BootloaderTraces /** Bootloader main removeECC returned */ BTLDR_TRC_MAIN_REMOVEECC_RTN = 0x13, - // @TODO RTC:167740 remove magic number check once fsp/op signs HBB - /** Bootloader main verifyBaseImage skip verification - no magic number */ - BTLDR_TRC_MAIN_VERIFY_HBB_SKIP = 0x14, - - /** Bootloader main verifyBaseImage started */ - BTLDR_TRC_MAIN_VERIFY_HBB_START = 0x15, + /** Bootloader main verifyContainer started */ + BTLDR_TRC_MAIN_VERIFY_START = 0x14, - /** Bootloader main verifyBaseImage succeeded */ - BTLDR_TRC_MAIN_VERIFY_HBB_SUCCESS = 0x16, + /** Bootloader main verifyContainer succeeded */ + BTLDR_TRC_MAIN_VERIFY_SUCCESS = 0x15, /** Bootloader main copy HBB to running location done */ - BTLDR_TRC_MAIN_COPY_HBB_DONE = 0x17, + BTLDR_TRC_MAIN_COPY_HBB_DONE = 0x16, + + /** Bootloader main verifyContainer skip verification - no eyecatch */ + BTLDR_TRC_MAIN_VERIFY_NO_EYECATCH = 0x17, + + // @TODO RTC:167740 remove magic number check once fsp/op signs HBB + /** Bootloader main verifyContainer skip verification - no magic number */ + BTLDR_TRC_MAIN_VERIFY_NO_MAGIC_NUM = 0x18, /** Bootloader handleMMIO started */ BTLDR_TRC_HANDLEMMIO_START = 0x20, @@ -169,8 +172,8 @@ enum BootloaderTraces /** Bootloader PNOR Access getHBBSection findTOC no HBB section */ BTLDR_TRC_PA_GETHBBSECTION_FINDTOC_NOHBB = 0xFA, - /** Bootloader main verifyBaseImage failed */ - BTLDR_TRC_MAIN_VERIFY_HBB_FAIL = 0xFB, + /** Bootloader main verifyContainer failed */ + BTLDR_TRC_MAIN_VERIFY_FAIL = 0xFB, }; #ifndef BOOTLOADER_TRACE diff --git a/src/include/bootloader/bootloaderif.H b/src/include/bootloader/bootloaderif.H new file mode 100644 index 000000000..beffe7c0f --- /dev/null +++ b/src/include/bootloader/bootloaderif.H @@ -0,0 +1,35 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/bootloader/bootloaderif.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 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 __BOOT_LOADERIF_H +#define __BOOT_LOADERIF_H + +// Max size of HBBL without ECC. Must match PNOR layout for eyeCatch HBBL +// Must be aligned CACHELINE_SIZE of 128 bytes +#define MAX_HBBL_SIZE (20 * KILOBYTE) + +// Size of exception vector reserved space at start of the HBBL section +#define HBBL_EXCEPTION_VECTOR_SIZE (12 * KILOBYTE) + +#endif \ No newline at end of file -- cgit v1.2.1