Skip to contentSkip to conversation

Clean up TPM compatibles

PATCH In review Alexander Steffen 3 participants 16 messages Sep 30, 2022 – Nov 1, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Clean up TPM compatibles

Not all TPM compatibles were documented correctly so far. Some were not documented at all, others missed some properties, most of them did not use the latest YAML format. But by design most TPMs are very similar, so this allows to document them in a single trivial-tpms.yaml, similar to how trivial-devices.yaml documents simple I2C and SPI devices. This fixes all the documentation issues and ensures that dtbs_check can be used in the future to detect incorrect configurations automatically.

Alexander Steffen (7):
dt-bindings: tpm: Introduce trivial-tpms.yaml
dt-bindings: tpm: Improve documentation of compatibles
dt-bindings: tpm: Add previously undocumented properties
dt-bindings: tpm: Merge existing trivial TPMs to YAML
dt-bindings: tpm: Document previously undocumented compatibles
dt-bindings: tpm: Add fallbacks for all TCG-compliant TPM variants
tpm: Add missing compatibles to drivers

 .../bindings/security/tpm/google,cr50.txt     |  19 ---
 .../bindings/security/tpm/tpm-i2c.txt         |  26 ----
 .../bindings/security/tpm/tpm_tis_mmio.txt    |  25 ----
 .../bindings/security/tpm/tpm_tis_spi.txt     |  23 ----
 .../bindings/security/tpm/trivial-tpms.yaml   | 118 ++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml  |  16 ---
 drivers/char/tpm/tpm_tis_i2c.c                |   2 +
 drivers/char/tpm/tpm_tis_spi_main.c           |   1 +
 8 files changed, 121 insertions(+), 109 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/google,cr50.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-i2c.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_spi.txt
 create mode 100644 Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/7 dt-bindings: tpm: Introduce trivial-tpms.yaml

Most TPM devices are very similar and only need a few common properties to describe them. However, they may use more properties than other trivial I2C or SPI devices, e.g. powered-while-suspended. Therefore, move them to their own trivial-tpms.yaml.

---
 .../bindings/security/tpm/trivial-tpms.yaml   | 54 +++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml  | 16 ------
 2 files changed, 54 insertions(+), 16 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +54 -0
new file mode 100644
index 000000000000..fadd4ca96554
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/security/tpm/trivial-tpms.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Trivial TPM devices that have simple device tree bindings
+
+maintainers:
+  - [email protected]
+
+description: |
+  This is a list of trivial TPM devices that share the same properties and
+  therefore have simple device tree bindings.
+
+  If a device needs more specific bindings, such as properties to
+  describe some aspect of it, there needs to be a specific binding
+  document for it just like any other devices.
+
+properties:
+  reg:
+    maxItems: 1
+  interrupts:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  compatible:
+    contains:
+      enum:
+          # i2c trusted platform module (TPM)
+        - atmel,at97sc3204t
+          # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
+        - infineon,slb9635tt
+          # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
+        - infineon,slb9645tt
+          # Infineon SLB9673 I2C TPM 2.0
+        - infineon,slb9673
+          # i2c trusted platform module (TPM)
+        - nuvoton,npct501
+          # i2c trusted platform module (TPM2)
+        - nuvoton,npct601
+          # Socionext SynQuacer TPM MMIO module
+        - socionext,synquacer-tpm-mmio
+          # i2c trusted platform module (TPM)
+        - winbond,wpct301
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+...
Documentation/devicetree/bindings/trivial-devices.yaml +0 -16
index 61746755c107..1cc7f82c0822 100644
@@ -47,8 +47,6 @@ properties:
           - ams,iaq-core
             # i2c serial eeprom (24cxx)
           - at,24c08
-            # i2c trusted platform module (TPM)
-          - atmel,at97sc3204t
             # ATSHA204 - i2c h/w symmetric crypto module
           - atmel,atsha204
             # ATSHA204A - i2c h/w symmetric crypto module
@@ -135,12 +133,6 @@ properties:
           - infineon,ir38164
             # Infineon IR38263 Voltage Regulator
           - infineon,ir38263
-            # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
-          - infineon,slb9635tt
-            # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
-          - infineon,slb9645tt
-            # Infineon SLB9673 I2C TPM 2.0
-          - infineon,slb9673
             # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
           - infineon,tlv493d-a1b6
             # Infineon Multi-phase Digital VR Controller xdpe11280
@@ -289,10 +281,6 @@ properties:
           - national,lm85
             # I2C ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator
           - national,lm92
-            # i2c trusted platform module (TPM)
-          - nuvoton,npct501
-            # i2c trusted platform module (TPM2)
-          - nuvoton,npct601
             # Nuvoton Temperature Sensor
           - nuvoton,w83773g
             # OKI ML86V7667 video decoder
@@ -327,8 +315,6 @@ properties:
           - silabs,si7020
             # Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply
           - skyworks,sky81452
