From e36e0019e0b97ee66e649fd32a708e2905b26623 Mon Sep 17 00:00:00 2001 From: Bill Hoffa Date: Wed, 10 Oct 2018 08:49:08 -0500 Subject: HBBL LPC Error Checking - To avoid IPL delays, the LPC status register should be checked prior to loading the entire PNOR image (done via LPC). If an error condition occurs, HBBL should fail out. Change-Id: I5d716213f468e28191db794bf3e5480af547b26e CQ: SW446254 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68442 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW Reviewed-by: Christian R. Geddes Reviewed-by: Nicholas E. Bofferding Reviewed-by: Daniel M. Crowell --- src/include/bootloader/bl_pnorAccess.H | 13 +++++++------ src/include/bootloader/bootloader_trace.H | 15 ++++++++++++++- src/include/usr/lpc/lpc_const.H | 5 ++++- 3 files changed, 25 insertions(+), 8 deletions(-) (limited to 'src/include') diff --git a/src/include/bootloader/bl_pnorAccess.H b/src/include/bootloader/bl_pnorAccess.H index a9c37d1cc..ea7077df9 100644 --- a/src/include/bootloader/bl_pnorAccess.H +++ b/src/include/bootloader/bl_pnorAccess.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -49,7 +49,7 @@ class bl_pnorAccess /** * @brief Get the hostboot base image * - * @param[in] i_pnorEnd MMIO address to access the end of pnor flash + * @param[in] i_lpcBar MMIO address to base LPC space * * @param[out] o_hbbSection Struct that holds information about the * Hostboot Base Image Section @@ -60,12 +60,13 @@ class bl_pnorAccess * * @return void */ -static void getHBBSection(uint64_t i_pnorEnd, +static void getHBBSection(uint64_t i_lpcBar, PNOR::SectionData_t& o_hbbSection, uint32_t& o_errCode, uint64_t& o_pnorStart); private: + /** * @brief Read in the toc and get information about each section * @@ -89,7 +90,7 @@ static void readTOC(uint8_t i_tocBuffer[PNOR::TOC_SIZE], uint32_t & o_errCode, * @brief Find a valid TOC within specified side of pnor flash side is determined by the base mmio address passed in * - * @param[in] i_pnorEnd MMIO address to access the end of pnor flash + * @param[in] i_lpcBar MMIO address to base LPC space * * @param[out] o_TOC Array of section data describing contents of pnor * @@ -99,9 +100,9 @@ static void readTOC(uint8_t i_tocBuffer[PNOR::TOC_SIZE], uint32_t & o_errCode, * * @return void */ -static void findTOC(uint64_t i_pnorEnd, PNOR::SectionData_t * o_TOC, +static void findTOC(uint64_t i_lpcBar, PNOR::SectionData_t * o_TOC, uint32_t& o_errCode, uint64_t& o_pnorStart); }; -#endif \ No newline at end of file +#endif diff --git a/src/include/bootloader/bootloader_trace.H b/src/include/bootloader/bootloader_trace.H index 313afbada..d79f3c4af 100644 --- a/src/include/bootloader/bootloader_trace.H +++ b/src/include/bootloader/bootloader_trace.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -85,6 +85,13 @@ enum BootloaderTraces /** Bootloader PNOR Access getHBBSection started */ BTLDR_TRC_PA_GETHBBSECTION_START = 0x30, + /** Technically the below value falls here in the IPL flow between + * BTLDR_TRC_PA_GETHBBSECTION_START + BTLDR_TRC_PA_FINDTOC_TOC1_HANDLEMMIO_RTN, + * but the value is defined below in numerical order to help guarantee + * it won't be re-used. + BTLDR_TRC_PA_FINDTOC_TOC1_LPC_RTN = 0x36, + **/ + /** Bootloader PNOR Access findTOC handleMMIO to copy TOC ONE returned */ BTLDR_TRC_PA_FINDTOC_TOC1_HANDLEMMIO_RTN = 0x31, @@ -100,6 +107,9 @@ enum BootloaderTraces /** Bootloader PNOR Access getHBBSection findTOC returned */ BTLDR_TRC_PA_GETHBBSECTION_FINDTOC_RTN = 0x35, + /** Bootloader PNOR Access findTOC handleMMIO LPC Error Check returned */ + BTLDR_TRC_PA_FINDTOC_TOC1_LPC_RTN = 0x36, + /** Bootloader PNOR Access readTOC zeroSection returned */ BTLDR_TRC_PA_READTOC_ZEROSECTION_RTN = 0x41, @@ -186,6 +196,9 @@ enum BootloaderTraces /** Bootloader main verifyContainer secure rom invalid */ BTLDR_TRC_MAIN_VERIFY_INVALID_SECROM = 0xFC, + + /** Bootloader PNOR Access findTOC handleMMIO LPC ERR returned */ + BTLDR_TRC_PA_FINDTOC_TOC1_LPC_ERR = 0xFD, }; #ifndef BOOTLOADER_TRACE diff --git a/src/include/usr/lpc/lpc_const.H b/src/include/usr/lpc/lpc_const.H index f686dcebf..0250db79a 100644 --- a/src/include/usr/lpc/lpc_const.H +++ b/src/include/usr/lpc/lpc_const.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -45,6 +45,9 @@ namespace LPC LPC_PHYS_BASE = 0x6030000000000, FW_WINDOW_SIZE = 0x10000000, //Size of FW Window + + OPB_ERROR_MASK = 0x20000FC3, /**< OPBM Error Bits MASK */ + }; } -- cgit v1.2.3