Skip to contentSkip to conversation

tpm2: tis_spi: add linux compatible fallback string

PATCH Superseded Bruno Thomsen 2 participants 2 messages Jun 10, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm2: tis_spi: add linux compatible fallback string

This solves a compatibility issue with Linux device trees that contain TPMv2.x hardware. So it's easier to import DTSs from upstream kernel when migrating board init from C code to device tree.

The issue is that fallback binding is different between Linux and u-Boot.

Linux: "tcg,tpm_tis-spi"
U-Boot: "tis,tpm2-spi"

---
 doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +-
 drivers/tpm/tpm2_tis_spi.c                     | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +1 -1
index b48a15112d..b0bc9d6a65 100644
@@ -2,7 +2,7 @@ ST33TPHF20 SPI TPMv2.0 bindings
 -------------------------------
 
 Required properties:
-- compatible		: Should be "tis,tpm2-spi"
+- compatible		: Should be "tis,tpm2-spi" or "tcg,tpm_tis-spi"
 - reg			: SPI Chip select
 
 Optional properties:
drivers/tpm/tpm2_tis_spi.c +4 -0
index 36016de4a6..73e5b6aab4 100644
@@ -679,6 +679,10 @@ static const struct udevice_id tpm_tis_spi_ids[] = {
 		.compatible = "tis,tpm2-spi",
 		.data = (ulong)&tpm_tis_std_chip_data,
 	},
+	{
+		.compatible = "tcg,tpm_tis-spi",
+		.data = (ulong)&tpm_tis_std_chip_data,
+	},
 	{ }
 };
 
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 tpm2: tis_spi: add linux compatible fallback string

Quoted 35 lines · Bruno Thomsen

This solves a compatibility issue with Linux device trees that contain TPMv2.x hardware. So it's easier to import DTSs from upstream kernel when migrating board init from C code to device tree.

The issue is that fallback binding is different between Linux and u-Boot.

Linux: "tcg,tpm_tis-spi"
U-Boot: "tis,tpm2-spi"

---
 doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +-
 drivers/tpm/tpm2_tis_spi.c                     | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +1 -1
index b48a15112d..b0bc9d6a65 100644
@@ -2,7 +2,7 @@ ST33TPHF20 SPI TPMv2.0 bindings
 -------------------------------
 
 Required properties:
-- compatible		: Should be "tis,tpm2-spi"
+- compatible		: Should be "tis,tpm2-spi" or "tcg,tpm_tis-spi"
 - reg			: SPI Chip select
 
 Optional properties:
drivers/tpm/tpm2_tis_spi.c +0 -0
index 36016de4a6..73e5b6aab4 100644

drivers/tpm/tpm2_tis_spi.c static const struct udevice_id tpm_tis_spi_ids[] = { · line 687

Quoted 9 lines
drivers/tpm/tpm2_tis_spi.c +4 -0
@@ -679,6 +679,10 @@ static const struct udevice_id tpm_tis_spi_ids[] = {
 		.compatible = "tis,tpm2-spi",
 		.data = (ulong)&tpm_tis_std_chip_data,
 	},
+	{
+		.compatible = "tcg,tpm_tis-spi",
+		.data = (ulong)&tpm_tis_std_chip_data,
+	},
 	{ }
 };

Do we have any known users of the other compatible? I don't see any in-tree so we should lean towards just using the one in Linux. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200610/4bab1712/attachment.sig>