-            # Socionext SynQuacer TPM MMIO module
-          - socionext,synquacer-tpm-mmio
             # SparkFun Qwiic Joystick (COM-15168) with i2c interface
           - sparkfun,qwiic-joystick
             # i2c serial eeprom (24cxx)
@@ -383,8 +369,6 @@ properties:
           - winbond,w83793
             # Vicor Corporation Digital Supervisor
           - vicor,pli1209bc
-            # i2c trusted platform module (TPM)
-          - winbond,wpct301
 
 required:
   - compatible
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/7] dt-bindings: tpm: Introduce trivial-tpms.yaml

Quoted 31 lines · Alexander Steffen

Most TPM devices are very similar and only need a few common properties to describe them. However, they may use more properties than other trivial I2C or SPI devices, e.g. powered-while-suspended. Therefore, move them to their own trivial-tpms.yaml.

---
 .../bindings/security/tpm/trivial-tpms.yaml   | 54 +++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml  | 16 ------
 2 files changed, 54 insertions(+), 16 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +12 -0
new file mode 100644
index 000000000000..fadd4ca96554
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/security/tpm/trivial-tpms.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Trivial TPM devices that have simple device tree bindings
+
+maintainers:
+  - [email protected]
+
+description: |

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 22

Quoted 10 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +10 -0
+  This is a list of trivial TPM devices that share the same properties and
+  therefore have simple device tree bindings.
+
+  If a device needs more specific bindings, such as properties to
+  describe some aspect of it, there needs to be a specific binding
+  document for it just like any other devices.
+
+properties:
+  reg:
+    maxItems: 1

blank line

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 26

Quoted 4 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +4 -0
+  interrupts:
+    maxItems: 1
+
+  spi-max-frequency: true

The SPI based devices need to reference spi-peripheral-props.yaml. So I think these are going to need to be split up by bus some.

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 28

Quoted 2 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +2 -0
+
+  compatible:

compatible goes first by convention.

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 29

Quoted 1 line
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +1 -0
+    contains:

'contains' can not be used here. That allows any other compatible strings to be present. It's got to be exact lists of what are valid combinations.

Quoted 83 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +25 -0
+      enum:
+          # i2c trusted platform module (TPM)
+        - atmel,at97sc3204t
+          # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
+        - infineon,slb9635tt
+          # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
+        - infineon,slb9645tt
+          # Infineon SLB9673 I2C TPM 2.0
+        - infineon,slb9673
+          # i2c trusted platform module (TPM)
+        - nuvoton,npct501
+          # i2c trusted platform module (TPM2)
+        - nuvoton,npct601
+          # Socionext SynQuacer TPM MMIO module
+        - socionext,synquacer-tpm-mmio
+          # i2c trusted platform module (TPM)
+        - winbond,wpct301
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+...
Documentation/devicetree/bindings/trivial-devices.yaml +0 -17
index 61746755c107..1cc7f82c0822 100644
@@ -47,8 +47,6 @@ properties:
           - ams,iaq-core
             # i2c serial eeprom (24cxx)
           - at,24c08
-            # i2c trusted platform module (TPM)
-          - atmel,at97sc3204t
             # ATSHA204 - i2c h/w symmetric crypto module
           - atmel,atsha204
             # ATSHA204A - i2c h/w symmetric crypto module
@@ -135,12 +133,6 @@ properties:
           - infineon,ir38164
             # Infineon IR38263 Voltage Regulator
           - infineon,ir38263
-            # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
-          - infineon,slb9635tt
-            # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
-          - infineon,slb9645tt
-            # Infineon SLB9673 I2C TPM 2.0
-          - infineon,slb9673
             # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
           - infineon,tlv493d-a1b6
             # Infineon Multi-phase Digital VR Controller xdpe11280
@@ -289,10 +281,6 @@ properties:
           - national,lm85
             # I2C ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator
           - national,lm92
-            # i2c trusted platform module (TPM)
-          - nuvoton,npct501
-            # i2c trusted platform module (TPM2)
-          - nuvoton,npct601
             # Nuvoton Temperature Sensor
           - nuvoton,w83773g
             # OKI ML86V7667 video decoder
@@ -327,8 +315,6 @@ properties:
           - silabs,si7020
             # Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply
           - skyworks,sky81452
-            # Socionext SynQuacer TPM MMIO module
-          - socionext,synquacer-tpm-mmio
             # SparkFun Qwiic Joystick (COM-15168) with i2c interface
           - sparkfun,qwiic-joystick
             # i2c serial eeprom (24cxx)
@@ -383,8 +369,6 @@ properties:
           - winbond,w83793
             # Vicor Corporation Digital Supervisor
           - vicor,pli1209bc
-            # i2c trusted platform module (TPM)
-          - winbond,wpct301
 
 required:
   - compatible
--

2.25.1

#3 lore raw

Re: [PATCH 1/7] dt-bindings: tpm: Introduce trivial-tpms.yaml

