Skip to content

Commit

Permalink
Add Support for new HDAT Slave Device Type for Nuvoton 75x
Browse files Browse the repository at this point in the history
The new HDAT spec added a new 'TCG_i2c_TPM' Slave Device Type for the
Host I2C Device Entry Structure.  This commit adds the use of it for
Nuvoton 75x support.

Change-Id: I01f75c919f255786e5b32dcde9b86b2e15d33986
RTC:204133
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/79527
Tested-by: Jenkins Server <pfd-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>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mabaiocchi authored and dcrowell77 committed Jun 28, 2019
1 parent 2042388 commit ca9007f
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/usr/i2c/i2c.C
Expand Up @@ -5499,20 +5499,21 @@ void getDeviceInfo( TARGETING::Target* i_i2cMaster,
l_currentDI.slavePort = 0xFF;
l_currentDI.busFreqKhz = (tpmInfo.busFreq)
/ FREQ_CONVERSION::HZ_PER_KHZ;
l_currentDI.deviceType =
TARGETING::HDAT_I2C_DEVICE_TYPE_NUVOTON_TPM;
l_currentDI.devicePurpose =
TARGETING::HDAT_I2C_DEVICE_PURPOSE_TPM;


// Read TPM Model attribute to determine the label
// Read TPM Model attribute to determine some values
if (tpmInfo.model == TPMDD::TPM_MODEL_65x)
{
strcpy(l_currentDI.deviceLabel,"?nuvoton,npct601,tpm,host");
l_currentDI.deviceType =
TARGETING::HDAT_I2C_DEVICE_TYPE_NUVOTON_TPM;
}
else if (tpmInfo.model == TPMDD::TPM_MODEL_75x)
{
strcpy(l_currentDI.deviceLabel,"?tcg,tpm_i2c_ptp,tpm,host");
l_currentDI.deviceType =
TARGETING::HDAT_I2C_DEVICE_TYPE_TCG_I2C_TPM;
}
else
{
Expand Down
17 changes: 17 additions & 0 deletions src/usr/targeting/common/processMrw.pl
Expand Up @@ -2952,6 +2952,23 @@ sub processI2C
{
$type = "0xFF";
}
# TPM types can vary by MODEL number
elsif ($type_str eq "NUVOTON_TPM")
{
# 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)
{
$type = $targetObj->getEnumValue("HDAT_I2C_DEVICE_TYPE",$type_str);
}
if ($tpm_model eq 2)
{
# @TODO RTC 212201 use proper enum when <system>.xml supports it
#$type = $targetObj->getEnumValue("HDAT_I2C_DEVICE_TYPE","TCG_I2C_TPM");
$type = 0x15;
}
}
else
{
$type = $targetObj->getEnumValue("HDAT_I2C_DEVICE_TYPE",$type_str);
Expand Down
40 changes: 40 additions & 0 deletions src/usr/targeting/common/xmltohb/attribute_types.xml
Expand Up @@ -2269,6 +2269,46 @@
<name>SEEPROM_Atmel28c256</name>
<value>0xB</value>
</enumerator>
<enumerator>
<name>THERMAL_SENSOR</name>
<value>0x0C</value>
</enumerator>
<enumerator>
<name>SEEPROM_Atmel24c04</name>
<value>0x0D</value>
</enumerator>
<enumerator>
<name>SEEPROM_Atmel24c412</name>
<value>0x0E</value>
</enumerator>
<enumerator>
<name>SEEPROM_Atmel24c32</name>
<value>0x0F</value>
</enumerator>
<enumerator>
<name>SEEPROM_Atmel24c64</name>
<value>0x10</value>
</enumerator>
<enumerator>
<name>SEEPROM_Atmel24c16</name>
<value>0x11</value>
</enumerator>
<enumerator>
<name>NVDIA_GPU</name>
<value>0x12</value>
</enumerator>
<enumerator>
<name>NXP_LPC_Microcontroller_LPC11U35</name>
<value>0x13</value>
</enumerator>
<enumerator>
<name>9550</name>
<value>0x14</value>
</enumerator>
<enumerator>
<name>TCG_I2C_TPM</name>
<value>0x15</value>
</enumerator>
<enumerator>
<name>UNKNOWN</name>
<value>0xFF</value>
Expand Down

0 comments on commit ca9007f

Please sign in to comment.