summaryrefslogtreecommitdiffstats
path: root/src/usr/i2c/i2c.C
diff options
context:
space:
mode:
authorMike Baiocchi <mbaiocch@us.ibm.com>2019-06-10 23:09:11 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-06-27 10:58:15 -0500
commitd978f97d33f0e16c7fd8938da7eba6e69fa4f99a (patch)
treec129454fcea9cebcc6118f69c6e62591a438a324 /src/usr/i2c/i2c.C
parent3805319f1d630c6bc9c022b3e9eeb601aa3ffbf4 (diff)
downloadtalos-hostboot-d978f97d33f0e16c7fd8938da7eba6e69fa4f99a.tar.gz
talos-hostboot-d978f97d33f0e16c7fd8938da7eba6e69fa4f99a.zip
Add Device Tree support for Nuvoton TPM 75x
This commit updates the code that creates the device tree to support Nuvoton TPM 75x models along with the existing 65x models. Change-Id: I46b08970911d259f620c747015800e4aeba34b99 RTC:204133 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78743 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/i2c/i2c.C')
-rwxr-xr-xsrc/usr/i2c/i2c.C25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index 4fbe4db24..8be749230 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -5471,6 +5471,7 @@ void getDeviceInfo( TARGETING::Target* i_i2cMaster,
// Lookup i2c info for the TPM
l_err = TPMDD::tpmReadAttributes(pTpm,
tpmInfo, locality);
+
if( NULL != l_err )
{
// Unable to get info, so we skip
@@ -5502,7 +5503,29 @@ void getDeviceInfo( TARGETING::Target* i_i2cMaster,
TARGETING::HDAT_I2C_DEVICE_TYPE_NUVOTON_TPM;
l_currentDI.devicePurpose =
TARGETING::HDAT_I2C_DEVICE_PURPOSE_TPM;
- strcpy(l_currentDI.deviceLabel,"?nuvoton,npct601,tpm,host");
+
+
+ // Read TPM Model attribute to determine the label
+ if (tpmInfo.model == TPMDD::TPM_MODEL_65x)
+ {
+ strcpy(l_currentDI.deviceLabel,"?nuvoton,npct601,tpm,host");
+ }
+ else if (tpmInfo.model == TPMDD::TPM_MODEL_75x)
+ {
+ strcpy(l_currentDI.deviceLabel,"?tcg,tpm_i2c_ptp,tpm,host");
+ }
+ else
+ {
+ // Should never get here as tpmReadAttributes will fail if
+ // unknown TPM Model, but just in case do this:
+ strcpy(l_currentDI.deviceLabel,
+ "?unknwon,unknown,tpm,host");
+ }
+
+ TRACUCOMP(g_trac_i2c,"TPM 0x%X is Model %d using label %s",
+ TARGETING::get_huid(pTpm),
+ tpmInfo.model,
+ l_currentDI.deviceLabel);
o_deviceInfo.push_back(l_currentDI);
} //end of tpm iter
OpenPOWER on IntegriCloud