summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/arch/memorymap.H61
-rw-r--r--src/include/kernel/bltohbdatamgr.H16
-rw-r--r--src/include/usr/lpc/lpcif.H6
3 files changed, 82 insertions, 1 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
diff --git a/src/include/kernel/bltohbdatamgr.H b/src/include/kernel/bltohbdatamgr.H
index 8ddccf49f..6563ba9f1 100644
--- a/src/include/kernel/bltohbdatamgr.H
+++ b/src/include/kernel/bltohbdatamgr.H
@@ -163,9 +163,23 @@ class BlToHbDataManager
* @return bool true if valid; false otherwise
*/
const bool isValid() const;
+
+ /*
+ * @brief Returns LPC BAR setup by SBE
+ *
+ * @return uint64_t LPC BAR
+ */
+ const uint64_t getLpcBAR() const;
+
+ /*
+ * @brief Returns XSCOM BAR setup by SBE
+ *
+ * @return size_t XSCP< BAR
+ */
+ const uint64_t getXscomBAR() const;
};
// Extern global instance of the class
extern BlToHbDataManager g_BlToHbDataManager;
-#endif \ No newline at end of file
+#endif
diff --git a/src/include/usr/lpc/lpcif.H b/src/include/usr/lpc/lpcif.H
index b09297a5e..db6ea9a32 100644
--- a/src/include/usr/lpc/lpcif.H
+++ b/src/include/usr/lpc/lpcif.H
@@ -64,6 +64,12 @@ errlHndl_t create_altmaster_objects( bool i_create,
*/
void block_lpc_ops( bool i_block );
+/**
+ * @brief Return the value of the LPC BAR that the driver is using
+ * @return LPC BAR physical address
+ */
+uint64_t get_lpc_bar( void );
+
}; // namespace LPC
OpenPOWER on IntegriCloud