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

dt-bindings: tpm: Consolidate TCG TIS bindings

A significant number of Trusted Platform Modules conform to the "TIS"
specification published by the Trusted Computing Group ("TCG PC Client
Specific TPM Interface Specification"). These chips typically use an
SPI, I²C or LPC bus as transport (via MMIO in the latter case). Some
of them even support multiple of those buses (selectable through a
config strap) or the same chip is available in multiple SKUs, each with
a different bus interface.

The devicetree bindings for these TPMs have not been converted to DT
schema yet and are spread out across 3 generic files and 2 chip-specific
files. A few TPM compatible strings were added to trivial-devices.yaml
even though additional properties are documented in the plaintext
bindings.

Consolidate the devicetree bindings into 3 yaml files, one per bus.

Move common properties to a separate tpm-common.yaml.

Document compatible strings which are supported by the TPM TIS driver
but were neglected to be added to the devicetree bindings.

Document the memory-region property recently introduced by commit
1e2714bb83fc ("tpm: Add reserved memory event log").

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/953fd4c7519030db88e5b5e12ab6307414ebdd21.1702806810.git.lukas@wunner.de
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Lukas Wunner and committed by
Rob Herring
26c9d152 4ec295ef

+301 -156
-34
Documentation/devicetree/bindings/security/tpm/st33zp24-i2c.txt
··· 1 - * STMicroelectronics SAS. ST33ZP24 TPM SoC 2 - 3 - Required properties: 4 - - compatible: Should be "st,st33zp24-i2c". 5 - - clock-frequency: I²C work frequency. 6 - - reg: address on the bus 7 - 8 - Optional ST33ZP24 Properties: 9 - - interrupts: GPIO interrupt to which the chip is connected 10 - - lpcpd-gpios: Output GPIO pin used for ST33ZP24 power management D1/D2 state. 11 - If set, power must be present when the platform is going into sleep/hibernate mode. 12 - 13 - Optional SoC Specific Properties: 14 - - pinctrl-names: Contains only one value - "default". 15 - - pintctrl-0: Specifies the pin control groups used for this controller. 16 - 17 - Example (for ARM-based BeagleBoard xM with ST33ZP24 on I2C2): 18 - 19 - &i2c2 { 20 - 21 - 22 - st33zp24: st33zp24@13 { 23 - 24 - compatible = "st,st33zp24-i2c"; 25 - 26 - reg = <0x13>; 27 - clock-frequency = <400000>; 28 - 29 - interrupt-parent = <&gpio5>; 30 - interrupts = <7 IRQ_TYPE_LEVEL_HIGH>; 31 - 32 - lpcpd-gpios = <&gpio5 15 GPIO_ACTIVE_HIGH>; 33 - }; 34 - };
-32
Documentation/devicetree/bindings/security/tpm/st33zp24-spi.txt
··· 1 - * STMicroelectronics SAS. ST33ZP24 TPM SoC 2 - 3 - Required properties: 4 - - compatible: Should be "st,st33zp24-spi". 5 - - spi-max-frequency: Maximum SPI frequency (<= 10000000). 6 - 7 - Optional ST33ZP24 Properties: 8 - - interrupts: GPIO interrupt to which the chip is connected 9 - - lpcpd-gpios: Output GPIO pin used for ST33ZP24 power management D1/D2 state. 10 - If set, power must be present when the platform is going into sleep/hibernate mode. 11 - 12 - Optional SoC Specific Properties: 13 - - pinctrl-names: Contains only one value - "default". 14 - - pintctrl-0: Specifies the pin control groups used for this controller. 15 - 16 - Example (for ARM-based BeagleBoard xM with ST33ZP24 on SPI4): 17 - 18 - &mcspi4 { 19 - 20 - 21 - st33zp24@0 { 22 - 23 - compatible = "st,st33zp24-spi"; 24 - 25 - spi-max-frequency = <10000000>; 26 - 27 - interrupt-parent = <&gpio5>; 28 - interrupts = <7 IRQ_TYPE_LEVEL_HIGH>; 29 - 30 - lpcpd-gpios = <&gpio5 15 GPIO_ACTIVE_HIGH>; 31 - }; 32 - };
-26
Documentation/devicetree/bindings/security/tpm/tpm-i2c.txt
··· 1 - * Device Tree Bindings for I2C based Trusted Platform Module(TPM) 2 - 3 - Required properties: 4 - 5 - - compatible : 'manufacturer,model', eg. nuvoton,npct650 6 - - label : human readable string describing the device, eg. "tpm" 7 - - linux,sml-base : 64-bit base address of the reserved memory allocated for 8 - the firmware event log 9 - - linux,sml-size : size of the memory allocated for the firmware event log 10 - 11 - Optional properties: 12 - 13 - - powered-while-suspended: present when the TPM is left powered on between 14 - suspend and resume (makes the suspend/resume 15 - callbacks do nothing). 16 - 17 - Example (for OpenPower Systems with Nuvoton TPM 2.0 on I2C) 18 - ---------------------------------------------------------- 19 - 20 - tpm@57 { 21 - reg = <0x57>; 22 - label = "tpm"; 23 - compatible = "nuvoton,npct650", "nuvoton,npct601"; 24 - linux,sml-base = <0x7f 0xfd450000>; 25 - linux,sml-size = <0x10000>; 26 - };
-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 - - 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 - };
-23
Documentation/devicetree/bindings/security/tpm/tpm_tis_spi.txt
··· 1 - Required properties: 2 - - compatible: should be one of the following 3 - "st,st33htpm-spi" 4 - "infineon,slb9670" 5 - "tcg,tpm_tis-spi" 6 - - spi-max-frequency: Maximum SPI frequency (depends on TPMs). 7 - 8 - Optional SoC Specific Properties: 9 - - pinctrl-names: Contains only one value - "default". 10 - - pintctrl-0: Specifies the pin control groups used for this controller. 11 - 12 - Example (for ARM-based BeagleBoard xM with TPM_TIS on SPI4): 13 - 14 - &mcspi4 { 15 - 16 - 17 - tpm_tis@0 { 18 - 19 - compatible = "tcg,tpm_tis-spi"; 20 - 21 - spi-max-frequency = <10000000>; 22 - }; 23 - };
+90
Documentation/devicetree/bindings/tpm/tcg,tpm-tis-i2c.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/tpm/tcg,tpm-tis-i2c.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: I²C-attached Trusted Platform Module conforming to TCG TIS specification 8 + 9 + maintainers: 10 + - Lukas Wunner <lukas@wunner.de> 11 + 12 + description: | 13 + The Trusted Computing Group (TCG) has defined a multi-vendor standard 14 + for accessing a TPM chip. It can be transported over various buses, 15 + one of them being I²C. The standard is named: 16 + TCG PC Client Specific TPM Interface Specification (TIS) 17 + https://trustedcomputinggroup.org/resource/pc-client-work-group-pc-client-specific-tpm-interface-specification-tis/ 18 + 19 + The I²C interface was not originally part of the standard, but added 20 + in 2017 with a separate document: 21 + TCG PC Client Platform TPM Profile Specification for TPM 2.0 (PTP) 22 + https://trustedcomputinggroup.org/resource/pc-client-platform-tpm-profile-ptp-specification/ 23 + 24 + Recent TPM 2.0 chips conform to this generic interface, others use a 25 + vendor-specific I²C interface. 26 + 27 + properties: 28 + compatible: 29 + oneOf: 30 + - description: Generic TPM 2.0 chips conforming to TCG PTP interface 31 + items: 32 + - enum: 33 + - infineon,slb9673 34 + - nuvoton,npct75x 35 + - const: tcg,tpm-tis-i2c 36 + 37 + - description: TPM 1.2 and 2.0 chips with vendor-specific I²C interface 38 + items: 39 + - enum: 40 + - atmel,at97sc3204t # TPM 1.2 41 + - infineon,slb9635tt # TPM 1.2 (maximum 100 kHz) 42 + - infineon,slb9645tt # TPM 1.2 (maximum 400 kHz) 43 + - infineon,tpm_i2c_infineon # TPM 1.2 44 + - nuvoton,npct501 # TPM 1.2 45 + - nuvoton,npct601 # TPM 2.0 46 + - st,st33zp24-i2c # TPM 2.0 47 + - winbond,wpct301 # TPM 1.2 48 + 49 + reg: 50 + description: address of TPM on the I²C bus 51 + 52 + allOf: 53 + - $ref: tpm-common.yaml# 54 + 55 + required: 56 + - compatible 57 + - reg 58 + 59 + unevaluatedProperties: false 60 + 61 + examples: 62 + - | 63 + i2c { 64 + #address-cells = <1>; 65 + #size-cells = <0>; 66 + 67 + tpm@57 { 68 + label = "tpm"; 69 + compatible = "nuvoton,npct601"; 70 + reg = <0x57>; 71 + linux,sml-base = <0x7f 0xfd450000>; 72 + linux,sml-size = <0x10000>; 73 + }; 74 + }; 75 + 76 + - | 77 + #include <dt-bindings/gpio/gpio.h> 78 + #include <dt-bindings/interrupt-controller/irq.h> 79 + i2c { 80 + #address-cells = <1>; 81 + #size-cells = <0>; 82 + 83 + tpm@13 { 84 + reg = <0x13>; 85 + compatible = "st,st33zp24-i2c"; 86 + interrupt-parent = <&gpio5>; 87 + interrupts = <7 IRQ_TYPE_LEVEL_HIGH>; 88 + lpcpd-gpios = <&gpio5 15 GPIO_ACTIVE_HIGH>; 89 + }; 90 + };
+49
Documentation/devicetree/bindings/tpm/tcg,tpm-tis-mmio.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/tpm/tcg,tpm-tis-mmio.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MMIO-accessed Trusted Platform Module conforming to TCG TIS specification 8 + 9 + maintainers: 10 + - Lukas Wunner <lukas@wunner.de> 11 + 12 + description: | 13 + The Trusted Computing Group (TCG) has defined a multi-vendor standard 14 + for accessing a TPM chip. It can be transported over various buses, 15 + one of them being LPC (via MMIO). The standard is named: 16 + TCG PC Client Specific TPM Interface Specification (TIS) 17 + https://trustedcomputinggroup.org/resource/pc-client-work-group-pc-client-specific-tpm-interface-specification-tis/ 18 + 19 + properties: 20 + compatible: 21 + items: 22 + - enum: 23 + - at97sc3201 24 + - atmel,at97sc3204 25 + - socionext,synquacer-tpm-mmio 26 + - const: tcg,tpm-tis-mmio 27 + 28 + reg: 29 + description: 30 + location and length of the MMIO registers, length should be 31 + at least 0x5000 bytes 32 + 33 + allOf: 34 + - $ref: tpm-common.yaml# 35 + 36 + required: 37 + - compatible 38 + - reg 39 + 40 + unevaluatedProperties: false 41 + 42 + examples: 43 + - | 44 + tpm@90000 { 45 + compatible = "atmel,at97sc3204", "tcg,tpm-tis-mmio"; 46 + reg = <0x90000 0x5000>; 47 + interrupt-parent = <&EIC0>; 48 + interrupts = <1 2>; 49 + };
+75
Documentation/devicetree/bindings/tpm/tcg,tpm_tis-spi.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/tpm/tcg,tpm_tis-spi.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: SPI-attached Trusted Platform Module conforming to TCG TIS specification 8 + 9 + maintainers: 10 + - Lukas Wunner <lukas@wunner.de> 11 + 12 + description: | 13 + The Trusted Computing Group (TCG) has defined a multi-vendor standard 14 + for accessing a TPM chip. It can be transported over various buses, 15 + one of them being SPI. The standard is named: 16 + TCG PC Client Specific TPM Interface Specification (TIS) 17 + https://trustedcomputinggroup.org/resource/pc-client-work-group-pc-client-specific-tpm-interface-specification-tis/ 18 + 19 + properties: 20 + compatible: 21 + items: 22 + - enum: 23 + - infineon,slb9670 24 + - st,st33htpm-spi 25 + - st,st33zp24-spi 26 + - const: tcg,tpm_tis-spi 27 + 28 + allOf: 29 + - $ref: tpm-common.yaml# 30 + - $ref: /schemas/spi/spi-peripheral-props.yaml# 31 + - if: 32 + properties: 33 + compatible: 34 + contains: 35 + const: st,st33zp24-spi 36 + then: 37 + properties: 38 + spi-max-frequency: 39 + maximum: 10000000 40 + 41 + required: 42 + - compatible 43 + - reg 44 + 45 + unevaluatedProperties: false 46 + 47 + examples: 48 + - | 49 + spi { 50 + #address-cells = <1>; 51 + #size-cells = <0>; 52 + 53 + tpm@0 { 54 + reg = <0>; 55 + compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; 56 + spi-max-frequency = <10000000>; 57 + }; 58 + }; 59 + 60 + - | 61 + #include <dt-bindings/gpio/gpio.h> 62 + #include <dt-bindings/interrupt-controller/irq.h> 63 + spi { 64 + #address-cells = <1>; 65 + #size-cells = <0>; 66 + 67 + tpm@0 { 68 + reg = <0>; 69 + compatible = "st,st33zp24-spi", "tcg,tpm_tis-spi"; 70 + spi-max-frequency = <10000000>; 71 + interrupt-parent = <&gpio5>; 72 + interrupts = <7 IRQ_TYPE_LEVEL_HIGH>; 73 + lpcpd-gpios = <&gpio5 15 GPIO_ACTIVE_HIGH>; 74 + }; 75 + };
+87
Documentation/devicetree/bindings/tpm/tpm-common.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/tpm/tpm-common.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Trusted Platform Module common properties 8 + 9 + maintainers: 10 + - Lukas Wunner <lukas@wunner.de> 11 + 12 + properties: 13 + $nodename: 14 + pattern: '^tpm(@[0-9a-f]+)?$' 15 + 16 + interrupts: 17 + description: indicates command completion 18 + maxItems: 1 19 + 20 + label: 21 + description: human readable string describing the device, e.g. "tpm" 22 + 23 + linux,sml-base: 24 + description: 25 + base address of reserved memory allocated for firmware event log 26 + $ref: /schemas/types.yaml#/definitions/uint64 27 + 28 + linux,sml-size: 29 + description: 30 + size of reserved memory allocated for firmware event log 31 + $ref: /schemas/types.yaml#/definitions/uint32 32 + 33 + memory-region: 34 + description: reserved memory allocated for firmware event log 35 + maxItems: 1 36 + 37 + powered-while-suspended: 38 + description: 39 + present when the TPM is left powered on between suspend and resume 40 + (makes the suspend/resume callbacks do nothing) 41 + type: boolean 42 + 43 + resets: 44 + description: Reset controller to reset the TPM 45 + $ref: /schemas/types.yaml#/definitions/phandle 46 + 47 + reset-gpios: 48 + description: Output GPIO pin to reset the TPM 49 + maxItems: 1 50 + 51 + # must always have both linux,sml-base and linux,sml-size 52 + dependentRequired: 53 + linux,sml-base: ['linux,sml-size'] 54 + linux,sml-size: ['linux,sml-base'] 55 + 56 + # must only have either memory-region or linux,sml-base 57 + # as well as either resets or reset-gpios 58 + dependentSchemas: 59 + memory-region: 60 + properties: 61 + linux,sml-base: false 62 + linux,sml-base: 63 + properties: 64 + memory-region: false 65 + resets: 66 + properties: 67 + reset-gpios: false 68 + reset-gpios: 69 + properties: 70 + resets: false 71 + 72 + allOf: 73 + - if: 74 + properties: 75 + compatible: 76 + contains: 77 + pattern: '^st,st33zp24' 78 + then: 79 + properties: 80 + lpcpd-gpios: 81 + description: 82 + Output GPIO pin used for ST33ZP24 power management of D1/D2 state. 83 + If set, power must be present when the platform is going into 84 + sleep/hibernate mode. 85 + maxItems: 1 86 + 87 + additionalProperties: true
-16
Documentation/devicetree/bindings/trivial-devices.yaml
··· 49 49 - ams,iaq-core 50 50 # i2c serial eeprom (24cxx) 51 51 - at,24c08 52 - # i2c trusted platform module (TPM) 53 - - atmel,at97sc3204t 54 52 # ATSHA204 - i2c h/w symmetric crypto module 55 53 - atmel,atsha204 56 54 # ATSHA204A - i2c h/w symmetric crypto module ··· 143 145 - infineon,ir38263 144 146 # Infineon IRPS5401 Voltage Regulator (PMIC) 145 147 - infineon,irps5401 146 - # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) 147 - - infineon,slb9635tt 148 - # Infineon SLB9645 I2C TPM (new protocol, max 400khz) 149 - - infineon,slb9645tt 150 - # Infineon SLB9673 I2C TPM 2.0 151 - - infineon,slb9673 152 148 # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor 153 149 - infineon,tlv493d-a1b6 154 150 # Infineon Multi-phase Digital VR Controller xdpe11280 ··· 293 301 - national,lm85 294 302 # I2C ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator 295 303 - national,lm92 296 - # i2c trusted platform module (TPM) 297 - - nuvoton,npct501 298 - # i2c trusted platform module (TPM2) 299 - - nuvoton,npct601 300 304 # Nuvoton Temperature Sensor 301 305 - nuvoton,w83773g 302 306 # OKI ML86V7667 video decoder ··· 337 349 - silabs,si7020 338 350 # Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply 339 351 - skyworks,sky81452 340 - # Socionext SynQuacer TPM MMIO module 341 - - socionext,synquacer-tpm-mmio 342 352 # SparkFun Qwiic Joystick (COM-15168) with i2c interface 343 353 - sparkfun,qwiic-joystick 344 354 # i2c serial eeprom (24cxx) ··· 391 405 - winbond,w83793 392 406 # Vicor Corporation Digital Supervisor 393 407 - vicor,pli1209bc 394 - # i2c trusted platform module (TPM) 395 - - winbond,wpct301 396 408 397 409 required: 398 410 - compatible