diff options
| -rw-r--r-- | src/include/usr/i2c/tpmddif.H | 3 | ||||
| -rwxr-xr-x | src/usr/i2c/i2c.C | 25 | ||||
| -rwxr-xr-x | src/usr/targeting/common/genHDATstructures.pl | 2 | ||||
| -rwxr-xr-x | src/usr/targeting/common/processMrw.pl | 12 |
4 files changed, 38 insertions, 4 deletions
diff --git a/src/include/usr/i2c/tpmddif.H b/src/include/usr/i2c/tpmddif.H index 0f57e4797..2a0c964c5 100644 --- a/src/include/usr/i2c/tpmddif.H +++ b/src/include/usr/i2c/tpmddif.H @@ -65,7 +65,8 @@ enum tpm_locality_t /** * @brief TPM Models that are supported * - * @note Must stay in sync with TPM_MODEL in attribute_types_hb.xml + * @note Must stay in sync with TPM_MODEL in attribute_types_hb.xml and + * the attribute usage in processMrw.pl. * @note Not using Attribute Enums since FSP does not currently support * overriding enum values */ 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 diff --git a/src/usr/targeting/common/genHDATstructures.pl b/src/usr/targeting/common/genHDATstructures.pl index 5150e3a06..2bbcbfd9a 100755 --- a/src/usr/targeting/common/genHDATstructures.pl +++ b/src/usr/targeting/common/genHDATstructures.pl @@ -6,7 +6,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2015,2018 +# Contributors Listed Below - COPYRIGHT 2015,2019 # [+] International Business Machines Corp. # # diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl index f0aaf4518..744eda2ef 100755 --- a/src/usr/targeting/common/processMrw.pl +++ b/src/usr/targeting/common/processMrw.pl @@ -3084,7 +3084,17 @@ sub processI2C # <vendor>,<device type>,<purpose>,<scope> if ($type_str eq "NUVOTON_TPM") { - $label = "nuvoton,npct601,tpm,host"; + # Model values can be found in tpmddif.H and are kept in + # sync with TPM_MODEL attribute in attribute_types_hb.xml + my $tpm_model = $targetObj->getAttribute($i2c->{DEST_PARENT},"TPM_MODEL"); + if ($tpm_model eq 1) + { + $label = "nuvoton,npct601,tpm,host"; + } + if ($tpm_model eq 2) + { + $label = "tcg,tpm_i2c_ptp,tpm,host"; + } } if ($label eq "") |