Quoted 51 lines · Rob Herring
Quoted 31 lines · Alexander Steffen

Most TPM devices are very similar and only need a few common properties to describe them. However, they may use more properties than other trivial I2C or SPI devices, e.g. powered-while-suspended. Therefore, move them to their own trivial-tpms.yaml.

---
  .../bindings/security/tpm/trivial-tpms.yaml   | 54 +++++++++++++++++++
  .../devicetree/bindings/trivial-devices.yaml  | 16 ------
  2 files changed, 54 insertions(+), 16 deletions(-)

create mode 100644 Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +12 -0
new file mode 100644
index 000000000000..fadd4ca96554
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/security/tpm/trivial-tpms.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Trivial TPM devices that have simple device tree bindings
+
+maintainers:
+  - [email protected]
+
+description: |

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 22

Quoted 10 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +10 -0
+  This is a list of trivial TPM devices that share the same properties and
+  therefore have simple device tree bindings.
+
+  If a device needs more specific bindings, such as properties to
+  describe some aspect of it, there needs to be a specific binding
+  document for it just like any other devices.
+
+properties:
+  reg:
+    maxItems: 1

blank line

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 26

Quoted 4 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +4 -0
+  interrupts:
+    maxItems: 1
+
+  spi-max-frequency: true
Quoted 7 lines

The SPI based devices need to reference spi-peripheral-props.yaml. So I think these are going to need to be split up by bus some.

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 28

Quoted 2 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +2 -0
+
+  compatible:

compatible goes first by convention.

I had copied all three from trivial-devices.yaml ;-)

The style fixes are easy. But do you really think I should split trivial-tpms.yaml into i2c-tpms.yaml, spi-tpms.yaml, etc.? After all, trivial-devices.yaml also contains a mix of I2C and SPI devices.

Also, what about devices like "google,cr50", that support both I2C and SPI? Can they appear in two YAML files at the same time?

Quoted 5 lines

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 29

Quoted 1 line
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +1 -0
+    contains:

'contains' can not be used here. That allows any other compatible strings to be present. It's got to be exact lists of what are valid combinations.

So what exactly are valid combinations then? If I look at what is in use, I find three possible combinations:

arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi: compatible = "tcg,tpm_tis-spi" arch/arm/boot/dts/imx6dl-eckelmann-ci4x10.dts: compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dts: compatible = "infineon,slb9670";

It is either a generic identifier or a specific device or both. Is it correct to allow all three variants? If so, how to specify that as YAML, ideally without duplicating any of the identifiers?

Quoted 83 lines
Quoted 83 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +25 -0
+      enum:
+          # i2c trusted platform module (TPM)
+        - atmel,at97sc3204t
+          # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
+        - infineon,slb9635tt
+          # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
+        - infineon,slb9645tt
+          # Infineon SLB9673 I2C TPM 2.0
+        - infineon,slb9673
+          # i2c trusted platform module (TPM)
+        - nuvoton,npct501
+          # i2c trusted platform module (TPM2)
+        - nuvoton,npct601
+          # Socionext SynQuacer TPM MMIO module
+        - socionext,synquacer-tpm-mmio
+          # i2c trusted platform module (TPM)
+        - winbond,wpct301
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+...
Documentation/devicetree/bindings/trivial-devices.yaml +0 -17
index 61746755c107..1cc7f82c0822 100644
@@ -47,8 +47,6 @@ properties:
            - ams,iaq-core
              # i2c serial eeprom (24cxx)
            - at,24c08
-            # i2c trusted platform module (TPM)
-          - atmel,at97sc3204t
              # ATSHA204 - i2c h/w symmetric crypto module
            - atmel,atsha204
              # ATSHA204A - i2c h/w symmetric crypto module
@@ -135,12 +133,6 @@ properties:
            - infineon,ir38164
              # Infineon IR38263 Voltage Regulator
            - infineon,ir38263
-            # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
-          - infineon,slb9635tt
-            # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
-          - infineon,slb9645tt
-            # Infineon SLB9673 I2C TPM 2.0
-          - infineon,slb9673
              # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
            - infineon,tlv493d-a1b6
              # Infineon Multi-phase Digital VR Controller xdpe11280
@@ -289,10 +281,6 @@ properties:
            - national,lm85
              # I2C ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator
            - national,lm92
-            # i2c trusted platform module (TPM)
-          - nuvoton,npct501
-            # i2c trusted platform module (TPM2)
-          - nuvoton,npct601
              # Nuvoton Temperature Sensor
            - nuvoton,w83773g
              # OKI ML86V7667 video decoder
@@ -327,8 +315,6 @@ properties:
            - silabs,si7020
              # Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply
            - skyworks,sky81452
-            # Socionext SynQuacer TPM MMIO module
-          - socionext,synquacer-tpm-mmio
              # SparkFun Qwiic Joystick (COM-15168) with i2c interface
            - sparkfun,qwiic-joystick
              # i2c serial eeprom (24cxx)
