Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tpm_tis: Allow tpm_tis to be bound using DT

This provides an open firwmare driver binding for tpm_tis. OF
is useful on arches where ACPI/PNP is not used.

The tcg,tpm-tis-mmio register map interface is specified by the TCG.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

authored by

Jason Gunthorpe and committed by
Jarkko Sakkinen
420d4398 7ea7861c

+37 -1
+25
Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
··· 1 + Trusted Computing Group MMIO Trusted Platform Module 2 + 3 + The TCG defines multi vendor standard for accessing a TPM chip, this 4 + is the standard protocol defined to access the TPM via MMIO. Typically 5 + this interface will be implemented over Intel's LPC bus. 6 + 7 + Refer to the 'TCG PC Client Specific TPM Interface Specification (TIS)' TCG 8 + publication for the specification. 9 + 10 + Required properties: 11 + 12 + - compatible: should contain a string below for the chip, followed by 13 + "tcg,tpm-tis-mmio". Valid chip strings are: 14 + * "atmel,at97sc3204" 15 + - reg: The location of the MMIO registers, should be at least 0x5000 bytes 16 + - interrupt-parent/interrupts: An optional interrupt indicating command completion. 17 + 18 + Example: 19 + 20 + tpm_tis@90000 { 21 + compatible = "atmel,at97sc3204", "tcg,tpm-tis-mmio"; 22 + reg = <0x90000 0x5000>; 23 + interrupt-parent = <&EIC0>; 24 + interrupts = <1 2>; 25 + };
+1 -1
drivers/char/tpm/Kconfig
··· 32 32 33 33 config TCG_TIS 34 34 tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface" 35 - depends on X86 35 + depends on X86 || OF 36 36 select TCG_TIS_CORE 37 37 ---help--- 38 38 If you have a TPM security chip that is compliant with the
+11
drivers/char/tpm/tpm_tis.c
··· 28 28 #include <linux/wait.h> 29 29 #include <linux/acpi.h> 30 30 #include <linux/freezer.h> 31 + #include <linux/of.h> 32 + #include <linux/of_device.h> 31 33 #include "tpm.h" 32 34 #include "tpm_tis_core.h" 33 35 ··· 356 354 return 0; 357 355 } 358 356 357 + #ifdef CONFIG_OF 358 + static const struct of_device_id tis_of_platform_match[] = { 359 + {.compatible = "tcg,tpm-tis-mmio"}, 360 + {}, 361 + }; 362 + MODULE_DEVICE_TABLE(of, tis_of_platform_match); 363 + #endif 364 + 359 365 static struct platform_driver tis_drv = { 360 366 .probe = tpm_tis_plat_probe, 361 367 .remove = tpm_tis_plat_remove, 362 368 .driver = { 363 369 .name = "tpm_tis", 364 370 .pm = &tpm_tis_pm, 371 + .of_match_table = of_match_ptr(tis_of_platform_match), 365 372 }, 366 373 }; 367 374