summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2016-11-08 14:29:38 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-01-04 21:15:44 -0500
commit82af686f8456f594ae17409f1e1e70fc55485cd8 (patch)
treedfb45ebed75b31efdc09f0e5d248d30c6d0a52a6
parentb2e82859d8551ef4ee4c6e270794b2fd2d5ad3a4 (diff)
downloadtalos-hostboot-82af686f8456f594ae17409f1e1e70fc55485cd8.tar.gz
talos-hostboot-82af686f8456f594ae17409f1e1e70fc55485cd8.zip
Bootloader - Error handling - Add terminate function
As a first step to providing Bootloader error handling add support for a terminate function. Change-Id: Id4f8f130376d1396cd4feb796d1a3a908558225b RTC:135746 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32390 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/bootloader/bl_pnorAccess.C110
-rw-r--r--src/bootloader/bl_terminate.C31
-rw-r--r--src/bootloader/bootloader.C17
-rw-r--r--src/bootloader/makefile1
-rw-r--r--src/include/bootloader/bootloader.H38
-rw-r--r--src/include/bootloader/hbblreasoncodes.H75
-rw-r--r--src/include/kernel/hbterminatetypes.H5
-rw-r--r--src/include/kernel/terminate.H14
-rw-r--r--src/include/usr/hbotcompid.H9
-rw-r--r--src/kernel/terminate.C23
-rw-r--r--src/makefile2
11 files changed, 315 insertions, 10 deletions
diff --git a/src/bootloader/bl_pnorAccess.C b/src/bootloader/bl_pnorAccess.C
index e5e790426..77f53265c 100644
--- a/src/bootloader/bl_pnorAccess.C
+++ b/src/bootloader/bl_pnorAccess.C
@@ -25,6 +25,7 @@
#include <bootloader/bl_pnorAccess.H>
#include <bootloader/bootloader_trace.H>
+#include <bootloader/hbblreasoncodes.H>
#include <util/singleton.H>
#include <bootloader/bootloader.H>
#ifdef PNORUTILSTEST_H
@@ -48,6 +49,7 @@ void bl_pnorAccess::readTOC(uint8_t i_tocBuffer[PNOR::TOC_SIZE],
do
{
o_errCode = PNOR::NO_ERROR;
+ o_pnorStart = NULL;
ffs_hdr* l_ffs_hdr = NULL;
//zero out the section data for each section
@@ -58,18 +60,37 @@ void bl_pnorAccess::readTOC(uint8_t i_tocBuffer[PNOR::TOC_SIZE],
//make sure that the buffer is not null
PNOR::checkForNullBuffer(i_tocBuffer, o_errCode, l_ffs_hdr);
- //Subtract the size of the pnor from the end address to find the start
- o_pnorStart = i_pnorEnd -
- (l_ffs_hdr->block_size * l_ffs_hdr->block_count) + 1;
-
if(o_errCode != PNOR::NO_ERROR)
{
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_READTOC_CHKNULLBUFFER_NULL);
+ // Set TI information but caller decides to TI or not
+ /*@
+ * @errortype
+ * @moduleid MOD_PNORACC_READTOC
+ * @reasoncode 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,
+ false);
break;
}
BOOTLOADER_TRACE(BTLDR_TRC_PA_READTOC_CHECKNULLBUFFER_RTN);
+ //Subtract the size of the pnor from the end address to find the start
+ o_pnorStart = i_pnorEnd -
+ (l_ffs_hdr->block_size * l_ffs_hdr->block_count) + 1;
+
//Do a checksum on the header
if(PNOR::pnor_ffs_checksum(l_ffs_hdr, FFS_HDR_SIZE) != 0)
{
@@ -79,6 +100,25 @@ void bl_pnorAccess::readTOC(uint8_t i_tocBuffer[PNOR::TOC_SIZE],
if(o_errCode != PNOR::NO_ERROR)
{
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_READTOC_HDRCHECKSUM_ERR);
+ // Set TI information but caller decides to TI or not
+ /*@
+ * @errortype
+ * @moduleid MOD_PNORACC_READTOC
+ * @reasoncode RC_HDR_CHECKSUM_ERR
+ * @userdata1[0:15] TI_WITH_SRC
+ * @userdata1[16:31] TI_BOOTLOADER
+ * @userdata1[32:63] Failing address = 0
+ * @userdata2[0:31] Pointer to FFS header
+ * @userdata2[32:63] Error code
+ * @devdesc FFS header checksum error
+ * @custdesc A problem occurred while running processor
+ * boot code.
+ */
+ bl_terminate(Bootloader::MOD_PNORACC_READTOC,
+ Bootloader::RC_HDR_CHECKSUM_ERR,
+ reinterpret_cast<uint64_t>(l_ffs_hdr),
+ o_errCode,
+ false);
break;
}
@@ -90,6 +130,25 @@ void bl_pnorAccess::readTOC(uint8_t i_tocBuffer[PNOR::TOC_SIZE],
if(o_errCode != PNOR::NO_ERROR)
{
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_READTOC_CHECKHEADER_ERR);
+ // Set TI information but caller decides to TI or not
+ /*@
+ * @errortype
+ * @moduleid MOD_PNORACC_READTOC
+ * @reasoncode RC_CHECK_HEADER_ERR
+ * @userdata1[0:15] TI_WITH_SRC
+ * @userdata1[16:31] TI_BOOTLOADER
+ * @userdata1[32:63] Failing address = 0
+ * @userdata2[0:31] Pointer to FFS header
+ * @userdata2[32:63] Error code
+ * @devdesc Check FFS header error(s)
+ * @custdesc A problem occurred while running processor
+ * boot code.
+ */
+ bl_terminate(Bootloader::MOD_PNORACC_READTOC,
+ Bootloader::RC_CHECK_HEADER_ERR,
+ reinterpret_cast<uint64_t>(l_ffs_hdr),
+ o_errCode,
+ false);
break;
}
BOOTLOADER_TRACE(BTLDR_TRC_PA_READTOC_CHECKHEADER_RTN);
@@ -106,6 +165,25 @@ void bl_pnorAccess::readTOC(uint8_t i_tocBuffer[PNOR::TOC_SIZE],
if(o_errCode != PNOR::NO_ERROR)
{
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_READTOC_PARSEENTRIES_ERR);
+ // Set TI information but caller decides to TI or not
+ /*@
+ * @errortype
+ * @moduleid MOD_PNORACC_READTOC
+ * @reasoncode RC_PARSE_ENTRIES_ERR
+ * @userdata1[0:15] TI_WITH_SRC
+ * @userdata1[16:31] TI_BOOTLOADER
+ * @userdata1[32:63] Failing address = 0
+ * @userdata2[0:31] Pointer to FFS entry with error
+ * @userdata2[32:63] Error code
+ * @devdesc Parse FFS entries error
+ * @custdesc A problem occurred while running processor
+ * boot code.
+ */
+ bl_terminate(Bootloader::MOD_PNORACC_READTOC,
+ Bootloader::RC_PARSE_ENTRIES_ERR,
+ reinterpret_cast<uint64_t>(l_err_entry),
+ o_errCode,
+ false);
break;
}
BOOTLOADER_TRACE(BTLDR_TRC_PA_READTOC_PARSEENTRIES_RTN);
@@ -143,6 +221,10 @@ void bl_pnorAccess::findTOC(uint64_t i_pnorEnd, PNOR::SectionData_t * o_TOC,
}
else
{
+ // @TODO RTC:164445 Can remove if there is a way to find another TOC
+ // TI with data from readTOC
+ terminateExecuteTI();
+
//If the first toc was invalid, look for the backup in the start
Bootloader::handleMMIO(o_pnorStart,
reinterpret_cast<uint64_t>(l_tocBuffer),
@@ -157,6 +239,8 @@ void bl_pnorAccess::findTOC(uint64_t i_pnorEnd, PNOR::SectionData_t * o_TOC,
break;
}
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_FINDTOC_READTOC_ERR);
+ // TI with data from readTOC
+ terminateExecuteTI();
}
break;
@@ -181,6 +265,7 @@ void bl_pnorAccess::getHBBSection(uint64_t i_pnorEnd,
if(o_errCode != PNOR::NO_ERROR)
{
+ // Note findTOC should have TI'd so won't get here
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_GETHBBSECTION_FINDTOC_ERR);
break;
}
@@ -190,6 +275,23 @@ void bl_pnorAccess::getHBBSection(uint64_t i_pnorEnd,
{
o_errCode = PNOR::NO_HBB_SECTION;
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_GETHBBSECTION_FINDTOC_NOHBB);
+ /*@
+ * @errortype
+ * @moduleid MOD_PNORACC_GETHBBSECT
+ * @reasoncode RC_NO_HBB_IN_TOC
+ * @userdata1[0:15] TI_WITH_SRC
+ * @userdata1[16:31] TI_BOOTLOADER
+ * @userdata1[32:63] Failing address = 0
+ * @userdata2[0:31] Pointer to HBB Section data
+ * @userdata2[32:63] HBB Section flash address
+ * @devdesc Invalid flash address for HBB
+ * @custdesc A problem occurred while running processor
+ * boot code.
+ */
+ bl_terminate(Bootloader::MOD_PNORACC_GETHBBSECT,
+ Bootloader::RC_NO_HBB_IN_TOC,
+ reinterpret_cast<uint64_t>(&o_hbbSection),
+ o_hbbSection.flashAddr);
break;
}
} while(0);
diff --git a/src/bootloader/bl_terminate.C b/src/bootloader/bl_terminate.C
new file mode 100644
index 000000000..c87c0a207
--- /dev/null
+++ b/src/bootloader/bl_terminate.C
@@ -0,0 +1,31 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/bootloader/bl_terminate.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] 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 */
+#include <bootloader/bootloader.H>
+
+#define bl_terminate_C
+
+#include <../kernel/terminate.C>
+
+#undef bl_terminate_C
diff --git a/src/bootloader/bootloader.C b/src/bootloader/bootloader.C
index 966332460..5c6032524 100644
--- a/src/bootloader/bootloader.C
+++ b/src/bootloader/bootloader.C
@@ -28,6 +28,7 @@
#include <stdint.h>
#include <bootloader/bootloader.H>
#include <bootloader/bootloader_trace.H>
+#include <bootloader/hbblreasoncodes.H>
#include <bootloader/bl_pnorAccess.H>
#include <lpc_const.H>
@@ -163,10 +164,26 @@ namespace Bootloader{
else
{
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_MAIN_REMOVEECC_FAIL);
+ /*@
+ * @errortype
+ * @moduleid MOD_BOOTLOADER_MAIN
+ * @reasoncode RC_REMOVE_ECC_FAIL
+ * @userdata1[0:15] TI_WITH_SRC
+ * @userdata1[16:31] TI_BOOTLOADER
+ * @userdata1[32:63] Failing address = 0
+ * @userdata2[0:31] Word7 = 0
+ * @userdata2[32:63] Word8 = 0
+ * @devdesc Uncorrectable ECC error found in HBB
+ * @custdesc A problem occurred while running processor
+ * boot code.
+ */
+ bl_terminate(MOD_BOOTLOADER_MAIN,
+ RC_REMOVE_ECC_FAIL);
}
}
else
{
+ // Note getHBBSection should have TI'd so won't get here
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_MAIN_GETHBBSECTION_FAIL);
}
diff --git a/src/bootloader/makefile b/src/bootloader/makefile
index 4ed5e444b..598236b79 100644
--- a/src/bootloader/makefile
+++ b/src/bootloader/makefile
@@ -36,6 +36,7 @@ OBJS += bl_pnorAccess.o
OBJS += bl_pnor_utils.o
OBJS += bl_pnor_ecc.o
OBJS += bl_builtins.o
+OBJS += bl_terminate.o
OPT_LEVEL = -Os
diff --git a/src/include/bootloader/bootloader.H b/src/include/bootloader/bootloader.H
index ebcc4e1de..26f7f84df 100644
--- a/src/include/bootloader/bootloader.H
+++ b/src/include/bootloader/bootloader.H
@@ -36,6 +36,8 @@
#include <pnor_const.H>
#include <pnor_utils.H>
#include <common/ffs_hb.H>
+#include <kernel/terminate.H>
+#include <kernel/hbterminatetypes.H>
extern "C" void task_end_stub();
extern "C" void enterHBB(uint64_t i_hbb_hrmor, uint64_t i_hbb_offset);
@@ -105,6 +107,42 @@ namespace Bootloader{
uint32_t i_size,
MMIOLoadStoreSizes i_ld_st_size);
+ /**
+ * @brief Handle setting up to terminate Bootloader
+ *
+ * @param[in] i_moduleID ID for module where terminate is occurring
+ * @param[in] i_reasoncode Reason code for why terminating
+ * @param[in] i_word7 Data for SRC word 7 / @userdata2[0:31]
+ * (optional, default is 0)
+ * @param[in] i_word8 Data for SRC word 8 / @userdata2[32:63]
+ * (optional, default is 0)
+ * @param[in] i_executeTI Flag for calling terminateExecuteTI
+ * (optional, default is true)
+ * @param[in] i_failAddr Address associated with termination
+ * (SRC word 6 / @userdata1[32:63],
+ * optional, default is 0)
+ */
+ inline void bl_terminate(uint8_t i_moduleID,
+ uint16_t i_reasoncode,
+ uint32_t i_word7 = 0,
+ uint32_t i_word8 = 0,
+ bool i_executeTI = true,
+ uint64_t i_failAddr = 0)
+ {
+ termWriteSRC(TI_BOOTLOADER,
+ i_reasoncode,
+ i_failAddr);
+
+ termModifySRC(i_moduleID,
+ i_word7,
+ i_word8);
+
+ if(i_executeTI)
+ {
+ terminateExecuteTI();
+ }
+ }
+
/** @enum HbbLengths
* @brief List of HBB lengths.
*
diff --git a/src/include/bootloader/hbblreasoncodes.H b/src/include/bootloader/hbblreasoncodes.H
new file mode 100644
index 000000000..502b74bcf
--- /dev/null
+++ b/src/include/bootloader/hbblreasoncodes.H
@@ -0,0 +1,75 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/bootloader/hbblreasoncodes.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] 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 __HBBLREASONCODES_H
+#define __HBBLREASONCODES_H
+
+
+#include <usr/hbotcompid.H>
+
+
+
+namespace Bootloader
+{
+
+/**
+* @enum hbblModuleId
+*
+* @brief Module Ids used in created errorlogs. Indicates which
+* functions an error log was created in.
+*
+*/
+ enum hbblModuleId
+ {
+ MOD_BOOTLOADER_INVALID = 0x00, /**< Zero is an invalid module id */
+ MOD_BOOTLOADER_TERMINATE = 0x01, /**< bl_terminate.C : save SRC */
+ MOD_BOOTLOADER_MAIN = 0x02, /**< bootloader.C : main */
+ MOD_PNORACC_READTOC = 0x03, /**< bl_pnorAccess.C : read TOC */
+ MOD_PNORACC_GETHBBSECT = 0x04, /**< bl_pnorAccess.C : get HBB sect */
+
+ };
+
+/**
+ * @enum hbblReasonCode
+ *
+ * @brief Reasoncodes used to describe what errors are being indicated.
+ *
+ */
+ enum hbblReasonCode
+ {
+ RC_ASSERT = HBBL_COMP_ID | 0x01, /**< Assert */
+ RC_SHUTDOWN = HBBL_COMP_ID | 0x02, /**< Shutdown */
+ RC_UNHANDLED_EX = HBBL_COMP_ID | 0x03, /**< Unhandled Exception */
+ RC_REMOVE_ECC_FAIL = HBBL_COMP_ID | 0x04, /**< Remove ECC Failed */
+ RC_CHK_NULL_BUFFER = HBBL_COMP_ID | 0x05, /**< Check for NULL Buffr */
+ RC_HDR_CHECKSUM_ERR = HBBL_COMP_ID | 0x06, /**< Hdr Checksum Error */
+ RC_CHECK_HEADER_ERR = HBBL_COMP_ID | 0x07, /**< Check Header Error */
+ RC_PARSE_ENTRIES_ERR = HBBL_COMP_ID | 0x08, /**< Parse Entries Error */
+ RC_NO_HBB_IN_TOC = HBBL_COMP_ID | 0x09, /**< No HBB Sect in TOC */
+ };
+
+}; // end Bootloader
+
+
+#endif
diff --git a/src/include/kernel/hbterminatetypes.H b/src/include/kernel/hbterminatetypes.H
index 660358de1..42bb16788 100644
--- a/src/include/kernel/hbterminatetypes.H
+++ b/src/include/kernel/hbterminatetypes.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -29,7 +29,7 @@
#define __KERNEL_HBTERMINATETYPES_H
#include <stdint.h>
-/** @struct HB_T_SRC_DataAreaw
+/** @struct HB_T_SRC_DataArea
* @brief Defines the data space recreating an SRC needed for a TI from kernel
* space
*/
@@ -107,6 +107,7 @@ enum hb_terminate_source
TI_CRIT_ASSERT = 0x0002,
TI_SHUTDOWN = 0x0003,
TI_UNHANDLED_EX = 0x0004,
+ TI_BOOTLOADER = 0x0005,
};
diff --git a/src/include/kernel/terminate.H b/src/include/kernel/terminate.H
index b19e2fa39..9d80f988d 100644
--- a/src/include/kernel/terminate.H
+++ b/src/include/kernel/terminate.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* [+] 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. */
@@ -53,5 +55,15 @@ void termWriteSRC(uint16_t i_source,
uint16_t i_reasoncode,
uint64_t i_failAddr = 0);
+/** @fn termModifySRC
+ * Modify an SRC and the TI data area for Bootloader
+ * @param[in] i_moduleID: moduleID for the failure (used by Bootloader)
+ * @param[in] i_word7: data to set SRC word 7 / @userdata2[0:31] (optional)
+ * @param[in] i_word8: data to set SRC word 8 / @userdata2[32:63] (optional)
+ * @param[out] NONE:
+ */
+void termModifySRC(uint8_t i_moduleID,
+ uint32_t i_word7 = 0,
+ uint32_t i_word8 = 0);
#endif
diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H
index 278e0af05..7f1c0308e 100644
--- a/src/include/usr/hbotcompid.H
+++ b/src/include/usr/hbotcompid.H
@@ -405,6 +405,14 @@ const char SIO_COMP_NAME[] = "sio";
const compId_t FAPI2_COMP_ID = 0x3300;
const char FAPI2_COMP_NAME[] = "fapi2";
+/** @name HBBL
+ * Hostboot Bootloader
+ */
+//@{
+const compId_t HBBL_COMP_ID = 0x3400;
+const char HBBL_COMP_NAME[] = "hbbl";
+//@}
+
/** @name HDAT
* HDAT component
* @Note HDAT_COMP_ID=0x9000 matches with what
@@ -415,7 +423,6 @@ const compId_t HDAT_COMP_ID = 0x9000;
const char HDAT_COMP_NAME[] = "hdat";
-
/** @name PRDF
* PRDF component
* @Note PRDF_COMP_ID=0xE500 matches with what
diff --git a/src/kernel/terminate.C b/src/kernel/terminate.C
index e657feb83..dd908b4e7 100644
--- a/src/kernel/terminate.C
+++ b/src/kernel/terminate.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* [+] 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. */
@@ -24,12 +26,14 @@
#include <kernel/hbdescriptor.H>
#include <kernel/hbterminatetypes.H>
#include <kernel/terminate.H>
+#ifndef bl_terminate_C
#include <stdint.h>
#include <kernel/console.H>
#include <kernel/ipc.H>
#include <builtins.h>
#include <kernel/kernel_reasoncodes.H>
+#endif // bl_terminate_C
extern "C" void p8_force_attn() NO_RETURN;
@@ -37,11 +41,15 @@ extern "C" void p8_force_attn() NO_RETURN;
/* Instance of the TI Data Area */
HB_TI_DataArea kernel_TIDataArea;
-/* Instance of the HB desriptor struct */
+/* Instance of the HB descriptor struct */
HB_Descriptor kernel_hbDescriptor =
{
&kernel_TIDataArea,
+#ifndef bl_terminate_C
&KernelIpc::ipc_data_area,
+#else
+ NULL,
+#endif // bl_terminate_C
0
};
@@ -72,7 +80,18 @@ void termWriteSRC(uint16_t i_source, uint16_t i_reasoncode,uint64_t i_failAddr)
kernel_TIDataArea.src.reasoncode = i_reasoncode;
kernel_TIDataArea.src.moduleID = 0;
kernel_TIDataArea.src.iType = TI_WITH_SRC;
+ kernel_TIDataArea.src.iSource = i_source;
// Update User Data with address of fail location
kernel_TIDataArea.src.word6 = i_failAddr;
}
+
+void termModifySRC(uint8_t i_moduleID, uint32_t i_word7, uint32_t i_word8)
+{
+ // Update module ID
+ kernel_TIDataArea.src.moduleID = i_moduleID;
+
+ // Update User Data with anything supplied for word7 or word8
+ kernel_TIDataArea.src.word7 = i_word7;
+ kernel_TIDataArea.src.word8 = i_word8;
+}
diff --git a/src/makefile b/src/makefile
index 2c4cb163c..ef0520df8 100644
--- a/src/makefile
+++ b/src/makefile
@@ -67,6 +67,8 @@ BOOTLDR_OBJECTS += bootloader.o
BOOTLDR_OBJECTS += bl_pnorAccess.o
BOOTLDR_OBJECTS += bl_pnor_utils.o
BOOTLDR_OBJECTS += bl_pnor_ecc.o
+BOOTLDR_OBJECTS += bl_terminate.o
+BOOTLDR_OBJECTS += forceattn_p8.o
DIRECT_BOOT_OBJECTS += start.o
DIRECT_BOOT_OBJECTS += kernel.o
OpenPOWER on IntegriCloud