summaryrefslogtreecommitdiffstats
path: root/src/bootloader
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2017-05-08 11:25:11 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-06-08 10:41:38 -0400
commit4edfbd997e46ab635821558047b80ba38a2d7f15 (patch)
treed25ae8b4fbb3fd16dedfde1d5f37d63cb63e6a4a /src/bootloader
parentbb0796065c4a8035b0f0a9bddee61edc8f221c38 (diff)
downloadtalos-hostboot-4edfbd997e46ab635821558047b80ba38a2d7f15.tar.gz
talos-hostboot-4edfbd997e46ab635821558047b80ba38a2d7f15.zip
Use effective fabric position for LPC operations in the bootloader
When the LPC BAR value is supplied in the SBE to BL structure, use it as the base LPC address, otherwise, still use the LPC constant. Save the value being used in the Bootloader data (which is reorganized to align data blocks on boundaries). Also add hb-bldata to parse out the Bootloader data. Change-Id: I1db19467464b90e0190c4df5f7404624c9423eb5 RTC: 173525 Depends-on: I2b0d1959c303df8c9c28c8f0a5b5be1e77aa154f Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40217 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.C4
-rw-r--r--src/bootloader/bootloader.C53
2 files changed, 27 insertions, 30 deletions
diff --git a/src/bootloader/bl_pnorAccess.C b/src/bootloader/bl_pnorAccess.C
index 3ea60eaaf..b0d0c8ae6 100644
--- a/src/bootloader/bl_pnorAccess.C
+++ b/src/bootloader/bl_pnorAccess.C
@@ -201,6 +201,7 @@ void bl_pnorAccess::findTOC(uint64_t i_pnorEnd, PNOR::SectionData_t * o_TOC,
{
//@TODO RTC:138268 Set up multiple side of PNOR for bootloader
o_errCode = 0;
+
//Copy Table of Contents from PNOR flash to a local buffer
Bootloader::handleMMIO(l_mmioAddr,
reinterpret_cast<uint64_t>(l_tocBuffer),
@@ -232,7 +233,8 @@ void bl_pnorAccess::findTOC(uint64_t i_pnorEnd, PNOR::SectionData_t * o_TOC,
}
// Check that address is still in FW space
- if(l_mmioAddr < (LPC::LPC_PHYS_BASE + LPC::LPCHC_FW_SPACE))
+ if(l_mmioAddr <
+ (Bootloader::g_blData->blToHbData.lpcBAR + LPC::LPCHC_FW_SPACE))
{
BOOTLOADER_TRACE_W_BRK(BTLDR_TRC_PA_FINDTOC_READTOC_ERR);
diff --git a/src/bootloader/bootloader.C b/src/bootloader/bootloader.C
index 69d06e5ed..772279bc9 100644
--- a/src/bootloader/bootloader.C
+++ b/src/bootloader/bootloader.C
@@ -34,6 +34,7 @@
#include <lpc_const.H>
#include <pnor_utils.H>
+#include <arch/memorymap.H>
#include <ecc.H>
@@ -112,36 +113,22 @@ namespace Bootloader{
const auto l_pSecRomInfo = reinterpret_cast<const SecureRomInfo*>(
l_pRomStart);
- // Set the MMIO BAR information as is appropriate
- if (l_blConfigData->version >= MMIO_BARS_ADDED)
+ // Translate SBE to BL version into BL to HB version
+ switch(l_blConfigData->version)
{
- // Translate SBE to BL version into BL to HB version
- switch(l_blConfigData->version)
- {
- // Add cases as additional versions are created
- default:
- g_blData->blToHbData.version = BLTOHB_MMIOBARS;
- break;
- }
-
- // Copy values for MMIO BARs
- g_blData->blToHbData.xscomBAR = l_blConfigData->xscomBAR;
- g_blData->blToHbData.lpcBAR = l_blConfigData->lpcBAR;
- }
- else
- {
- // Use MMIO BARs version since default values are being set
- g_blData->blToHbData.version = BLTOHB_MMIOBARS;
-
- // Set default values for MMIO BARs
- // @TODO RTC: 173526 or RTC: 173525
- // Use constants MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR and
- // MMIO_GROUP0_CHIP0_LPC_BASE_ADDR from
- // src/include/arch/memorymap.H for setting values
- g_blData->blToHbData.xscomBAR = 0x000603FC00000000;
- g_blData->blToHbData.lpcBAR = 0x0006030000000000;
+ // Add cases as additional versions are created
+ default:
+ g_blData->blToHbData.version = BLTOHB_MMIOBARS;
+ break;
}
+ // Copy values for MMIO BARs
+ g_blData->blToHbData.xscomBAR
+ = (l_blConfigData->version >= MMIO_BARS_ADDED)
+ ? l_blConfigData->xscomBAR
+ : MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR;
+ /* lpcBAR already copied in main() */
+
// Only set rest of BlToHbData if SecureROM is valid
if ( secureRomInfoValid(l_pSecRomInfo) )
{
@@ -302,10 +289,18 @@ 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 *>(
+ SBE_HB_COMM_ADDR);
+ g_blData->blToHbData.lpcBAR
+ = (l_blConfigData->version >= MMIO_BARS_ADDED)
+ ? l_blConfigData->lpcBAR
+ : 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
- uint64_t l_pnorEnd = LPC::LPC_PHYS_BASE + LPC::LPCHC_FW_SPACE
- + PNOR::LPC_TOP_OF_FLASH_OFFSET;
+ uint64_t l_pnorEnd = g_blData->blToHbData.lpcBAR + LPC::LPCHC_FW_SPACE
+ + PNOR::LPC_TOP_OF_FLASH_OFFSET;
//We dont know what the start of pnor is because we dont know the size
uint64_t l_pnorStart = 0;
OpenPOWER on IntegriCloud