Skip to content

Commit

Permalink
tpm_tis: Allow tpm_tis to be bound using DT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Gunthorpe authored and Jarkko Sakkinen committed Nov 27, 2016
1 parent 7ea7861 commit 420d439
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
25 changes: 25 additions & 0 deletions Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Trusted Computing Group MMIO Trusted Platform Module

The TCG defines multi vendor standard for accessing a TPM chip, this
is the standard protocol defined to access the TPM via MMIO. Typically
this interface will be implemented over Intel's LPC bus.

Refer to the 'TCG PC Client Specific TPM Interface Specification (TIS)' TCG
publication for the specification.

Required properties:

- compatible: should contain a string below for the chip, followed by
"tcg,tpm-tis-mmio". Valid chip strings are:
* "atmel,at97sc3204"
- reg: The location of the MMIO registers, should be at least 0x5000 bytes
- interrupt-parent/interrupts: An optional interrupt indicating command completion.

Example:

tpm_tis@90000 {
compatible = "atmel,at97sc3204", "tcg,tpm-tis-mmio";
reg = <0x90000 0x5000>;
interrupt-parent = <&EIC0>;
interrupts = <1 2>;
};
2 changes: 1 addition & 1 deletion drivers/char/tpm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ config TCG_TIS_CORE

config TCG_TIS
tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface"
depends on X86
depends on X86 || OF
select TCG_TIS_CORE
---help---
If you have a TPM security chip that is compliant with the
Expand Down
11 changes: 11 additions & 0 deletions drivers/char/tpm/tpm_tis.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <linux/wait.h>
#include <linux/acpi.h>
#include <linux/freezer.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include "tpm.h"
#include "tpm_tis_core.h"

Expand Down Expand Up @@ -354,12 +356,21 @@ static int tpm_tis_plat_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_OF
static const struct of_device_id tis_of_platform_match[] = {
{.compatible = "tcg,tpm-tis-mmio"},
{},
};
MODULE_DEVICE_TABLE(of, tis_of_platform_match);
#endif

static struct platform_driver tis_drv = {
.probe = tpm_tis_plat_probe,
.remove = tpm_tis_plat_remove,
.driver = {
.name = "tpm_tis",
.pm = &tpm_tis_pm,
.of_match_table = of_match_ptr(tis_of_platform_match),
},
};

Expand Down

0 comments on commit 420d439

Please sign in to comment.