@@ -156,6 +156,7 @@ static struct hdat_i2c_type hdat_i2c_devs[] = {
{ 0x11, "eeprom", "atmel,24c16" },
{ 0x12, "i2c", NULL }, /* NVDIA GPU */
{ 0x13, "i2c", "nxp,lpc11u35" },
+ { 0x15, "tpm", "nuvoton,npct75x" },
};
struct hdat_i2c_info {
@@ -49,6 +49,15 @@ static struct tpm_info tpm_nuvoton_650_info = {
.vid_did = 0x60,
};
+static struct tpm_info tpm_nuvoton_75x_info = {
+ .vendor_id = 0x5010FC00,
+ .sts = 0x18,
+ .burst_count = 0x19,
+ .data_fifo_w = 0x24,
+ .data_fifo_r = 0x24,
+ .vid_did = 0x48,
+};
+
static struct tpm_dev *tpm_device = NULL;
static struct tpm_info *tpm_info = NULL;
@@ -627,6 +636,9 @@ static void tpm_i2c_nuvoton_probe(const char compat[], struct tpm_info *info)
/*
* Tweak for linux. It doesn't have a driver compatible
* with "nuvoton,npct650"
+ *
+ * Not necessary for 75x, as we use the compatible that
+ * Linux expects.
*/
if (!dt_node_is_compatible(node, "nuvoton,npct601")) {
dt_check_del_prop(node, "compatible");
@@ -646,3 +658,8 @@ void tpm_i2c_nuvoton_650_probe(void)
{
tpm_i2c_nuvoton_probe("nuvoton,npct650", &tpm_nuvoton_650_info);
}
+
+void tpm_i2c_nuvoton_75x_probe(void)
+{
+ tpm_i2c_nuvoton_probe("nuvoton,npct75x", &tpm_nuvoton_75x_info);
+}
@@ -5,5 +5,6 @@
#define __TPM_I2C_NUVOTON_H
extern void tpm_i2c_nuvoton_650_probe(void);
+extern void tpm_i2c_nuvoton_75x_probe(void);
#endif /* __TPM_I2C_NUVOTON_H */
@@ -190,6 +190,7 @@ int tpm_init(void)
/* tpm drivers supported */
tpm_i2c_nuvoton_650_probe();
+ tpm_i2c_nuvoton_75x_probe();
if (list_empty(&tpm_list)) {
prlog(PR_INFO, "no compatible tpm device found!\n");
This patch adds the new expected values for the 75x chip to the hdat i2c devices table, and the requisite new constants to the Nuvoton driver as according to the TCG TPM I2C Interfact Specification for TPM 2.0 Revision 1.0[1]. [1] https://trustedcomputinggroup.org/resource/tcg-tpm-i2c-interface-specification/ Signed-off-by: Eric Richter <erichte@linux.ibm.com> --- hdata/i2c.c | 1 + libstb/drivers/tpm_i2c_nuvoton.c | 17 +++++++++++++++++ libstb/drivers/tpm_i2c_nuvoton.h | 1 + libstb/tpm_chip.c | 1 + 4 files changed, 20 insertions(+)