@@ -383,8 +369,6 @@ properties:
            - winbond,w83793
              # Vicor Corporation Digital Supervisor
            - vicor,pli1209bc
-            # i2c trusted platform module (TPM)
-          - winbond,wpct301
 
  required:
    - compatible
--

2.25.1

maintainer
#4 lore raw

Re: [PATCH 1/7] dt-bindings: tpm: Introduce trivial-tpms.yaml

Quoted 58 lines · Alexander Steffen
Quoted 57 lines · Rob Herring
Quoted 31 lines · Alexander Steffen

Most TPM devices are very similar and only need a few common properties to describe them. However, they may use more properties than other trivial I2C or SPI devices, e.g. powered-while-suspended. Therefore, move them to their own trivial-tpms.yaml.

---
  .../bindings/security/tpm/trivial-tpms.yaml   | 54 +++++++++++++++++++
  .../devicetree/bindings/trivial-devices.yaml  | 16 ------
  2 files changed, 54 insertions(+), 16 deletions(-)

create mode 100644 Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +12 -0
new file mode 100644
index 000000000000..fadd4ca96554
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/security/tpm/trivial-tpms.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Trivial TPM devices that have simple device tree bindings
+
+maintainers:
+  - [email protected]
+
+description: |

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 22

Quoted 10 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +10 -0
+  This is a list of trivial TPM devices that share the same properties and
+  therefore have simple device tree bindings.
+
+  If a device needs more specific bindings, such as properties to
+  describe some aspect of it, there needs to be a specific binding
+  document for it just like any other devices.
+
+properties:
+  reg:
+    maxItems: 1

blank line

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 26

Quoted 4 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +4 -0
+  interrupts:
+    maxItems: 1
+
+  spi-max-frequency: true

The SPI based devices need to reference spi-peripheral-props.yaml. So I think these are going to need to be split up by bus some.

Quoted 2 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +2 -0
+
+  compatible:
Quoted 7 lines
Quoted 1 line

compatible goes first by convention.

I had copied all three from trivial-devices.yaml ;-)

The style fixes are easy. But do you really think I should split trivial-tpms.yaml into i2c-tpms.yaml, spi-tpms.yaml, etc.? After all, trivial-devices.yaml also contains a mix of I2C and SPI devices.

Well, you can leave them mixed. It just means that SPI bus properties would be allowed in I2C devices. That's okay, but if we can avoid it we should.

Quoted 2 lines

Also, what about devices like "google,cr50", that support both I2C and SPI? Can they appear in two YAML files at the same time?

No, it can't. It can be a single schema for both, but perhaps a separate schema doc from the rest.

Quoted 17 lines
Quoted 6 lines

Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml line 29

Quoted 2 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml new file +1 -0
+    contains:

'contains' can not be used here. That allows any other compatible strings to be present. It's got to be exact lists of what are valid combinations.

So what exactly are valid combinations then? If I look at what is in use, I find three possible combinations:

arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi: compatible = "tcg,tpm_tis-spi" arch/arm/boot/dts/imx6dl-eckelmann-ci4x10.dts: compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dts: compatible = "infineon,slb9670";

Quoted 3 lines

It is either a generic identifier or a specific device or both. Is it correct to allow all three variants? If so, how to specify that as YAML, ideally without duplicating any of the identifiers?

At a minimum you need an 'items' entry for each length of compatible entries and generally an entry for each fallback. So you will have to have some duplication.

In cases like imx8mq-kontron-pitx-imx8m.dts, the dts should be fixed adding "tcg,tpm_tis-spi". If all the users were just "infineon,slb9670", then we'd leave it. So define the schema with what matches existing users, but fix users when inconsistent.

Rob

#5 lore raw

PATCH 2/7 dt-bindings: tpm: Improve documentation of compatibles

In reply to Alexander Steffen

Add missing information:
* Device name, for discoverability
* Interface, to distinguish otherwise similar devices
* TPM version, so that outdated devices can be deprecated in the future

---
 .../bindings/security/tpm/trivial-tpms.yaml        | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml +7 -7
index fadd4ca96554..2092341c6491 100644
@@ -28,21 +28,21 @@ properties:
   compatible:
     contains:
       enum:
-          # i2c trusted platform module (TPM)
+          # Atmel AT97SC3204T I2C TPM 1.2
         - atmel,at97sc3204t
-          # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
+          # Infineon SLB9635 I2C TPM 1.2 (old protocol, max 100khz)
         - infineon,slb9635tt
-          # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
+          # Infineon SLB9645 I2C TPM 1.2 (new protocol, max 400khz)
         - infineon,slb9645tt
           # Infineon SLB9673 I2C TPM 2.0
         - infineon,slb9673
-          # i2c trusted platform module (TPM)
+          # Nuvoton NPCT501 I2C TPM 1.2
         - nuvoton,npct501
