summaryrefslogtreecommitdiffstats
path: root/src/bootloader
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2017-06-05 11:48:27 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-06-15 12:37:55 -0400
commit74ca835c212ecf6df1b671d18e92887f76817a48 (patch)
tree364a668174e42a0225a4b4e37123b323c1eaa617 /src/bootloader
parentcf636ad2527070d3d7da277e03ba2b394ed77a29 (diff)
downloadtalos-hostboot-74ca835c212ecf6df1b671d18e92887f76817a48.tar.gz
talos-hostboot-74ca835c212ecf6df1b671d18e92887f76817a48.zip
Fix tracing for Bootloader hangs if it can't find first TOC
Limit how many traces are done by recovery loop that walks back through PNOR to find a valid TOC. Use page aligned MMIO addresses. Change-Id: Icdd41fe36fc597769af57d54049c3e457b790594 RTC: 175243 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41398 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/bootloader')
-rw-r--r--src/bootloader/bl_pnorAccess.C27
-rw-r--r--src/bootloader/bootloader.C1
2 files changed, 28 insertions, 0 deletions
diff --git a/src/bootloader/bl_pnorAccess.C b/src/bootloader/bl_pnorAccess.C
index b0d0c8ae6..2d924e1a6 100644
--- a/src/bootloader/bl_pnorAccess.C
+++ b/src/bootloader/bl_pnorAccess.C
@@ -27,6 +27,7 @@
#include <bootloader/bootloader_trace.H>
#include <bootloader/hbblreasoncodes.H>
#include <util/singleton.H>
+#include <util/align.H>
#include <bootloader/bootloader.H>
#include <lpc_const.H>
#ifdef PNORUTILSTEST_H
@@ -196,6 +197,7 @@ void bl_pnorAccess::findTOC(uint64_t i_pnorEnd, PNOR::SectionData_t * o_TOC,
//The first TOC is 1 TOC size + 1 page back from the end of the flash (+ 1)
uint64_t l_mmioAddr = i_pnorEnd - PNOR::TOC_OFFSET_FROM_TOP_OF_FLASH;
+ l_mmioAddr = ALIGN_PAGE_DOWN(l_mmioAddr);
do
{
@@ -224,12 +226,37 @@ void bl_pnorAccess::findTOC(uint64_t i_pnorEnd, PNOR::SectionData_t * o_TOC,
// Use PNOR start address for next MMIO
BOOTLOADER_TRACE(BTLDR_TRC_PA_FINDTOC_USE_PNOR_START);
l_mmioAddr = o_pnorStart;
+
+ // Reset saved trace index
+ Bootloader::g_blData->bl_trace_index_saved =
+ BOOTLOADER_TRACE_SIZE;
}
else
{
+ // Check if a trace index is not saved
+ if(Bootloader::g_blData->bl_trace_index_saved >=
+ BOOTLOADER_TRACE_SIZE)
+ {
+ // Save trace index for future passes through loop
+ Bootloader::g_blData->bl_trace_index_saved =
+ Bootloader::g_blData->bl_trace_index;
+
+ // Save this PNOR MMIO address
+ Bootloader::g_blData->bl_first_pnor_mmio = l_mmioAddr;
+ }
+ else // A trace index was saved
+ {
+ // Replace trace index, reuse trace entries for this loop
+ Bootloader::g_blData->bl_trace_index =
+ Bootloader::g_blData->bl_trace_index_saved;
+ }
+
// Adjust to new location in PNOR flash for next MMIO
BOOTLOADER_TRACE(BTLDR_TRC_PA_FINDTOC_ADJUST_PNOR_ADDR);
l_mmioAddr -= PAGESIZE;
+
+ // Increment loop counter
+ Bootloader::g_blData->bl_pnor_loop_count++;
}
// Check that address is still in FW space
diff --git a/src/bootloader/bootloader.C b/src/bootloader/bootloader.C
index bf8ca180a..cb13f0da4 100644
--- a/src/bootloader/bootloader.C
+++ b/src/bootloader/bootloader.C
@@ -280,6 +280,7 @@ namespace Bootloader{
// Initialization
g_blData = reinterpret_cast<blData_t *>(HBBL_DATA_ADDR);
g_blData->bl_trace_index = 0;
+ g_blData->bl_trace_index_saved = BOOTLOADER_TRACE_SIZE;
BOOTLOADER_TRACE(BTLDR_TRC_MAIN_START);
//Set core scratch 3 to say bootloader is active
OpenPOWER on IntegriCloud