summaryrefslogtreecommitdiffstats
path: root/src/usr/fsi
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2015-02-11 11:04:51 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-02-18 15:06:42 -0600
commit79ea7abf6d31c146c680d39b9f3ae007e434a573 (patch)
tree359506a770bde98bb88930c71723b17371ec5937 /src/usr/fsi
parent84023756531d9c48d2e4939326f4048f2dadbe28 (diff)
downloadtalos-hostboot-79ea7abf6d31c146c680d39b9f3ae007e434a573.tar.gz
talos-hostboot-79ea7abf6d31c146c680d39b9f3ae007e434a573.zip
New interfaces to get FSI and PNOR info for Xstop code
Added new external interfaces to retrieve information about the FSI topology and the PNOR characteristics in order to enable the checkstop analysis code that runs on the OCC. RTC: 108820 Change-Id: Ibbe9bca8eee4c8ac86006b1ad881bd8b2c3b8280 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15726 Tested-by: Jenkins Server Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-by: William H. Schwartz <whs@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/fsi')
-rw-r--r--src/usr/fsi/fsidd.C31
-rw-r--r--src/usr/fsi/test/fsiddtest.H92
2 files changed, 111 insertions, 12 deletions
diff --git a/src/usr/fsi/fsidd.C b/src/usr/fsi/fsidd.C
index 7f313aa7d..6e7ae8aea 100644
--- a/src/usr/fsi/fsidd.C
+++ b/src/usr/fsi/fsidd.C
@@ -1806,15 +1806,15 @@ errlHndl_t FsiDD::genFullFsiAddr(FsiAddrInfo_t& io_addrInfo)
//start off with the addresses being the same
io_addrInfo.absAddr = io_addrInfo.relAddr;
+ //pull the FSI info out for this target
+ io_addrInfo.accessInfo = getFsiInfo( io_addrInfo.fsiTarg );
+
//target matches master so the address is correct as-is
if( io_addrInfo.fsiTarg == iv_master )
{
return NULL;
}
- //pull the FSI info out for this target
- io_addrInfo.accessInfo = getFsiInfo( io_addrInfo.fsiTarg );
-
TRACU1COMP( g_trac_fsi, "target=%.8X : Link Id=%.8X", TARGETING::get_huid(io_addrInfo.fsiTarg), io_addrInfo.accessInfo.linkid.id );
//FSI master is the master proc, find the port
@@ -3011,17 +3011,26 @@ FsiDD::FsiChipInfo_t FsiDD::getFsiInfo( TARGETING::Target* i_target )
void FsiDD::getFsiLinkInfo( TARGETING::Target* i_slave,
FSI::FsiLinkInfo_t& o_info )
{
- FsiChipInfo_t info = getFsiInfo( i_slave );
- o_info.master = info.master;
- o_info.type = info.type;
- o_info.link = info.port;
- o_info.cascade = info.cascade;
+ FsiAddrInfo_t addr_info( i_slave, 0x0 );
+ errlHndl_t tmp_err = genFullFsiAddr( addr_info );
+ if( tmp_err )
+ {
+ TRACFCOMP( g_trac_fsi, "Error getting FsiLinkInfo for %.8X", TARGETING::get_huid(i_slave) );
+ delete tmp_err;
+ return;
+ }
+
+ o_info.master = addr_info.accessInfo.master;
+ o_info.type = addr_info.accessInfo.type;
+ o_info.link = addr_info.accessInfo.port;
+ o_info.cascade = addr_info.accessInfo.cascade;
o_info.mPort = 0;
- if( info.master
- && (info.master != iv_master )
- && (getFsiInfo(info.master).flagbits.flipPort) )
+ if( addr_info.accessInfo.master
+ && (addr_info.accessInfo.master != iv_master )
+ && (getFsiInfo(addr_info.accessInfo.master).flagbits.flipPort) )
{
o_info.mPort = 1;
}
+ o_info.baseAddr = addr_info.absAddr;
}
diff --git a/src/usr/fsi/test/fsiddtest.H b/src/usr/fsi/test/fsiddtest.H
index 5d6eaaabc..ab409bc78 100644
--- a/src/usr/fsi/test/fsiddtest.H
+++ b/src/usr/fsi/test/fsiddtest.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* [+] 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. */
@@ -445,6 +447,94 @@ class FsiDDTest : public CxxTest::TestSuite
TRACFCOMP( g_trac_fsi, "FsiDDTest::test_FFDC> Finish" );
};
+
+ /**
+ * @brief FSI DD test - FSI Link Info
+ * Spot check getFsiLinkInfo results
+ */
+ void test_getFsiLinkInfo(void)
+ {
+ TRACFCOMP( g_trac_fsi, "FsiDDTest::test_getFsiLinkInfo> Start" );
+
+ enum {
+ PROC0,
+ CENTAUR4,
+ NUM_TARGETS
+ };
+ TARGETING::Target* fsi_targets[NUM_TARGETS];
+ for( size_t x = 0; x < NUM_TARGETS; x++ )
+ {
+ fsi_targets[x] = NULL;
+ }
+
+ TARGETING::Target* fsi_target = NULL;
+
+ // master processor target
+ TARGETING::EntityPath epath(TARGETING::EntityPath::PATH_PHYSICAL);
+ epath.addLast(TARGETING::TYPE_SYS,0);
+ epath.addLast(TARGETING::TYPE_NODE,0);
+ epath.addLast(TARGETING::TYPE_PROC,0);
+ fsi_target = TARGETING::targetService().toTarget(epath);
+ fsi_targets[PROC0] = fsi_target;
+
+ // local centaur target (physical:sys-0/node-0/membuf-4)
+ epath.removeLast();
+ epath.addLast(TARGETING::TYPE_MEMBUF,4);
+ fsi_target = TARGETING::targetService().toTarget(epath);
+ fsi_targets[CENTAUR4] = fsi_target;
+
+
+
+ // loop through all of the targets we defined to
+ // check the data
+ for( size_t x = 0; x < NUM_TARGETS; x++ )
+ {
+ if( fsi_targets[x] == NULL )
+ {
+ continue;
+ }
+
+ // Get the FSI port info for this target
+ TARGETING::FSI_MASTER_TYPE type =
+ fsi_targets[x]->getAttr<TARGETING::ATTR_FSI_MASTER_TYPE>();
+ uint8_t slave_port =
+ fsi_targets[x]->getAttr<TARGETING::ATTR_FSI_MASTER_PORT>();
+ TARGETING::EntityPath masterpath =
+ fsi_targets[x]->getAttr<TARGETING::ATTR_FSI_MASTER_CHIP>();
+ TARGETING::Target* master =
+ TARGETING::targetService().toTarget(masterpath);
+ uint8_t master_port = 0;
+ if( type != TARGETING::FSI_MASTER_TYPE_NO_MASTER )
+ {
+ master_port =
+ master->getAttr<TARGETING::ATTR_FSI_MASTER_PORT>()+1;
+ }
+
+ TRACFCOMP( g_trac_fsi, "sport=%d, mport=%d, master=%.8X, type=%d",slave_port,master_port, TARGETING::get_huid(master), master_port);
+ // Compute the offset
+ // CMFSI ports start at 0x040000 and increment by 0x008000
+ // MFSI ports start at 0x080000 and increment by 0x080000
+ // (local CMFSI ports have no MFSI offset)
+ uint32_t offset = (master_port * 0x080000);
+ if( type == TARGETING::FSI_MASTER_TYPE_CMFSI )
+ {
+ offset += ((slave_port * 0x008000) + 0x040000);
+ }
+
+ // Now call the interface we want to test
+ FSI::FsiLinkInfo_t linkinfo;
+ FSI::getFsiLinkInfo( fsi_targets[x], linkinfo );
+
+ // Compare the results
+ TRACFCOMP( g_trac_fsi, "FsiDDTest::test_getFsiLinkInfo> Data for %.8X: exp=%.6X, act=%.6X", TARGETING::get_huid(fsi_targets[x]), offset, linkinfo.baseAddr );
+ if( linkinfo.baseAddr != offset )
+ {
+ TS_FAIL( "FsiDDTest::test_getFsiLinkInfo> Mismatch for %.8X: exp=%.6X, act=%.6X", TARGETING::get_huid(fsi_targets[x]), offset, linkinfo.baseAddr );
+ }
+ }
+
+ TRACFCOMP( g_trac_fsi, "FsiDDTest::test_getFsiLinkInfo> End" );
+ }
};
OpenPOWER on IntegriCloud