-          # i2c trusted platform module (TPM2)
+          # Nuvoton NPCT601 I2C TPM 2.0
         - nuvoton,npct601
-          # Socionext SynQuacer TPM MMIO module
+          # Socionext SynQuacer MMIO TPM
         - socionext,synquacer-tpm-mmio
-          # i2c trusted platform module (TPM)
+          # Winbond WPCT301 I2C TPM 1.2
         - winbond,wpct301
 
 required:
Signature · 1 line
2.25.1
maintainer
#6 lore raw

Re: [PATCH 2/7] dt-bindings: tpm: Improve documentation of compatibles

Quoted 10 lines · Alexander Steffen

Add missing information:
* Device name, for discoverability
* Interface, to distinguish otherwise similar devices
* TPM version, so that outdated devices can be deprecated in the future

---
 .../bindings/security/tpm/trivial-tpms.yaml        | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Running 'make dtbs_check' with the schema in this patch gives the following warnings. Consider if they are expected or the schema is incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check. This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/patch/

tpm@20: 'powered-while-suspended' does not match any of the regexes: 'pinctrl-[0-9]+'

	arch/arm/boot/dts/rk3288-veyron-brain.dtb
	arch/arm/boot/dts/rk3288-veyron-fievel.dtb
	arch/arm/boot/dts/rk3288-veyron-jaq.dtb
	arch/arm/boot/dts/rk3288-veyron-jerry.dtb
	arch/arm/boot/dts/rk3288-veyron-mickey.dtb
	arch/arm/boot/dts/rk3288-veyron-mighty.dtb
	arch/arm/boot/dts/rk3288-veyron-minnie.dtb
	arch/arm/boot/dts/rk3288-veyron-pinky.dtb
	arch/arm/boot/dts/rk3288-veyron-speedy.dtb
	arch/arm/boot/dts/rk3288-veyron-tiger.dtb
	arch/arm64/boot/dts/mediatek/mt8173-elm-hana-rev7.dtb
	arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtb
	arch/arm64/boot/dts/mediatek/mt8173-elm.dtb
	arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dtb
#7 lore raw

Re: [PATCH 2/7] dt-bindings: tpm: Improve documentation of compatibles

Quoted 23 lines · Rob Herring
Quoted 10 lines · Alexander Steffen

Add missing information:
* Device name, for discoverability
* Interface, to distinguish otherwise similar devices
* TPM version, so that outdated devices can be deprecated in the future

---
  .../bindings/security/tpm/trivial-tpms.yaml        | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)

Running 'make dtbs_check' with the schema in this patch gives the following warnings. Consider if they are expected or the schema is incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check. This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/patch/

tpm@20: 'powered-while-suspended' does not match any of the regexes: 'pinctrl-[0-9]+'

Quoted 14 lines
         arch/arm/boot/dts/rk3288-veyron-brain.dtb
         arch/arm/boot/dts/rk3288-veyron-fievel.dtb
         arch/arm/boot/dts/rk3288-veyron-jaq.dtb
         arch/arm/boot/dts/rk3288-veyron-jerry.dtb
         arch/arm/boot/dts/rk3288-veyron-mickey.dtb
         arch/arm/boot/dts/rk3288-veyron-mighty.dtb
         arch/arm/boot/dts/rk3288-veyron-minnie.dtb
         arch/arm/boot/dts/rk3288-veyron-pinky.dtb
         arch/arm/boot/dts/rk3288-veyron-speedy.dtb
         arch/arm/boot/dts/rk3288-veyron-tiger.dtb
         arch/arm64/boot/dts/mediatek/mt8173-elm-hana-rev7.dtb
         arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtb
         arch/arm64/boot/dts/mediatek/mt8173-elm.dtb
         arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dtb

This is fixed by PATCH 3/7. Not sure it is worth changing the order, since the intention of the first two patches was just to convert the existing data, without making any functional changes.

#8 lore raw

PATCH 3/7 dt-bindings: tpm: Add previously undocumented properties

In reply to Alexander Steffen

TPM devices may use some more properties than previously allowed by trivial-devices.yaml. Document those in trivial-tpms.yaml.

---
 .../bindings/security/tpm/trivial-tpms.yaml      | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml +16 -0
index 2092341c6491..a9e2dd17b1ca 100644
@@ -25,6 +25,22 @@ properties:
 
   spi-max-frequency: true
 
+  linux,sml-base:
+    $ref: /schemas/types.yaml#/definitions/uint64
+    description: |
+      64-bit base address of the reserved memory allocated for the firmware
+      event log
+
+  linux,sml-size:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: size of the memory allocated for the firmware event log
+
+  powered-while-suspended:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: |
+      Present when the TPM is left powered on between suspend and resume
+      (makes the suspend/resume callbacks do nothing).
+
   compatible:
     contains:
       enum:
