summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2017-05-10 15:55:40 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-06-02 09:23:59 -0400
commit6b508aaf86e1d397155ada70bd1678cf5efde9aa (patch)
tree6ff8cd3aa44c82263df9ce4dda351163f2568be0 /src/kernel
parent3cbec65e0cf56eac08f826d3aa7fa618b9e7c1c9 (diff)
downloadblackbird-hostboot-6b508aaf86e1d397155ada70bd1678cf5efde9aa.tar.gz
blackbird-hostboot-6b508aaf86e1d397155ada70bd1678cf5efde9aa.zip
Map BAR attributes based on data from Bootloader
If the master processor has no memory behind it the entire memory map must be modified. Each processor has its own statically defined map that covers both memory and MMIOs. If the master has no memory, its memory map is swapped with another processor. Each processor gets a new effective fabric id that is then used to compute all of the BAR values for those processors. The SBE boots with a certain memory map programmed into the master processor. That value is then passed up through the bootloader into Hostboot. This value is compared to the BAR values that Hostboot assumes it is using. Based on that comparison, various attributes are computed to match the effective fabric positions. Change-Id: I2b0d1959c303df8c9c28c8f0a5b5be1e77aa154f RTC: 173528 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40359 Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/bltohbdatamgr.C38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/kernel/bltohbdatamgr.C b/src/kernel/bltohbdatamgr.C
index a0af449a8..775741b04 100644
--- a/src/kernel/bltohbdatamgr.C
+++ b/src/kernel/bltohbdatamgr.C
@@ -26,6 +26,7 @@
#include <util/align.H>
#include <kernel/console.H>
#include <assert.h>
+#include <arch/memorymap.H>
// Global and only BlToHbDataManager instance
BlToHbDataManager g_BlToHbDataManager;
@@ -122,12 +123,31 @@ void BlToHbDataManager::initValid (const Bootloader::BlToHbData& i_data)
iv_data.hbbHeader = i_data.hbbHeader;
iv_data.hbbHeaderSize = i_data.hbbHeaderSize;
+printk("Version=%lX\n",i_data.version);
// Ensure Bootloader to HB structure has the SAB member
if(iv_data.version >= Bootloader::BLTOHB_SAB)
{
iv_data.secureAccessBit = i_data.secureAccessBit;
}
+ // Ensure Bootloader to HB structure has the MMIO members
+ if( iv_data.version >= Bootloader::BLTOHB_MMIOBARS )
+ {
+printk("lpc=%lX, xscom=%lX\n", i_data.lpcBAR, i_data.xscomBAR );
+ kassert(i_data.lpcBar>0);
+ kassert(i_data.xscomBar>0);
+ iv_data.lpcBAR = i_data.lpcBAR;
+ iv_data.xscomBAR = i_data.xscomBAR;
+ }
+ else
+ {
+ //default to group0-proc0 values for down-level SBE
+ iv_data.lpcBAR = MMIO_GROUP0_CHIP0_LPC_BASE_ADDR;
+ iv_data.xscomBAR = MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR;
+
+ }
+
+
// Size of data that needs to be preserved and pinned.
iv_preservedSize = ALIGN_PAGE(iv_data.secureRomSize +
iv_data.hwKeysHashSize +
@@ -139,6 +159,7 @@ void BlToHbDataManager::initValid (const Bootloader::BlToHbData& i_data)
void BlToHbDataManager::initInvalid ()
{
+ printkd("BlToHbDataManager::initInvalid\n");
// Allow only one initializer call
if (iv_initialized)
{
@@ -146,6 +167,10 @@ void BlToHbDataManager::initInvalid ()
kassert(!iv_initialized);
}
+ //default to group0-proc0 values for down-level SBE
+ iv_data.lpcBAR = MMIO_GROUP0_CHIP0_LPC_BASE_ADDR;
+ iv_data.xscomBAR = MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR;
+
iv_initialized = true;
iv_dataValid = false;
print();
@@ -226,4 +251,15 @@ const size_t BlToHbDataManager::getPreservedSize() const
const bool BlToHbDataManager::isValid() const
{
return iv_dataValid;
-} \ No newline at end of file
+}
+
+const uint64_t BlToHbDataManager::getLpcBAR() const
+{
+ return reinterpret_cast<uint64_t>(iv_data.lpcBAR);
+}
+
+const uint64_t BlToHbDataManager::getXscomBAR() const
+{
+ return reinterpret_cast<uint64_t>(iv_data.xscomBAR);
+}
+
OpenPOWER on IntegriCloud