summaryrefslogtreecommitdiffstats
path: root/src/usr/i2c/test
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2015-01-12 10:26:06 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-02-11 12:27:46 -0600
commit52561adeaa1c8d846e363d8386ca99a1ad89196b (patch)
treed4df89c98939044536f0262bd08ae8fa4c0dbb0d /src/usr/i2c/test
parent35019a5b9b1916840c5551acd758bcded0596dc9 (diff)
downloadtalos-hostboot-52561adeaa1c8d846e363d8386ca99a1ad89196b.tar.gz
talos-hostboot-52561adeaa1c8d846e363d8386ca99a1ad89196b.zip
Report I2C devices in devtree
Report all I2C masters, busses and end devices in the devtree. Current support includes the following devices: -Processor module vpd (primary and backup) -Processor SBE SEEPROM (x2) -Memory buffer VPD -DIMM SPD Change-Id: Ic0e08c208331ce9701de27111cc2e9f54a81fcf7 RTC: 117996 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15203 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Michael Baiocchi <baiocchi@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/i2c/test')
-rwxr-xr-xsrc/usr/i2c/test/eepromddtest.H19
-rwxr-xr-xsrc/usr/i2c/test/i2ctest.H25
2 files changed, 41 insertions, 3 deletions
diff --git a/src/usr/i2c/test/eepromddtest.H b/src/usr/i2c/test/eepromddtest.H
index c26ccaf82..cdd6c4b20 100755
--- a/src/usr/i2c/test/eepromddtest.H
+++ b/src/usr/i2c/test/eepromddtest.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. */
@@ -649,7 +651,20 @@ class EEPROMTest: public CxxTest::TestSuite
fails, num_ops );
}
-
+ /**
+ * @brief Verify we retrieve all of the EEPROMs we can think of
+ */
+ void test_getEEPROMs( void )
+ {
+ std::list<EEPROM::EepromInfo_t> info;
+ getEEPROMs( info );
+ for( std::list<EEPROM::EepromInfo_t>::iterator eep = info.begin();
+ eep != info.end();
+ ++eep )
+ {
+ TRACFCOMP( g_trac_eeprom, "Found EEPROM: Master=%.8X, Eng=%d, Port=%d, Freq=%d, Addr=%.2X, Dev=%d, Targ=%.8X", TARGETING::get_huid(eep->i2cMaster), eep->engine, eep->port, eep->busFreq, eep->devAddr, eep->device, eep->assocTarg );
+ }
+ }
};
diff --git a/src/usr/i2c/test/i2ctest.H b/src/usr/i2c/test/i2ctest.H
index 95a5d231e..77470033e 100755
--- a/src/usr/i2c/test/i2ctest.H
+++ b/src/usr/i2c/test/i2ctest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -40,6 +40,7 @@
#include <i2c/i2cif.H>
#include <targeting/common/predicates/predicates.H>
#include <targeting/common/attributes.H>
+#include <targeting/common/utilFilter.H>
#include "../i2c.H"
extern trace_desc_t* g_trac_i2c;
@@ -1007,6 +1008,28 @@ class I2CTest: public CxxTest::TestSuite
}
+ /**
+ * @brief Verify we retrieve all of the EEPROMs we can think of
+ */
+ void test_getMasterInfo( void )
+ {
+ std::list<I2C::MasterInfo_t> info;
+ TARGETING::TargetHandleList allchips;
+ TARGETING::getAllChips( allchips, TARGETING::TYPE_NA );
+ for( TARGETING::TargetHandleList::iterator tgt = allchips.begin();
+ tgt != allchips.end();
+ ++tgt )
+ {
+ getMasterInfo( *tgt, info );
+ for( std::list<I2C::MasterInfo_t>::iterator i2cm = info.begin();
+ i2cm != info.end();
+ ++i2cm )
+ {
+ TRACFCOMP( g_trac_i2c, "Found I2C Master: Master=%.8X :: Scom=%.8X, Eng=%d, Freq=%d", TARGETING::get_huid(*tgt), i2cm->scomAddr, i2cm->engine, i2cm->freq );
+ }
+ }
+ }
+
};
#endif
OpenPOWER on IntegriCloud