Signature · 1 line
2.25.1
#9 lore raw

Re: [PATCH 3/7] dt-bindings: tpm: Add previously undocumented properties

Quoted 8 lines · Alexander Steffen

TPM devices may use some more properties than previously allowed by trivial-devices.yaml. Document those in trivial-tpms.yaml.

---
 .../bindings/security/tpm/trivial-tpms.yaml      | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Adding these here means we would need to duplicate them for any device with its own schema file. You need a common TPM property schema which the specific TPM device schemas can reference.

Quoted 31 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml +16 -1
index 2092341c6491..a9e2dd17b1ca 100644
@@ -25,6 +25,22 @@ properties:
 
   spi-max-frequency: true
 
+  linux,sml-base:
+    $ref: /schemas/types.yaml#/definitions/uint64
+    description: |
+      64-bit base address of the reserved memory allocated for the firmware
+      event log
+
+  linux,sml-size:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: size of the memory allocated for the firmware event log
+
+  powered-while-suspended:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: |
+      Present when the TPM is left powered on between suspend and resume
+      (makes the suspend/resume callbacks do nothing).
+
   compatible:
     contains:
       enum:
--

2.25.1

#10 lore raw

Re: [PATCH 3/7] dt-bindings: tpm: Add previously undocumented properties

Quoted 6 lines · Rob Herring
Quoted 4 lines · Alexander Steffen

TPM devices may use some more properties than previously allowed by trivial-devices.yaml. Document those in trivial-tpms.yaml.

Quoted 8 lines
Quoted 4 lines
---
  .../bindings/security/tpm/trivial-tpms.yaml      | 16 ++++++++++++++++
  1 file changed, 16 insertions(+)

Adding these here means we would need to duplicate them for any device with its own schema file. You need a common TPM property schema which the specific TPM device schemas can reference.

Good point, I'll create one.

Quoted 31 lines
Quoted 31 lines
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml +16 -1
index 2092341c6491..a9e2dd17b1ca 100644
@@ -25,6 +25,22 @@ properties:
 
    spi-max-frequency: true
 
+  linux,sml-base:
+    $ref: /schemas/types.yaml#/definitions/uint64
+    description: |
+      64-bit base address of the reserved memory allocated for the firmware
+      event log
+
+  linux,sml-size:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: size of the memory allocated for the firmware event log
+
+  powered-while-suspended:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: |
+      Present when the TPM is left powered on between suspend and resume
+      (makes the suspend/resume callbacks do nothing).
+
    compatible:
      contains:
        enum:
--

2.25.1

#11 lore raw

PATCH 4/7 dt-bindings: tpm: Merge existing trivial TPMs to YAML

In reply to Alexander Steffen

Several of the existing text files describe trivial TPMs, that fit perfectly into the new trivial-tpms.yaml. Move them there.

---
 .../bindings/security/tpm/google,cr50.txt     | 19 ----------
 .../bindings/security/tpm/tpm-i2c.txt         | 26 --------------
 .../bindings/security/tpm/tpm_tis_mmio.txt    | 25 -------------
 .../bindings/security/tpm/tpm_tis_spi.txt     | 23 ------------
 .../bindings/security/tpm/trivial-tpms.yaml   | 36 +++++++++++++++++++
 5 files changed, 36 insertions(+), 93 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/google,cr50.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-i2c.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_spi.txt
