From 4bf57814b214bd8d2d730d27955898b1f9cd1e43 Mon Sep 17 00:00:00 2001 From: Missy Connell Date: Thu, 28 Jun 2012 10:50:14 -0500 Subject: 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 Tested-by: Jenkins Server --- src/usr/xscom/xscom.C | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'src/usr/xscom') 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(i_target->getAttr()); + o_virtAddr = reinterpret_cast(i_target->getAttr()); // 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(); + uint64_t xscomNodeId = 0; + uint64_t xscomChipId = 0; + + // Get the target Node Id + xscomNodeId = + i_target->getAttr(); + + // Get the target Chip Id + xscomChipId = + i_target->getAttr(); //@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 (mmio_dev_map(reinterpret_cast(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(reinterpret_cast(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(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; } -- cgit v1.2.1