diff options
author | Mike Baiocchi <baiocchi@us.ibm.com> | 2014-11-03 10:31:42 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-12-03 08:21:06 -0600 |
commit | e6b7b30e1722ea948c090bf757e04510517ff890 (patch) | |
tree | 63e33d8ed9ee7d04e9abb40ac466eb273225e5fc /src/usr/i2c/test/i2ctest.H | |
parent | 6917afadcdea9e5761319c6f5d4d259563c4a6ef (diff) | |
download | talos-hostboot-e6b7b30e1722ea948c090bf757e04510517ff890.tar.gz talos-hostboot-e6b7b30e1722ea948c090bf757e04510517ff890.zip |
Sync I2C and EEPROM Attributes from MRW
This commit adds additional MRW parsing and a new I2C Bus attribute
to pull the needed information from the MRWs for EEPROM and I2C operations.
Change-Id: I28abec9a04fe27502cab02790c00b15329a8b364
RTC: 80614
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14298
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Tested-by: Jenkins Server
Diffstat (limited to 'src/usr/i2c/test/i2ctest.H')
-rwxr-xr-x | src/usr/i2c/test/i2ctest.H | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/usr/i2c/test/i2ctest.H b/src/usr/i2c/test/i2ctest.H index e2ef80597..95a5d231e 100755 --- a/src/usr/i2c/test/i2ctest.H +++ b/src/usr/i2c/test/i2ctest.H @@ -683,53 +683,55 @@ class I2CTest: public CxxTest::TestSuite tS.masterProcChipTargetHandle( procTarget ); /****************************************************/ - /* Test i2cSetBusVariables() with different i_modes */ + /* Test i2cSetBusVariables() with different i_speed */ /****************************************************/ struct { - I2C::i2c_bus_setting_mode_t i_mode; + uint64_t i_speed; uint64_t o_bus_speed; } testData[] = { // 1MHz - { I2C::SET_I2C_BUS_1MHZ, 1000 }, + { I2C_BUS_SPEED_1MHZ, 1000 }, // 400KHz - { I2C::SET_I2C_BUS_400KHZ, 400 }, + { I2C_BUS_SPEED_400KHZ, 400 }, - // READ_I2C_BUS_ATTRIBUTES should default to 1MHz + // I2C_BUS_SPEED_FROM_MRW (==0) should default to 1MHz // with a processor target using Host I2C - { I2C::READ_I2C_BUS_ATTRIBUTES, 1000 }, + { I2C_BUS_SPEED_FROM_MRW, 1000 }, }; uint32_t NUM_CMDS = sizeof(testData)/sizeof(testData[0]); - // set Processor Target to Host I2C mode + // set Processor Target to Host I2C mode and default engine/port io_args.switches.useHostI2C = 1; io_args.switches.useFsiI2C = 0; + io_args.engine = 0; + io_args.port = 0; for ( uint32_t i = 0; i < NUM_CMDS; i++ ) { cmds++; err = I2C::i2cSetBusVariables(procTarget, - testData[i].i_mode, + testData[i].i_speed, io_args); if( err ) { TS_FAIL( "testI2cSetBusVariables - Error returned from " - "i2cSetBusVariables: i_mode=0x%d, i=%d", - testData[i].i_mode, i); + "i2cSetBusVariables: i_speed=%d, i=%d", + testData[i].i_speed, i); fails++; delete err; } else if ( io_args.bus_speed != testData[i].o_bus_speed ) { TS_FAIL( "testI2cSetBusVariables - i2cSetBusVariables " - "returned bad data: i_mode=0x%d, i=%d " + "returned bad data: i_speed=%d, i=%d " "o_bus_speed=%d, io_args.bus_speed=%d", - testData[i].i_mode, i, + testData[i].i_speed, i, testData[i].o_bus_speed, io_args.bus_speed); fails++; } @@ -806,7 +808,7 @@ class I2CTest: public CxxTest::TestSuite I2C::g_I2C_NEST_FREQ_MHZ = I2C::i2cGetNestFreq(); TRACFCOMP( g_trac_i2c, - "testI2CSetBusVariables - End: %d/%d fails", + "testI2cSetBusVariables - End: %d/%d fails", fails, cmds ); } |