Documentation/devicetree/bindings/security/tpm/google,cr50.txt deleted +0 -19
deleted file mode 100644
index cd69c2efdd37..000000000000
@@ -1,19 +0,0 @@
-* H1 Secure Microcontroller with Cr50 Firmware on SPI Bus.
-
-H1 Secure Microcontroller running Cr50 firmware provides several
-functions, including TPM-like functionality. It communicates over
-SPI using the FIFO protocol described in the PTP Spec, section 6.
-
-Required properties:
-- compatible: Should be "google,cr50".
-- spi-max-frequency: Maximum SPI frequency.
-
-Example:
-
-&spi0 {
-	tpm@0 {
-		compatible = "google,cr50";
-		reg = <0>;
-		spi-max-frequency = <800000>;
-	};
-};
Documentation/devicetree/bindings/security/tpm/tpm-i2c.txt deleted +0 -26
deleted file mode 100644
index a65d7b71e81a..000000000000
@@ -1,26 +0,0 @@
-* Device Tree Bindings for I2C based Trusted Platform Module(TPM)
-
-Required properties:
-
-- compatible     : 'manufacturer,model', eg. nuvoton,npct650
-- label          : human readable string describing the device, eg. "tpm"
-- linux,sml-base : 64-bit base address of the reserved memory allocated for
-                   the firmware event log
-- linux,sml-size : size of the memory allocated for the firmware event log
-
-Optional properties:
-
-- powered-while-suspended: present when the TPM is left powered on between
-                           suspend and resume (makes the suspend/resume
-                           callbacks do nothing).
-
-Example (for OpenPower Systems with Nuvoton TPM 2.0 on I2C)
-----------------------------------------------------------
-
-tpm@57 {
-	reg = <0x57>;
-	label = "tpm";
-	compatible = "nuvoton,npct650", "nuvoton,npct601";
-	linux,sml-base = <0x7f 0xfd450000>;
-	linux,sml-size = <0x10000>;
-};
Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt deleted +0 -25
deleted file mode 100644
index 7c6304426da1..000000000000
@@ -1,25 +0,0 @@
-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
-- 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>;
-	};
Documentation/devicetree/bindings/security/tpm/tpm_tis_spi.txt deleted +0 -23
deleted file mode 100644
index b800667da92b..000000000000
@@ -1,23 +0,0 @@
-Required properties:
-- compatible: should be one of the following
-    "st,st33htpm-spi"
-    "infineon,slb9670"
-    "tcg,tpm_tis-spi"
-- spi-max-frequency: Maximum SPI frequency (depends on TPMs).
-
-Optional SoC Specific Properties:
-- pinctrl-names: Contains only one value - "default".
-- pintctrl-0: Specifies the pin control groups used for this controller.
-
-Example (for ARM-based BeagleBoard xM with TPM_TIS on SPI4):
-
-&mcspi4 {
-
-
-        tpm_tis@0 {
-
-                compatible = "tcg,tpm_tis-spi";
-
-                spi-max-frequency = <10000000>;
-        };
-};
Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml +36 -0
index a9e2dd17b1ca..1fd7f38b7b6d 100644
@@ -44,20 +44,34 @@ properties:
   compatible:
     contains:
       enum:
+          # Atmel AT97SC3204 LPC TPM 1.2
+        - atmel,at97sc3204
           # Atmel AT97SC3204T I2C TPM 1.2
         - atmel,at97sc3204t
+          # Google Titan H1/Cr50 I2C/SPI TPM 2.0
+        - google,cr50
           # Infineon SLB9635 I2C TPM 1.2 (old protocol, max 100khz)
         - infineon,slb9635tt
           # Infineon SLB9645 I2C TPM 1.2 (new protocol, max 400khz)
         - infineon,slb9645tt
+          # Infineon SLB9670 SPI TPM 2.0
+        - infineon,slb9670
           # Infineon SLB9673 I2C TPM 2.0
         - infineon,slb9673
           # Nuvoton NPCT501 I2C TPM 1.2
         - nuvoton,npct501
           # Nuvoton NPCT601 I2C TPM 2.0
         - nuvoton,npct601
+          # Nuvoton NPCT650 I2C TPM 2.0
+        - nuvoton,npct650
           # Socionext SynQuacer MMIO TPM
         - socionext,synquacer-tpm-mmio
+          # STMicroelectronics ST33TPHF2xSPI TPM 2.0
+        - st,st33htpm-spi
+          # TCG TIS-compliant MMIO TPM (generic fallback)
+        - tcg,tpm-tis-mmio
+          # TCG TIS-compliant SPI TPM (generic fallback)
+        - tcg,tpm_tis-spi
           # Winbond WPCT301 I2C TPM 1.2
         - winbond,wpct301
 
@@ -67,4 +81,26 @@ required:
 
 additionalProperties: false
 
+examples:
+  - |
+    tpm@0 {
+      compatible = "google,cr50";
+      reg = <0>;
+      spi-max-frequency = <800000>;
+    };
+  - |
+    tpm@57 {
+      compatible = "nuvoton,npct601";
+      reg = <0x57>;
+      linux,sml-base = <0x7f 0xfd450000>;
+      linux,sml-size = <0x10000>;
+    };
+  - |
+    tpm_tis@90000 {
+      compatible = "atmel,at97sc3204";
+      reg = <0x90000 0x5000>;
+      interrupt-parent = <&EIC0>;
+      interrupts = <1 2>;
+    };
+
 ...
Signature · 1 line
2.25.1
maintainer
#12 lore raw

Re: [PATCH 4/7] dt-bindings: tpm: Merge existing trivial TPMs to YAML

Quoted 4 lines · Alexander Steffen

Several of the existing text files describe trivial TPMs, that fit perfectly into the new trivial-tpms.yaml. Move them there.

