Skip to content

Commit b29154d

Browse files
mgloffdcrowell77
authored andcommitted
Remove Hacks / Workarounds put in by commits 41463 and 41574
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>
1 parent ab2b3a0 commit b29154d

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/bootloader/bootloader.C

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252

5353
extern char bootloader_end_address;
5454

55+
// XSCOM/LPC BAR constants
56+
const uint64_t XSCOM_BAR_MASK = 0xFF000003FFFFFFFFULL;
57+
const uint64_t LPC_BAR_MASK = 0xFF000000FFFFFFFFULL;
58+
5559

5660
namespace Bootloader{
5761
/**
@@ -129,9 +133,10 @@ namespace Bootloader{
129133

130134
// Copy values for MMIO BARs
131135
g_blData->blToHbData.xscomBAR
132-
= /* (l_blConfigData->version >= MMIO_BARS_ADDED)
136+
= ((l_blConfigData->version >= MMIO_BARS_ADDED) &&
137+
((l_blConfigData->xscomBAR & XSCOM_BAR_MASK) == 0))
133138
? l_blConfigData->xscomBAR
134-
: @fixme-RTC:149250-Remove */ MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR;
139+
: MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR;
135140
/* lpcBAR already copied in main() */
136141

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

298303
// Copy SBE BL shared data into BL HB shared data
299-
/* const auto l_blConfigData = reinterpret_cast<BootloaderConfigData_t *>(
304+
const auto l_blConfigData = reinterpret_cast<BootloaderConfigData_t *>(
300305
SBE_HB_COMM_ADDR);
301-
@fixme-RTC:149250-Remove */
302306
g_blData->blToHbData.lpcBAR
303-
= /* (l_blConfigData->version >= MMIO_BARS_ADDED)
307+
= ((l_blConfigData->version >= MMIO_BARS_ADDED) &&
308+
((l_blConfigData->lpcBAR & LPC_BAR_MASK) == 0))
304309
? l_blConfigData->lpcBAR
305-
: @fixme-RTC:149250-Remove */ MMIO_GROUP0_CHIP0_LPC_BASE_ADDR;
310+
: MMIO_GROUP0_CHIP0_LPC_BASE_ADDR;
306311

307312
//pnorEnd is the end of flash, which is base of lpc, plus
308313
//the offset of the FW space, plus the TOP memory address in FW space

src/kernel/bltohbdatamgr.C

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ printk("Version=%lX\n",i_data.version);
145145
}
146146

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

162164
}
163165

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

169169

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

0 commit comments

Comments
 (0)