summaryrefslogtreecommitdiffstats
path: root/src/usr/xscom
diff options
context:
space:
mode:
authorMissy Connell <missyc@us.ibm.com>2012-06-28 10:50:14 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-07-12 11:46:06 -0500
commit4bf57814b214bd8d2d730d27955898b1f9cd1e43 (patch)
tree998bc47b4486c5176729a1fb5cdd9eb5bce5fbf3 /src/usr/xscom
parentb37137dc550343c0dc6368d3d56558941e48c79e (diff)
downloadtalos-hostboot-4bf57814b214bd8d2d730d27955898b1f9cd1e43.tar.gz
talos-hostboot-4bf57814b214bd8d2d730d27955898b1f9cd1e43.zip
XSCOM Support to remote Processor
Added support to XSCOM remote processor. Create testcase to perform an xscom on the remote processor Testing on a multip chip murano environment. Removed XSCOM_CHIP_INFO attribute. Now using FABRIC_NODE_ID and FABRIC_CHIP_ID RTC: 35529 Change-Id: I372740e817212361dfd7311d9b8c46a65ce52880 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1288 Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Tested-by: Jenkins Server
Diffstat (limited to 'src/usr/xscom')
-rw-r--r--src/usr/xscom/xscom.C33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/usr/xscom/xscom.C b/src/usr/xscom/xscom.C
index 27ca5a63c..d2ef0f254 100644
--- a/src/usr/xscom/xscom.C
+++ b/src/usr/xscom/xscom.C
@@ -346,17 +346,23 @@ errlHndl_t getTargetVirtualAddress(TARGETING::Target* i_target,
// Get the virtual addr value of the chip from the virtual address
// attribute
- o_virtAddr = reinterpret_cast<uint64_t*>(i_target->getAttr<TARGETING::ATTR_XSCOM_VIRTUAL_ADDR>());
+ o_virtAddr = reinterpret_cast<uint64_t*>(i_target->getAttr<TARGETING::ATTR_XSCOM_VIRTUAL_ADDR>());
// 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.
if (o_virtAddr == NULL)
{
- // Get the target chip info
- TARGETING::XscomChipInfo l_xscomChipInfo = {0};
- l_xscomChipInfo =
- i_target->getAttr<TARGETING::ATTR_XSCOM_CHIP_INFO>();
+ uint64_t xscomNodeId = 0;
+ uint64_t xscomChipId = 0;
+
+ // Get the target Node Id
+ xscomNodeId =
+ i_target->getAttr<TARGETING::ATTR_FABRIC_NODE_ID>();
+
+ // Get the target Chip Id
+ xscomChipId =
+ i_target->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
//@todo
// Save the node id of the master chip in a global as well and
@@ -376,14 +382,17 @@ errlHndl_t getTargetVirtualAddress(TARGETING::Target* i_target,
// Target's XSCOM Base address
l_XSComBaseAddr = l_systemBaseAddr +
- ( ( (g_xscomMaxChipsPerNode * l_xscomChipInfo.nodeId) +
- l_xscomChipInfo.chipId ) * THIRTYTWO_GB);
+ ( ( (g_xscomMaxChipsPerNode * xscomNodeId) +
+ xscomChipId ) * THIRTYTWO_GB);
// Target's virtual address
o_virtAddr = static_cast<uint64_t*>
(mmio_dev_map(reinterpret_cast<void*>(l_XSComBaseAddr),
THIRTYTWO_GB));
+ TRACDCOMP(g_trac_xscom, "xscomPerformOp: o_Virtual Address = 0x%llX\n",
+ o_virtAddr);
+
// Implemented the virtual address attribute..
// Leaving the comments as a discussion point...
@@ -400,7 +409,9 @@ errlHndl_t getTargetVirtualAddress(TARGETING::Target* i_target,
// this case.
// Save the virtual address attribute.
+
i_target->setAttr<TARGETING::ATTR_XSCOM_VIRTUAL_ADDR>(reinterpret_cast<uint64_t>(o_virtAddr));
+
}
}
@@ -465,11 +476,6 @@ errlHndl_t xscomPerformOp(DeviceFW::OperationType i_opType,
// Get the offset
uint64_t l_offset = l_mmioAddr.offset();
- TRACDCOMP(g_trac_xscom, "xscomPerformOp: OpType 0x%.16llX, Address 0x%llX, l_virtAddr+l_offset %p",
- static_cast<uint64_t>(i_opType),
- l_addr,
- l_virtAddr + l_offset);
-
// Keep MMIO access until XSCOM successfully done or error
uint64_t l_data = 0;
do
@@ -483,11 +489,14 @@ errlHndl_t xscomPerformOp(DeviceFW::OperationType i_opType,
if (i_opType == DeviceFW::READ)
{
+
l_data = *(l_virtAddr + l_offset);
+
memcpy(io_buffer, &l_data, sizeof(l_data));
}
else
{
+
memcpy(&l_data, io_buffer, sizeof(l_data));
*(l_virtAddr + l_offset) = l_data;
}
OpenPOWER on IntegriCloud