Quoted 12 lines
---
 .../bindings/security/tpm/google,cr50.txt     | 19 ----------
 .../bindings/security/tpm/tpm-i2c.txt         | 26 --------------
 .../bindings/security/tpm/tpm_tis_mmio.txt    | 25 -------------
 .../bindings/security/tpm/tpm_tis_spi.txt     | 23 ------------
 .../bindings/security/tpm/trivial-tpms.yaml   | 36 +++++++++++++++++++
 5 files changed, 36 insertions(+), 93 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/google,cr50.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-i2c.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_spi.txt

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dts:20.11-21: Warning (reg_format): /example-0/tpm@0:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dts:42.11-24: Warning (reg_format): /example-1/tpm@57:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (simple_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

#13 lore raw

Re: [PATCH 4/7] dt-bindings: tpm: Merge existing trivial TPMs to YAML

Quoted 39 lines · Rob Herring
Quoted 11 lines · Alexander Steffen

Several of the existing text files describe trivial TPMs, that fit perfectly into the new trivial-tpms.yaml. Move them there.

---
  .../bindings/security/tpm/google,cr50.txt     | 19 ----------
  .../bindings/security/tpm/tpm-i2c.txt         | 26 --------------
  .../bindings/security/tpm/tpm_tis_mmio.txt    | 25 -------------
  .../bindings/security/tpm/tpm_tis_spi.txt     | 23 ------------
  .../bindings/security/tpm/trivial-tpms.yaml   | 36 +++++++++++++++++++
  5 files changed, 36 insertions(+), 93 deletions(-)
Quoted 5 lines

delete mode 100644 Documentation/devicetree/bindings/security/tpm/google,cr50.txt delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-i2c.txt delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_spi.txt

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dts:20.11-21: Warning (reg_format): /example-0/tpm@0:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dts:42.11-24: Warning (reg_format): /example-1/tpm@57:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (simple_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

Quoted 7 lines

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

Any idea what is wrong here with reg_format? I just copied the existing examples, so something was broken there before.

maintainer
#14 lore raw

Re: [PATCH 4/7] dt-bindings: tpm: Merge existing trivial TPMs to YAML

Quoted 44 lines · Alexander Steffen
Quoted 43 lines · Rob Herring
Quoted 11 lines · Alexander Steffen

Several of the existing text files describe trivial TPMs, that fit perfectly into the new trivial-tpms.yaml. Move them there.

---
  .../bindings/security/tpm/google,cr50.txt     | 19 ----------
  .../bindings/security/tpm/tpm-i2c.txt         | 26 --------------
  .../bindings/security/tpm/tpm_tis_mmio.txt    | 25 -------------
  .../bindings/security/tpm/tpm_tis_spi.txt     | 23 ------------
  .../bindings/security/tpm/trivial-tpms.yaml   | 36 +++++++++++++++++++
  5 files changed, 36 insertions(+), 93 deletions(-)
Quoted 5 lines

delete mode 100644 Documentation/devicetree/bindings/security/tpm/google,cr50.txt delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-i2c.txt delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_spi.txt

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dts:20.11-21: Warning (reg_format): /example-0/tpm@0:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dts:42.11-24: Warning (reg_format): /example-1/tpm@57:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (simple_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/security/tpm/trivial-tpms.example.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

Quoted 6 lines
Quoted 3 lines

pip3 install dtschema --upgrade

Please check and re-submit.

Any idea what is wrong here with reg_format? I just copied the existing examples, so something was broken there before.

The default bus is 1 address cell and 1 size cell. If you need something different, like I2C or SPI, you need to define the bus node in the example. This is explained in example-schema.yaml.

Rob

#15 lore raw
In reply to Alexander Steffen

+Joel

Quoted 18 lines · Alexander Steffen

Not all TPM compatibles were documented correctly so far. Some were not documented at all, others missed some properties, most of them did not use the latest YAML format. But by design most TPMs are very similar, so this allows to document them in a single trivial-tpms.yaml, similar to how trivial-devices.yaml documents simple I2C and SPI devices. This fixes all the documentation issues and ensures that dtbs_check can be used in the future to detect incorrect configurations automatically.

Alexander Steffen (7):
dt-bindings: tpm: Introduce trivial-tpms.yaml
dt-bindings: tpm: Improve documentation of compatibles
dt-bindings: tpm: Add previously undocumented properties
dt-bindings: tpm: Merge existing trivial TPMs to YAML
dt-bindings: tpm: Document previously undocumented compatibles
dt-bindings: tpm: Add fallbacks for all TCG-compliant TPM variants
tpm: Add missing compatibles to drivers

Quoted 14 lines
 .../bindings/security/tpm/google,cr50.txt     |  19 ---
 .../bindings/security/tpm/tpm-i2c.txt         |  26 ----
 .../bindings/security/tpm/tpm_tis_mmio.txt    |  25 ----
 .../bindings/security/tpm/tpm_tis_spi.txt     |  23 ----
 .../bindings/security/tpm/trivial-tpms.yaml   | 118 ++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml  |  16 ---
 drivers/char/tpm/tpm_tis_i2c.c                |   2 +
 drivers/char/tpm/tpm_tis_spi_main.c           |   1 +
 8 files changed, 121 insertions(+), 109 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/google,cr50.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-i2c.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
 delete mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_spi.txt
 create mode 100644 Documentation/devicetree/bindings/security/tpm/trivial-tpms.yaml

Thanks, but please coordinate your work with this[1].

Rob

[1] https://lore.kernel.org/all/[email protected]/

Quoted 1 line