summaryrefslogtreecommitdiffstats
path: root/src/include/arch
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/include/arch
parent3cbec65e0cf56eac08f826d3aa7fa618b9e7c1c9 (diff)
downloadtalos-hostboot-6b508aaf86e1d397155ada70bd1678cf5efde9aa.tar.gz
talos-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/include/arch')
-rw-r--r--src/include/arch/memorymap.H61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/include/arch/memorymap.H b/src/include/arch/memorymap.H
new file mode 100644
index 000000000..f102395fb
--- /dev/null
+++ b/src/include/arch/memorymap.H
@@ -0,0 +1,61 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/arch/memorymap.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2017 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef _MEMORYMAP_H
+#define _MEMORYMAP_H
+
+#include <limits.h>
+
+/**
+ * Collection of constants and utility functions related to the
+ * static memory map defined for the POWER9 family of processors.
+ */
+
+/**
+ * @brief Static offsets into other chips
+ */
+constexpr uint64_t MMIO_OFFSET_PER_CHIP = (4*TERABYTE); //0x40000000000
+constexpr uint64_t MMIO_OFFSET_PER_GROUP = (32*TERABYTE); //0x200000000000
+
+/**
+ * @brief Compute MMIO value for a given chip and base value
+ */
+inline uint64_t computeMemoryMapOffset( uint64_t i_baseAddr,
+ uint8_t i_group,
+ uint8_t i_chip )
+{
+ return (i_baseAddr +
+ (MMIO_OFFSET_PER_GROUP * i_group) +
+ (MMIO_OFFSET_PER_CHIP * i_chip));
+};
+
+/**
+ * @brief A few default values that will need to be known
+ * by low-level code
+ */
+constexpr uint64_t MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR = 0x000603FC00000000;
+constexpr uint64_t MMIO_GROUP0_CHIP0_LPC_BASE_ADDR = 0x0006030000000000;
+
+
+#endif //#ifndef _MEMORYMAP_H
OpenPOWER on IntegriCloud