aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2016-11-07 17:44:31 -0500
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-11-27 18:31:31 -0500
commit420d439849cabaa0587c424b09b9507108a4e058 (patch)
tree8c2bbf040d0ed3c6ca5f26068ced642d9ef10991
parent7ea7861c8c2462af932410c54542cb279683eaf8 (diff)
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>
-rw-r--r--Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt25
-rw-r--r--drivers/char/tpm/Kconfig2
-rw-r--r--drivers/char/tpm/tpm_tis.c11
3 files changed, 37 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt b/Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
new file mode 100644
index 000000000000..41d740545189
--- /dev/null
+++ b/Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
@@ -0,0 +1,25 @@
1Trusted Computing Group MMIO Trusted Platform Module
2
3The TCG defines multi vendor standard for accessing a TPM chip, this
4is the standard protocol defined to access the TPM via MMIO. Typically
5this interface will be implemented over Intel's LPC bus.
6
7Refer to the 'TCG PC Client Specific TPM Interface Specification (TIS)' TCG
8publication for the specification.
9
10Required 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
18Example:
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 };
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 9faa0b1e7766..277186d3b668 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -32,7 +32,7 @@ config TCG_TIS_CORE
32 32
33config TCG_TIS 33config TCG_TIS
34 tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface" 34 tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface"
35 depends on X86 35 depends on X86 || OF
36 select TCG_TIS_CORE 36 select TCG_TIS_CORE
37 ---help--- 37 ---help---
38 If you have a TPM security chip that is compliant with the 38 If you have a TPM security chip that is compliant with the
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index eaf5730d79eb..0127af130cb1 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -28,6 +28,8 @@
28#include <linux/wait.h> 28#include <linux/wait.h>
29#include <linux/acpi.h> 29#include <linux/acpi.h>
30#include <linux/freezer.h> 30#include <linux/freezer.h>
31#include <linux/of.h>
32#include <linux/of_device.h>
31#include "tpm.h" 33#include "tpm.h"
32#include "tpm_tis_core.h" 34#include "tpm_tis_core.h"
33 35
@@ -354,12 +356,21 @@ static int tpm_tis_plat_remove(struct platform_device *pdev)
354 return 0; 356 return 0;
355} 357}
356 358
359#ifdef CONFIG_OF
360static const struct of_device_id tis_of_platform_match[] = {
361 {.compatible = "tcg,tpm-tis-mmio"},
362 {},
363};
364MODULE_DEVICE_TABLE(of, tis_of_platform_match);
365#endif
366
357static struct platform_driver tis_drv = { 367static struct platform_driver tis_drv = {
358 .probe = tpm_tis_plat_probe, 368 .probe = tpm_tis_plat_probe,
359 .remove = tpm_tis_plat_remove, 369 .remove = tpm_tis_plat_remove,
360 .driver = { 370 .driver = {
361 .name = "tpm_tis", 371 .name = "tpm_tis",
362 .pm = &tpm_tis_pm, 372 .pm = &tpm_tis_pm,
373 .of_match_table = of_match_ptr(tis_of_platform_match),
363 }, 374 },
364}; 375};
365 376