summaryrefslogtreecommitdiffstats
path: root/src/usr/xscom
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2017-05-30 15:32:26 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-06-07 12:43:35 -0400
commite9489e7f7bdf45edb5e274c6b771485532ea906c (patch)
treec8c53b6e9a761447e06caaaa79f821605f37492b /src/usr/xscom
parent47f343509fdd57dfe6d2f7e230413db9ebab0066 (diff)
downloadtalos-hostboot-e9489e7f7bdf45edb5e274c6b771485532ea906c.tar.gz
talos-hostboot-e9489e7f7bdf45edb5e274c6b771485532ea906c.zip
Use XSCOM BAR from Bootloader instead of hardcoded value
The memory map can be modified by the SBE such that the XSCOM BAR is not in the default location. The BAR value is passed up through the bootloader into hostboot. Change-Id: I469b7534d384bce4bb8c72f7cd78d0075ac04632 RTC: 173519 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41140 Reviewed-by: Martin Gloff <mgloff@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> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/xscom')
-rw-r--r--src/usr/xscom/xscom.C25
-rw-r--r--src/usr/xscom/xscom.H5
2 files changed, 16 insertions, 14 deletions
diff --git a/src/usr/xscom/xscom.C b/src/usr/xscom/xscom.C
index d5e47511f..422063729 100644
--- a/src/usr/xscom/xscom.C
+++ b/src/usr/xscom/xscom.C
@@ -48,6 +48,9 @@
#include <xscom/piberror.H>
#include <arch/pirformat.H>
#include <lpc/lpcif.H>
+#include <sys/mm.h>
+#include <kernel/bltohbdatamgr.H>
+#undef HMER // from securerom/ROM.H
// Trace definition
trace_desc_t* g_trac_xscom = NULL;
@@ -321,8 +324,8 @@ errlHndl_t getTargetVirtualAddress(TARGETING::Target* i_target,
// If the virtual address equals NULL(default) then this is the
- // first XSCOM to this target so we need to calculate
- // the virtual address and save it in the xscom address attribute.
+ // first XSCOM to this target so we need to map in the appropriate
+ // address
if (o_virtAddr == NULL)
{
uint64_t xscomGroupId = 0;
@@ -522,13 +525,8 @@ uint64_t* getCpuIdVirtualAddress( XSComBase_t& o_mmioAddr )
{
uint64_t* o_virtAddr = 0;
- // Get the CPU core this thread is running on
- PIR_t cpuid = task_getcpuid();
-
- // Target's XSCOM Base address
- o_mmioAddr = MASTER_PROC_XSCOM_BASE_ADDR +
- (MMIO_OFFSET_PER_GROUP * cpuid.groupId) +
- (MMIO_OFFSET_PER_GROUP * cpuid.chipId);
+ // Read the MMIO setup by the SBE
+ o_mmioAddr = g_BlToHbDataManager.getXscomBAR();
// Target's virtual address
o_virtAddr = static_cast<uint64_t*>
@@ -843,4 +841,13 @@ errlHndl_t xscomPerformOp(DeviceFW::OperationType i_opType,
return l_err;
}
+/**
+ * @brief Return the value of the XSCOM BAR that the driver is using
+ */
+uint64_t get_master_bar( void )
+{
+ return mm_virt_to_phys(g_masterProcVirtAddr);
+}
+
+
} // end namespace
diff --git a/src/usr/xscom/xscom.H b/src/usr/xscom/xscom.H
index b1ceaab6a..6f5f87c13 100644
--- a/src/usr/xscom/xscom.H
+++ b/src/usr/xscom/xscom.H
@@ -34,11 +34,6 @@
#include <arch/memorymap.H>
/**
- * @brief The (fixed) base address value for master proc
- */
-constexpr uint64_t MASTER_PROC_XSCOM_BASE_ADDR = 0x000603FC00000000;
-
-/**
* @brief Type definition for XSCom address and Base
*/
typedef uint32_t XSComAddress_t;
OpenPOWER on IntegriCloud