diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2011-09-08 16:08:26 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2011-10-05 12:49:57 -0500 |
commit | 336f6ac6abc1d5ee4efc1229be06a66baf06643b (patch) | |
tree | e3476d2423567ad81249cc215d195dbc36c4a04f /src/usr/fsi/test | |
parent | 485bb5c0e6d2c7c5df6560a996dc264e94f2058a (diff) | |
download | talos-hostboot-336f6ac6abc1d5ee4efc1229be06a66baf06643b.tar.gz talos-hostboot-336f6ac6abc1d5ee4efc1229be06a66baf06643b.zip |
Initialize the FSI hardware - Story 3551
This code will initialize the FSI hardware and allow access
to remote slaves.
Note - current code is hardcoded to using the MFSI-0 port on the
master processor wrapped back into its own CFAM.
Note2 - One testcase is disabled pending integration of required
fixes to the simics models.
Contains work for
- Task 3830 : FSI Master Regs
- Task 3831 : FSI Slave Regs
Change-Id: I8dd5f0e03cf083e35cf8241db22ad6d76ba85fac
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/359
Tested-by: Jenkins Server
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fsi/test')
-rw-r--r-- | src/usr/fsi/test/fsiddtest.H | 79 |
1 files changed, 58 insertions, 21 deletions
diff --git a/src/usr/fsi/test/fsiddtest.H b/src/usr/fsi/test/fsiddtest.H index 406d1b9d6..7ff02c448 100644 --- a/src/usr/fsi/test/fsiddtest.H +++ b/src/usr/fsi/test/fsiddtest.H @@ -35,6 +35,7 @@ #include <errl/errltypes.H> #include <limits.h> #include <devicefw/driverif.H> +#include <fsi/fsiif.H> #include "../fsidd.H" extern trace_desc_t* g_trac_fsi; @@ -43,12 +44,11 @@ extern trace_desc_t* g_trac_fsi; class FsiDDTest : public CxxTest::TestSuite { public: - /** * @brief FSI DD test - Read/Write * Perform basic read/write operations */ - void test_readWrite(void) + void t_readWrite(void) { TRACFCOMP( g_trac_fsi, "FsiDDTest::test_readWrite> Start" ); uint64_t fails = 0; @@ -63,21 +63,26 @@ class FsiDDTest : public CxxTest::TestSuite } test_data[] = { //** Master Control Space // version number - { FsiDD::CMFSI_CONTROL_REG | 0x000074, 0x91010800, false }, - { FsiDD::MFSI_CONTROL_REG | 0x000074, 0x91010800, false }, + { 0x003074, 0x91010800, false }, //CMFSI MVER + { 0x003474, 0x91010800, false }, //MFSI MVER // clock rate delay for ports 32-63 (unused ports) - { FsiDD::MFSI_CONTROL_REG | 0x00000C, 0x11111111, true }, - { FsiDD::CMFSI_CONTROL_REG | 0x00000C, 0x22222222, true }, + { 0x00340C, 0x11111111, true }, //MFSI MCRSP32 + { 0x00300C, 0x22222222, true }, //CMFSI MCRSP32 - // port static level - { FsiDD::MFSI_CONTROL_REG | 0x000018, 0x80000000, false }, //port0 - { FsiDD::MFSI_CONTROL_REG | 0x00001C, 0x00000000, false }, - { FsiDD::CMFSI_CONTROL_REG | 0x000018, 0x00000000, false }, - { FsiDD::CMFSI_CONTROL_REG | 0x00001C, 0x00000000, false }, + // port static levels + { 0x003418, 0x80000000, false }, //MFSI MLEVP32 (port0 present) + { 0x00341C, 0x00000000, false }, //MFSI MLEVP32 + { 0x003018, 0x00000000, false }, //CMFSI MLEVP0 + { 0x00301C, 0x00000000, false }, //CMFSI MLEVP32 //** Master Control Regs in Port space //{ FsiDD::MFSI_PORT_0 | 0x000000, 0x91010800, false }, //Slave Config Table + + //** Slave Regs + { 0x080000, 0xC0000F90, false }, //Config Table entry for slave0 off MFSI-0 + { 0x081000, 0x12345678, true }, //DATA_0 from FSI2PIB off MFSI-0 + { 0x081004, 0xA5A5A5A5, true }, //DATA_1 from FSI2PIB off MFSI-0 }; const uint64_t NUM_ADDRS = sizeof(test_data)/sizeof(test_data[0]); @@ -95,6 +100,7 @@ class FsiDDTest : public CxxTest::TestSuite { total++; TRACFCOMP( g_trac_fsi, "FsiDDTest::test_readWrite> Reading %llX", test_data[x].addr ); + op_size = sizeof(uint32_t); l_err = DeviceFW::deviceOp( DeviceFW::READ, fsi_target, &(read_data[x]), @@ -110,8 +116,6 @@ class FsiDDTest : public CxxTest::TestSuite } TRACFCOMP( g_trac_fsi, "READ Reg 0x%X = 0x%X", test_data[x].addr, read_data[x] ); - - //@todo - check op_size } // write X=A, Y=B, Z=C @@ -133,8 +137,6 @@ class FsiDDTest : public CxxTest::TestSuite errlCommit(l_err); delete l_err; } - - //@todo - check op_size } } @@ -142,6 +144,7 @@ class FsiDDTest : public CxxTest::TestSuite for( uint64_t x = 0; x < NUM_ADDRS; x++ ) { total++; + op_size = sizeof(uint32_t); l_err = DeviceFW::deviceOp( DeviceFW::READ, fsi_target, &(read_data[x]), @@ -155,8 +158,6 @@ class FsiDDTest : public CxxTest::TestSuite errlCommit(l_err); delete l_err; } - - //@todo - check op_size } // verify X==A, Y==B, Z==C @@ -171,18 +172,54 @@ class FsiDDTest : public CxxTest::TestSuite } } - //@todo - repeat for each address space - TRACFCOMP( g_trac_fsi, "FsiDDTest::test_readWrite> %d/%d fails", fails, total ); }; /** + * @brief FSI DD test - Initialization + * Test FSI Master/Slave Initialization + */ + void test_init(void) + { + //TRACFCOMP( g_trac_fsi, "FsiDDTest::test_init> Skipping until simics patches are ready" ); + //return; //@fixme + + TRACFCOMP( g_trac_fsi, "FsiDDTest::test_init> Start" ); + uint64_t fails = 0; + uint64_t total = 1; //only 1 slave port in the config + errlHndl_t l_err = NULL; + + uint64_t good_ports = 0; + l_err = FSI::initializeHardware(good_ports); + if( l_err ) + { + TRACFCOMP(g_trac_fsi, "FsiDDTest::test_init> Error from device : RC=%X", l_err->reasonCode() ); + TS_FAIL( "FsiDDTest::test_init> ERROR : Unexpected error log from initMaster" ); + errlCommit(l_err); + delete l_err; + } + + if( total != good_ports ) + { + fails = total - good_ports; + TRACFCOMP( g_trac_fsi, "FsiDDTest::test_init> ERROR : Wrong number of ports were initialized : exp=%d, actual=%d", total, good_ports ); + TS_FAIL( "FsiDDTest::test_init> ERROR : Wrong number of ports were initialized" ); + } + + TRACFCOMP( g_trac_fsi, "FsiDDTest::test_init> %d/%d fails", fails, total ); + + // Execute the reg read/write tests + //t_readWrite(); + //@fixme - waiting for simics patches + }; + + /** * @brief FSI DD test - verifyAddressRange * Test output of verifyAddressRange */ void test_verifyAddressRange(void) { - TRACFCOMP( g_trac_fsi, "FsiDDTest::verifyAddressRange> Start" ); + TRACFCOMP( g_trac_fsi, "FsiDDTest::test_verifyAddressRange> Start" ); uint64_t fails = 0; uint64_t total = 0; @@ -197,7 +234,7 @@ class FsiDDTest : public CxxTest::TestSuite // -address before beginning (if not 0) - TRACFCOMP( g_trac_fsi, "FsiDDTest::verifyAddressRange> %d/%d fails", fails, total ); + TRACFCOMP( g_trac_fsi, "FsiDDTest::test_verifyAddressRange> %d/%d fails", fails, total ); }; }; |