summaryrefslogtreecommitdiffstats
path: root/src/bootloader
diff options
context:
space:
mode:
authorRoland Veloz <rveloz@us.ibm.com>2019-04-30 23:22:00 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-05-07 08:51:08 -0500
commitd935c5c94a9e1c23325f3dcd4ed113a6985412db (patch)
tree83f05f240b8f65eb506d4f9a9d03abea6b8563ff /src/bootloader
parente4b279cb88d769dd7167b35d0d6f51d9c5500bd3 (diff)
downloadtalos-hostboot-d935c5c94a9e1c23325f3dcd4ed113a6985412db.tar.gz
talos-hostboot-d935c5c94a9e1c23325f3dcd4ed113a6985412db.zip
Added more error reporting to HWSV when PNOR fails, removed superfluous code
- Replaced the terminate (terminateExecuteTI) raw calls with bl_terminate. Returning descriptive RC codes with bl_terminate call. - Module ID MOD_PNORACC_FINDTOC(=0x08) was added to hbblModuleId enums. - Return codes RC_LPC_ERR(HBBL_COMP_ID | 0x10) and RC_TOC_NOT_FOUND_ERR(HBBL_COMP_ID | 0x11) added to hbblReasonCode enums. - Freed up space in bootoloader: - Removed unnecessary calls to the method PNOR::checkForNullBuffer, because the call is always guaranteed to return with no error. - Once the calls to PNOR::checkForNullBuffer were dropped, the method PNOR::checkForNullBuffer is no longer necessary - removed it from production code. - The unit tests relied heavily on the call to PNOR::checkForNullBuffer, was not sure if the call could be removed from the unit tests, so relocated the PNOR::checkForNullBuffer method to the unit tests, out of production code. Change-Id: I1e3f8915ee4ed9b75ad74c57627ca1d2bc3a458d CQ:SW464040 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76787 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/bootloader')
-rw-r--r--src/bootloader/bl_pnorAccess.C71
1 files changed, 39 insertions, 32 deletions
diff --git a/src/bootloader/bl_pnorAccess.C b/src/bootloader/bl_pnorAccess.C
index 89183754a..ac49e010b 100644
--- a/src/bootloader/bl_pnorAccess.C
+++ b/src/bootloader/bl_pnorAccess.C
@@ -57,32 +57,8 @@ void bl_pnorAccess::readTOC(uint8_t i_tocBuffer[PNOR::TOC_SIZE],
BOOTLOADER_TRACE(BTLDR_TRC_PA_READTOC_ZEROSECTION_RTN);
- //make sure that the buffer is not null
- PNOR::checkForNullBuffer(i_tocBuffer, o_errCode, l_ffs_hdr);
-
- if(o_errCode != PNOR::NO_ERROR)
- {
- BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_READTOC_CHKNULLBUFFER_NULL);
- // Always TI if NULL pointer is passed in
- /*@
- * @errortype
- * @moduleid Bootloader::MOD_PNORACC_READTOC
- * @reasoncode Bootloader::RC_CHK_NULL_BUFFER
- * @userdata1[0:15] TI_WITH_SRC
- * @userdata1[16:31] TI_BOOTLOADER
- * @userdata1[32:63] Failing address = 0
- * @userdata2[0:31] Pointer to TOC buffer
- * @userdata2[32:63] Error code
- * @devdesc Invalid TOC buffer pointer
- * @custdesc A problem occurred while running processor
- * boot code.
- */
- bl_terminate(Bootloader::MOD_PNORACC_READTOC,
- Bootloader::RC_CHK_NULL_BUFFER,
- reinterpret_cast<uint64_t>(i_tocBuffer),
- o_errCode);
- break;
- }
+ // Create a convenient way to access the ffs_hdr struct
+ l_ffs_hdr = reinterpret_cast<ffs_hdr*>(i_tocBuffer);
BOOTLOADER_TRACE(BTLDR_TRC_PA_READTOC_CHECKNULLBUFFER_RTN);
@@ -233,8 +209,25 @@ void bl_pnorAccess::findTOC(uint64_t i_lpcBar, PNOR::SectionData_t * o_TOC,
//PNOR error found
o_errCode = PNOR::LPC_ERR;
BOOTLOADER_TRACE(BTLDR_TRC_PA_FINDTOC_TOC1_LPC_ERR);
- //@TODO RTC:203989 Add LPC Error/Status Reg as part of FFDC
- terminateExecuteTI();
+ /*@
+ * @errortype
+ * @moduleid Bootloader::MOD_PNORACC_FINDTOC
+ * @reasoncode Bootloader::RC_LPC_ERR
+ * @userdata1[0:15] TI_WITH_SRC
+ * @userdata1[16:31] TI_BOOTLOADER
+ * @userdata1[32:63] Failing address = 0
+ * @userdata2[0:31] LPC error/status
+ * @userdata2[32:63] Error code
+ * @devdesc LPC error detected.
+ * @custdesc A problem occurred while running processor
+ * boot code.
+ */
+ bl_terminate(Bootloader::MOD_PNORACC_FINDTOC,
+ Bootloader::RC_LPC_ERR,
+ (*l_val),
+ o_errCode,
+ true);
+ break;
}
//Copy Table of Contents from PNOR flash to a local buffer
@@ -293,10 +286,24 @@ void bl_pnorAccess::findTOC(uint64_t i_lpcBar, PNOR::SectionData_t * o_TOC,
(g_blData->blToHbData.lpcBAR + LPC::LPCHC_FW_SPACE))
{
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_FINDTOC_READTOC_ERR);
-
- // TI with data from readTOC
- terminateExecuteTI();
-
+ /*@
+ * @errortype
+ * @moduleid Bootloader::MOD_PNORACC_FINDTOC
+ * @reasoncode Bootloader::RC_TOC_NOT_FOUND_ERR
+ * @userdata1[0:15] TI_WITH_SRC
+ * @userdata1[16:31] TI_BOOTLOADER
+ * @userdata1[32:63] Failing address = 0
+ * @userdata2 MMIO Address
+ * @devdesc TOC not found
+ * @custdesc A problem occurred while running processor
+ * boot code.
+ */
+ bl_terminate(Bootloader::MOD_PNORACC_FINDTOC,
+ Bootloader::RC_TOC_NOT_FOUND_ERR,
+ // Extract the l_mmioAddr address among 2 - 32 bits
+ (l_mmioAddr >> 32),
+ l_mmioAddr,
+ true);
break;
}
}
OpenPOWER on IntegriCloud