Skip to content

Commit

Permalink
Remove Hacks / Workarounds put in by commits 41463 and 41574
Browse files Browse the repository at this point in the history
Remove hacks to set LPC and XSCOM MMIO BAR default values in Bootloader and in
data passed to Hostboot (defect SW391259).

Change-Id: I3df6accadda8a5c461d969ed38e7970bc37291c9
CQ: SW391539
CMVC-Prereq: 1026637
Depends-on: I55ca10034d7adf3e766edb4d0071f649c7c90446
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41556
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: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mgloff authored and dcrowell77 committed Jun 28, 2017
1 parent ab2b3a0 commit b29154d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
17 changes: 11 additions & 6 deletions src/bootloader/bootloader.C
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@

extern char bootloader_end_address;

// XSCOM/LPC BAR constants
const uint64_t XSCOM_BAR_MASK = 0xFF000003FFFFFFFFULL;
const uint64_t LPC_BAR_MASK = 0xFF000000FFFFFFFFULL;


namespace Bootloader{
/**
Expand Down Expand Up @@ -129,9 +133,10 @@ namespace Bootloader{

// Copy values for MMIO BARs
g_blData->blToHbData.xscomBAR
= /* (l_blConfigData->version >= MMIO_BARS_ADDED)
= ((l_blConfigData->version >= MMIO_BARS_ADDED) &&
((l_blConfigData->xscomBAR & XSCOM_BAR_MASK) == 0))
? l_blConfigData->xscomBAR
: @fixme-RTC:149250-Remove */ MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR;
: MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR;
/* lpcBAR already copied in main() */

// Only set rest of BlToHbData if SecureROM is valid
Expand Down Expand Up @@ -296,13 +301,13 @@ namespace Bootloader{
// @TODO RTC:138268 Support multiple sides of PNOR in bootloader

// Copy SBE BL shared data into BL HB shared data
/* const auto l_blConfigData = reinterpret_cast<BootloaderConfigData_t *>(
const auto l_blConfigData = reinterpret_cast<BootloaderConfigData_t *>(
SBE_HB_COMM_ADDR);
@fixme-RTC:149250-Remove */
g_blData->blToHbData.lpcBAR
= /* (l_blConfigData->version >= MMIO_BARS_ADDED)
= ((l_blConfigData->version >= MMIO_BARS_ADDED) &&
((l_blConfigData->lpcBAR & LPC_BAR_MASK) == 0))
? l_blConfigData->lpcBAR
: @fixme-RTC:149250-Remove */ MMIO_GROUP0_CHIP0_LPC_BASE_ADDR;
: MMIO_GROUP0_CHIP0_LPC_BASE_ADDR;

//pnorEnd is the end of flash, which is base of lpc, plus
//the offset of the FW space, plus the TOP memory address in FW space
Expand Down
10 changes: 5 additions & 5 deletions src/kernel/bltohbdatamgr.C
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ printk("Version=%lX\n",i_data.version);
}

// Ensure Bootloader to HB structure has the MMIO members
if( iv_data.version >= Bootloader::BLTOHB_MMIOBARS )
// NOTE: BLTOHB_MMIOBARS version may not be sufficient to ensure that BARs
// were set correctly, instead use BLTOHB_SECURE_OVERRIDES version.
if( iv_data.version >= Bootloader::BLTOHB_SECURE_OVERRIDES )
{
printk("lpc=%lX, xscom=%lX\n", i_data.lpcBAR, i_data.xscomBAR );
kassert(i_data.lpcBAR>0);
Expand All @@ -161,10 +163,8 @@ printk("lpc=%lX, xscom=%lX\n", i_data.lpcBAR, i_data.xscomBAR );

}

//@fixme-RTC:149250-Remove this hack
iv_data.lpcBAR = MMIO_GROUP0_CHIP0_LPC_BASE_ADDR;
iv_data.xscomBAR = MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR;
printk( "Use default LPC/XSCOM\n" );
printk("lpc=%lX, xscom=%lX, iv_data=%p\n", iv_data.lpcBAR, iv_data.xscomBAR,
static_cast<void *>(&iv_data) );


// Size of data that needs to be preserved and pinned.
Expand Down

0 comments on commit b29154d

Please sign in to comment.