summaryrefslogtreecommitdiffstats
path: root/src/usr/i2c
diff options
context:
space:
mode:
authorChris Engel <cjengel@us.ibm.com>2015-09-18 09:17:23 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-06-08 22:45:27 -0400
commitc4119b881e8a6e3746ac4553dee024351d97226f (patch)
treeaa1148f790629526cb2367dff0c5ce162e4b051d /src/usr/i2c
parent02db181b01ad44a7c18d929f9541336d050dbae2 (diff)
downloadtalos-hostboot-c4119b881e8a6e3746ac4553dee024351d97226f.tar.gz
talos-hostboot-c4119b881e8a6e3746ac4553dee024351d97226f.zip
Trustedboot add TPM and associated i2c master to the devtree
Change-Id: Ic2edee549d23669f046a6e78f0cfae838faaec2d RTC: 125287 ForwardPort: yes Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25470 Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com> Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/i2c')
-rwxr-xr-xsrc/usr/i2c/test/tpmddtest.H7
-rwxr-xr-xsrc/usr/i2c/tpmdd.C39
2 files changed, 43 insertions, 3 deletions
diff --git a/src/usr/i2c/test/tpmddtest.H b/src/usr/i2c/test/tpmddtest.H
index 4053245a6..14c22d6c4 100755
--- a/src/usr/i2c/test/tpmddtest.H
+++ b/src/usr/i2c/test/tpmddtest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015 */
+/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,7 +38,7 @@
#include <devicefw/driverif.H>
#include <i2c/tpmddreasoncodes.H>
#include <targeting/common/commontargeting.H>
-#include "secureboot/trustedbootif.H"
+#include <secureboot/trustedbootif.H>
#include "i2ctest.H"
#include "../tpmdd.H"
#include "../../secureboot/trusted/trustedTypes.H"
@@ -381,7 +381,8 @@ class TPMDDTest: public CxxTest::TestSuite
0) );
if( NULL == err ||
- err->reasonCode() != TPM_DEVICE_NOT_AVAILABLE)
+ (err->reasonCode() != TPM_DEVICE_NOT_AVAILABLE &&
+ err->reasonCode() != TPM_BUS_SPEED_LOOKUP_FAIL))
{
fails++;
TS_FAIL( "testTPMInvalidChip - TpmBackup : Error "
diff --git a/src/usr/i2c/tpmdd.C b/src/usr/i2c/tpmdd.C
index 24a49552b..d2b777cb0 100755
--- a/src/usr/i2c/tpmdd.C
+++ b/src/usr/i2c/tpmdd.C
@@ -1260,6 +1260,45 @@ errlHndl_t tpmReadAttributes ( TARGETING::Target * i_target,
}
+ // Lookup bus speed
+ TARGETING::ATTR_I2C_BUS_SPEED_ARRAY_type speeds;
+ if( io_tpmInfo.i2cTarget->
+ tryGetAttr<TARGETING::ATTR_I2C_BUS_SPEED_ARRAY>(speeds) &&
+ (io_tpmInfo.engine < I2C_BUS_MAX_ENGINE(speeds)) &&
+ (io_tpmInfo.port < I2C_BUS_MAX_PORT(speeds)) )
+ {
+ io_tpmInfo.busFreq = speeds[io_tpmInfo.engine][io_tpmInfo.port];
+ io_tpmInfo.busFreq *= 1000; //convert KHz->Hz
+ }
+ else
+ {
+ TRACFCOMP( g_trac_tpmdd,
+ ERR_MRK"tpmReadAttributes() - BUS SPEED LOOKUP FAIL");
+
+ /*@
+ * @errortype
+ * @reasoncode TPM_BUS_SPEED_LOOKUP_FAIL
+ * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TPMDD_READATTRIBUTES
+ * @userdata1 HUID of target
+ * @userdata2 Address Offset Size
+ * @devdesc Invalid address offset size
+ */
+ err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ TPMDD_READATTRIBUTES,
+ TPM_BUS_SPEED_LOOKUP_FAIL,
+ TARGETING::get_huid(i_target),
+ tpmData.byteAddrOffset,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( TPMDD_COMP_NAME );
+
+ break;
+
+ }
+
+
} while( 0 );
TRACUCOMP(g_trac_tpmdd,"tpmReadAttributes() tgt=0x%X, %d/%d/0x%X "
OpenPOWER on IntegriCloud