diff options
author | Missy Connell <missyc@us.ibm.com> | 2012-06-28 10:50:14 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-07-12 11:46:06 -0500 |
commit | 4bf57814b214bd8d2d730d27955898b1f9cd1e43 (patch) | |
tree | 998bc47b4486c5176729a1fb5cdd9eb5bce5fbf3 /src/usr | |
parent | b37137dc550343c0dc6368d3d56558941e48c79e (diff) | |
download | talos-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')
-rw-r--r-- | src/usr/scom/test/scomtest.H | 157 | ||||
-rw-r--r-- | src/usr/targeting/common/targetservice.C | 61 | ||||
-rw-r--r-- | src/usr/targeting/common/test/testcommontargeting.H | 50 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 25 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/simics_MURANO.system.xml | 28 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/simics_VENICE.system.xml | 56 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/target_types.xml | 3 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/vbu.system.xml | 7 | ||||
-rw-r--r-- | src/usr/targeting/xmltohb/TULETA.mrw.xml | 28 | ||||
-rwxr-xr-x | src/usr/targeting/xmltohb/genHwsvMrwXml.pl | 14 | ||||
-rw-r--r-- | src/usr/xscom/xscom.C | 33 |
11 files changed, 237 insertions, 225 deletions
diff --git a/src/usr/scom/test/scomtest.H b/src/usr/scom/test/scomtest.H index 5f622cb2f..a42cb56a8 100644 --- a/src/usr/scom/test/scomtest.H +++ b/src/usr/scom/test/scomtest.H @@ -37,6 +37,8 @@ #include <fsi/fsiif.H> #include <targeting/common/util.H> +#include <devicefw/driverif.H> + extern trace_desc_t* g_trac_scom; @@ -1635,6 +1637,161 @@ public: //@todo - write error path testcase for FSI scom using bad address + + + + /** + * @brief multi chip SCOM test + * + */ + void test_MultiChipSCOMreadWrite_proc(void) + { + + TRACFCOMP( g_trac_scom, "ScomTest::test_MultiChipSCOMreadWrite_proc> Start" ); + + uint64_t fails = 0; + uint64_t total = 0; + errlHndl_t l_err = NULL; + + // Setup some targets to use + enum { + PROC1, + NUM_TARGETS + }; + TARGETING::Target* scom_targets[NUM_TARGETS]; + for( uint64_t x = 0; x < NUM_TARGETS; x++ ) + { + scom_targets[x] = NULL; + } + + TARGETING::EntityPath epath(TARGETING::EntityPath::PATH_PHYSICAL); + epath.addLast(TARGETING::TYPE_SYS,0); + epath.addLast(TARGETING::TYPE_NODE,0); + epath.addLast(TARGETING::TYPE_PROC,1); + scom_targets[PROC1] = TARGETING::targetService().toTarget(epath); + + for( uint64_t x = 0; x < NUM_TARGETS; x++ ) + { + //only run if the target exists + if(scom_targets[x] == NULL) + { + continue; + } + else if (scom_targets[x]->getAttr<TARGETING::ATTR_HWAS_STATE>().functional != true) + { + TRACDCOMP( g_trac_scom, "ScomTest::test_FSISCOMreadWrite_proc> Target %d is not functional", x ); + scom_targets[x] = NULL; //remove from our list + } + } + // scratch data to use + //@fixme: Need to either fabricate some fake registers to use or save off data before modifying SCOMs to avoid + // corrupting the HW. + struct { + TARGETING::Target* target; + uint64_t addr; + uint64_t data; + } test_data[] = { + { scom_targets[PROC1], 0x01010803, 0x1234567887654321}, + { scom_targets[PROC1], 0x02040004, 0x1122334455667788}, + }; + const uint64_t NUM_ADDRS = sizeof(test_data)/sizeof(test_data[0]); + + // allocate space for read data + uint64_t read_data[NUM_ADDRS]; + size_t op_size = sizeof(uint32_t); + + // write all the test registers + for( uint64_t x = 0; x < NUM_ADDRS; x++ ) + { + //only run if the target exists + if(test_data[x].target == NULL) + { + continue; + } + + op_size = sizeof(uint64_t); + + total++; + + l_err = deviceOp( DeviceFW::WRITE, + test_data[x].target, + &(test_data[x].data), + op_size, + DEVICE_XSCOM_ADDRESS(test_data[x].addr) ); + + if( l_err ) + { + TRACFCOMP(g_trac_scom, "ScomTest::test_MultiChipScomWrite_proc> [%d] Write: Error from device : addr=0x%X, RC=%X", x, test_data[x].addr, l_err->reasonCode() ); + TS_FAIL( "ScomTest::test__MultiChipScomWrite_proc> ERROR : Unexpected error log from write1" ); + fails++; + errlCommit(l_err,SCOM_COMP_ID); + } + } + + // read all the test registers + for( uint64_t x = 0; x < NUM_ADDRS; x++ ) + { + //only run if the target exists + if(test_data[x].target == NULL) + { + continue; + } + + op_size = sizeof(uint64_t); + + total++; + + // read the data back using XSCOM + l_err = deviceOp( DeviceFW::READ, + test_data[x].target, + &(read_data[x]), + op_size, + DEVICE_XSCOM_ADDRESS(test_data[x].addr) ); + + if( l_err ) + { + TRACFCOMP(g_trac_scom, "ScomTest::test__MultiChipScomWrite_proc> [%d] XSCOM Read: Error from device : addr=0x%X, RC=%X", x, test_data[x].addr, l_err->reasonCode() ); + TS_FAIL( "ScomTest::test__MultiChipScomWrite_proc> ERROR : Unexpected error log from write1" ); + fails++; + errlCommit(l_err,SCOM_COMP_ID); + } + else if(read_data[x] != test_data[x].data) + { + TRACFCOMP(g_trac_scom, "ScomTest::test__MultiChipScomWrite_proc> [%d] XSCOM Read: Data miss-match : addr=0x%X, read_data=0x%llx, write_data=0x%llx", x, test_data[x].addr, read_data[x], test_data[x].data); + TS_FAIL( "ScomTest::test__MultiChipScomWrite_proc> ERROR : Data miss-match between read and expected data" ); + fails++; + } + + // Read the data back using FSIscom to make sure the data is the same. + l_err = deviceOp( DeviceFW::READ, + test_data[x].target, + &(read_data[x]), + op_size, + DEVICE_FSISCOM_ADDRESS(test_data[x].addr) ); + + + if( l_err ) + { + TRACFCOMP(g_trac_scom, "ScomTest::test__MultiChipScomWrite_proc> [%d] FSISCOM Read: Error from device : addr=0x%X, RC=%X", x, test_data[x].addr, l_err->reasonCode() ); + TS_FAIL( "ScomTest::test__MultiChipScomWrite_proc> ERROR : Unexpected error log from write1" ); + fails++; + errlCommit(l_err,SCOM_COMP_ID); + } + else if(read_data[x] != test_data[x].data) + { + TRACFCOMP(g_trac_scom, "ScomTest::test__MultiChipScomWrite_proc> [%d] FSISCOM Read: Data miss-match : addr=0x%X, read_data=0x%llx, write_data=0x%llx", x, test_data[x].addr, read_data[x], test_data[x].data); + TS_FAIL( "ScomTest::test__MultiChipScomWrite_proc> ERROR : Data miss-match between read and expected data" ); + fails++; + } + + } + + TRACFCOMP( g_trac_scom, "ScomTest::test__MultiChipScomWrite_proc> %d/%d fails", fails, total ); + + } + }; + + #endif diff --git a/src/usr/targeting/common/targetservice.C b/src/usr/targeting/common/targetservice.C index f208d9e24..c38bb5cbf 100644 --- a/src/usr/targeting/common/targetservice.C +++ b/src/usr/targeting/common/targetservice.C @@ -1,26 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/targeting/targetservice.C $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END - +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/targeting/common/targetservice.C $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ /** * @file targeting/common/targetservice.C * @@ -512,13 +512,18 @@ void TargetService::dump() const TARG_INF("XSCOM Base Address = 0x%016llX",l_xscomBaseAddr); } - XscomChipInfo l_xscomChipInfo = {0}; - if ( (*iv_targets)[i].tryGetAttr<ATTR_XSCOM_CHIP_INFO>( - l_xscomChipInfo) ) + uint8_t l_Node_Id = 0; + if ( (*iv_targets)[i].tryGetAttr<ATTR_FABRIC_NODE_ID>(l_Node_Id)) { - TARG_INF("XSCOM Node ID = 0x%X",l_xscomChipInfo.nodeId); - TARG_INF("XSCOM Chip ID = 0x%X",l_xscomChipInfo.chipId); + TARG_INF("XSCOM Node ID = 0x%X",l_Node_Id); } + + uint8_t l_Chip_Id = 0; + if ( (*iv_targets)[i].tryGetAttr<ATTR_FABRIC_CHIP_ID>(l_Chip_Id)) + { + TARG_INF("XSCOM Chip ID = 0x%X",l_Chip_Id); + } + } return; diff --git a/src/usr/targeting/common/test/testcommontargeting.H b/src/usr/targeting/common/test/testcommontargeting.H index 37430fdb2..13cd07418 100644 --- a/src/usr/targeting/common/test/testcommontargeting.H +++ b/src/usr/targeting/common/test/testcommontargeting.H @@ -1,26 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/targeting/test/targetingtest.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END - +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/targeting/common/test/testcommontargeting.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef __TARGETING_COMMON_TESTCOMMONTARGETING_H #define __TARGETING_COMMON_TESTCOMMONTARGETING_H @@ -1067,10 +1067,10 @@ class CommonTargetingTestSuite: public CxxTest::TestSuite uint64_t l_xscom = l_pTarget->getAttr<TARGETING::ATTR_XSCOM_BASE_ADDRESS>(); - if(l_xscom != 0x300000000000ULL) + if(l_xscom != 0x0003FC0000000000) { TARG_TS_FAIL("l_xscom value is 0x%016llX, not 0x%016llX as expected in direct " - "attribute access",l_xscom,0x300000000000ULL); + "attribute access",l_xscom,0x0003FC00000000ULL); } TARG_TS_TRACE(INF_MRK "Now using FAPI get macros"); diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index c08772264..1fdc6bdb0 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -677,36 +677,13 @@ <description>System XSCOM base address</description> <simpleType> <uint64_t> - <default>0x300000000000</default> + <default>0x0003FC0000000000</default> </uint64_t> </simpleType> <persistency>non-volatile</persistency> <readable/> </attribute> -<attribute> - <id>XSCOM_CHIP_INFO</id> - <description>Attribute which describes XSCOM chip info</description> - <complexType> - <description>Structure which defines chip info necessary for XSCOM. - Only applicable for chip targets which support XSCOM. Structure is - read-only</description> - <field> - <name>nodeId</name> - <description>Unique ID of node containing the chip</description> - <type>uint8_t</type> - <default>0</default> - </field> - <field> - <name>chipId</name> - <description>Unique ID of chip, relative to node</description> - <type>uint8_t</type> - <default>0</default> - </field> - </complexType> - <persistency>non-volatile</persistency> - <readable/> -</attribute> <attribute> <id>XSCOM_VIRTUAL_ADDR</id> diff --git a/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml b/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml index 3b5fdbc4d..5d993d7e2 100644 --- a/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml @@ -158,13 +158,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0</default> </attribute> @@ -724,13 +717,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-1</default> </attribute> @@ -1312,13 +1298,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-2</default> </attribute> @@ -1901,13 +1880,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-3</default> </attribute> diff --git a/src/usr/targeting/common/xmltohb/simics_VENICE.system.xml b/src/usr/targeting/common/xmltohb/simics_VENICE.system.xml index d5d98eda1..16ce8936c 100644 --- a/src/usr/targeting/common/xmltohb/simics_VENICE.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_VENICE.system.xml @@ -164,13 +164,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0</default> </attribute> @@ -1011,13 +1004,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-1</default> </attribute> @@ -1878,13 +1864,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-2</default> </attribute> @@ -2747,13 +2726,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id> <!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-3</default> </attribute> @@ -3613,13 +3585,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-4</default> </attribute> @@ -4481,13 +4446,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-5</default> </attribute> @@ -5347,13 +5305,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-6</default> </attribute> @@ -6214,13 +6165,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id><!-- @fixme: Story 35529 --> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-7</default> </attribute> diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index c1a3c833f..e7092b4a0 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -195,9 +195,6 @@ <targetType> <id>chip-processor-power8</id> <parent>chip-processor</parent> - <attribute> - <id>XSCOM_CHIP_INFO</id> - </attribute> <attribute><id>DUMMY_RW</id></attribute> <attribute><id>DUMMY_HEAP_ZERO_DEFAULT</id></attribute> <attribute> diff --git a/src/usr/targeting/common/xmltohb/vbu.system.xml b/src/usr/targeting/common/xmltohb/vbu.system.xml index cd7bcb19b..1e152b22a 100644 --- a/src/usr/targeting/common/xmltohb/vbu.system.xml +++ b/src/usr/targeting/common/xmltohb/vbu.system.xml @@ -153,13 +153,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0</default> </attribute> diff --git a/src/usr/targeting/xmltohb/TULETA.mrw.xml b/src/usr/targeting/xmltohb/TULETA.mrw.xml index 83c7ccb81..e49ede224 100644 --- a/src/usr/targeting/xmltohb/TULETA.mrw.xml +++ b/src/usr/targeting/xmltohb/TULETA.mrw.xml @@ -139,13 +139,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-0</default> </attribute> @@ -736,13 +729,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-1</default> </attribute> @@ -1354,13 +1340,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-2</default> </attribute> @@ -1972,13 +1951,6 @@ </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id> - <default> - <field><id>nodeId</id><value>0</value></field> - <field><id>chipId</id><value>0</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-0/node-0/proc-3</default> </attribute> diff --git a/src/usr/targeting/xmltohb/genHwsvMrwXml.pl b/src/usr/targeting/xmltohb/genHwsvMrwXml.pl index fc433344b..4b1c2c244 100755 --- a/src/usr/targeting/xmltohb/genHwsvMrwXml.pl +++ b/src/usr/targeting/xmltohb/genHwsvMrwXml.pl @@ -606,13 +606,6 @@ sub generate_master_proc </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id> - <default> - <field><id>nodeId</id><value>$node</value></field> - <field><id>chipId</id><value>$proc</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-$sys/node-$node/proc-$proc</default> </attribute> @@ -689,13 +682,6 @@ sub generate_slave_proc </default> </attribute> <attribute> - <id>XSCOM_CHIP_INFO</id> - <default> - <field><id>nodeId</id><value>$node</value></field> - <field><id>chipId</id><value>$Mproc</value></field> - </default> - </attribute> - <attribute> <id>PHYS_PATH</id> <default>physical:sys-$sys/node-$node/proc-$proc</default> </attribute> 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; } |