dt-bindings: json-schema conversions and cleanups
Subsystems (30)
cover dt-bindings: json-schema conversions and cleanups
From: Thierry Reding <[email protected]>
Hi Rob,
This set of patches is the result of trying to get all the Tegra DTS files validated against the YAML bindings. I initially set out to do this conversion because I wanted to add interconnect properties and a way of validating them, so this started off as just a conversion of various bindings and the addition of the interconnects properties but then spun out of control a bit as I was running into various issues with the validation.
I do have another set of patches of about 60 patches that fix various preexisting issues in the device tree files, but after applying these conversions and fixes as well as the DT updates I can validate all 32 and 64-bit device tree files for Tegra with a "make dtbs_check".
Not all of the device tree bindings have been converted yet, but the main ones should be covered. I plan on doing a couple more conversions once these have landed and as I find the time.
I wasn't sure whether I should be sending this as multiple smaller series or a large set, but ended up deciding on the latter because a lot of these are very similar, so should be easier to review as a lot. If you prefer some other format, let me know.
Thierry
Thierry Reding (38):
dt-bindings: interrupt-controller: arm,gic: Add compatible for
Tegra186 AGIC
dt-bindings: memory: nvidia: Mark memory controller as interconnect
provider
dt-bindings: memory: Increase number of reg entries on Tegra194
dt-bindings: firmware: Convert Tegra186 BPMP bindings to json-schema
dt-bindings: firmware: tegra186-bpmp: Document interconnect paths
dt-bindings: display: tegra: Document display-hub
dt-bindings: display: tegra: Convert to json-schema
dt-bindings: display: tegra: Document interconnect paths
dt-bindings: gpu: tegra: Convert to json-schema
dt-bindings: gpu: tegra: Document interconnect paths
dt-bindings: mmc: tegra: Convert to json-schema
dt-bindings: mmc: tegra: Document interconnect paths
dt-bindings: pci: tegra: Convert to json-schema
dt-bindings: pci: tegra: Document interconnect paths
dt-bindings: sound: tegra: hda: Convert to json-schema
dt-bindings: sound: tegra: hda: Document interconnect paths
dt-bindings: usb: tegra-xusb: Convert to json-schema
dt-bindings: usb: tegra-xusb: Document interconnect paths
dt-bindings: net: dwc-qos-ethernet: Convert to json-schema
dt-bindings: net: dwc-qos-ethernet: Document interconnect paths
dt-bindings: sound: sgtl5000: Convert to json-schema
dt-bindings: gpio: tegra186: Use unique include guard
dt-bindings: gpio: tegra186: Convert to json-schema
dt-bindings: mfd: max77620: Convert to json-schema
dt-bindings: gpio: tegra: Convert to json-schema
dt-bindings: pci: iommu: Convert to json-schema
dt-bindings: tegra: Add missing compatible strings
dt-bindings: phy: tegra-xusb: Convert to json-schema
dt-bindings: tegra: pmc: Increase clock limit for power domains
dt-bindings: panel: Allow reg property for DSI panels
dt-bindings: panel: simple: Use unevaluatedProperties
dt-bindings: leds: Document rfkill* trigger
dt-bindings: memory-controller: Document Tegra132 EMC
dt-bindings: memory-controller: Fix "reg" entries on Tegra194
dt-bindings: memory: Update Tegra210 EMC bindings
dt-bindings: power: supply: sbs-battery: Document TI BQ20Z45
compatible
dt-bindings: pwm: Explicitly include pwm.yaml
dt-bindings: serial: Document Tegra-specific properties
.../devicetree/bindings/arm/tegra.yaml | 46 +- .../arm/tegra/nvidia,tegra20-pmc.yaml | 2 +- .../bindings/display/panel/panel-simple.yaml | 5 +- .../display/tegra/nvidia,tegra20-host1x.txt | 466 --- .../display/tegra/nvidia,tegra20-host1x.yaml | 1458 +++++++++ .../firmware/nvidia,tegra186-bpmp.txt | 107 - .../firmware/nvidia,tegra186-bpmp.yaml | 201 ++ .../bindings/gpio/gpio-max77620.txt | 25 - .../bindings/gpio/nvidia,tegra186-gpio.txt | 165 - .../bindings/gpio/nvidia,tegra186-gpio.yaml | 215 ++ .../bindings/gpio/nvidia,tegra20-gpio.txt | 40 - .../bindings/gpio/nvidia,tegra20-gpio.yaml | 111 + .../devicetree/bindings/gpu/nvidia,gk20a.txt | 90 - .../devicetree/bindings/gpu/nvidia,gk20a.yaml | 204 ++ .../interrupt-controller/arm,gic.yaml | 7 + .../devicetree/bindings/leds/common.yaml | 17 +- .../nvidia,tegra124-emc.yaml | 4 +- .../nvidia,tegra186-mc.yaml | 70 +- .../nvidia,tegra210-emc.yaml | 34 +- .../devicetree/bindings/mfd/max77620.txt | 162 - .../devicetree/bindings/mfd/max77620.yaml | 662 ++++ .../bindings/mmc/nvidia,tegra20-sdhci.txt | 117 - .../bindings/mmc/nvidia,tegra20-sdhci.yaml | 283 ++ .../bindings/net/snps,dwc-qos-ethernet.txt | 168 - .../bindings/net/snps,dwc-qos-ethernet.yaml | 322 ++ .../bindings/pci/nvidia,tegra20-pcie.txt | 682 ---- .../bindings/pci/nvidia,tegra20-pcie.yaml | 835 +++++ .../devicetree/bindings/pci/pci-iommu.txt | 171 - .../devicetree/bindings/pci/pci-iommu.yaml | 168 + .../phy/nvidia,tegra124-xusb-padctl.txt | 778 ----- .../phy/nvidia,tegra124-xusb-padctl.yaml | 2800 +++++++++++++++++ .../bindings/pinctrl/pinctrl-max77620.txt | 127 - .../power/supply/sbs,sbs-battery.yaml | 6 +- .../bindings/pwm/allwinner,sun4i-a10-pwm.yaml | 51 +- .../bindings/pwm/google,cros-ec-pwm.yaml | 4 +- .../devicetree/bindings/pwm/iqs620a-pwm.yaml | 4 +- .../devicetree/bindings/pwm/pwm-samsung.yaml | 1 - .../devicetree/bindings/pwm/pwm.yaml | 2 + .../bindings/pwm/renesas,pwm-rcar.yaml | 4 +- .../bindings/pwm/renesas,tpu-pwm.yaml | 4 +- .../bindings/regulator/regulator-max77620.txt | 222 -- .../devicetree/bindings/serial/8250.yaml | 26 + .../bindings/sound/nvidia,tegra30-hda.txt | 35 - .../bindings/sound/nvidia,tegra30-hda.yaml | 141 + .../devicetree/bindings/sound/sgtl5000.txt | 60 - .../devicetree/bindings/sound/sgtl5000.yaml | 103 + .../bindings/thermal/max77620_thermal.txt | 70 - .../devicetree/bindings/trivial-devices.yaml | 2 - .../bindings/usb/nvidia,tegra124-xusb.txt | 132 - .../bindings/usb/nvidia,tegra124-xusb.yaml | 371 +++ include/dt-bindings/gpio/tegra186-gpio.h | 4 +- 51 files changed, 8103 insertions(+), 3681 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt create mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml delete mode 100644 Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt create mode 100644 Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-max77620.txt delete mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt create mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml delete mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.txt create mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml delete mode 100644 Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt create mode 100644 Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml delete mode 100644 Documentation/devicetree/bindings/mfd/max77620.txt create mode 100644 Documentation/devicetree/bindings/mfd/max77620.yaml delete mode 100644 Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt create mode 100644 Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml delete mode 100644 Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt create mode 100644 Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.yaml delete mode 100644 Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt create mode 100644 Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.yaml delete mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.txt create mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.yaml delete mode 100644 Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt create mode 100644 Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.yaml delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-max77620.txt delete mode 100644 Documentation/devicetree/bindings/regulator/regulator-max77620.txt delete mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml delete mode 100644 Documentation/devicetree/bindings/sound/sgtl5000.txt create mode 100644 Documentation/devicetree/bindings/sound/sgtl5000.yaml delete mode 100644 Documentation/devicetree/bindings/thermal/max77620_thermal.txt delete mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt create mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.yaml
Signature · 1 line
2.24.1
PATCH 1/38 dt-bindings: interrupt-controller: arm,gic: Add compatible for Tegra186 AGIC
From: Thierry Reding <[email protected]>
The AGIC variant of GIC found in the audio subsystem of NVIDIA Tegra186 SoCs is mostly compatible with the version found on Tegra210. Provide a Tegra210 compatible as a fallback compatible, but also require a Tegra186 specific compatible for forwards compatibility in case there's ever a need to implement instantiation-specific quirks.
--- .../devicetree/bindings/interrupt-controller/arm,gic.yaml | 7 +++++++ 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/interrupt-controller/arm,gic.yaml +7 -0
@@ -53,6 +53,13 @@ properties: - const: brcm,brahma-b15-gic - const: arm,cortex-a15-gic + - items: + - enum: + - nvidia,tegra186-agic + - nvidia,tegra194-agic + - enum: + - nvidia,tegra210-agic + interrupt-controller: true "#address-cells":
Signature · 1 line
2.24.1
PATCH 2/38 dt-bindings: memory: nvidia: Mark memory controller as interconnect provider
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
--- .../memory-controllers/nvidia,tegra186-mc.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +10 -0
@@ -38,6 +38,16 @@ properties: interrupts: maxItems: 1 + "#interconnect-cells": + const: 1 + description: + Each interconnect node for the memory controller takes a phandle to the + memory controller and a single cell as the specifier, identifying the + memory client by its ID. + + For a list of valid IDs, see dt-bindings/memory/tegra186-mc.h and + dt-bindings/memory/tegra194-mc.h. + "#address-cells": const: 2
Signature · 1 line
2.24.1
PATCH 3/38 dt-bindings: memory: Increase number of reg entries on Tegra194
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The memory controller and external memory controller control multiple channels that require additional register ranges. Allow the number of ranges to be up to 3 or 2 for the memory controller and the external memory controller, respectively.
--- .../nvidia,tegra186-mc.yaml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +25 -0
@@ -102,6 +102,31 @@ required: additionalProperties: false +allOf: + - if: + properties: + compatible: + contains: + const: nvidia,tegra194-mc + then: + properties: + reg: + maxItems: 3 + + - if: + patternProperties: + "^external-memory-controller@[0-9a-f]+$": + properties: + compatible: + contains: + const: nvidia,tegra194-emc + then: + patternProperties: + "^external-memory-controller@[0-9a-f]+$": + properties: + reg: + maxItems: 2 + examples: - | #include <dt-bindings/clock/tegra186-clock.h>
Signature · 1 line
2.24.1
PATCH 4/38 dt-bindings: firmware: Convert Tegra186 BPMP bindings to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Tegra186 BPMP bindings from the free-form text format to a json-schema and fix things up so that existing device trees properly validate.
--- .../firmware/nvidia,tegra186-bpmp.txt | 107 ----------- .../firmware/nvidia,tegra186-bpmp.yaml | 180 ++++++++++++++++++ 2 files changed, 180 insertions(+), 107 deletions(-) delete mode 100644 Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt create mode 100644 Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt deleted +0 -107
@@ -1,107 +0,0 @@ -NVIDIA Tegra Boot and Power Management Processor (BPMP) - -The BPMP is a specific processor in Tegra chip, which is designed for -booting process handling and offloading the power management, clock -management, and reset control tasks from the CPU. The binding document -defines the resources that would be used by the BPMP firmware driver, -which can create the interprocessor communication (IPC) between the CPU -and BPMP. - -Required properties: -- compatible - Array of strings - One of: - - "nvidia,tegra186-bpmp" -- mboxes : The phandle of mailbox controller and the mailbox specifier. -- shmem : List of the phandle of the TX and RX shared memory area that - the IPC between CPU and BPMP is based on. -- #clock-cells : Should be 1. -- #power-domain-cells : Should be 1. -- #reset-cells : Should be 1. - -This node is a mailbox consumer. See the following files for details of -the mailbox subsystem, and the specifiers implemented by the relevant -provider(s): - -- .../mailbox/mailbox.txt -- .../mailbox/nvidia,tegra186-hsp.txt - -This node is a clock, power domain, and reset provider. See the following -files for general documentation of those features, and the specifiers -implemented by this node: - -- .../clock/clock-bindings.txt -- <dt-bindings/clock/tegra186-clock.h> -- ../power/power-domain.yaml -- <dt-bindings/power/tegra186-powergate.h> -- .../reset/reset.txt -- <dt-bindings/reset/tegra186-reset.h> - -The BPMP implements some services which must be represented by separate nodes. -For example, it can provide access to certain I2C controllers, and the I2C -bindings represent each I2C controller as a device tree node. Such nodes should -be nested directly inside the main BPMP node. - -Software can determine whether a child node of the BPMP node represents a device -by checking for a compatible property. Any node with a compatible property -represents a device that can be instantiated. Nodes without a compatible -property may be used to provide configuration information regarding the BPMP -itself, although no such configuration nodes are currently defined by this -binding. - -The BPMP firmware defines no single global name-/numbering-space for such -services. Put another way, the numbering scheme for I2C buses is distinct from -the numbering scheme for any other service the BPMP may provide (e.g. a future -hypothetical SPI bus service). As such, child device nodes will have no reg -property, and the BPMP node will have no #address-cells or #size-cells property. - -The shared memory bindings for BPMP ------------------------------------ - -The shared memory area for the IPC TX and RX between CPU and BPMP are -predefined and work on top of sysram, which is an SRAM inside the chip. - -See ".../sram/sram.txt" for the bindings. - -Example: - -hsp_top0: hsp@3c00000 { - ... - #mbox-cells = <2>; -}; - -sysram@30000000 { - compatible = "nvidia,tegra186-sysram", "mmio-sram"; - reg = <0x0 0x30000000 0x0 0x50000>; - #address-cells = <2>; - #size-cells = <2>; - ranges = <0 0x0 0x0 0x30000000 0x0 0x50000>; - - cpu_bpmp_tx: shmem@4e000 { - compatible = "nvidia,tegra186-bpmp-shmem"; - reg = <0x0 0x4e000 0x0 0x1000>; - label = "cpu-bpmp-tx"; - pool; - }; - - cpu_bpmp_rx: shmem@4f000 { - compatible = "nvidia,tegra186-bpmp-shmem"; - reg = <0x0 0x4f000 0x0 0x1000>; - label = "cpu-bpmp-rx"; - pool; - }; -}; - -bpmp { - compatible = "nvidia,tegra186-bpmp"; - mboxes = <&hsp_top0 TEGRA_HSP_MBOX_TYPE_DB TEGRA_HSP_DB_MASTER_BPMP>; - shmem = <&cpu_bpmp_tx &cpu_bpmp_rx>; - #clock-cells = <1>; - #power-domain-cells = <1>; - #reset-cells = <1>; - - i2c { - compatible = "..."; - ... - }; -};
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +180 -0
180 lines not on this page · raw message
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 04/38] dt-bindings: firmware: Convert Tegra186 BPMP bindings to json-schema
Quoted 13 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the Tegra186 BPMP bindings from the free-form text format to a json-schema and fix things up so that existing device trees properly validate.
Signed-off-by Thierry Reding <[email protected]>--- .../firmware/nvidia,tegra186-bpmp.txt | 107 ----------- .../firmware/nvidia,tegra186-bpmp.yaml | 180 ++++++++++++++++++ 2 files changed, 180 insertions(+), 107 deletions(-) delete mode 100644 Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt create mode 100644 Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml
[...]
Quoted 46 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +40
-0@@ -0,0 +1,180 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/firmware/nvidia,tegra186-bpmp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra186 (and later) Boot and Power Management Processor (BPMP) + +maintainers: + - Thierry Reding <[email protected]> + - Jon Hunter <[email protected]> + +description: | + The BPMP is a specific processor in Tegra chip, which is designed for + booting process handling and offloading the power management, clock + management, and reset control tasks from the CPU. The binding document + defines the resources that would be used by the BPMP firmware driver, + which can create the interprocessor communication (IPC) between the + CPU and BPMP. + + The BPMP implements some services which must be represented by separate + nodes. For example, it can provide access to certain I2C controllers, and + the I2C bindings represent each I2C controller as a device tree node. Such + nodes should be nested directly inside the main BPMP node. + + Software can determine whether a child node of the BPMP node represents a + device by checking for a compatible property. Any node with a compatible + property represents a device that can be instantiated. Nodes without a + compatible property may be used to provide configuration information + regarding the BPMP itself, although no such configuration nodes are + currently defined by this binding. + + The BPMP firmware defines no single global name-/numbering-space for such + services. Put another way, the numbering scheme for I2C buses is distinct + from the numbering scheme for any other service the BPMP may provide (e.g. + a future hypothetical SPI bus service). As such, child device nodes will + have no "reg" property, and the BPMP node will have no "#address-cells" or + "#size-cells" property. + +properties:
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml line 50
Quoted 10 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +10
-0+ compatible: + items: + - enum: + - nvidia,tegra186-bpmp + + iommus: + description: | + The phandle of the IOMMU and the IOMMU specifier. See ../iommu/iommu.txt + for details. + $ref: "/schemas/types.yaml#/definitions/phandle-array"
Standard property, don't need a type. Just 'maxItems: 1' if 1 entry or an 'items' list if more than 1.
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml line 57
Quoted 7 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +7
-0+ + mboxes: + description: | + The phandle of the mailbox controller and the mailbox specifier. See + ../mailbox/mailbox.txt and ../mailbox/nvidia,tegra186-hsp.txt for + details. + $ref: "/schemas/types.yaml#/definitions/phandle-array"
Same here.
Quoted 16 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +16
-0+ + shmem: + description: | + List of phandles for the TX and RX shared memory areas used for + interprocess communication between the CPU and the BPMP. + + The shared memory area for the IPC TX and RX between CPU and BPMP are + predefined and work on top of sysram, which is an SRAM inside the chip. + + See ../sram/sram.yaml for the bindings. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + "#clock-cells": + const: 1 + + "#power-domain-cells":
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml line 83
Quoted 10 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +10
-0+ const: 1 + + "#reset-cells": + const: 1 + + i2c: + type: object + description: | + The BPMP can provide serialized access to I2C controllers that have + been assigned to it.
Should have a $ref to i2c-controller.yaml
Quoted 24 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +24
-0+ + properties: + compatible: + items: + - enum: + - nvidia,tegra186-bpmp-i2c + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + nvidia,bpmp-bus-id: + description: The bus ID of the I2C controller. + $ref: "/schemas/types.yaml#/definitions/uint32" + + required: + - compatible + - "#address-cells" + - "#size-cells" + - nvidia,bpmp-bus-id + + patternProperties:
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml line 117
Quoted 10 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +10
-0+ "^.*@[0-9a-f]+$": + type: object + description: I2C slave + properties: + reg: + maxItems: 1 + description: I2C address of the slave + + required: + - reg
And child node schema can be dropped.
Quoted 46 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +46
-0+ + additionalProperties: false + + thermal: + type: object + description: + The BPMP provides functionality that exposes system temperature sensors + and which can be used to trigger a system shutdown if the temperature + for a given zone exceeds the specified thresholds. + + properties: + compatible: + items: + - enum: + - nvidia,tegra186-bpmp-thermal + + "#thermal-sensor-cells": + description: The ID of the thermal zone. + const: 1 + + required: + - compatible + - "#thermal-sensor-cells" + + additionalProperties: false + +required: + - compatible + - mboxes + - shmem + - "#clock-cells" + - "#power-domain-cells" + - "#reset-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/mailbox/tegra186-hsp.h> + #include <dt-bindings/memory/tegra186-mc.h> + + bpmp { + compatible = "nvidia,tegra186-bpmp"; + iommus = <&smmu TEGRA186_SID_BPMP>; + mboxes = <&hsp_top0 TEGRA_HSP_MBOX_TYPE_DB TEGRA_HSP_DB_MASTER_BPMP>; + shmem = <&cpu_bpmp_tx &cpu_bpmp_rx>;
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml line 173
Quoted 10 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +10
-0+ #clock-cells = <1>; + #power-domain-cells = <1>; + #reset-cells = <1>; + + i2c { + compatible = "nvidia,tegra186-bpmp-i2c"; + nvidia,bpmp-bus-id = <5>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled";
Don't show status in examples.
Quoted 10 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml new file +7
-0+ }; + + thermal { + compatible = "nvidia,tegra186-bpmp-thermal"; + #thermal-sensor-cells = <1>; + }; + };Signature · 1 line
2.24.1
PATCH 5/38 dt-bindings: firmware: tegra186-bpmp: Document interconnect paths
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Document the interconnects property that is used to describe the paths from and to system memory from and to the BPMP.
--- .../firmware/nvidia,tegra186-bpmp.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml +21 -0
@@ -43,6 +43,21 @@ properties: - enum: - nvidia,tegra186-bpmp + interconnects: + description: A list of phandle and specifier pairs that describe the + interconnect paths to and from the BPMP. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + interconnect-names: + description: One string for each pair of phandle and specifier in the + "interconnects" property. + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: read + - const: write + - const: dma-mem # dma-read + - const: dma-write + iommus: description: | The phandle of the IOMMU and the IOMMU specifier. See ../iommu/iommu.txt
@@ -158,6 +173,12 @@ examples: bpmp { compatible = "nvidia,tegra186-bpmp"; + interconnects = <&mc TEGRA186_MEMORY_CLIENT_BPMPR &emc>, + <&mc TEGRA186_MEMORY_CLIENT_BPMPW &emc>, + <&mc TEGRA186_MEMORY_CLIENT_BPMPDMAR &emc>, + <&mc TEGRA186_MEMORY_CLIENT_BPMPDMAW &emc>; + interconnect-names = "read", "write", "dma-mem", "dma-write"; + iommus = <&smmu TEGRA186_SID_BPMP>; mboxes = <&hsp_top0 TEGRA_HSP_MBOX_TYPE_DB TEGRA_HSP_DB_MASTER_BPMP>; shmem = <&cpu_bpmp_tx &cpu_bpmp_rx>;
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 05/38] dt-bindings: firmware: tegra186-bpmp: Document interconnect paths
Quoted 15 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Document the interconnects property that is used to describe the paths from and to system memory from and to the BPMP.
Signed-off-by Thierry Reding <[email protected]>--- .../firmware/nvidia,tegra186-bpmp.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml +0
-0
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml properties: · line 49
Quoted 7 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml +4
-0@@ -43,6 +43,21 @@ properties: - enum: - nvidia,tegra186-bpmp + interconnects: + description: A list of phandle and specifier pairs that describe the + interconnect paths to and from the BPMP. + $ref: "/schemas/types.yaml#/definitions/phandle-array"
Again, don't re-define standard properties.
Quoted 30 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml +17
-0+ + interconnect-names: + description: One string for each pair of phandle and specifier in the + "interconnects" property. + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: read + - const: write + - const: dma-mem # dma-read + - const: dma-write + iommus: description: | The phandle of the IOMMU and the IOMMU specifier. See ../iommu/iommu.txt@@ -158,6 +173,12 @@ examples: bpmp { compatible = "nvidia,tegra186-bpmp"; + interconnects = <&mc TEGRA186_MEMORY_CLIENT_BPMPR &emc>, + <&mc TEGRA186_MEMORY_CLIENT_BPMPW &emc>, + <&mc TEGRA186_MEMORY_CLIENT_BPMPDMAR &emc>, + <&mc TEGRA186_MEMORY_CLIENT_BPMPDMAW &emc>; + interconnect-names = "read", "write", "dma-mem", "dma-write"; + iommus = <&smmu TEGRA186_SID_BPMP>; mboxes = <&hsp_top0 TEGRA_HSP_MBOX_TYPE_DB TEGRA_HSP_DB_MASTER_BPMP>; shmem = <&cpu_bpmp_tx &cpu_bpmp_rx>;Signature · 1 line
2.24.1
PATCH 6/38 dt-bindings: display: tegra: Document display-hub
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Tegra186 and later have an additional component in the display pipeline called the display hub. Document the bindings which were missing.
--- .../display/tegra/nvidia,tegra20-host1x.txt | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+)
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +50 -0
@@ -297,6 +297,56 @@ of the following host1x client modules: - reset-names: Must include the following entries: - vic +- display-hub: display controller hub + Required properties: + - compatible: "nvidia,tegra<chip>-display" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - disp + - dsc + - hub + - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - misc + - wgrp0 + - wgrp1 + - wgrp2 + - wgrp3 + - wgrp4 + - wgrp5 + - power-domains: A list of phandle and specifiers identifying the power + domains that the display hub is part of. + - ranges: Range of registers used for the display controllers. + + Each subnode of the display hub represents one of the display controllers + available: + + - display: display controller + - compatible: "nvidia,tegra<chip>-dc" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - dc + - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - dc + - power-domains: A list of phandle and specifiers that identify the power + domains that this display controller is part of. + - iommus: A phandle and specifier identifying the SMMU master interface of + this display controller. + - nvidia,outputs: A list of phandles of outputs that this display + controller can drive. + - nvidia,head: The number of the display controller head. This is used to + setup the various types of output to receive video data from the given + head. + Example: / {
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 06/38] dt-bindings: display: tegra: Document display-hub
Quoted 4 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Tegra186 and later have an additional component in the display pipeline called the display hub. Document the bindings which were missing.
I'd rather this be after the conversion or I'm reviewing it twice.
Quoted 50 lines
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.txt | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+)Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +36
-0@@ -297,6 +297,56 @@ of the following host1x client modules: - reset-names: Must include the following entries: - vic +- display-hub: display controller hub + Required properties: + - compatible: "nvidia,tegra<chip>-display" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - disp + - dsc + - hub + - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - misc + - wgrp0 + - wgrp1 + - wgrp2 + - wgrp3 + - wgrp4 + - wgrp5 + - power-domains: A list of phandle and specifiers identifying the power + domains that the display hub is part of. + - ranges: Range of registers used for the display controllers. + + Each subnode of the display hub represents one of the display controllers + available: + + - display: display controller + - compatible: "nvidia,tegra<chip>-dc" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - dc
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt of the following host1x client modules: · line 345
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +10
-0+ - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - dc + - power-domains: A list of phandle and specifiers that identify the power + domains that this display controller is part of. + - iommus: A phandle and specifier identifying the SMMU master interface of + this display controller. + - nvidia,outputs: A list of phandles of outputs that this display + controller can drive.
Seems like an OF graph should describe this?
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt of the following host1x client modules: · line 348
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +3
-0+ - nvidia,head: The number of the display controller head. This is used to + setup the various types of output to receive video data from the given + head.
Not really clear what this is...
Quoted 7 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +1
-0+ Example: / {Signature · 1 line
2.24.1
Re: [PATCH 06/38] dt-bindings: display: tegra: Document display-hub
Quoted 7 lines · Rob Herring
Quoted 4 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Tegra186 and later have an additional component in the display pipeline called the display hub. Document the bindings which were missing.
I'd rather this be after the conversion or I'm reviewing it twice.
Okay, I'll reorder the patches accordingly.
Quoted 54 lines
Quoted 54 lines
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.txt | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+)Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +40
-0@@ -297,6 +297,56 @@ of the following host1x client modules: - reset-names: Must include the following entries: - vic +- display-hub: display controller hub + Required properties: + - compatible: "nvidia,tegra<chip>-display" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - disp + - dsc + - hub + - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - misc + - wgrp0 + - wgrp1 + - wgrp2 + - wgrp3 + - wgrp4 + - wgrp5 + - power-domains: A list of phandle and specifiers identifying the power + domains that the display hub is part of. + - ranges: Range of registers used for the display controllers. + + Each subnode of the display hub represents one of the display controllers + available: + + - display: display controller + - compatible: "nvidia,tegra<chip>-dc" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - dc + - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - dc
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt of the following host1x client modules: · line 345
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +6
-0+ - power-domains: A list of phandle and specifiers that identify the power + domains that this display controller is part of. + - iommus: A phandle and specifier identifying the SMMU master interface of + this display controller. + - nvidia,outputs: A list of phandles of outputs that this display + controller can drive.Seems like an OF graph should describe this?
The above documents the current state of affairs. I don't recall exactly why we never merged the bindings, but we've been using this nvidia,outputs property for almost three years now. Changing this would break ABI, although I guess you could say that since this was never documented it can't be ABI. Still, changing this is going to cause old device trees to fail with new kernels. Unless of course if we add some backwards-compatibility mechanism in the driver. But in that case, what exactly do we gain by switching to an OF graph?
Historically, I think nvidia,outputs was introduced before OF graphs were "a thing", at least in DRM. According to the git log, the helpers for graphs were introduced a couple of years before nvidia,outputs was used, but I guess they must not have been widespread enough for me to have been aware of them.
Anyway, irrespective of the compatibility issues, I tried to use an OF graph to describe this and here's what I came up with:
--- >8 ---
arch/arm64/boot/dts/nvidia/tegra186.dtsi | 170 ++++++++++++++++++++++++++++++- drivers/gpu/drm/tegra/dc.c | 15 +-- drivers/gpu/drm/tegra/dc.h | 1 - drivers/gpu/drm/tegra/output.c | 12 +-- 4 files changed, 172 insertions(+), 26 deletions(-)
arch/arm64/boot/dts/nvidia/tegra186.dtsi +167 -3
@@ -994,8 +994,38 @@ display@15200000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; iommus = <&smmu TEGRA186_SID_NVDISPLAY>; - nvidia,outputs = <&dsia &dsib &sor0 &sor1>; nvidia,head = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dc0_out: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dc0_out_dsia: endpoint@0 { + reg = <0>; + remote-endpoint = <&dsia_in_dc0>; + }; + + dc0_out_dsib: endpoint@1 { + reg = <1>; + remote-endpoint = <&dsib_in_dc0>; + }; + + dc0_out_sor0: endpoint@2 { + reg = <2>; + remote-endpoint = <&sor0_in_dc0>; + }; + + dc0_out_sor1: endpoint@3 { + reg = <3>; + remote-endpoint = <&sor1_in_dc0>; + }; + }; + }; }; display@15210000 {
@@ -1010,8 +1040,38 @@ display@15210000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISPB>; iommus = <&smmu TEGRA186_SID_NVDISPLAY>; - nvidia,outputs = <&dsia &dsib &sor0 &sor1>; nvidia,head = <1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dc1_out: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dc1_out_dsia: endpoint@0 { + reg = <0>; + remote-endpoint = <&dsia_in_dc1>; + }; + + dc1_out_dsib: endpoint@1 { + reg = <1>; + remote-endpoint = <&dsib_in_dc1>; + }; + + dc1_out_sor0: endpoint@2 { + reg = <2>; + remote-endpoint = <&sor0_in_dc1>; + }; + + dc1_out_sor1: endpoint@3 { + reg = <3>; + remote-endpoint = <&sor1_in_dc1>; + }; + }; + }; }; display@15220000 {
@@ -1026,8 +1086,28 @@ display@15220000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISPC>; iommus = <&smmu TEGRA186_SID_NVDISPLAY>; - nvidia,outputs = <&sor0 &sor1>; nvidia,head = <2>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dc2_out: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dc2_out_sor0: endpoint@0 { + reg = <0>; + remote-endpoint = <&sor0_in_dc2>; + }; + + dc2_out_sor1: endpoint@1 { + reg = <1>; + remote-endpoint = <&sor1_in_dc2>; + }; + }; + }; }; };
@@ -1044,6 +1124,25 @@ dsia: dsi@15300000 { status = "disabled"; power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dsia_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dsia_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_dsia>; + }; + + dsia_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_dsia>; + }; + }; + }; }; vic@15340000 {
@@ -1072,6 +1171,25 @@ dsib: dsi@15400000 { status = "disabled"; power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dsib_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dsib_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_dsib>; + }; + + dsib_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_dsib>; + }; + }; + }; }; sor0: sor@15540000 {
@@ -1096,6 +1214,29 @@ sor0: sor@15540000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; nvidia,interface = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + sor0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + sor0_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_sor0>; + }; + + sor0_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_sor0>; + }; + + sor0_in_dc2: endpoint@2 { + remote-endpoint = <&dc2_out_sor0>; + }; + }; + }; }; sor1: sor@15580000 {
@@ -1120,6 +1261,29 @@ sor1: sor@15580000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; nvidia,interface = <1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + sor1_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + sor1_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_sor1>; + }; + + sor1_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_sor1>; + }; + + sor1_in_dc2: endpoint@2 { + remote-endpoint = <&dc2_out_sor1>; + }; + }; + }; }; dpaux: dpaux@155c0000 {
drivers/gpu/drm/tegra/dc.c +2 -13
@@ -10,6 +10,7 @@#include <linux/iommu.h> #include <linux/module.h> #include <linux/of_device.h> +#include <linux/of_graph.h> #include <linux/pm_runtime.h> #include <linux/reset.h>
@@ -86,19 +87,6 @@ static inline void tegra_plane_writel(struct tegra_plane *plane, u32 value,tegra_dc_writel (plane->dc, value,tegra_plane_offset (plane, offset)); } -bool tegra_dc_has_output (struct tegra_dc *dc,struct device *dev) -{ -struct device_node *np = dc->dev->of_node; -struct of_phandle_iterator it; -int err; - -of_for_each_phandle (&it, err, np,"nvidia,outputs" ,NULL ,0 ) -if (it.node == dev->of_node) -return true; - -return false; -} -/* * Double-buffered registers have two copies: ASSEMBLY and ACTIVE. When the * *_ACT_REQ bits are set the ASSEMBLY copy is latched into the ACTIVE copy.
@@ -2061,6 +2049,7 @@ static int tegra_dc_init(struct host1x_client *client)if (err <0 ) goto cleanup; + dc->base.port =of_graph_get_port_by_id (dc->dev->of_node,0 );drm_crtc_helper_add (&dc->base, &tegra_crtc_helper_funcs);/*
drivers/gpu/drm/tegra/dc.h +0 -1
@@ -144,7 +144,6 @@ struct tegra_dc_window { };/* from dc.c */ -bool tegra_dc_has_output (struct tegra_dc *dc,struct device *dev);void tegra_dc_commit (struct tegra_dc *dc); int tegra_dc_state_setup_clock(struct tegra_dc *dc, struct drm_crtc_state *crtc_state,
drivers/gpu/drm/tegra/output.c +3 -9
@@ -5,6 +5,7 @@*/ #include <drm/drm_atomic_helper.h> +#include <drm/drm_of.h> #include <drm/drm_panel.h> #include <drm/drm_simple_kms_helper.h>
@@ -229,16 +230,9 @@ void tegra_output_find_possible_crtcs(struct tegra_output *output, struct drm_device *drm) {struct device *dev = output->dev; -struct drm_crtc *crtc; -unsigned int mask =0 ; - -drm_for_each_crtc (crtc, drm) { -struct tegra_dc *dc =to_tegra_dc (crtc); - -if (tegra_dc_has_output (dc, dev)) - mask |=drm_crtc_mask (crtc); - } +u32 mask; + mask =drm_of_find_possible_crtcs (drm, dev->of_node);if (mask ==0 ) {dev_warn (dev,"missing output definition for heads in DT\n" ); mask =0x3 ;
--- >8 ---
I do see the benefit of using standard bindings where available, but in this case I think that's hardly an improvement over the current binding, even though it's undocumented.
Quoted 5 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt of the following host1x client modules: · line 348
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +3
-0+ - nvidia,head: The number of the display controller head. This is used to + setup the various types of output to receive video data from the given + head.Not really clear what this is...
This is the same as for the display controller in older Tegra devices. The value is the index of the display controller head, or the instance number of the IP, if that's any clearer. We need this in some places for register programming. We can't always safely derive it in some other way.
Thierry
Rob Herring
maintainerRe: [PATCH 06/38] dt-bindings: display: tegra: Document display-hub
Quoted 75 lines · Thierry Reding
Quoted 7 lines · Rob Herring
Quoted 4 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Tegra186 and later have an additional component in the display pipeline called the display hub. Document the bindings which were missing.
I'd rather this be after the conversion or I'm reviewing it twice.
Okay, I'll reorder the patches accordingly.
Quoted 54 lines
Quoted 54 lines
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.txt | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+)Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +40
-0@@ -297,6 +297,56 @@ of the following host1x client modules: - reset-names: Must include the following entries: - vic +- display-hub: display controller hub + Required properties: + - compatible: "nvidia,tegra<chip>-display" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - disp + - dsc + - hub + - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - misc + - wgrp0 + - wgrp1 + - wgrp2 + - wgrp3 + - wgrp4 + - wgrp5 + - power-domains: A list of phandle and specifiers identifying the power + domains that the display hub is part of. + - ranges: Range of registers used for the display controllers. + + Each subnode of the display hub represents one of the display controllers + available: + + - display: display controller + - compatible: "nvidia,tegra<chip>-dc" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - dc + - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - dcQuoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt of the following host1x client modules: · line 345
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +6
-0+ - power-domains: A list of phandle and specifiers that identify the power + domains that this display controller is part of. + - iommus: A phandle and specifier identifying the SMMU master interface of + this display controller. + - nvidia,outputs: A list of phandles of outputs that this display + controller can drive.Seems like an OF graph should describe this?
Quoted 8 lines
The above documents the current state of affairs. I don't recall exactly why we never merged the bindings, but we've been using this nvidia,outputs property for almost three years now. Changing this would break ABI, although I guess you could say that since this was never documented it can't be ABI. Still, changing this is going to cause old device trees to fail with new kernels. Unless of course if we add some backwards-compatibility mechanism in the driver. But in that case, what exactly do we gain by switching to an OF graph?
Probably nothing at this point. More I was just curious how we ended up with something different.
Quoted 5 lines
Historically, I think nvidia,outputs was introduced before OF graphs were "a thing", at least in DRM. According to the git log, the helpers for graphs were introduced a couple of years before nvidia,outputs was used, but I guess they must not have been widespread enough for me to have been aware of them.
There was a period display subsystem bindings were pretty much un-reviewed...
Quoted 329 lines
Anyway, irrespective of the compatibility issues, I tried to use an OF graph to describe this and here's what I came up with:
--- >8 ---
arch/arm64/boot/dts/nvidia/tegra186.dtsi | 170 ++++++++++++++++++++++++++++++- drivers/gpu/drm/tegra/dc.c | 15 +-- drivers/gpu/drm/tegra/dc.h | 1 - drivers/gpu/drm/tegra/output.c | 12 +-- 4 files changed, 172 insertions(+), 26 deletions(-)arch/arm64/boot/dts/nvidia/tegra186.dtsi +167
-3@@ -994,8 +994,38 @@ display@15200000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; iommus = <&smmu TEGRA186_SID_NVDISPLAY>; - nvidia,outputs = <&dsia &dsib &sor0 &sor1>; nvidia,head = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dc0_out: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dc0_out_dsia: endpoint@0 { + reg = <0>; + remote-endpoint = <&dsia_in_dc0>; + }; + + dc0_out_dsib: endpoint@1 { + reg = <1>; + remote-endpoint = <&dsib_in_dc0>; + }; + + dc0_out_sor0: endpoint@2 { + reg = <2>; + remote-endpoint = <&sor0_in_dc0>; + }; + + dc0_out_sor1: endpoint@3 { + reg = <3>; + remote-endpoint = <&sor1_in_dc0>; + }; + }; + }; }; display@15210000 {@@ -1010,8 +1040,38 @@ display@15210000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISPB>; iommus = <&smmu TEGRA186_SID_NVDISPLAY>; - nvidia,outputs = <&dsia &dsib &sor0 &sor1>; nvidia,head = <1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dc1_out: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dc1_out_dsia: endpoint@0 { + reg = <0>; + remote-endpoint = <&dsia_in_dc1>; + }; + + dc1_out_dsib: endpoint@1 { + reg = <1>; + remote-endpoint = <&dsib_in_dc1>; + }; + + dc1_out_sor0: endpoint@2 { + reg = <2>; + remote-endpoint = <&sor0_in_dc1>; + }; + + dc1_out_sor1: endpoint@3 { + reg = <3>; + remote-endpoint = <&sor1_in_dc1>; + }; + }; + }; }; display@15220000 {@@ -1026,8 +1086,28 @@ display@15220000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISPC>; iommus = <&smmu TEGRA186_SID_NVDISPLAY>; - nvidia,outputs = <&sor0 &sor1>; nvidia,head = <2>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dc2_out: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dc2_out_sor0: endpoint@0 { + reg = <0>; + remote-endpoint = <&sor0_in_dc2>; + }; + + dc2_out_sor1: endpoint@1 { + reg = <1>; + remote-endpoint = <&sor1_in_dc2>; + }; + }; + }; }; };@@ -1044,6 +1124,25 @@ dsia: dsi@15300000 { status = "disabled"; power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dsia_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dsia_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_dsia>; + }; + + dsia_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_dsia>; + }; + }; + }; }; vic@15340000 {@@ -1072,6 +1171,25 @@ dsib: dsi@15400000 { status = "disabled"; power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dsib_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dsib_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_dsib>; + }; + + dsib_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_dsib>; + }; + }; + }; }; sor0: sor@15540000 {@@ -1096,6 +1214,29 @@ sor0: sor@15540000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; nvidia,interface = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + sor0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + sor0_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_sor0>; + }; + + sor0_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_sor0>; + }; + + sor0_in_dc2: endpoint@2 { + remote-endpoint = <&dc2_out_sor0>; + }; + }; + }; }; sor1: sor@15580000 {@@ -1120,6 +1261,29 @@ sor1: sor@15580000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; nvidia,interface = <1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + sor1_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + sor1_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_sor1>; + }; + + sor1_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_sor1>; + }; + + sor1_in_dc2: endpoint@2 { + remote-endpoint = <&dc2_out_sor1>; + }; + }; + }; }; dpaux: dpaux@155c0000 {drivers/gpu/drm/tegra/dc.c +2
-13@@ -10,6 +10,7 @@#include <linux/iommu.h> #include <linux/module.h> #include <linux/of_device.h> +#include <linux/of_graph.h> #include <linux/pm_runtime.h> #include <linux/reset.h> @@ -86,19 +87,6 @@ static inline void tegra_plane_writel(struct tegra_plane *plane, u32 value,tegra_dc_writel (plane->dc, value,tegra_plane_offset (plane, offset)); } -bool tegra_dc_has_output (struct tegra_dc *dc,struct device *dev) -{ -struct device_node *np = dc->dev->of_node; -struct of_phandle_iterator it; -int err; - -of_for_each_phandle (&it, err, np,"nvidia,outputs" ,NULL ,0 ) -if (it.node == dev->of_node) -return true; - -return false; -} -/* * Double-buffered registers have two copies: ASSEMBLY and ACTIVE. When the * *_ACT_REQ bits are set the ASSEMBLY copy is latched into the ACTIVE copy. @@ -2061,6 +2049,7 @@ static int tegra_dc_init(struct host1x_client *client)if (err <0 ) goto cleanup; + dc->base.port =of_graph_get_port_by_id (dc->dev->of_node,0 );drm_crtc_helper_add (&dc->base, &tegra_crtc_helper_funcs);/* drivers/gpu/drm/tegra/dc.h +0
-1@@ -144,7 +144,6 @@ struct tegra_dc_window { };/* from dc.c */ -bool tegra_dc_has_output (struct tegra_dc *dc,struct device *dev);void tegra_dc_commit (struct tegra_dc *dc); int tegra_dc_state_setup_clock(struct tegra_dc *dc, struct drm_crtc_state *crtc_state,drivers/gpu/drm/tegra/output.c +3
-10@@ -5,6 +5,7 @@*/ #include <drm/drm_atomic_helper.h> +#include <drm/drm_of.h> #include <drm/drm_panel.h> #include <drm/drm_simple_kms_helper.h> @@ -229,16 +230,9 @@ void tegra_output_find_possible_crtcs(struct tegra_output *output, struct drm_device *drm) {struct device *dev = output->dev; -struct drm_crtc *crtc; -unsigned int mask =0 ; - -drm_for_each_crtc (crtc, drm) { -struct tegra_dc *dc =to_tegra_dc (crtc); - -if (tegra_dc_has_output (dc, dev)) - mask |=drm_crtc_mask (crtc); - } +u32 mask; + mask =drm_of_find_possible_crtcs (drm, dev->of_node);if (mask ==0 ) {dev_warn (dev,"missing output definition for heads in DT\n" ); mask =0x3 ; --- >8 ---I do see the benefit of using standard bindings where available, but in this case I think that's hardly an improvement over the current binding, even though it's undocumented.
Quoted 4 lines
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +3
-0+ - nvidia,head: The number of the display controller head. This is used to + setup the various types of output to receive video data from the given + head.
Quoted 7 lines
Quoted 1 line
Not really clear what this is...
This is the same as for the display controller in older Tegra devices. The value is the index of the display controller head, or the instance number of the IP, if that's any clearer. We need this in some places for register programming. We can't always safely derive it in some other way.
Index, humm. I'll pretend I didn't ask...
Rob
Re: [PATCH 06/38] dt-bindings: display: tegra: Document display-hub
Quoted 85 lines · Rob Herring
Quoted 75 lines · Thierry Reding
Quoted 7 lines · Rob Herring
Quoted 4 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Tegra186 and later have an additional component in the display pipeline called the display hub. Document the bindings which were missing.
I'd rather this be after the conversion or I'm reviewing it twice.
Okay, I'll reorder the patches accordingly.
Quoted 54 lines
Quoted 54 lines
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.txt | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+)Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +40
-0@@ -297,6 +297,56 @@ of the following host1x client modules: - reset-names: Must include the following entries: - vic +- display-hub: display controller hub + Required properties: + - compatible: "nvidia,tegra<chip>-display" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - disp + - dsc + - hub + - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - misc + - wgrp0 + - wgrp1 + - wgrp2 + - wgrp3 + - wgrp4 + - wgrp5 + - power-domains: A list of phandle and specifiers identifying the power + domains that the display hub is part of. + - ranges: Range of registers used for the display controllers. + + Each subnode of the display hub represents one of the display controllers + available: + + - display: display controller + - compatible: "nvidia,tegra<chip>-dc" + - reg: Physical base address and length of the controller's registers. + - interrupts: The interrupt outputs from the controller. + - clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. + - clock-names: Must include the following entries: + - dc + - resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names: Must include the following entries: + - dcQuoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt of the following host1x client modules: · line 345
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +6
-0+ - power-domains: A list of phandle and specifiers that identify the power + domains that this display controller is part of. + - iommus: A phandle and specifier identifying the SMMU master interface of + this display controller. + - nvidia,outputs: A list of phandles of outputs that this display + controller can drive.Seems like an OF graph should describe this?
Quoted 8 lines
The above documents the current state of affairs. I don't recall exactly why we never merged the bindings, but we've been using this nvidia,outputs property for almost three years now. Changing this would break ABI, although I guess you could say that since this was never documented it can't be ABI. Still, changing this is going to cause old device trees to fail with new kernels. Unless of course if we add some backwards-compatibility mechanism in the driver. But in that case, what exactly do we gain by switching to an OF graph?
Quoted 2 lines
Probably nothing at this point. More I was just curious how we ended up with something different.
So does that mean yes or no? Do you want me to proceed with what's currently used or should I switch to the OF graph version?
Quoted 339 lines
Quoted 5 lines
Historically, I think nvidia,outputs was introduced before OF graphs were "a thing", at least in DRM. According to the git log, the helpers for graphs were introduced a couple of years before nvidia,outputs was used, but I guess they must not have been widespread enough for me to have been aware of them.
There was a period display subsystem bindings were pretty much un-reviewed...
Quoted 331 lines
Anyway, irrespective of the compatibility issues, I tried to use an OF graph to describe this and here's what I came up with:
--- >8 ---
arch/arm64/boot/dts/nvidia/tegra186.dtsi | 170 ++++++++++++++++++++++++++++++- drivers/gpu/drm/tegra/dc.c | 15 +-- drivers/gpu/drm/tegra/dc.h | 1 - drivers/gpu/drm/tegra/output.c | 12 +-- 4 files changed, 172 insertions(+), 26 deletions(-)arch/arm64/boot/dts/nvidia/tegra186.dtsi +167
-3@@ -994,8 +994,38 @@ display@15200000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; iommus = <&smmu TEGRA186_SID_NVDISPLAY>; - nvidia,outputs = <&dsia &dsib &sor0 &sor1>; nvidia,head = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dc0_out: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dc0_out_dsia: endpoint@0 { + reg = <0>; + remote-endpoint = <&dsia_in_dc0>; + }; + + dc0_out_dsib: endpoint@1 { + reg = <1>; + remote-endpoint = <&dsib_in_dc0>; + }; + + dc0_out_sor0: endpoint@2 { + reg = <2>; + remote-endpoint = <&sor0_in_dc0>; + }; + + dc0_out_sor1: endpoint@3 { + reg = <3>; + remote-endpoint = <&sor1_in_dc0>; + }; + }; + }; }; display@15210000 {@@ -1010,8 +1040,38 @@ display@15210000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISPB>; iommus = <&smmu TEGRA186_SID_NVDISPLAY>; - nvidia,outputs = <&dsia &dsib &sor0 &sor1>; nvidia,head = <1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dc1_out: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dc1_out_dsia: endpoint@0 { + reg = <0>; + remote-endpoint = <&dsia_in_dc1>; + }; + + dc1_out_dsib: endpoint@1 { + reg = <1>; + remote-endpoint = <&dsib_in_dc1>; + }; + + dc1_out_sor0: endpoint@2 { + reg = <2>; + remote-endpoint = <&sor0_in_dc1>; + }; + + dc1_out_sor1: endpoint@3 { + reg = <3>; + remote-endpoint = <&sor1_in_dc1>; + }; + }; + }; }; display@15220000 {@@ -1026,8 +1086,28 @@ display@15220000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISPC>; iommus = <&smmu TEGRA186_SID_NVDISPLAY>; - nvidia,outputs = <&sor0 &sor1>; nvidia,head = <2>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dc2_out: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dc2_out_sor0: endpoint@0 { + reg = <0>; + remote-endpoint = <&sor0_in_dc2>; + }; + + dc2_out_sor1: endpoint@1 { + reg = <1>; + remote-endpoint = <&sor1_in_dc2>; + }; + }; + }; }; };@@ -1044,6 +1124,25 @@ dsia: dsi@15300000 { status = "disabled"; power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dsia_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dsia_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_dsia>; + }; + + dsia_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_dsia>; + }; + }; + }; }; vic@15340000 {@@ -1072,6 +1171,25 @@ dsib: dsi@15400000 { status = "disabled"; power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dsib_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dsib_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_dsib>; + }; + + dsib_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_dsib>; + }; + }; + }; }; sor0: sor@15540000 {@@ -1096,6 +1214,29 @@ sor0: sor@15540000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; nvidia,interface = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + sor0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + sor0_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_sor0>; + }; + + sor0_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_sor0>; + }; + + sor0_in_dc2: endpoint@2 { + remote-endpoint = <&dc2_out_sor0>; + }; + }; + }; }; sor1: sor@15580000 {@@ -1120,6 +1261,29 @@ sor1: sor@15580000 { power-domains = <&bpmp TEGRA186_POWER_DOMAIN_DISP>; nvidia,interface = <1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + sor1_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + sor1_in_dc0: endpoint@0 { + remote-endpoint = <&dc0_out_sor1>; + }; + + sor1_in_dc1: endpoint@1 { + remote-endpoint = <&dc1_out_sor1>; + }; + + sor1_in_dc2: endpoint@2 { + remote-endpoint = <&dc2_out_sor1>; + }; + }; + }; }; dpaux: dpaux@155c0000 {drivers/gpu/drm/tegra/dc.c +2
-13@@ -10,6 +10,7 @@#include <linux/iommu.h> #include <linux/module.h> #include <linux/of_device.h> +#include <linux/of_graph.h> #include <linux/pm_runtime.h> #include <linux/reset.h> @@ -86,19 +87,6 @@ static inline void tegra_plane_writel(struct tegra_plane *plane, u32 value,tegra_dc_writel (plane->dc, value,tegra_plane_offset (plane, offset)); } -bool tegra_dc_has_output (struct tegra_dc *dc,struct device *dev) -{ -struct device_node *np = dc->dev->of_node; -struct of_phandle_iterator it; -int err; - -of_for_each_phandle (&it, err, np,"nvidia,outputs" ,NULL ,0 ) -if (it.node == dev->of_node) -return true; - -return false; -} -/* * Double-buffered registers have two copies: ASSEMBLY and ACTIVE. When the * *_ACT_REQ bits are set the ASSEMBLY copy is latched into the ACTIVE copy. @@ -2061,6 +2049,7 @@ static int tegra_dc_init(struct host1x_client *client)if (err <0 ) goto cleanup; + dc->base.port =of_graph_get_port_by_id (dc->dev->of_node,0 );drm_crtc_helper_add (&dc->base, &tegra_crtc_helper_funcs);/* drivers/gpu/drm/tegra/dc.h +0
-1@@ -144,7 +144,6 @@ struct tegra_dc_window { };/* from dc.c */ -bool tegra_dc_has_output (struct tegra_dc *dc,struct device *dev);void tegra_dc_commit (struct tegra_dc *dc); int tegra_dc_state_setup_clock(struct tegra_dc *dc, struct drm_crtc_state *crtc_state,drivers/gpu/drm/tegra/output.c +3
-10@@ -5,6 +5,7 @@*/ #include <drm/drm_atomic_helper.h> +#include <drm/drm_of.h> #include <drm/drm_panel.h> #include <drm/drm_simple_kms_helper.h> @@ -229,16 +230,9 @@ void tegra_output_find_possible_crtcs(struct tegra_output *output, struct drm_device *drm) {struct device *dev = output->dev; -struct drm_crtc *crtc; -unsigned int mask =0 ; - -drm_for_each_crtc (crtc, drm) { -struct tegra_dc *dc =to_tegra_dc (crtc); - -if (tegra_dc_has_output (dc, dev)) - mask |=drm_crtc_mask (crtc); - } +u32 mask; + mask =drm_of_find_possible_crtcs (drm, dev->of_node);if (mask ==0 ) {dev_warn (dev,"missing output definition for heads in DT\n" ); mask =0x3 ; --- >8 ---I do see the benefit of using standard bindings where available, but in this case I think that's hardly an improvement over the current binding, even though it's undocumented.
Quoted 5 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt of the following host1x client modules: · line 348
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +3
-0+ - nvidia,head: The number of the display controller head. This is used to + setup the various types of output to receive video data from the given + head.Not really clear what this is...
Quoted 7 lines
Quoted 5 lines
This is the same as for the display controller in older Tegra devices. The value is the index of the display controller head, or the instance number of the IP, if that's any clearer. We need this in some places for register programming. We can't always safely derive it in some other way.
Index, humm. I'll pretend I didn't ask...
Do you have a better suggestion? If we break ABI for the OF graph thing maybe we should role this ABI break in at the same time. This should be safe to do on Tegra because I'm not aware of any devices that will boot with a DTB from a read-only location.
Thierry
PATCH 7/38 dt-bindings: display: tegra: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Tegra host1x controller bindings from the free-form text format to json-schema.
--- .../display/tegra/nvidia,tegra20-host1x.txt | 516 ------ .../display/tegra/nvidia,tegra20-host1x.yaml | 1418 +++++++++++++++++ 2 files changed, 1418 insertions(+), 516 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt create mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt deleted +0 -516
@@ -1,516 +0,0 @@ -NVIDIA Tegra host1x - -Required properties: -- compatible: "nvidia,tegra<chip>-host1x" -- reg: Physical base address and length of the controller's registers. - For pre-Tegra186, one entry describing the whole register area. - For Tegra186, one entry for each entry in reg-names: - "vm" - VM region assigned to Linux - "hypervisor" - Hypervisor region (only if Linux acts as hypervisor) -- interrupts: The interrupt outputs from the controller. -- #address-cells: The number of cells used to represent physical base addresses - in the host1x address space. Should be 1. -- #size-cells: The number of cells used to represent the size of an address - range in the host1x address space. Should be 1. -- ranges: The mapping of the host1x address space to the CPU address space. -- clocks: Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. -- resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names: Must include the following entries: - - host1x - -The host1x top-level node defines a number of children, each representing one -of the following host1x client modules: - -- mpe: video encoder - - Required properties: - - compatible: "nvidia,tegra<chip>-mpe" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - mpe - -- vi: video input - - Required properties: - - compatible: "nvidia,tegra<chip>-vi" - - reg: Physical base address and length of the controller registers. - - interrupts: The interrupt outputs from the controller. - - clocks: clocks: Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. - - Tegra20/Tegra30/Tegra114/Tegra124: - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - vi - - Tegra210: - - power-domains: Must include venc powergate node as vi is in VE partition. - - Tegra210 has CSI part of VI sharing same host interface and register space. - So, VI device node should have CSI child node. - - - csi: mipi csi interface to vi - - Required properties: - - compatible: "nvidia,tegra210-csi" - - reg: Physical base address offset to parent and length of the controller - registers. - - clocks: Must contain entries csi, cilab, cilcd, cile, csi_tpg clocks. - See ../clocks/clock-bindings.txt for details. - - power-domains: Must include sor powergate node as csicil is in - SOR partition. - -- epp: encoder pre-processor - - Required properties: - - compatible: "nvidia,tegra<chip>-epp" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - epp - -- isp: image signal processor - - Required properties: - - compatible: "nvidia,tegra<chip>-isp" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - isp - -- gr2d: 2D graphics engine - - Required properties: - - compatible: "nvidia,tegra<chip>-gr2d" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - 2d - -- gr3d: 3D graphics engine - - Required properties: - - compatible: "nvidia,tegra<chip>-gr3d" - - reg: Physical base address and length of the controller's registers. - - clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. - - clock-names: Must include the following entries: - (This property may be omitted if the only clock in the list is "3d") - - 3d - This MUST be the first entry. - - 3d2 (Only required on SoCs with two 3D clocks) - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - 3d - - 3d2 (Only required on SoCs with two 3D clocks) - -- dc: display controller - - Required properties: - - compatible: "nvidia,tegra<chip>-dc" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. - - clock-names: Must include the following entries: - - dc - This MUST be the first entry. - - parent - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - dc - - nvidia,head: The number of the display controller head. This is used to - setup the various types of output to receive video data from the given - head. - - Each display controller node has a child node, named "rgb", that represents - the RGB output associated with the controller. It can take the following - optional properties: - - nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing - - nvidia,hpd-gpio: specifies a GPIO used for hotplug detection - - nvidia,edid: supplies a binary EDID blob - - nvidia,panel: phandle of a display panel - -- hdmi: High Definition Multimedia Interface - - Required properties: - - compatible: "nvidia,tegra<chip>-hdmi" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - hdmi-supply: supply for the +5V HDMI connector pin - - vdd-supply: regulator for supply voltage - - pll-supply: regulator for PLL - - clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. - - clock-names: Must include the following entries: - - hdmi - This MUST be the first entry. - - parent - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - hdmi - - Optional properties: - - nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing - - nvidia,hpd-gpio: specifies a GPIO used for hotplug detection - - nvidia,edid: supplies a binary EDID blob - - nvidia,panel: phandle of a display panel - -- tvo: TV encoder output - - Required properties: - - compatible: "nvidia,tegra<chip>-tvo" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. - -- dsi: display serial interface - - Required properties: - - compatible: "nvidia,tegra<chip>-dsi" - - reg: Physical base address and length of the controller's registers. - - clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. - - clock-names: Must include the following entries: - - dsi - This MUST be the first entry. - - lp - - parent - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - dsi - - avdd-dsi-supply: phandle of a supply that powers the DSI controller - - nvidia,mipi-calibrate: Should contain a phandle and a specifier specifying - which pads are used by this DSI output and need to be calibrated. See also - ../display/tegra/nvidia,tegra114-mipi.txt. - - Optional properties: - - nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing - - nvidia,hpd-gpio: specifies a GPIO used for hotplug detection - - nvidia,edid: supplies a binary EDID blob - - nvidia,panel: phandle of a display panel - - nvidia,ganged-mode: contains a phandle to a second DSI controller to gang - up with in order to support up to 8 data lanes - -- sor: serial output resource - - Required properties: - - compatible: Should be: - - "nvidia,tegra124-sor": for Tegra124 and Tegra132 - - "nvidia,tegra132-sor": for Tegra132 - - "nvidia,tegra210-sor": for Tegra210 - - "nvidia,tegra210-sor1": for Tegra210 - - "nvidia,tegra186-sor": for Tegra186 - - "nvidia,tegra186-sor1": for Tegra186 - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. - - clock-names: Must include the following entries: - - sor: clock input for the SOR hardware - - out: SOR output clock - - parent: input for the pixel clock - - dp: reference clock for the SOR clock - - safe: safe reference for the SOR clock during power up - - For Tegra186 and later: - - pad: SOR pad output clock (on Tegra186 and later) - - Obsolete: - - source: source clock for the SOR clock (obsolete, use "out" instead) - - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - sor - - Required properties on Tegra186 and later: - - nvidia,interface: index of the SOR interface - - Optional properties: - - nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing - - nvidia,hpd-gpio: specifies a GPIO used for hotplug detection - - nvidia,edid: supplies a binary EDID blob - - nvidia,panel: phandle of a display panel - - nvidia,xbar-cfg: 5 cells containing the crossbar configuration. Each lane - of the SOR, identified by the cell's index, is mapped via the crossbar to - the pad specified by the cell's value. - - Optional properties when driving an eDP output: - - nvidia,dpaux: phandle to a DispayPort AUX interface - -- dpaux: DisplayPort AUX interface - - compatible : Should contain one of the following: - - "nvidia,tegra124-dpaux": for Tegra124 and Tegra132 - - "nvidia,tegra210-dpaux": for Tegra210 - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. - - clock-names: Must include the following entries: - - dpaux: clock input for the DPAUX hardware - - parent: reference clock - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - dpaux - - vdd-supply: phandle of a supply that powers the DisplayPort link - - i2c-bus: Subnode where I2C slave devices are listed. This subnode - must be always present. If there are no I2C slave devices, an empty - node should be added. See ../../i2c/i2c.txt for more information. - - See ../pinctrl/nvidia,tegra124-dpaux-padctl.txt for information - regarding the DPAUX pad controller bindings. - -- vic: Video Image Compositor - - compatible : "nvidia,tegra<chip>-vic" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. - - clock-names: Must include the following entries: - - vic: clock input for the VIC hardware - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - vic - -- display-hub: display controller hub - Required properties: - - compatible: "nvidia,tegra<chip>-display" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. - - clock-names: Must include the following entries: - - disp - - dsc - - hub - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - misc - - wgrp0 - - wgrp1 - - wgrp2 - - wgrp3 - - wgrp4 - - wgrp5 - - power-domains: A list of phandle and specifiers identifying the power - domains that the display hub is part of. - - ranges: Range of registers used for the display controllers. - - Each subnode of the display hub represents one of the display controllers - available: - - - display: display controller - - compatible: "nvidia,tegra<chip>-dc" - - reg: Physical base address and length of the controller's registers. - - interrupts: The interrupt outputs from the controller. - - clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. - - clock-names: Must include the following entries: - - dc - - resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. - - reset-names: Must include the following entries: - - dc - - power-domains: A list of phandle and specifiers that identify the power - domains that this display controller is part of. - - iommus: A phandle and specifier identifying the SMMU master interface of - this display controller. - - nvidia,outputs: A list of phandles of outputs that this display - controller can drive. - - nvidia,head: The number of the display controller head. This is used to - setup the various types of output to receive video data from the given - head. - -Example: - -/ { - ... - - host1x { - compatible = "nvidia,tegra20-host1x", "simple-bus"; - reg = <0x50000000 0x00024000>; - interrupts = <0 65 0x04 /* mpcore syncpt */ - 0 67 0x04>; /* mpcore general */ - clocks = <&tegra_car TEGRA20_CLK_HOST1X>; - resets = <&tegra_car 28>; - reset-names = "host1x"; - - #address-cells = <1>; - #size-cells = <1>; - - ranges = <0x54000000 0x54000000 0x04000000>; - - mpe { - compatible = "nvidia,tegra20-mpe"; - reg = <0x54040000 0x00040000>; - interrupts = <0 68 0x04>; - clocks = <&tegra_car TEGRA20_CLK_MPE>; - resets = <&tegra_car 60>; - reset-names = "mpe"; - }; - - vi@54080000 { - compatible = "nvidia,tegra210-vi"; - reg = <0x0 0x54080000 0x0 0x700>; - interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>; - assigned-clocks = <&tegra_car TEGRA210_CLK_VI>; - assigned-clock-parents = <&tegra_car TEGRA210_CLK_PLL_C4_OUT0>; - - clocks = <&tegra_car TEGRA210_CLK_VI>; - power-domains = <&pd_venc>; - - #address-cells = <1>; - #size-cells = <1>; - - ranges = <0x0 0x0 0x54080000 0x2000>; - - csi@838 { - compatible = "nvidia,tegra210-csi"; - reg = <0x838 0x1300>; - assigned-clocks = <&tegra_car TEGRA210_CLK_CILAB>, - <&tegra_car TEGRA210_CLK_CILCD>, - <&tegra_car TEGRA210_CLK_CILE>, - <&tegra_car TEGRA210_CLK_CSI_TPG>; - assigned-clock-parents = <&tegra_car TEGRA210_CLK_PLL_P>, - <&tegra_car TEGRA210_CLK_PLL_P>, - <&tegra_car TEGRA210_CLK_PLL_P>; - assigned-clock-rates = <102000000>, - <102000000>, - <102000000>, - <972000000>; - - clocks = <&tegra_car TEGRA210_CLK_CSI>, - <&tegra_car TEGRA210_CLK_CILAB>, - <&tegra_car TEGRA210_CLK_CILCD>, - <&tegra_car TEGRA210_CLK_CILE>, - <&tegra_car TEGRA210_CLK_CSI_TPG>; - clock-names = "csi", "cilab", "cilcd", "cile", "csi_tpg"; - power-domains = <&pd_sor>; - }; - }; - - epp { - compatible = "nvidia,tegra20-epp"; - reg = <0x540c0000 0x00040000>; - interrupts = <0 70 0x04>; - clocks = <&tegra_car TEGRA20_CLK_EPP>; - resets = <&tegra_car 19>; - reset-names = "epp"; - }; - - isp { - compatible = "nvidia,tegra20-isp"; - reg = <0x54100000 0x00040000>; - interrupts = <0 71 0x04>; - clocks = <&tegra_car TEGRA20_CLK_ISP>; - resets = <&tegra_car 23>; - reset-names = "isp"; - }; - - gr2d { - compatible = "nvidia,tegra20-gr2d"; - reg = <0x54140000 0x00040000>; - interrupts = <0 72 0x04>; - clocks = <&tegra_car TEGRA20_CLK_GR2D>; - resets = <&tegra_car 21>; - reset-names = "2d"; - }; - - gr3d { - compatible = "nvidia,tegra20-gr3d"; - reg = <0x54180000 0x00040000>; - clocks = <&tegra_car TEGRA20_CLK_GR3D>; - resets = <&tegra_car 24>; - reset-names = "3d"; - }; - - dc@54200000 { - compatible = "nvidia,tegra20-dc"; - reg = <0x54200000 0x00040000>; - interrupts = <0 73 0x04>; - clocks = <&tegra_car TEGRA20_CLK_DISP1>, - <&tegra_car TEGRA20_CLK_PLL_P>; - clock-names = "dc", "parent"; - resets = <&tegra_car 27>; - reset-names = "dc"; - - rgb { - status = "disabled"; - }; - }; - - dc@54240000 { - compatible = "nvidia,tegra20-dc"; - reg = <0x54240000 0x00040000>; - interrupts = <0 74 0x04>; - clocks = <&tegra_car TEGRA20_CLK_DISP2>, - <&tegra_car TEGRA20_CLK_PLL_P>; - clock-names = "dc", "parent"; - resets = <&tegra_car 26>; - reset-names = "dc"; - - rgb { - status = "disabled"; - }; - }; - - hdmi { - compatible = "nvidia,tegra20-hdmi"; - reg = <0x54280000 0x00040000>; - interrupts = <0 75 0x04>; - clocks = <&tegra_car TEGRA20_CLK_HDMI>, - <&tegra_car TEGRA20_CLK_PLL_D_OUT0>; - clock-names = "hdmi", "parent"; - resets = <&tegra_car 51>; - reset-names = "hdmi"; - status = "disabled"; - }; - - tvo { - compatible = "nvidia,tegra20-tvo"; - reg = <0x542c0000 0x00040000>; - interrupts = <0 76 0x04>; - clocks = <&tegra_car TEGRA20_CLK_TVO>; - status = "disabled"; - }; - - dsi { - compatible = "nvidia,tegra20-dsi"; - reg = <0x54300000 0x00040000>; - clocks = <&tegra_car TEGRA20_CLK_DSI>, - <&tegra_car TEGRA20_CLK_PLL_D_OUT0>; - clock-names = "dsi", "parent"; - resets = <&tegra_car 48>; - reset-names = "dsi"; - status = "disabled"; - }; - }; - - ... -};
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +1418 -0
1,418 lines not on this page · raw message
Signature · 1 line
2.24.1
Re: [PATCH 07/38] dt-bindings: display: tegra: Convert to json-schema
12.06.2020 17:18, Thierry Reding пишет:
Quoted 7 lines
From: Thierry Reding <[email protected]>
Convert the Tegra host1x controller bindings from the free-form text format to json-schema.
Signed-off-by Thierry Reding <[email protected]>---
...
Quoted 5 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +5
-0+ memory-controllers: + $ref: /schemas/types.yaml#/definitions/phandle-array + +required: + - compatible
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 114
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ - interrupts + - interrupt-names + - '#address-cells' + - '#size-cells' + - ranges + - reg + - clocks + - clock-names + - resets + - reset-names
This memory-controllers property didn't exist before the conversion. So this is not a pure conversion, which makes it a bit difficult to review the changes. Could you please factor out the addition of new properties into a separate patch?
Re: [PATCH 07/38] dt-bindings: display: tegra: Convert to json-schema
Quoted 21 lines · Dmitry Osipenko
12.06.2020 17:18, Thierry Reding пишет:
Quoted 7 lines
From: Thierry Reding <[email protected]>
Convert the Tegra host1x controller bindings from the free-form text format to json-schema.
Signed-off-by Thierry Reding <[email protected]>---
...
Quoted 12 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +12
-0+ memory-controllers: + $ref: /schemas/types.yaml#/definitions/phandle-array + +required: + - compatible + - interrupts + - interrupt-names + - '#address-cells' + - '#size-cells' + - ranges + - reg + - clocks
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 114
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +3
-0+ - clock-names + - resets + - reset-namesThis memory-controllers property didn't exist before the conversion. So this is not a pure conversion, which makes it a bit difficult to review the changes. Could you please factor out the addition of new properties into a separate patch?
The memory-controllers property was from an earlier draft of this series and is no longer needed. I'll remove it.
In my opinion, these schema conversion patches are difficult to review in general, especially the likes of this one for host1x because they are fairly complex to begin with. All existing Tegra-based device trees do pass validation (although there's a small patch needed to support the unevaluatedProperties keyword that's new in json-schema draft-08), which gives me some confidence that they are at least correct from a content point of view.
Thierry
Rob Herring
maintainerRe: [PATCH 07/38] dt-bindings: display: tegra: Convert to json-schema
In reply to Thierry RedingQuoted 61 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the Tegra host1x controller bindings from the free-form text format to json-schema.
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.txt | 516 ------ .../display/tegra/nvidia,tegra20-host1x.yaml | 1418 +++++++++++++++++ 2 files changed, 1418 insertions(+), 516 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt create mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yamlDocumentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +41
-0@@ -0,0 +1,1418 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/tegra/nvidia,tegra20-host1x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra host1x controller + +maintainers: + - Thierry Reding <[email protected]> + - Jon Hunter <[email protected]> + +description: The host1x top-level node defines a number of children, each + representing one of the host1x client modules defined in this binding. + +properties: + # required + compatible: + oneOf: + - description: NVIDIA Tegra20 + items: + - const: nvidia,tegra20-host1x + + - description: NVIDIA Tegra30 + items: + - const: nvidia,tegra30-host1x + + - description: NVIDIA Tegra114 + items: + - const: nvidia,tegra114-host1x + + - description: NVIDIA Tegra124 + items: + - const: nvidia,tegra124-host1x + + - description: NVIDIA Tegra132 + items: + - const: nvidia,tegra132-host1x + - const: nvidia,tegra124-host1x + + - description: NVIDIA Tegra210
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 51
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ items: + - const: nvidia,tegra210-host1x + + - description: NVIDIA Tegra186 + items: + - const: nvidia,tegra186-host1x + + - description: NVIDIA Tegra194 + items: + - const: nvidia,tegra194-host1x
I don't think the descriptions really add much. I'd rather see all the single entry cases as 1 'enum'.
Quoted 14 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +14
-0+ + interrupts: + items: + - description: host1x syncpoint interrupt + - description: host1x general interrupt + minItems: 1 + maxItems: 2 + + interrupt-names: + items: + - const: syncpt + - const: host1x + + '#address-cells':
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 75
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ description: The number of cells used to represent physical base addresses + in the host1x address space. + enum: [1, 2] + + '#size-cells': + description: The number of cells used to represent the size of an address + range in the host1x address space. + enum: [1, 2] + + # required
Odd comment...
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 78
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +3
-0+ ranges: + description: The mapping of the host1x address space to the CPU address + space.
That's every 'ranges'. If you know how many entries, then define 'maxItems'. If not, 'ranges: true' is enough.
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ + clocks: + description: Must contain one entry, for the module clock. See + ../clocks/clock-bindings.txt for details. + + clock-names: + items: + - const: host1x + + resets:
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 98
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ description: Must contain an entry for each entry in reset-names. See + ../reset/reset.txt for details. + + reset-names: + items: + - const: host1x + + # optional + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus"
This is already applied to every 'iommus' property, so you just need to define how many entries.
Quoted 47 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +47
-0+ + memory-controllers: + $ref: /schemas/types.yaml#/definitions/phandle-array + +required: + - compatible + - interrupts + - interrupt-names + - '#address-cells' + - '#size-cells' + - ranges + - reg + - clocks + - clock-names + - resets + - reset-names + +unevaluatedProperties: false + +allOf: + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra186-host1x + - nvidia,tegra194-host1x + then: + properties: + reg-names: + items: + - const: hypervisor + - const: vm + + reg: + items: + - description: physical base address and length of the register + region assigned to the VM + - description: physical base address and length of the register + region used by the hypervisor + + required: + - reg-names + else: + properties: + reg: + maxItems: 1
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 155
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ + - if: + properties: + compatible: + contains: + oneOf: + - const: nvidia,tegra20-host1x + - const: nvidia,tegra30-host1x + - const: nvidia,tegra114-host1x + - const: nvidia,tegra124-host1x
Use 'enum'.
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 168
Quoted 13 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +13
-0+ + then: + patternProperties: + "^vi@[0-9a-f]+$": + description: video input + type: object + properties: + compatible: + oneOf: + - const: nvidia,tegra20-vi + - const: nvidia,tegra30-vi + - const: nvidia,tegra114-vi + - const: nvidia,tegra124-vi
Use a 'enum' for these 4.
Quoted 40 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +40
-0+ - items: + - const: nvidia,tegra132-vi + - const: nvidia,tegra124-vi + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: true + + reset-names: + items: + - const: vi + else: + patternProperties: + "^vi@[0-9a-f]+$": + description: video input + type: object + properties: + compatible: + oneOf: + - const: nvidia,tegra210-vi + - const: nvidia,tegra186-vi + - const: nvidia,tegra194-vi + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + power-domains: true
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 218
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ + - if: + properties: + compatible: + contains: + oneOf: + - const: nvidia,tegra210-host1x + then: + patternProperties: + "^vi@[0-9a-f]+$":
type: object
Quoted 54 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +54
-0+ patternProperties: + "^csi@[0-9a-f]+$": + description: camera sensor interface + type: object + properties: + compatible: + enum: + - nvidia,tegra210-csi + + reg: true + + clocks: true + + clock-names: + items: + - const: csi + - const: cilab + - const: cilcd + - const: cile + - const: csi_tpg + + power-domains: true + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-host1x + - nvidia,tegra30-host1x + - nvidia,tegra114-host1x + then: + patternProperties: + "^epp@[0-9a-f]+$": + description: encoder pre-processor + type: object + properties: + compatible: + enum: + - nvidia,tegra20-epp + - nvidia,tegra30-epp + - nvidia,tegra114-epp + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + items:
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 282
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ - description: module reset + + reset-names: + items: + - const: epp + + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" + + unevaluatedProperties: false
I think 'additionalProperties: false' will work here.
Quoted 460 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +460
-0+ + "^mpe@[0-9a-f]+$": + description: video encoder + type: object + properties: + compatible: + enum: + - nvidia,tegra20-mpe + - nvidia,tegra30-mpe + - nvidia,tegra114-mpe + + reg: + minItems: 1 + maxItems: 1 + + interrupts: + minItems: 1 + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 1 + + resets: + minItems: 1 + maxItems: 1 + + reset-names: + items: + - const: mpe + + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" + + unevaluatedProperties: false + + "^gr2d@[0-9a-f]+$": + description: 2D graphics engine + type: object + properties: + compatible: + enum: + - nvidia,tegra20-gr2d + - nvidia,tegra30-gr2d + - nvidia,tegra114-gr2d + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + items: + - description: module reset + + reset-names: + items: + - const: 2d + + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" + + unevaluatedProperties: false + + "^gr3d@[0-9a-f]+$": + description: 3D graphics engine + type: object + properties: + compatible: + enum: + - nvidia,tegra20-gr3d + - nvidia,tegra30-gr3d + - nvidia,tegra114-gr3d + + reg: + maxItems: 1 + + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" + + allOf: + - if: + properties: + compatible: + contains: + const: nvidia,tegra30-gr3d + then: + properties: + clocks: + items: + - description: primary module clock + - description: secondary module clock + + clock-names: + items: + - const: 3d + - const: 3d2 + + resets: + items: + - description: primary module reset + - description: secondary module reset + + reset-names: + items: + - const: 3d + - const: 3d2 + else: + properties: + clocks: + items: + - description: module clock + + clock-names: + items: + - const: 3d + + resets: + items: + - description: module reset + + reset-names: + items: + - const: 3d + + unevaluatedProperties: false + + "^tvo@[0-9a-f]+$": + description: TV encoder output + type: object + properties: + # required + compatible: + enum: + - nvidia,tegra20-tvo + - nvidia,tegra30-tvo + - nvidia,tegra114-tvo + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + status: + $ref: "/schemas/dt-core.yaml#/properties/status" + + unevaluatedProperties: false + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-host1x + - nvidia,tegra30-host1x + - nvidia,tegra114-host1x + - nvidia,tegra124-host1x + - nvidia,tegra132-host1x + - nvidia,tegra210-host1x + then: + patternProperties: + "^dc@[0-9a-f]+$": + description: display controller + type: object + properties: + compatible: + oneOf: + - const: nvidia,tegra20-dc + - const: nvidia,tegra30-dc + - const: nvidia,tegra114-dc + - const: nvidia,tegra124-dc + - items: + - const: nvidia,tegra124-dc + - const: nvidia,tegra132-dc + - const: nvidia,tegra210-dc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: display controller pixel clock + + clock-names: + items: + - const: dc + + resets: + items: + - description: module reset + + reset-names: + items: + - const: dc + + iommus: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + nvidia,head: + description: The number of the display controller head. This is + used to setup the various types of output to receive video + data from the given head. + $ref: "/schemas/types.yaml#/definitions/uint32" + + allOf: + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-dc + - nvidia,tegra30-dc + - nvidia,tegra114-dc + then: + properties: + rgb: + description: Each display controller node has a child node, + named "rgb", that represents the RGB output associated + with the controller. + type: object + properties: + nvidia,ddc-i2c-bus: + description: phandle of an I2C controller used for DDC + EDID probing + $ref: "/schemas/types.yaml#/definitions/phandle" + + nvidia,hpd-gpio: + description: specifies a GPIO used for hotplug + detection + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + nvidia,edid: + description: supplies a binary EDID blob + $ref: "/schemas/types.yaml#/definitions/uint8-array" + + nvidia,panel: + description: phandle of a display panel + $ref: "/schemas/types.yaml#/definitions/phandle" + + unevaluatedProperties: false + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra186-host1x + - nvidia,tegra194-host1x + then: + patternProperties: + "^display-hub@[0-9a-f]+$": + properties: + compatible: + oneOf: + - description: NVIDIA Tegra186 + const: nvidia,tegra186-display + + - description: NVIDIA Tegra194 + const: nvidia,tegra194-display + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + ranges: + $ref: "/schemas/dt-core.yaml#/properties/ranges" + + status: + $ref: "/schemas/dt-core.yaml#/properties/status" + + resets: + items: + - description: display hub reset + - description: window group 0 reset + - description: window group 1 reset + - description: window group 2 reset + - description: window group 3 reset + - description: window group 4 reset + - description: window group 5 reset + + reset-names: + items: + - const: misc + - const: wgrp0 + - const: wgrp1 + - const: wgrp2 + - const: wgrp3 + - const: wgrp4 + - const: wgrp5 + + power-domains: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + patternProperties: + "^display@[0-9a-f]+$": + description: display controller + type: object + properties: + compatible: + enum: + - nvidia,tegra186-dc + - nvidia,tegra194-dc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: display controller pixel clock + + clock-names: + items: + - const: dc + + resets: + items: + - description: display controller reset + + reset-names: + items: + - const: dc + + power-domains: + description: A list of phandle and specifiers that identify + the power domains that this display controller is part of. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + iommus: + description: a phandle and specifier identifying the SMMU + master interface of this display controller. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + memory-controllers: + $ref: /schemas/types.yaml#/definitions/phandle-array + + nvidia,outputs: + description: A list of phandles of outputs that this display + controller can drive. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + nvidia,head: + description: The number of the display controller head. This + is used to setup the various types of output to receive + video data from the given head. + $ref: "/schemas/types.yaml#/definitions/uint32" + + unevaluatedProperties: false + + allOf: + - if: + properties: + compatible: + contains: + const: nvidia,tegra186-display + then: + properties: + clocks: + items: + - description: display core clock + - description: display stream compression clock + - description: display hub clock + + clock-names: + items: + - const: disp + - const: dsc + - const: hub + else: + properties: + clocks: + items: + - description: display core clock + - description: display hub clock + + clock-names: + items: + - const: disp + - const: hub + + unevaluatedProperties: false + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-host1x + - nvidia,tegra30-host1x + - nvidia,tegra114-host1x + - nvidia,tegra124-host1x + then: + patternProperties: + "^hdmi@[0-9a-f]+$": + description: High Definition Multimedia Interface + type: object + properties: + # required + compatible: + oneOf: + - const: nvidia,tegra20-hdmi + - const: nvidia,tegra30-hdmi + - const: nvidia,tegra114-hdmi + - const: nvidia,tegra124-hdmi + - items: + - const: nvidia,tegra132-hdmi + - const: nvidia,tegra124-hdmi + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: module clock + - description: parent clock + + clock-names: + items: + - const: hdmi + - const: parent + + resets: + items: + - description: module reset + + reset-names: + items: + - const: hdmi + + hdmi-supply: + description: supply for the +5V HDMI connector pin + + vdd-supply: + description: regulator for supply voltage + + pll-supply: + description: regulator for PLL
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 752
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ + # optional + nvidia,ddc-i2c-bus: + description: phandle of an I2C controller used for DDC EDID + probing + $ref: "/schemas/types.yaml#/definitions/phandle" + + nvidia,hpd-gpio: + description: specifies a GPIO used for hotplug detection + $ref: "/schemas/types.yaml#/definitions/phandle-array"
*-gpio has a type already. Just 'maxItems: 1' needed.
Quoted 56 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +56
-0+ + nvidia,edid: + description: supplies a binary EDID blob + $ref: "/schemas/types.yaml#/definitions/uint8-array" + + nvidia,panel: + description: phandle of a display panel + $ref: "/schemas/types.yaml#/definitions/phandle" + + status: + $ref: "/schemas/dt-core.yaml#/properties/status" + + phandle: + $ref: "/schemas/types.yaml#/definitions/uint32" + + unevaluatedProperties: false + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra124-host1x + - nvidia,tegra210-host1x + - nvidia,tegra186-host1x + - nvidia,tegra194-host1x + then: + patternProperties: + "^sor@[0-9a-f]+$": + description: | + The Serial Output Resource (SOR) can be used to drive HDMI, LVDS, + eDP and DP outputs. + + See ../pinctrl/nvidia,tegra124-dpaux-padctl.txt for information + regarding the DPAUX pad controller bindings. + type: object + properties: + # required + compatible: + oneOf: + - const: nvidia,tegra124-sor + - items: + - const: nvidia,tegra132-sor + - const: nvidia,tegra124-sor + - const: nvidia,tegra210-sor + - const: nvidia,tegra210-sor1 + - const: nvidia,tegra186-sor + - const: nvidia,tegra186-sor1 + - const: nvidia,tegra194-sor + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 +
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 818
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ resets: + items: + - description: module reset + + reset-names: + items: + - const: sor + + status: + $ref: "/schemas/dt-core.yaml#/properties/status"
'status' should never need to be listed.
Quoted 41 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +41
-0+ + power-domains: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + avdd-io-hdmi-dp-supply: + description: I/O supply for HDMI/DP + + vdd-hdmi-dp-pll-supply: + description: PLL supply for HDMI/DP + + hdmi-supply: + description: +5.0V HDMI connector supply + + # Tegra186 and later + nvidia,interface: + description: index of the SOR interface + $ref: "/schemas/types.yaml#/definitions/uint32" + + # optional + nvidia,ddc-i2c-bus: + description: phandle of an I2C controller used for DDC EDID + probing + $ref: "/schemas/types.yaml#/definitions/phandle" + + nvidia,hpd-gpio: + description: specifies a GPIO used for hotplug detection + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + nvidia,edid: + description: supplies a binary EDID blob + $ref: "/schemas/types.yaml#/definitions/uint8-array" + + nvidia,panel: + description: phandle of a display panel + $ref: "/schemas/types.yaml#/definitions/phandle" + + nvidia,xbar-cfg: + description: 5 cells containing the crossbar configuration. + Each lane of the SOR, identified by the cell's index, is + mapped via the crossbar to the pad specified by the cell's + value.
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 869
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ $ref: "/schemas/types.yaml#/definitions/uint32-array" + + # optional when driving an eDP output + nvidia,dpaux: + description: phandle to a DispayPort AUX interface + $ref: "/schemas/types.yaml#/definitions/phandle" + + pinctrl-names: true + phandle: + $ref: "/schemas/types.yaml#/definitions/uint32"
'phandle' shouldn't need to be listed.
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 872
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +3
-0+ + patternProperties: + "^pinctrl-[0-9]+$": true
pinctrl properties are automatically added, but maybe not if under an 'if' schema. Really, I think probably either this should be split into multiple schema files or all of these child nodes should be described at the top-level. I'm not sure it's really important to define which set of child nodes belong or not for each chip.
I'm stopping there. I think the rest is more of the same comments.
Rob
Re: [PATCH 07/38] dt-bindings: display: tegra: Convert to json-schema
Quoted 67 lines · Rob Herring
Quoted 66 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the Tegra host1x controller bindings from the free-form text format to json-schema.
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.txt | 516 ------ .../display/tegra/nvidia,tegra20-host1x.yaml | 1418 +++++++++++++++++ 2 files changed, 1418 insertions(+), 516 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt create mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yamlDocumentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +46
-0@@ -0,0 +1,1418 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/tegra/nvidia,tegra20-host1x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra host1x controller + +maintainers: + - Thierry Reding <[email protected]> + - Jon Hunter <[email protected]> + +description: The host1x top-level node defines a number of children, each + representing one of the host1x client modules defined in this binding. + +properties: + # required + compatible: + oneOf: + - description: NVIDIA Tegra20 + items: + - const: nvidia,tegra20-host1x + + - description: NVIDIA Tegra30 + items: + - const: nvidia,tegra30-host1x + + - description: NVIDIA Tegra114 + items: + - const: nvidia,tegra114-host1x + + - description: NVIDIA Tegra124 + items: + - const: nvidia,tegra124-host1x + + - description: NVIDIA Tegra132 + items: + - const: nvidia,tegra132-host1x + - const: nvidia,tegra124-host1x + + - description: NVIDIA Tegra210 + items: + - const: nvidia,tegra210-host1x + + - description: NVIDIA Tegra186 + items:
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 51
Quoted 5 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +5
-0+ - const: nvidia,tegra186-host1x + + - description: NVIDIA Tegra194 + items: + - const: nvidia,tegra194-host1xI don't think the descriptions really add much. I'd rather see all the single entry cases as 1 'enum'.
Okay, done.
Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +18
-0+ + interrupts: + items: + - description: host1x syncpoint interrupt + - description: host1x general interrupt + minItems: 1 + maxItems: 2 + + interrupt-names: + items: + - const: syncpt + - const: host1x + + '#address-cells': + description: The number of cells used to represent physical base addresses + in the host1x address space. + enum: [1, 2] +
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 75
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +6
-0+ '#size-cells': + description: The number of cells used to represent the size of an address + range in the host1x address space. + enum: [1, 2] + + # requiredOdd comment...
There were a couple of others like this. I've removed them all now.
Quoted 7 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 78
Quoted 4 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +3
-0+ ranges: + description: The mapping of the host1x address space to the CPU address + space.That's every 'ranges'. If you know how many entries, then define 'maxItems'. If not, 'ranges: true' is enough.
Done.
Quoted 15 lines
Quoted 15 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +15
-0+ + clocks: + description: Must contain one entry, for the module clock. See + ../clocks/clock-bindings.txt for details. + + clock-names: + items: + - const: host1x + + resets: + description: Must contain an entry for each entry in reset-names. See + ../reset/reset.txt for details. + + reset-names: + items:
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 98
Quoted 5 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +5
-0+ - const: host1x + + # optional + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus"This is already applied to every 'iommus' property, so you just need to define how many entries.
Done.
Quoted 51 lines
Quoted 51 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +51
-0+ + memory-controllers: + $ref: /schemas/types.yaml#/definitions/phandle-array + +required: + - compatible + - interrupts + - interrupt-names + - '#address-cells' + - '#size-cells' + - ranges + - reg + - clocks + - clock-names + - resets + - reset-names + +unevaluatedProperties: false + +allOf: + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra186-host1x + - nvidia,tegra194-host1x + then: + properties: + reg-names: + items: + - const: hypervisor + - const: vm + + reg: + items: + - description: physical base address and length of the register + region assigned to the VM + - description: physical base address and length of the register + region used by the hypervisor + + required: + - reg-names + else: + properties: + reg: + maxItems: 1 + + - if: + properties: + compatible:
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 155
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +6
-0+ contains: + oneOf: + - const: nvidia,tegra20-host1x + - const: nvidia,tegra30-host1x + - const: nvidia,tegra114-host1x + - const: nvidia,tegra124-host1xUse 'enum'.
Done.
Quoted 14 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 168
Quoted 13 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +13
-0+ + then: + patternProperties: + "^vi@[0-9a-f]+$": + description: video input + type: object + properties: + compatible: + oneOf: + - const: nvidia,tegra20-vi + - const: nvidia,tegra30-vi + - const: nvidia,tegra114-vi + - const: nvidia,tegra124-vi
Quoted 1 line
Use a 'enum' for these 4.
Done.
Quoted 45 lines
Quoted 45 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +44
-0+ - items: + - const: nvidia,tegra132-vi + - const: nvidia,tegra124-vi + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: true + + reset-names: + items: + - const: vi + else: + patternProperties: + "^vi@[0-9a-f]+$": + description: video input + type: object + properties: + compatible: + oneOf: + - const: nvidia,tegra210-vi + - const: nvidia,tegra186-vi + - const: nvidia,tegra194-vi + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + power-domains: true + + - if: + properties: + compatible:
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 218
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +6
-0+ contains: + oneOf: + - const: nvidia,tegra210-host1x + then: + patternProperties: + "^vi@[0-9a-f]+$":type: object
Done.
Quoted 59 lines
Quoted 59 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +58
-0+ patternProperties: + "^csi@[0-9a-f]+$": + description: camera sensor interface + type: object + properties: + compatible: + enum: + - nvidia,tegra210-csi + + reg: true + + clocks: true + + clock-names: + items: + - const: csi + - const: cilab + - const: cilcd + - const: cile + - const: csi_tpg + + power-domains: true + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-host1x + - nvidia,tegra30-host1x + - nvidia,tegra114-host1x + then: + patternProperties: + "^epp@[0-9a-f]+$": + description: encoder pre-processor + type: object + properties: + compatible: + enum: + - nvidia,tegra20-epp + - nvidia,tegra30-epp + - nvidia,tegra114-epp + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + items: + - description: module reset + + reset-names: + items:
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 282
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +6
-0+ - const: epp + + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" + + unevaluatedProperties: falseI think 'additionalProperties: false' will work here.
Yes, it does.
Quoted 465 lines
Quoted 465 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +464
-0+ + "^mpe@[0-9a-f]+$": + description: video encoder + type: object + properties: + compatible: + enum: + - nvidia,tegra20-mpe + - nvidia,tegra30-mpe + - nvidia,tegra114-mpe + + reg: + minItems: 1 + maxItems: 1 + + interrupts: + minItems: 1 + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 1 + + resets: + minItems: 1 + maxItems: 1 + + reset-names: + items: + - const: mpe + + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" + + unevaluatedProperties: false + + "^gr2d@[0-9a-f]+$": + description: 2D graphics engine + type: object + properties: + compatible: + enum: + - nvidia,tegra20-gr2d + - nvidia,tegra30-gr2d + - nvidia,tegra114-gr2d + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + items: + - description: module reset + + reset-names: + items: + - const: 2d + + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" + + unevaluatedProperties: false + + "^gr3d@[0-9a-f]+$": + description: 3D graphics engine + type: object + properties: + compatible: + enum: + - nvidia,tegra20-gr3d + - nvidia,tegra30-gr3d + - nvidia,tegra114-gr3d + + reg: + maxItems: 1 + + iommus: + $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" + + allOf: + - if: + properties: + compatible: + contains: + const: nvidia,tegra30-gr3d + then: + properties: + clocks: + items: + - description: primary module clock + - description: secondary module clock + + clock-names: + items: + - const: 3d + - const: 3d2 + + resets: + items: + - description: primary module reset + - description: secondary module reset + + reset-names: + items: + - const: 3d + - const: 3d2 + else: + properties: + clocks: + items: + - description: module clock + + clock-names: + items: + - const: 3d + + resets: + items: + - description: module reset + + reset-names: + items: + - const: 3d + + unevaluatedProperties: false + + "^tvo@[0-9a-f]+$": + description: TV encoder output + type: object + properties: + # required + compatible: + enum: + - nvidia,tegra20-tvo + - nvidia,tegra30-tvo + - nvidia,tegra114-tvo + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + status: + $ref: "/schemas/dt-core.yaml#/properties/status" + + unevaluatedProperties: false + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-host1x + - nvidia,tegra30-host1x + - nvidia,tegra114-host1x + - nvidia,tegra124-host1x + - nvidia,tegra132-host1x + - nvidia,tegra210-host1x + then: + patternProperties: + "^dc@[0-9a-f]+$": + description: display controller + type: object + properties: + compatible: + oneOf: + - const: nvidia,tegra20-dc + - const: nvidia,tegra30-dc + - const: nvidia,tegra114-dc + - const: nvidia,tegra124-dc + - items: + - const: nvidia,tegra124-dc + - const: nvidia,tegra132-dc + - const: nvidia,tegra210-dc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: display controller pixel clock + + clock-names: + items: + - const: dc + + resets: + items: + - description: module reset + + reset-names: + items: + - const: dc + + iommus: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + nvidia,head: + description: The number of the display controller head. This is + used to setup the various types of output to receive video + data from the given head. + $ref: "/schemas/types.yaml#/definitions/uint32" + + allOf: + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-dc + - nvidia,tegra30-dc + - nvidia,tegra114-dc + then: + properties: + rgb: + description: Each display controller node has a child node, + named "rgb", that represents the RGB output associated + with the controller. + type: object + properties: + nvidia,ddc-i2c-bus: + description: phandle of an I2C controller used for DDC + EDID probing + $ref: "/schemas/types.yaml#/definitions/phandle" + + nvidia,hpd-gpio: + description: specifies a GPIO used for hotplug + detection + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + nvidia,edid: + description: supplies a binary EDID blob + $ref: "/schemas/types.yaml#/definitions/uint8-array" + + nvidia,panel: + description: phandle of a display panel + $ref: "/schemas/types.yaml#/definitions/phandle" + + unevaluatedProperties: false + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra186-host1x + - nvidia,tegra194-host1x + then: + patternProperties: + "^display-hub@[0-9a-f]+$": + properties: + compatible: + oneOf: + - description: NVIDIA Tegra186 + const: nvidia,tegra186-display + + - description: NVIDIA Tegra194 + const: nvidia,tegra194-display + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + ranges: + $ref: "/schemas/dt-core.yaml#/properties/ranges" + + status: + $ref: "/schemas/dt-core.yaml#/properties/status" + + resets: + items: + - description: display hub reset + - description: window group 0 reset + - description: window group 1 reset + - description: window group 2 reset + - description: window group 3 reset + - description: window group 4 reset + - description: window group 5 reset + + reset-names: + items: + - const: misc + - const: wgrp0 + - const: wgrp1 + - const: wgrp2 + - const: wgrp3 + - const: wgrp4 + - const: wgrp5 + + power-domains: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + patternProperties: + "^display@[0-9a-f]+$": + description: display controller + type: object + properties: + compatible: + enum: + - nvidia,tegra186-dc + - nvidia,tegra194-dc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: display controller pixel clock + + clock-names: + items: + - const: dc + + resets: + items: + - description: display controller reset + + reset-names: + items: + - const: dc + + power-domains: + description: A list of phandle and specifiers that identify + the power domains that this display controller is part of. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + iommus: + description: a phandle and specifier identifying the SMMU + master interface of this display controller. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + memory-controllers: + $ref: /schemas/types.yaml#/definitions/phandle-array + + nvidia,outputs: + description: A list of phandles of outputs that this display + controller can drive. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + nvidia,head: + description: The number of the display controller head. This + is used to setup the various types of output to receive + video data from the given head. + $ref: "/schemas/types.yaml#/definitions/uint32" + + unevaluatedProperties: false + + allOf: + - if: + properties: + compatible: + contains: + const: nvidia,tegra186-display + then: + properties: + clocks: + items: + - description: display core clock + - description: display stream compression clock + - description: display hub clock + + clock-names: + items: + - const: disp + - const: dsc + - const: hub + else: + properties: + clocks: + items: + - description: display core clock + - description: display hub clock + + clock-names: + items: + - const: disp + - const: hub + + unevaluatedProperties: false + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-host1x + - nvidia,tegra30-host1x + - nvidia,tegra114-host1x + - nvidia,tegra124-host1x + then: + patternProperties: + "^hdmi@[0-9a-f]+$": + description: High Definition Multimedia Interface + type: object + properties: + # required + compatible: + oneOf: + - const: nvidia,tegra20-hdmi + - const: nvidia,tegra30-hdmi + - const: nvidia,tegra114-hdmi + - const: nvidia,tegra124-hdmi + - items: + - const: nvidia,tegra132-hdmi + - const: nvidia,tegra124-hdmi + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: module clock + - description: parent clock + + clock-names: + items: + - const: hdmi + - const: parent + + resets: + items: + - description: module reset + + reset-names: + items: + - const: hdmi + + hdmi-supply: + description: supply for the +5V HDMI connector pin + + vdd-supply: + description: regulator for supply voltage + + pll-supply: + description: regulator for PLL + + # optional + nvidia,ddc-i2c-bus: + description: phandle of an I2C controller used for DDC EDID
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 752
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +6
-0+ probing + $ref: "/schemas/types.yaml#/definitions/phandle" + + nvidia,hpd-gpio: + description: specifies a GPIO used for hotplug detection + $ref: "/schemas/types.yaml#/definitions/phandle-array"*-gpio has a type already. Just 'maxItems: 1' needed.
Yes, that seems to work fine.
Quoted 60 lines
Quoted 60 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +60
-0+ + nvidia,edid: + description: supplies a binary EDID blob + $ref: "/schemas/types.yaml#/definitions/uint8-array" + + nvidia,panel: + description: phandle of a display panel + $ref: "/schemas/types.yaml#/definitions/phandle" + + status: + $ref: "/schemas/dt-core.yaml#/properties/status" + + phandle: + $ref: "/schemas/types.yaml#/definitions/uint32" + + unevaluatedProperties: false + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra124-host1x + - nvidia,tegra210-host1x + - nvidia,tegra186-host1x + - nvidia,tegra194-host1x + then: + patternProperties: + "^sor@[0-9a-f]+$": + description: | + The Serial Output Resource (SOR) can be used to drive HDMI, LVDS, + eDP and DP outputs. + + See ../pinctrl/nvidia,tegra124-dpaux-padctl.txt for information + regarding the DPAUX pad controller bindings. + type: object + properties: + # required + compatible: + oneOf: + - const: nvidia,tegra124-sor + - items: + - const: nvidia,tegra132-sor + - const: nvidia,tegra124-sor + - const: nvidia,tegra210-sor + - const: nvidia,tegra210-sor1 + - const: nvidia,tegra186-sor + - const: nvidia,tegra186-sor1 + - const: nvidia,tegra194-sor + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + resets: + items: + - description: module reset +
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 818
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +6
-0+ reset-names: + items: + - const: sor + + status: + $ref: "/schemas/dt-core.yaml#/properties/status"'status' should never need to be listed.
This seems to be needed at least when I try to validate against a single binding, like so:
$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml dtbs_check
I assume that that somehow prevents the tooling from looking at any of the other bindings, which in turn then causes status and other standard properties to never be defined and then it flags them as extra and causes a failure.
I think I've even seen this trigger on dt_binding_check if I happened to have status in there. Now, you've mentioned elsewhere that we shouldn't use "status" in examples, so that would work around this. However, I think I've seen this happen as well in examples that referenced some node via phandle, and then dt_binding_check would emit an error about phandle being undefined.
Perhaps this is a problem with the tooling? Should we instruct the scripts to always include the core schema even if we're only testing a single YAML file via DT_SCHEMA_FILES?
Quoted 58 lines
Quoted 41 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +41
-0+ + power-domains: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + avdd-io-hdmi-dp-supply: + description: I/O supply for HDMI/DP + + vdd-hdmi-dp-pll-supply: + description: PLL supply for HDMI/DP + + hdmi-supply: + description: +5.0V HDMI connector supply + + # Tegra186 and later + nvidia,interface: + description: index of the SOR interface + $ref: "/schemas/types.yaml#/definitions/uint32" + + # optional + nvidia,ddc-i2c-bus: + description: phandle of an I2C controller used for DDC EDID + probing + $ref: "/schemas/types.yaml#/definitions/phandle" + + nvidia,hpd-gpio: + description: specifies a GPIO used for hotplug detection + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + nvidia,edid: + description: supplies a binary EDID blob + $ref: "/schemas/types.yaml#/definitions/uint8-array" + + nvidia,panel: + description: phandle of a display panel + $ref: "/schemas/types.yaml#/definitions/phandle" + + nvidia,xbar-cfg: + description: 5 cells containing the crossbar configuration. + Each lane of the SOR, identified by the cell's index, is + mapped via the crossbar to the pad specified by the cell's + value.Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 869
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +10
-0+ $ref: "/schemas/types.yaml#/definitions/uint32-array" + + # optional when driving an eDP output + nvidia,dpaux: + description: phandle to a DispayPort AUX interface + $ref: "/schemas/types.yaml#/definitions/phandle" + + pinctrl-names: true + phandle: + $ref: "/schemas/types.yaml#/definitions/uint32"'phandle' shouldn't need to be listed.
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 872
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +3
-0+ + patternProperties: + "^pinctrl-[0-9]+$": true
Quoted 5 lines
pinctrl properties are automatically added, but maybe not if under an 'if' schema. Really, I think probably either this should be split into multiple schema files or all of these child nodes should be described at the top-level. I'm not sure it's really important to define which set of child nodes belong or not for each chip.
I'm not too worried about the set of child nodes for each chip, but I think having this all in one file underlines the importance of the hierarchy. If these were discrete bindings for each of the compatible strings it'd be easy for someone to create them as standalone nodes in device tree, but that's not something that would work. All of these devices are children of host1x and they do depend on host1x for a lot of the functionality, so the hierarchy must be respected.
Quoted 1 line
I'm stopping there. I think the rest is more of the same comments.
I've made a pass over the whole file and fixed the issues that you pointed out above in other places.
Sounds like the biggest remaining issue is with the duplicated standard properties. I'm not a huge fan of giving up on doing the right thing because the tooling can't deal with it. I think we should fix the tooling to do the right thing. So if there's something in the core DT schema then it should apply regardless of what mode we run in. Much of the above issues should go away once that's fixed.
Any thoughts on making some of the schema files "always included"? I haven't looked at this side of the tooling at all yet, so I'm not sure how difficult that would be, but if you're okay with it conceptually I can take a closer look.
Thierry
Rob Herring
maintainerRe: [PATCH 07/38] dt-bindings: display: tegra: Convert to json-schema
Quoted 15 lines · Thierry Reding
Quoted 13 lines · Rob Herring
Quoted 12 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the Tegra host1x controller bindings from the free-form text format to json-schema.
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.txt | 516 ------ .../display/tegra/nvidia,tegra20-host1x.yaml | 1418 +++++++++++++++++ 2 files changed, 1418 insertions(+), 516 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt create mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml
[...]
Quoted 55 lines
Quoted 43 lines
Quoted 43 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +43
-0+ - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra124-host1x + - nvidia,tegra210-host1x + - nvidia,tegra186-host1x + - nvidia,tegra194-host1x + then: + patternProperties: + "^sor@[0-9a-f]+$": + description: | + The Serial Output Resource (SOR) can be used to drive HDMI, LVDS, + eDP and DP outputs. + + See ../pinctrl/nvidia,tegra124-dpaux-padctl.txt for information + regarding the DPAUX pad controller bindings. + type: object + properties: + # required + compatible: + oneOf: + - const: nvidia,tegra124-sor + - items: + - const: nvidia,tegra132-sor + - const: nvidia,tegra124-sor + - const: nvidia,tegra210-sor + - const: nvidia,tegra210-sor1 + - const: nvidia,tegra186-sor + - const: nvidia,tegra186-sor1 + - const: nvidia,tegra194-sor + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + resets: + items: + - description: module reset +Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 818
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +6
-0+ reset-names: + items: + - const: sor + + status: + $ref: "/schemas/dt-core.yaml#/properties/status"'status' should never need to be listed.
This seems to be needed at least when I try to validate against a single binding, like so:
Quoted 6 lines
$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml dtbs_checkI assume that that somehow prevents the tooling from looking at any of the other bindings, which in turn then causes status and other standard properties to never be defined and then it flags them as extra and causes a failure.
I'm surprised using DT_SCHEMA_FILES makes a difference. I'm guessing that has your 'unevaluatedProperties' support. If so, that means there's an unintended side effect that any common schema property becomes always allowed. That's good for 'status' and 'phandle', but not so much for 'reg', '*-gpios, '*-names', etc.
Quoted 10 lines
I think I've even seen this trigger on
dt_binding_checkif I happened to have status in there. Now, you've mentioned elsewhere that we shouldn't use "status" in examples, so that would work around this. However, I think I've seen this happen as well in examples that referenced some node via phandle, and thendt_binding_checkwould emit an error about phandle being undefined.Perhaps this is a problem with the tooling? Should we instruct the scripts to always include the core schema even if we're only testing a single YAML file via
DT_SCHEMA_FILES?
The purpose of DT_SCHEMA_FILES is to see warnings just from that schema file. If the core schema was warning free, we could add that, but it's not. Plus that wouldn't solve the problem here. 'status' and 'phandle' are added to each schema by the tooling (along with other things), not by another schema file (well, they are in another schema file, but they are added to each schema so that 'additionalProperties:
false' works).
This is certainly a limitation in the tooling in that what you have is a bit different from the expected form. Generally it is expected that everything is defined under the top-level 'properties' and then any 'if/then' schema only add further constraints. However, you have the child nodes only defined under an if/then. We could fix that, but I'm not sure I want to. IMO, extensive use of if/then is a sign the schema should be split up. More on that below.
Quoted 16 lines
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 869
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +3
-0+ pinctrl-names: true + phandle: + $ref: "/schemas/types.yaml#/definitions/uint32"'phandle' shouldn't need to be listed.
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 872
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +3
-0+ + patternProperties: + "^pinctrl-[0-9]+$": trueQuoted 5 lines
pinctrl properties are automatically added, but maybe not if under an 'if' schema. Really, I think probably either this should be split into multiple schema files or all of these child nodes should be described at the top-level. I'm not sure it's really important to define which set of child nodes belong or not for each chip.
Quoted 7 lines
I'm not too worried about the set of child nodes for each chip, but I think having this all in one file underlines the importance of the hierarchy. If these were discrete bindings for each of the compatible strings it'd be easy for someone to create them as standalone nodes in device tree, but that's not something that would work. All of these devices are children of host1x and they do depend on host1x for a lot of the functionality, so the hierarchy must be respected.
I'm not saying don't describe the hierarchy.
The first option is 1 host1x schema file per SoC (roughly) and the 'host1x' parent node would be duplicated in each one. That doesn't worry me too much as it's all standard properties and not that many of them. Though you could have a common 'host1x-bus.yaml' just describing the parent node properties that each <soc>-host1x.yaml references.
The 2nd option is keep this as a single file, but just move every child node definition under the top-level 'patternProperties'. This option has the limitation that you can't enforce which child nodes are valid per SoC.
Quoted 12 lines
Quoted 1 line
I'm stopping there. I think the rest is more of the same comments.
I've made a pass over the whole file and fixed the issues that you pointed out above in other places.
Sounds like the biggest remaining issue is with the duplicated standard properties. I'm not a huge fan of giving up on doing the right thing because the tooling can't deal with it. I think we should fix the tooling to do the right thing. So if there's something in the core DT schema then it should apply regardless of what mode we run in. Much of the above issues should go away once that's fixed.
Quoted 4 lines
Any thoughts on making some of the schema files "always included"? I haven't looked at this side of the tooling at all yet, so I'm not sure how difficult that would be, but if you're okay with it conceptually I can take a closer look.
Hopefully, it's clear why that doesn't help here. But don't worry, there's plenty of other work to do on the tooling. :)
Rob
Re: [PATCH 07/38] dt-bindings: display: tegra: Convert to json-schema
Quoted 81 lines · Rob Herring
Quoted 15 lines · Thierry Reding
Quoted 13 lines · Rob Herring
Quoted 12 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the Tegra host1x controller bindings from the free-form text format to json-schema.
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.txt | 516 ------ .../display/tegra/nvidia,tegra20-host1x.yaml | 1418 +++++++++++++++++ 2 files changed, 1418 insertions(+), 516 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt create mode 100644 Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml[...]
Quoted 55 lines
Quoted 43 lines
Quoted 43 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +43
-0+ - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra124-host1x + - nvidia,tegra210-host1x + - nvidia,tegra186-host1x + - nvidia,tegra194-host1x + then: + patternProperties: + "^sor@[0-9a-f]+$": + description: | + The Serial Output Resource (SOR) can be used to drive HDMI, LVDS, + eDP and DP outputs. + + See ../pinctrl/nvidia,tegra124-dpaux-padctl.txt for information + regarding the DPAUX pad controller bindings. + type: object + properties: + # required + compatible: + oneOf: + - const: nvidia,tegra124-sor + - items: + - const: nvidia,tegra132-sor + - const: nvidia,tegra124-sor + - const: nvidia,tegra210-sor + - const: nvidia,tegra210-sor1 + - const: nvidia,tegra186-sor + - const: nvidia,tegra186-sor1 + - const: nvidia,tegra194-sor + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + resets: + items: + - description: module reset +Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 818
Quoted 6 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +6
-0+ reset-names: + items: + - const: sor + + status: + $ref: "/schemas/dt-core.yaml#/properties/status"'status' should never need to be listed.
This seems to be needed at least when I try to validate against a single binding, like so:
Quoted 6 lines
$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml dtbs_checkI assume that that somehow prevents the tooling from looking at any of the other bindings, which in turn then causes status and other standard properties to never be defined and then it flags them as extra and causes a failure.
Quoted 5 lines
I'm surprised using
DT_SCHEMA_FILESmakes a difference. I'm guessing that has your 'unevaluatedProperties' support. If so, that means there's an unintended side effect that any common schema property becomes always allowed. That's good for 'status' and 'phandle', but not so much for 'reg', '*-gpios, '*-names', etc.
I don't think that's an unintended side-effect. If the property validates against a schema it counts as evaluated, doesn't it? In order to avoid that we would somehow have to restrict which schemas contribute to the evaluatedProperties annotation and I don't think there's a way to do that because we don't know which out of all the schemas is relevant.
Quoted 19 lines
Quoted 10 lines
I think I've even seen this trigger on
dt_binding_checkif I happened to have status in there. Now, you've mentioned elsewhere that we shouldn't use "status" in examples, so that would work around this. However, I think I've seen this happen as well in examples that referenced some node via phandle, and thendt_binding_checkwould emit an error about phandle being undefined.Perhaps this is a problem with the tooling? Should we instruct the scripts to always include the core schema even if we're only testing a single YAML file via
DT_SCHEMA_FILES?The purpose of
DT_SCHEMA_FILESis to see warnings just from that schema file. If the core schema was warning free, we could add that, but it's not. Plus that wouldn't solve the problem here. 'status' and 'phandle' are added to each schema by the tooling (along with other things), not by another schema file (well, they are in another schema file, but they are added to each schema so that 'additionalProperties:
false' works).
Quoted 7 lines
This is certainly a limitation in the tooling in that what you have is a bit different from the expected form. Generally it is expected that everything is defined under the top-level 'properties' and then any 'if/then' schema only add further constraints. However, you have the child nodes only defined under an if/then. We could fix that, but I'm not sure I want to. IMO, extensive use of if/then is a sign the schema should be split up. More on that below.
Okay, I see your point.
Quoted 32 lines
Quoted 16 lines
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 869
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +3
-0+ pinctrl-names: true + phandle: + $ref: "/schemas/types.yaml#/definitions/uint32"'phandle' shouldn't need to be listed.
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml line 872
Quoted 3 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml new file +3
-0+ + patternProperties: + "^pinctrl-[0-9]+$": trueQuoted 5 lines
pinctrl properties are automatically added, but maybe not if under an 'if' schema. Really, I think probably either this should be split into multiple schema files or all of these child nodes should be described at the top-level. I'm not sure it's really important to define which set of child nodes belong or not for each chip.
Quoted 7 lines
I'm not too worried about the set of child nodes for each chip, but I think having this all in one file underlines the importance of the hierarchy. If these were discrete bindings for each of the compatible strings it'd be easy for someone to create them as standalone nodes in device tree, but that's not something that would work. All of these devices are children of host1x and they do depend on host1x for a lot of the functionality, so the hierarchy must be respected.
I'm not saying don't describe the hierarchy.
The first option is 1 host1x schema file per SoC (roughly) and the 'host1x' parent node would be duplicated in each one. That doesn't worry me too much as it's all standard properties and not that many of them. Though you could have a common '
host1x-bus.yaml' just describing the parent node properties that each <soc>-host1x.yaml references.
Quoted 4 lines
The 2nd option is keep this as a single file, but just move every child node definition under the top-level 'patternProperties'. This option has the limitation that you can't enforce which child nodes are valid per SoC.
Okay, I'll give the first option a try and see where I end up.
Quoted 12 lines
Quoted 12 lines
Quoted 1 line
I'm stopping there. I think the rest is more of the same comments.
I've made a pass over the whole file and fixed the issues that you pointed out above in other places.
Sounds like the biggest remaining issue is with the duplicated standard properties. I'm not a huge fan of giving up on doing the right thing because the tooling can't deal with it. I think we should fix the tooling to do the right thing. So if there's something in the core DT schema then it should apply regardless of what mode we run in. Much of the above issues should go away once that's fixed.
Quoted 7 lines
Quoted 4 lines
Any thoughts on making some of the schema files "always included"? I haven't looked at this side of the tooling at all yet, so I'm not sure how difficult that would be, but if you're okay with it conceptually I can take a closer look.
Hopefully, it's clear why that doesn't help here. But don't worry, there's plenty of other work to do on the tooling. :)
Yes, I think I understand now.
Thierry
PATCH 8/38 dt-bindings: display: tegra: Document interconnect paths
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
--- .../display/tegra/nvidia,tegra20-host1x.yaml | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +46 -6
@@ -97,8 +97,17 @@ properties: iommus: $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" - memory-controllers: - $ref: /schemas/types.yaml#/definitions/phandle-array + interconnects: + description: Description of the interconnect paths for the host1x + controller; see ../interconnect/interconnect.txt for details. + items: + - description: memory read client for host1x + + interconnect-names: + description: A list of names identifying each entry listed in the + "interconnects" property. + items: + - const: dma-mem # read required: - compatible
@@ -489,6 +498,26 @@ allOf: iommus: $ref: "/schemas/types.yaml#/definitions/phandle-array" + #interconnects: + # items: + # - description: memory read client for window A + # - description: memory read client for window B + # - description: memory read client for window C + # - description: memory read client for cursor + # # disp only + # - description: memory read client for window T + # - description: memory read client for window D + + #interconnect-names: + # items: + # - const: wina + # - const: winb + # - const: winc + # - const: cursor + # # disp only + # - const: wint + # - const: wind + nvidia,head: description: The number of the display controller head. This is used to setup the various types of output to receive video
@@ -634,8 +663,15 @@ allOf: master interface of this display controller. $ref: "/schemas/types.yaml#/definitions/phandle-array" - memory-controllers: - $ref: /schemas/types.yaml#/definitions/phandle-array + interconnects: + description: Description of the interconnect paths for the + display controller; see ../interconnect/interconnect.txt + for details. + + interconnect-names: + items: + - const: dma-mem # read-0 + - const: read-1 nvidia,outputs: description: A list of phandles of outputs that this display
@@ -1027,8 +1063,12 @@ allOf: iommus: $ref: "/schemas/types.yaml#/definitions/phandle-array" - memory-controllers: - $ref: /schemas/types.yaml#/definitions/phandle-array + interconnects: true + + interconnect-names: + items: + - const: dma-mem # read + - const: write unevaluatedProperties: false
Signature · 1 line
2.24.1
Re: [PATCH 08/38] dt-bindings: display: tegra: Document interconnect paths
Hello Thierry,
12.06.2020 17:18, Thierry Reding пишет:
Quoted 1 line
From: Thierry Reding <[email protected]>
Commit description is missing, checkpatch should warn about it.
Quoted 10 lines
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.yaml | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-)Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +0
-0
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml properties: · line 101
Quoted 5 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +0
-2@@ -97,8 +97,17 @@ properties: iommus: $ref: "/schemas/iommu/iommu.yaml#/properties/iommus" - memory-controllers: - $ref: /schemas/types.yaml#/definitions/phandle-array
Why memory-controllers property is removed?
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml properties: · line 110
Quoted 11 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +11
-0+ interconnects: + description: Description of the interconnect paths for the host1x + controller; see ../interconnect/interconnect.txt for details. + items: + - description: memory read client for host1x + + interconnect-names: + description: A list of names identifying each entry listed in the + "interconnects" property. + items: + - const: dma-mem # read
Please notice that Host1x has two memory clients: one for DMA engine and second I don't know what's for, maybe for indirect memory accesses. Why you skipped the second path?
Quoted 15 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +9
-0required: - compatible@@ -489,6 +498,26 @@ allOf: iommus: $ref: "/schemas/types.yaml#/definitions/phandle-array" + #interconnects: + # items: + # - description: memory read client for window A + # - description: memory read client for window B + # - description: memory read client for window C + # - description: memory read client for cursor + # # disp only + # - description: memory read client for window T + # - description: memory read client for window D
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml allOf: · line 519
Quoted 10 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +10
-0+ + #interconnect-names: + # items: + # - const: wina + # - const: winb + # - const: winc + # - const: cursor + # # disp only + # - const: wint + # - const: wind
Is this really intended to be commented out? Looks like this is an unfinished patch.
In the patch [1] I used memory client names for the interconnect paths. I like yours variant of the naming, it is more intuitive.
I'll rebase my series on top of yours patches once you'll get them into linux-next. Looking forward to v2!
Re: [PATCH 08/38] dt-bindings: display: tegra: Document interconnect paths
Quoted 19 lines · Dmitry Osipenko
Hello Thierry,
12.06.2020 17:18, Thierry Reding пишет:
Quoted 1 line
From: Thierry Reding <[email protected]>
Commit description is missing, checkpatch should warn about it.
Quoted 13 lines
Signed-off-by Thierry Reding <[email protected]>--- .../display/tegra/nvidia,tegra20-host1x.yaml | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-)Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +0
-0@@ -97,8 +97,17 @@ properties: iommus: $ref: "/schemas/iommu/iommu.yaml#/properties/iommus"
Quoted 4 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml properties: · line 101
Quoted 2 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +0
-2- memory-controllers: - $ref: /schemas/types.yaml#/definitions/phandle-arrayWhy memory-controllers property is removed?
Because it was accidentally added in patch 7. This is leftover from an earlier set of patches.
Quoted 12 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml properties: · line 110
Quoted 11 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +11
-0+ interconnects: + description: Description of the interconnect paths for the host1x + controller; see ../interconnect/interconnect.txt for details. + items: + - description: memory read client for host1x + + interconnect-names: + description: A list of names identifying each entry listed in the + "interconnects" property. + items: + - const: dma-mem # read
Quoted 3 lines
Please notice that Host1x has two memory clients: one for DMA engine and second I don't know what's for, maybe for indirect memory accesses. Why you skipped the second path?
I'm primarily targetting Tegra186 and Tegra194 with these patches because we need the interconnects properties on those platforms in order to correctly set the DMA masks at a global scope. For Tegra186 and Tegra194 I can only see a single memory client for host1x.
Looking at the register documentation, the host1xw and host1xr clients do exist on Tegra210 and earlier and they are used for indirect writes and reads, respectively.
I don't think we use indirect reads/writes, so we can probably do without the corresponding memory clients. Alternatively we could conditionally add them on Tegra210 and earlier.
Thierry
Quoted 20 lines
Quoted 20 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +14
-0required: - compatible@@ -489,6 +498,26 @@ allOf: iommus: $ref: "/schemas/types.yaml#/definitions/phandle-array" + #interconnects: + # items: + # - description: memory read client for window A + # - description: memory read client for window B + # - description: memory read client for window C + # - description: memory read client for cursor + # # disp only + # - description: memory read client for window T + # - description: memory read client for window D + + #interconnect-names: + # items: + # - const: wina + # - const: winb
Quoted 8 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml allOf: · line 519
Quoted 5 lines
Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml +5
-0+ # - const: winc + # - const: cursor + # # disp only + # - const: wint + # - const: windIs this really intended to be commented out? Looks like this is an unfinished patch.
I started adding this after finishing Tegra186 and Tegra194, but then I ran into various other issues and wanted to do this step by step, so I plan to go back to Tegra210 and earlier later on and stub them out.
However, since I had already done the research I wanted to leave these in here for later reference, so I didn't have to go back and look this up again.
Quoted 2 lines
In the patch [1] I used memory client names for the interconnect paths. I like yours variant of the naming, it is more intuitive.
I only noticed after posting this series that you had sent out the series for interconnects and that it conflicted in the bindings.
But yeah, I do also like the contextual names better because they are more intuitive.
Quoted 5 lines
I'll rebase my series on top of yours patches once you'll get them into linux-next. Looking forward to v2!
There's quite a bit to review here, but I also have a couple of patches that depend on these, so yeah, it'd be great if this could go in sooner rather than later.
Thierry
PATCH 9/38 dt-bindings: gpu: tegra: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the NVIDIA Tegra GPU bindings from the previous free-form text format to json-schema.
--- .../devicetree/bindings/gpu/nvidia,gk20a.txt | 90 --------- .../devicetree/bindings/gpu/nvidia,gk20a.yaml | 189 ++++++++++++++++++ 2 files changed, 189 insertions(+), 90 deletions(-) delete mode 100644 Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt create mode 100644 Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml
Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt deleted +0 -90
@@ -1,90 +0,0 @@ -NVIDIA Tegra Graphics Processing Units - -Required properties: -- compatible: "nvidia,<gpu>" - Currently recognized values: - - nvidia,gk20a - - nvidia,gm20b - - nvidia,gp10b -- reg: Physical base address and length of the controller's registers. - Must contain two entries: - - first entry for bar0 - - second entry for bar1 -- interrupts: Must contain an entry for each entry in interrupt-names. - See ../interrupt-controller/interrupts.txt for details. -- interrupt-names: Must include the following entries: - - stall - - nonstall -- vdd-supply: regulator for supply voltage. Only required for GPUs not using - power domains. -- clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. -- clock-names: Must include the following entries: - - gpu - - pwr -If the compatible string is "nvidia,gm20b", then the following clock -is also required: - - ref -- resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names: Must include the following entries: - - gpu -- power-domains: GPUs that make use of power domains can define this property - instead of vdd-supply. Currently "nvidia,gp10b" makes use of this. - -Optional properties: -- iommus: A reference to the IOMMU. See ../iommu/iommu.txt for details. - -Example for GK20A: - - gpu@57000000 { - compatible = "nvidia,gk20a"; - reg = <0x0 0x57000000 0x0 0x01000000>, - <0x0 0x58000000 0x0 0x01000000>; - interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "stall", "nonstall"; - vdd-supply = <&vdd_gpu>; - clocks = <&tegra_car TEGRA124_CLK_GPU>, - <&tegra_car TEGRA124_CLK_PLL_P_OUT5>; - clock-names = "gpu", "pwr"; - resets = <&tegra_car 184>; - reset-names = "gpu"; - iommus = <&mc TEGRA_SWGROUP_GPU>; - }; - -Example for GM20B: - - gpu@57000000 { - compatible = "nvidia,gm20b"; - reg = <0x0 0x57000000 0x0 0x01000000>, - <0x0 0x58000000 0x0 0x01000000>; - interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "stall", "nonstall"; - clocks = <&tegra_car TEGRA210_CLK_GPU>, - <&tegra_car TEGRA210_CLK_PLL_P_OUT5>, - <&tegra_car TEGRA210_CLK_PLL_G_REF>; - clock-names = "gpu", "pwr", "ref"; - resets = <&tegra_car 184>; - reset-names = "gpu"; - iommus = <&mc TEGRA_SWGROUP_GPU>; - }; - -Example for GP10B: - - gpu@17000000 { - compatible = "nvidia,gp10b"; - reg = <0x0 0x17000000 0x0 0x1000000>, - <0x0 0x18000000 0x0 0x1000000>; - interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH - GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "stall", "nonstall"; - clocks = <&bpmp TEGRA186_CLK_GPCCLK>, - <&bpmp TEGRA186_CLK_GPU>; - clock-names = "gpu", "pwr"; - resets = <&bpmp TEGRA186_RESET_GPU>; - reset-names = "gpu"; - power-domains = <&bpmp TEGRA186_POWER_DOMAIN_GPU>; - iommus = <&smmu TEGRA186_SID_GPU>; - };
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml new file +189 -0
189 lines not on this page · raw message
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 09/38] dt-bindings: gpu: tegra: Convert to json-schema
Quoted 68 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the NVIDIA Tegra GPU bindings from the previous free-form text format to json-schema.
Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/gpu/nvidia,gk20a.txt | 90 --------- .../devicetree/bindings/gpu/nvidia,gk20a.yaml | 189 ++++++++++++++++++ 2 files changed, 189 insertions(+), 90 deletions(-) delete mode 100644 Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt create mode 100644 Documentation/devicetree/bindings/gpu/nvidia,gk20a.yamlDocumentation/devicetree/bindings/gpu/nvidia,gk20a.yaml new file +48
-0@@ -0,0 +1,189 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpu/nvidia,gk20a.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra Graphics Processing Units + +maintainers: + - Thierry Reding <[email protected]> + - Jon Hunter <[email protected]> + +properties: + compatible: + items: + - enum: + - nvidia,gk20a + - nvidia,gm20b + - nvidia,gp10b + + reg: + items: + - description: base address and size for BAR0 + - description: base address and size for BAR1 + + interrupts: + items: + - description: stalling interrupt + - description: non-stalling interrupt + + interrupt-names: + items: + - const: stall + - const: nonstall + + clocks: + minItems: 2 + maxItems: 3 + items: + - description: GPU clock + - description: PWR clock + - description: REF clock + + clock-names: + minItems: 2 + maxItems: 3 + items: + - const: gpu
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml line 58
Quoted 10 lines
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml new file +10
-0+ - const: pwr + - const: ref + + resets: + items: + - description: GPU reset + + reset-names: + minItems: 1 + maxItems: 1
You can drop minItems/maxItems. The tooling will add them based on 'items' length if not specified.
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml line 64
Quoted 6 lines
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml new file +6
-0+ items: + - const: gpu + + power-domains: + description: GPUs that make use of power domains can define this property + instead of vdd-supply. Currently "nvidia,gp10b" makes use of this.
How many?
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml line 72
Quoted 8 lines
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml new file +8
-0+ + vdd-supply: + description: GPU power supply. + + iommus: + description: The phandle of the IOMMU and the IOMMU specifier. See + ../iommu/iommu.txt for details. + $ref: "/schemas/types.yaml#/definitions/phandle-array"
Again, just need to define how many.
Quoted 45 lines
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml new file +45
-0+ +required: + - compatible + - reg + - interrupts + - interrupt-names + - clocks + - clock-names + - resets + - reset-names + +allOf: + - if: + properties: + compatible: + contains: + const: nvidia,gm20b + then: + required: + - vdd-supply + + - if: + properties: + compatible: + contains: + const: nvidia,gm20b + then: + properties: + clock-names: + minItems: 3 + + required: + - vdd-supply + + - if: + properties: + compatible: + contains: + const: nvidia,gp10b + then: + required: + - power-domains + +unevaluatedProperties: false +
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml line 127
Quoted 10 lines
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml new file +10
-0+examples: + - | + #include <dt-bindings/clock/tegra124-car.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/memory/tegra124-mc.h> + + gpu@57000000 { + compatible = "nvidia,gk20a"; + reg = <0x0 0x57000000 0x0 0x01000000>, + <0x0 0x58000000 0x0 0x01000000>;
The default size is 1 cell each for examples. So either use that or add a parent node defining 2 cells.
Quoted 65 lines
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml new file +62
-0+ interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "stall", "nonstall"; + vdd-supply = <&vdd_gpu>; + clocks = <&tegra_car TEGRA124_CLK_GPU>, + <&tegra_car TEGRA124_CLK_PLL_P_OUT5>; + clock-names = "gpu", "pwr"; + resets = <&tegra_car 184>; + reset-names = "gpu"; + iommus = <&mc TEGRA_SWGROUP_GPU>; + }; + + - | + #include <dt-bindings/clock/tegra210-car.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + /* + * XXX can't include this because it conflicts with the tegra124-mc.h + * include from the Tegra124 example above. + */ + /* + #include <dt-bindings/memory/tegra210-mc.h> + */ + + gpu@57000000 { + compatible = "nvidia,gm20b"; + reg = <0x0 0x57000000 0x0 0x01000000>, + <0x0 0x58000000 0x0 0x01000000>; + interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "stall", "nonstall"; + vdd-supply = <&vdd_gpu>; + clocks = <&tegra_car TEGRA210_CLK_GPU>, + <&tegra_car TEGRA210_CLK_PLL_P_OUT5>, + <&tegra_car TEGRA210_CLK_PLL_G_REF>; + clock-names = "gpu", "pwr", "ref"; + resets = <&tegra_car 184>; + reset-names = "gpu"; + iommus = <&mc TEGRA_SWGROUP_GPU>; + }; + + - | + #include <dt-bindings/clock/tegra186-clock.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/memory/tegra186-mc.h> + #include <dt-bindings/power/tegra186-powergate.h> + #include <dt-bindings/reset/tegra186-reset.h> + + gpu@17000000 { + compatible = "nvidia,gp10b"; + reg = <0x0 0x17000000 0x0 0x1000000>, + <0x0 0x18000000 0x0 0x1000000>; + interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "stall", "nonstall"; + clocks = <&bpmp TEGRA186_CLK_GPCCLK>, + <&bpmp TEGRA186_CLK_GPU>; + clock-names = "gpu", "pwr"; + resets = <&bpmp TEGRA186_RESET_GPU>; + reset-names = "gpu"; + power-domains = <&bpmp TEGRA186_POWER_DOMAIN_GPU>; + iommus = <&smmu TEGRA186_SID_GPU>; + };Signature · 1 line
2.24.1
PATCH 10/38 dt-bindings: gpu: tegra: Document interconnect paths
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
--- .../devicetree/bindings/gpu/nvidia,gk20a.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
Documentation/devicetree/bindings/gpu/nvidia,gk20a.yaml +15 -0
@@ -71,6 +71,21 @@ properties: ../iommu/iommu.txt for details. $ref: "/schemas/types.yaml#/definitions/phandle-array" + interconnects: + description: A list of phandle and specifier pairs that describe the + interconnect paths to and from the GPU. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + interconnect-names: + description: One string for each pair of phandle and specifier in the + "interconnects" property. + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: dma-mem # read-0 + - const: write-0 + - const: read-1 + - const: write-1 + required: - compatible - reg
Signature · 1 line
2.24.1
PATCH 11/38 dt-bindings: mmc: tegra: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the NVIDIA Tegra SDHCI bindings from the free-form text format to json-schema.
--- .../bindings/mmc/nvidia,tegra20-sdhci.txt | 117 -------- .../bindings/mmc/nvidia,tegra20-sdhci.yaml | 270 ++++++++++++++++++ 2 files changed, 270 insertions(+), 117 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt create mode 100644 Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml
Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt deleted +0 -117
@@ -1,117 +0,0 @@ -* NVIDIA Tegra Secure Digital Host Controller - -This controller on Tegra family SoCs provides an interface for MMC, SD, -and SDIO types of memory cards. - -This file documents differences between the core properties described -by mmc.txt and the properties used by the sdhci-tegra driver. - -Required properties: -- compatible : should be one of: - - "nvidia,tegra20-sdhci": for Tegra20 - - "nvidia,tegra30-sdhci": for Tegra30 - - "nvidia,tegra114-sdhci": for Tegra114 - - "nvidia,tegra124-sdhci": for Tegra124 and Tegra132 - - "nvidia,tegra210-sdhci": for Tegra210 - - "nvidia,tegra186-sdhci": for Tegra186 - - "nvidia,tegra194-sdhci": for Tegra194 -- clocks : Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. -- resets : Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names : Must include the following entries: - - sdhci - -Optional properties: -- power-gpios : Specify GPIOs for power control - -Example: - -sdhci@c8000200 { - compatible = "nvidia,tegra20-sdhci"; - reg = <0xc8000200 0x200>; - interrupts = <47>; - clocks = <&tegra_car 14>; - resets = <&tegra_car 14>; - reset-names = "sdhci"; - cd-gpios = <&gpio 69 0>; /* gpio PI5 */ - wp-gpios = <&gpio 57 0>; /* gpio PH1 */ - power-gpios = <&gpio 155 0>; /* gpio PT3 */ - bus-width = <8>; -}; - -Optional properties for Tegra210, Tegra186 and Tegra194: -- pinctrl-names, pinctrl-0, pinctrl-1 : Specify pad voltage - configurations. Valid pinctrl-names are "sdmmc-3v3" and "sdmmc-1v8" - for controllers supporting multiple voltage levels. The order of names - should correspond to the pin configuration states in pinctrl-0 and - pinctrl-1. -- pinctrl-names : "sdmmc-3v3-drv" and "sdmmc-1v8-drv" are applicable for - Tegra210 where pad config registers are in the pinmux register domain - for pull-up-strength and pull-down-strength values configuration when - using pads at 3V3 and 1V8 levels. -- nvidia,only-1-8-v : The presence of this property indicates that the - controller operates at a 1.8 V fixed I/O voltage. -- nvidia,pad-autocal-pull-up-offset-3v3, - nvidia,pad-autocal-pull-down-offset-3v3 : Specify drive strength - calibration offsets for 3.3 V signaling modes. -- nvidia,pad-autocal-pull-up-offset-1v8, - nvidia,pad-autocal-pull-down-offset-1v8 : Specify drive strength - calibration offsets for 1.8 V signaling modes. -- nvidia,pad-autocal-pull-up-offset-3v3-timeout, - nvidia,pad-autocal-pull-down-offset-3v3-timeout : Specify drive - strength used as a fallback in case the automatic calibration times - out on a 3.3 V signaling mode. -- nvidia,pad-autocal-pull-up-offset-1v8-timeout, - nvidia,pad-autocal-pull-down-offset-1v8-timeout : Specify drive - strength used as a fallback in case the automatic calibration times - out on a 1.8 V signaling mode. -- nvidia,pad-autocal-pull-up-offset-sdr104, - nvidia,pad-autocal-pull-down-offset-sdr104 : Specify drive strength - calibration offsets for SDR104 mode. -- nvidia,pad-autocal-pull-up-offset-hs400, - nvidia,pad-autocal-pull-down-offset-hs400 : Specify drive strength - calibration offsets for HS400 mode. -- nvidia,default-tap : Specify the default inbound sampling clock - trimmer value for non-tunable modes. -- nvidia,default-trim : Specify the default outbound clock trimmer - value. -- nvidia,dqs-trim : Specify DQS trim value for HS400 timing - - Notes on the pad calibration pull up and pulldown offset values: - - The property values are drive codes which are programmed into the - PD_OFFSET and PU_OFFSET sections of the - SDHCI_TEGRA_AUTO_CAL_CONFIG register. - - A higher value corresponds to higher drive strength. Please refer - to the reference manual of the SoC for correct values. - - The SDR104 and HS400 timing specific values are used in - corresponding modes if specified. - - Notes on tap and trim values: - - The values are used for compensating trace length differences - by adjusting the sampling point. - - The values are programmed to the Vendor Clock Control Register. - Please refer to the reference manual of the SoC for correct - values. - - The DQS trim values are only used on controllers which support - HS400 timing. Only SDMMC4 on Tegra210 and Tegra 186 supports - HS400. - -Example: -sdhci@700b0000 { - compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci"; - reg = <0x0 0x700b0000 0x0 0x200>; - interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&tegra_car TEGRA210_CLK_SDMMC1>; - clock-names = "sdhci"; - resets = <&tegra_car 14>; - reset-names = "sdhci"; - pinctrl-names = "sdmmc-3v3", "sdmmc-1v8"; - pinctrl-0 = <&sdmmc1_3v3>; - pinctrl-1 = <&sdmmc1_1v8>; - nvidia,pad-autocal-pull-up-offset-3v3 = <0x00>; - nvidia,pad-autocal-pull-down-offset-3v3 = <0x7d>; - nvidia,pad-autocal-pull-up-offset-1v8 = <0x7b>; - nvidia,pad-autocal-pull-down-offset-1v8 = <0x7b>; - status = "disabled"; -};
Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml new file +270 -0
270 lines not on this page · raw message
Signature · 1 line
2.24.1
PATCH 12/38 dt-bindings: mmc: tegra: Document interconnect paths
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
--- .../bindings/mmc/nvidia,tegra20-sdhci.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml +13 -0
@@ -86,6 +86,19 @@ properties: iommus: $ref: "/schemas/types.yaml#/definitions/phandle-array" + interconnects: + description: A list of phandle and specifier pairs that describe the + interconnect paths to and from the SDHCI controller. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + interconnect-names: + description: One string for each pair of phandle and specifier in the + "interconnects" property. + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: dma-mem # read + - const: write + nvidia,default-tap: description: Specify the default inbound sampling clock trimmer value for non-tunable modes.
Signature · 1 line
2.24.1
PATCH 13/38 dt-bindings: pci: tegra: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Tegra PCIe controller bindings from the free-form text format to json-schema.
--- .../bindings/pci/nvidia,tegra20-pcie.txt | 682 --------------- .../bindings/pci/nvidia,tegra20-pcie.yaml | 824 ++++++++++++++++++ 2 files changed, 824 insertions(+), 682 deletions(-) delete mode 100644 Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt create mode 100644 Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.yaml
Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt deleted +0 -682
@@ -1,682 +0,0 @@ -NVIDIA Tegra PCIe controller - -Required properties: -- compatible: Must be: - - "nvidia,tegra20-pcie": for Tegra20 - - "nvidia,tegra30-pcie": for Tegra30 - - "nvidia,tegra124-pcie": for Tegra124 and Tegra132 - - "nvidia,tegra210-pcie": for Tegra210 - - "nvidia,tegra186-pcie": for Tegra186 -- power-domains: To ungate power partition by BPMP powergate driver. Must - contain BPMP phandle and PCIe power partition ID. This is required only - for Tegra186. -- device_type: Must be "pci" -- reg: A list of physical base address and length for each set of controller - registers. Must contain an entry for each entry in the reg-names property. -- reg-names: Must include the following entries: - "pads": PADS registers - "afi": AFI registers - "cs": configuration space region -- interrupts: A list of interrupt outputs of the controller. Must contain an - entry for each entry in the interrupt-names property. -- interrupt-names: Must include the following entries: - "intr": The Tegra interrupt that is asserted for controller interrupts - "msi": The Tegra interrupt that is asserted when an MSI is received -- bus-range: Range of bus numbers associated with this controller -- #address-cells: Address representation for root ports (must be 3) - - cell 0 specifies the bus and device numbers of the root port: - [23:16]: bus number - [15:11]: device number - - cell 1 denotes the upper 32 address bits and should be 0 - - cell 2 contains the lower 32 address bits and is used to translate to the - CPU address space -- #size-cells: Size representation for root ports (must be 2) -- ranges: Describes the translation of addresses for root ports and standard - PCI regions. The entries must be 6 cells each, where the first three cells - correspond to the address as described for the #address-cells property - above, the fourth cell is the physical CPU address to translate to and the - fifth and six cells are as described for the #size-cells property above. - - The first two entries are expected to translate the addresses for the root - port registers, which are referenced by the assigned-addresses property of - the root port nodes (see below). - - The remaining entries setup the mapping for the standard I/O, memory and - prefetchable PCI regions. The first cell determines the type of region - that is setup: - - 0x81000000: I/O memory region - - 0x82000000: non-prefetchable memory region - - 0xc2000000: prefetchable memory region - Please refer to the standard PCI bus binding document for a more detailed - explanation. -- #interrupt-cells: Size representation for interrupts (must be 1) -- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties - Please refer to the standard PCI bus binding document for a more detailed - explanation. -- clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. -- clock-names: Must include the following entries: - - pex - - afi - - pll_e - - cml (not required for Tegra20) -- resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names: Must include the following entries: - - pex - - afi - - pcie_x - -Optional properties: -- pinctrl-names: A list of pinctrl state names. Must contain the following - entries: - - "default": active state, puts PCIe I/O out of deep power down state - - "idle": puts PCIe I/O into deep power down state -- pinctrl-0: phandle for the default/active state of pin configurations. -- pinctrl-1: phandle for the idle state of pin configurations. - -Required properties on Tegra124 and later (deprecated): -- phys: Must contain an entry for each entry in phy-names. -- phy-names: Must include the following entries: - - pcie - -These properties are deprecated in favour of per-lane PHYs define in each of -the root ports (see below). - -Power supplies for Tegra20: -- avdd-pex-supply: Power supply for analog PCIe logic. Must supply 1.05 V. -- vdd-pex-supply: Power supply for digital PCIe I/O. Must supply 1.05 V. -- avdd-pex-pll-supply: Power supply for dedicated (internal) PCIe PLL. Must - supply 1.05 V. -- avdd-plle-supply: Power supply for PLLE, which is shared with SATA. Must - supply 1.05 V. -- vddio-pex-clk-supply: Power supply for PCIe clock. Must supply 3.3 V. - -Power supplies for Tegra30: -- Required: - - avdd-pex-pll-supply: Power supply for dedicated (internal) PCIe PLL. Must - supply 1.05 V. - - avdd-plle-supply: Power supply for PLLE, which is shared with SATA. Must - supply 1.05 V. - - vddio-pex-ctl-supply: Power supply for PCIe control I/O partition. Must - supply 1.8 V. - - hvdd-pex-supply: High-voltage supply for PCIe I/O and PCIe output clocks. - Must supply 3.3 V. -- Optional: - - If lanes 0 to 3 are used: - - avdd-pexa-supply: Power supply for analog PCIe logic. Must supply 1.05 V. - - vdd-pexa-supply: Power supply for digital PCIe I/O. Must supply 1.05 V. - - If lanes 4 or 5 are used: - - avdd-pexb-supply: Power supply for analog PCIe logic. Must supply 1.05 V. - - vdd-pexb-supply: Power supply for digital PCIe I/O. Must supply 1.05 V. - -Power supplies for Tegra124: -- Required: - - avddio-pex-supply: Power supply for analog PCIe logic. Must supply 1.05 V. - - dvddio-pex-supply: Power supply for digital PCIe I/O. Must supply 1.05 V. - - avdd-pex-pll-supply: Power supply for dedicated (internal) PCIe PLL. Must - supply 1.05 V. - - hvdd-pex-supply: High-voltage supply for PCIe I/O and PCIe output clocks. - Must supply 3.3 V. - - hvdd-pex-pll-e-supply: High-voltage supply for PLLE (shared with USB3). - Must supply 3.3 V. - - vddio-pex-ctl-supply: Power supply for PCIe control I/O partition. Must - supply 2.8-3.3 V. - - avdd-pll-erefe-supply: Power supply for PLLE (shared with USB3). Must - supply 1.05 V. - -Power supplies for Tegra210: -- Required: - - avdd-pll-uerefe-supply: Power supply for PLLE (shared with USB3). Must - supply 1.05 V. - - hvddio-pex-supply: High-voltage supply for PCIe I/O and PCIe output - clocks. Must supply 1.8 V. - - dvddio-pex-supply: Power supply for digital PCIe I/O. Must supply 1.05 V. - - dvdd-pex-pll-supply: Power supply for dedicated (internal) PCIe PLL. Must - supply 1.05 V. - - hvdd-pex-pll-e-supply: High-voltage supply for PLLE (shared with USB3). - Must supply 3.3 V. - - vddio-pex-ctl-supply: Power supply for PCIe control I/O partition. Must - supply 1.8 V. - -Power supplies for Tegra186: -- Required: - - dvdd-pex-supply: Power supply for digital PCIe I/O. Must supply 1.05 V. - - hvdd-pex-pll-supply: High-voltage supply for PLLE (shared with USB3). Must - supply 1.8 V. - - hvdd-pex-supply: High-voltage supply for PCIe I/O and PCIe output clocks. - Must supply 1.8 V. - - vddio-pexctl-aud-supply: Power supply for PCIe side band signals. Must - supply 1.8 V. - -Root ports are defined as subnodes of the PCIe controller node. - -Required properties: -- device_type: Must be "pci" -- assigned-addresses: Address and size of the port configuration registers -- reg: PCI bus address of the root port -- #address-cells: Must be 3 -- #size-cells: Must be 2 -- ranges: Sub-ranges distributed from the PCIe controller node. An empty - property is sufficient. -- nvidia,num-lanes: Number of lanes to use for this port. Valid combinations - are: - - Root port 0 uses 4 lanes, root port 1 is unused. - - Both root ports use 2 lanes. - -Required properties for Tegra124 and later: -- phys: Must contain an phandle to a PHY for each entry in phy-names. -- phy-names: Must include an entry for each active lane. Note that the number - of entries does not have to (though usually will) be equal to the specified - number of lanes in the nvidia,num-lanes property. Entries are of the form - "pcie-N": where N ranges from 0 to the value specified in nvidia,num-lanes. - -Examples: -========= - -Tegra20: --------- - -SoC DTSI: - - pcie-controller@80003000 { - compatible = "nvidia,tegra20-pcie"; - device_type = "pci"; - reg = <0x80003000 0x00000800 /* PADS registers */ - 0x80003800 0x00000200 /* AFI registers */ - 0x90000000 0x10000000>; /* configuration space */ - reg-names = "pads", "afi", "cs"; - interrupts = <0 98 0x04 /* controller interrupt */ - 0 99 0x04>; /* MSI interrupt */ - interrupt-names = "intr", "msi"; - - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &intc GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; - - bus-range = <0x00 0xff>; - #address-cells = <3>; - #size-cells = <2>; - - ranges = <0x82000000 0 0x80000000 0x80000000 0 0x00001000 /* port 0 registers */ - 0x82000000 0 0x80001000 0x80001000 0 0x00001000 /* port 1 registers */ - 0x81000000 0 0 0x82000000 0 0x00010000 /* downstream I/O */ - 0x82000000 0 0xa0000000 0xa0000000 0 0x10000000 /* non-prefetchable memory */ - 0xc2000000 0 0xb0000000 0xb0000000 0 0x10000000>; /* prefetchable memory */ - - clocks = <&tegra_car 70>, <&tegra_car 72>, <&tegra_car 118>; - clock-names = "pex", "afi", "pll_e"; - resets = <&tegra_car 70>, <&tegra_car 72>, <&tegra_car 74>; - reset-names = "pex", "afi", "pcie_x"; - status = "disabled"; - - pci@1,0 { - device_type = "pci"; - assigned-addresses = <0x82000800 0 0x80000000 0 0x1000>; - reg = <0x000800 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - - ranges; - - nvidia,num-lanes = <2>; - }; - - pci@2,0 { - device_type = "pci"; - assigned-addresses = <0x82001000 0 0x80001000 0 0x1000>; - reg = <0x001000 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - - ranges; - - nvidia,num-lanes = <2>; - }; - }; - -Board DTS: - - pcie-controller@80003000 { - status = "okay"; - - vdd-supply = <&pci_vdd_reg>; - pex-clk-supply = <&pci_clk_reg>; - - /* root port 00:01.0 */ - pci@1,0 { - status = "okay"; - - /* bridge 01:00.0 (optional) */ - pci@0,0 { - reg = <0x010000 0 0 0 0>; - - #address-cells = <3>; - #size-cells = <2>; - - device_type = "pci"; - - /* endpoint 02:00.0 */ - pci@0,0 { - reg = <0x020000 0 0 0 0>; - }; - }; - }; - }; - -Note that devices on the PCI bus are dynamically discovered using PCI's bus -enumeration and therefore don't need corresponding device nodes in DT. However -if a device on the PCI bus provides a non-probeable bus such as I2C or SPI, -device nodes need to be added in order to allow the bus' children to be -instantiated at the proper location in the operating system's device tree (as -illustrated by the optional nodes in the example above). - -Tegra30: --------- - -SoC DTSI: - - pcie-controller@3000 { - compatible = "nvidia,tegra30-pcie"; - device_type = "pci"; - reg = <0x00003000 0x00000800 /* PADS registers */ - 0x00003800 0x00000200 /* AFI registers */ - 0x10000000 0x10000000>; /* configuration space */ - reg-names = "pads", "afi", "cs"; - interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH /* controller interrupt */ - GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ - interrupt-names = "intr", "msi"; - - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &intc GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; - - bus-range = <0x00 0xff>; - #address-cells = <3>; - #size-cells = <2>; - - ranges = <0x82000000 0 0x00000000 0x00000000 0 0x00001000 /* port 0 configuration space */ - 0x82000000 0 0x00001000 0x00001000 0 0x00001000 /* port 1 configuration space */ - 0x82000000 0 0x00004000 0x00004000 0 0x00001000 /* port 2 configuration space */ - 0x81000000 0 0 0x02000000 0 0x00010000 /* downstream I/O */ - 0x82000000 0 0x20000000 0x20000000 0 0x08000000 /* non-prefetchable memory */ - 0xc2000000 0 0x28000000 0x28000000 0 0x18000000>; /* prefetchable memory */ - - clocks = <&tegra_car TEGRA30_CLK_PCIE>, - <&tegra_car TEGRA30_CLK_AFI>, - <&tegra_car TEGRA30_CLK_PLL_E>, - <&tegra_car TEGRA30_CLK_CML0>; - clock-names = "pex", "afi", "pll_e", "cml"; - resets = <&tegra_car 70>, - <&tegra_car 72>, - <&tegra_car 74>; - reset-names = "pex", "afi", "pcie_x"; - status = "disabled"; - - pci@1,0 { - device_type = "pci"; - assigned-addresses = <0x82000800 0 0x00000000 0 0x1000>; - reg = <0x000800 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <2>; - }; - - pci@2,0 { - device_type = "pci"; - assigned-addresses = <0x82001000 0 0x00001000 0 0x1000>; - reg = <0x001000 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <2>; - }; - - pci@3,0 { - device_type = "pci"; - assigned-addresses = <0x82001800 0 0x00004000 0 0x1000>; - reg = <0x001800 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <2>; - }; - }; - -Board DTS: - - pcie-controller@3000 { - status = "okay"; - - avdd-pexa-supply = <&ldo1_reg>; - vdd-pexa-supply = <&ldo1_reg>; - avdd-pexb-supply = <&ldo1_reg>; - vdd-pexb-supply = <&ldo1_reg>; - avdd-pex-pll-supply = <&ldo1_reg>; - avdd-plle-supply = <&ldo1_reg>; - vddio-pex-ctl-supply = <&sys_3v3_reg>; - hvdd-pex-supply = <&sys_3v3_pexs_reg>; - - pci@1,0 { - status = "okay"; - }; - - pci@3,0 { - status = "okay"; - }; - }; - -Tegra124: ---------- - -SoC DTSI: - - pcie-controller@1003000 { - compatible = "nvidia,tegra124-pcie"; - device_type = "pci"; - reg = <0x0 0x01003000 0x0 0x00000800 /* PADS registers */ - 0x0 0x01003800 0x0 0x00000800 /* AFI registers */ - 0x0 0x02000000 0x0 0x10000000>; /* configuration space */ - reg-names = "pads", "afi", "cs"; - interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ - <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ - interrupt-names = "intr", "msi"; - - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &gic GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; - - bus-range = <0x00 0xff>; - #address-cells = <3>; - #size-cells = <2>; - - ranges = <0x82000000 0 0x01000000 0x0 0x01000000 0 0x00001000 /* port 0 configuration space */ - 0x82000000 0 0x01001000 0x0 0x01001000 0 0x00001000 /* port 1 configuration space */ - 0x81000000 0 0x0 0x0 0x12000000 0 0x00010000 /* downstream I/O (64 KiB) */ - 0x82000000 0 0x13000000 0x0 0x13000000 0 0x0d000000 /* non-prefetchable memory (208 MiB) */ - 0xc2000000 0 0x20000000 0x0 0x20000000 0 0x20000000>; /* prefetchable memory (512 MiB) */ - - clocks = <&tegra_car TEGRA124_CLK_PCIE>, - <&tegra_car TEGRA124_CLK_AFI>, - <&tegra_car TEGRA124_CLK_PLL_E>, - <&tegra_car TEGRA124_CLK_CML0>; - clock-names = "pex", "afi", "pll_e", "cml"; - resets = <&tegra_car 70>, - <&tegra_car 72>, - <&tegra_car 74>; - reset-names = "pex", "afi", "pcie_x"; - status = "disabled"; - - pci@1,0 { - device_type = "pci"; - assigned-addresses = <0x82000800 0 0x01000000 0 0x1000>; - reg = <0x000800 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <2>; - }; - - pci@2,0 { - device_type = "pci"; - assigned-addresses = <0x82001000 0 0x01001000 0 0x1000>; - reg = <0x001000 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <1>; - }; - }; - -Board DTS: - - pcie-controller@1003000 { - status = "okay"; - - avddio-pex-supply = <&vdd_1v05_run>; - dvddio-pex-supply = <&vdd_1v05_run>; - avdd-pex-pll-supply = <&vdd_1v05_run>; - hvdd-pex-supply = <&vdd_3v3_lp0>; - hvdd-pex-pll-e-supply = <&vdd_3v3_lp0>; - vddio-pex-ctl-supply = <&vdd_3v3_lp0>; - avdd-pll-erefe-supply = <&avdd_1v05_run>; - - /* Mini PCIe */ - pci@1,0 { - phys = <&{/padctl@7009f000/pads/pcie/lanes/pcie-4}>; - phy-names = "pcie-0"; - status = "okay"; - }; - - /* Gigabit Ethernet */ - pci@2,0 { - phys = <&{/padctl@7009f000/pads/pcie/lanes/pcie-2}>; - phy-names = "pcie-0"; - status = "okay"; - }; - }; - -Tegra210: ---------- - -SoC DTSI: - - pcie-controller@1003000 { - compatible = "nvidia,tegra210-pcie"; - device_type = "pci"; - reg = <0x0 0x01003000 0x0 0x00000800 /* PADS registers */ - 0x0 0x01003800 0x0 0x00000800 /* AFI registers */ - 0x0 0x02000000 0x0 0x10000000>; /* configuration space */ - reg-names = "pads", "afi", "cs"; - interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ - <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ - interrupt-names = "intr", "msi"; - - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &gic GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; - - bus-range = <0x00 0xff>; - #address-cells = <3>; - #size-cells = <2>; - - ranges = <0x82000000 0 0x01000000 0x0 0x01000000 0 0x00001000 /* port 0 configuration space */ - 0x82000000 0 0x01001000 0x0 0x01001000 0 0x00001000 /* port 1 configuration space */ - 0x81000000 0 0x0 0x0 0x12000000 0 0x00010000 /* downstream I/O (64 KiB) */ - 0x82000000 0 0x13000000 0x0 0x13000000 0 0x0d000000 /* non-prefetchable memory (208 MiB) */ - 0xc2000000 0 0x20000000 0x0 0x20000000 0 0x20000000>; /* prefetchable memory (512 MiB) */ - - clocks = <&tegra_car TEGRA210_CLK_PCIE>, - <&tegra_car TEGRA210_CLK_AFI>, - <&tegra_car TEGRA210_CLK_PLL_E>, - <&tegra_car TEGRA210_CLK_CML0>; - clock-names = "pex", "afi", "pll_e", "cml"; - resets = <&tegra_car 70>, - <&tegra_car 72>, - <&tegra_car 74>; - reset-names = "pex", "afi", "pcie_x"; - status = "disabled"; - - pci@1,0 { - device_type = "pci"; - assigned-addresses = <0x82000800 0 0x01000000 0 0x1000>; - reg = <0x000800 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <4>; - }; - - pci@2,0 { - device_type = "pci"; - assigned-addresses = <0x82001000 0 0x01001000 0 0x1000>; - reg = <0x001000 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <1>; - }; - }; - -Board DTS: - - pcie-controller@1003000 { - status = "okay"; - - avdd-pll-uerefe-supply = <&avdd_1v05_pll>; - hvddio-pex-supply = <&vdd_1v8>; - dvddio-pex-supply = <&vdd_pex_1v05>; - dvdd-pex-pll-supply = <&vdd_pex_1v05>; - hvdd-pex-pll-e-supply = <&vdd_1v8>; - vddio-pex-ctl-supply = <&vdd_1v8>; - - pci@1,0 { - phys = <&{/padctl@7009f000/pads/pcie/lanes/pcie-0}>, - <&{/padctl@7009f000/pads/pcie/lanes/pcie-1}>, - <&{/padctl@7009f000/pads/pcie/lanes/pcie-2}>, - <&{/padctl@7009f000/pads/pcie/lanes/pcie-3}>; - phy-names = "pcie-0", "pcie-1", "pcie-2", "pcie-3"; - status = "okay"; - }; - - pci@2,0 { - phys = <&{/padctl@7009f000/pads/pcie/lanes/pcie-4}>; - phy-names = "pcie-0"; - status = "okay"; - }; - }; - -Tegra186: ---------- - -SoC DTSI: - - pcie@10003000 { - compatible = "nvidia,tegra186-pcie"; - power-domains = <&bpmp TEGRA186_POWER_DOMAIN_PCX>; - device_type = "pci"; - reg = <0x0 0x10003000 0x0 0x00000800 /* PADS registers */ - 0x0 0x10003800 0x0 0x00000800 /* AFI registers */ - 0x0 0x40000000 0x0 0x10000000>; /* configuration space */ - reg-names = "pads", "afi", "cs"; - - interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ - <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ - interrupt-names = "intr", "msi"; - - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &gic GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>; - - bus-range = <0x00 0xff>; - #address-cells = <3>; - #size-cells = <2>; - - ranges = <0x82000000 0 0x10000000 0x0 0x10000000 0 0x00001000 /* port 0 configuration space */ - 0x82000000 0 0x10001000 0x0 0x10001000 0 0x00001000 /* port 1 configuration space */ - 0x82000000 0 0x10004000 0x0 0x10004000 0 0x00001000 /* port 2 configuration space */ - 0x81000000 0 0x0 0x0 0x50000000 0 0x00010000 /* downstream I/O (64 KiB) */ - 0x82000000 0 0x50100000 0x0 0x50100000 0 0x07F00000 /* non-prefetchable memory (127 MiB) */ - 0xc2000000 0 0x58000000 0x0 0x58000000 0 0x28000000>; /* prefetchable memory (640 MiB) */ - - clocks = <&bpmp TEGRA186_CLK_AFI>, - <&bpmp TEGRA186_CLK_PCIE>, - <&bpmp TEGRA186_CLK_PLLE>; - clock-names = "afi", "pex", "pll_e"; - - resets = <&bpmp TEGRA186_RESET_AFI>, - <&bpmp TEGRA186_RESET_PCIE>, - <&bpmp TEGRA186_RESET_PCIEXCLK>; - reset-names = "afi", "pex", "pcie_x"; - - status = "disabled"; - - pci@1,0 { - device_type = "pci"; - assigned-addresses = <0x82000800 0 0x10000000 0 0x1000>; - reg = <0x000800 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <2>; - }; - - pci@2,0 { - device_type = "pci"; - assigned-addresses = <0x82001000 0 0x10001000 0 0x1000>; - reg = <0x001000 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <1>; - }; - - pci@3,0 { - device_type = "pci"; - assigned-addresses = <0x82001800 0 0x10004000 0 0x1000>; - reg = <0x001800 0 0 0 0>; - status = "disabled"; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - nvidia,num-lanes = <1>; - }; - }; - -Board DTS: - - pcie@10003000 { - status = "okay"; - - dvdd-pex-supply = <&vdd_pex>; - hvdd-pex-pll-supply = <&vdd_1v8>; - hvdd-pex-supply = <&vdd_1v8>; - vddio-pexctl-aud-supply = <&vdd_1v8>; - - pci@1,0 { - nvidia,num-lanes = <4>; - status = "okay"; - }; - - pci@2,0 { - nvidia,num-lanes = <0>; - status = "disabled"; - }; - - pci@3,0 { - nvidia,num-lanes = <1>; - status = "disabled"; - }; - };
Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.yaml new file +824 -0
824 lines not on this page · raw message
Signature · 1 line
2.24.1
PATCH 14/38 dt-bindings: pci: tegra: Document interconnect paths
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Add optional interconnects and interconnect-names properties to allow describing the interconnect paths to and from the PCIe controller.
--- .../devicetree/bindings/pci/nvidia,tegra20-pcie.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+)
Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.yaml +11 -0
@@ -104,6 +104,17 @@ properties: iommus: $ref: "/schemas/types.yaml#/definitions/phandle-array" + interconnects: + description: Description of the interconnect paths for the PCIe controller; + see ../interconnect/interconnect.txt for details. + + interconnect-names: + description: A list of names identifying each entry listed in the + "interconnects" property. + items: + - const: dma-mem # read + - const: write + pinctrl-names: items: # active state, puts PCIe I/O out of deep power down state
Signature · 1 line
2.24.1
PATCH 15/38 dt-bindings: sound: tegra: hda: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Tegra HDA controller bindings from the free-form text format to json-schema.
--- .../bindings/sound/nvidia,tegra30-hda.txt | 35 ----- .../bindings/sound/nvidia,tegra30-hda.yaml | 128 ++++++++++++++++++ 2 files changed, 128 insertions(+), 35 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt deleted +0 -35
@@ -1,35 +0,0 @@ -NVIDIA Tegra30 HDA controller - -Required properties: -- compatible : For Tegra30, must contain "nvidia,tegra30-hda". Otherwise, - must contain '"nvidia,<chip>-hda", "nvidia,tegra30-hda"', where <chip> is - tegra114, tegra124, or tegra132. -- reg : Should contain the HDA registers location and length. -- interrupts : The interrupt from the HDA controller. -- clocks : Must contain an entry for each required entry in clock-names. - See ../clocks/clock-bindings.txt for details. -- clock-names : Must include the following entries: hda, hda2hdmi, hda2codec_2x -- resets : Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names : Must include the following entries: hda, hda2hdmi, hda2codec_2x - -Optional properties: -- nvidia,model : The user-visible name of this sound complex. Since the property - is optional, legacy boards can use default name provided in hda driver. - -Example: - -hda@70030000 { - compatible = "nvidia,tegra124-hda", "nvidia,tegra30-hda"; - reg = <0x0 0x70030000 0x0 0x10000>; - interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&tegra_car TEGRA124_CLK_HDA>, - <&tegra_car TEGRA124_CLK_HDA2HDMI>, - <&tegra_car TEGRA124_CLK_HDA2CODEC_2X>; - clock-names = "hda", "hda2hdmi", "hda2codec_2x"; - resets = <&tegra_car 125>, /* hda */ - <&tegra_car 128>, /* hda2hdmi */ - <&tegra_car 111>; /* hda2codec_2x */ - reset-names = "hda", "hda2hdmi", "hda2codec_2x"; - nvidia,model = "jetson-tk1-hda"; -};
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml new file +128 -0
128 lines not on this page · raw message
Signature · 1 line
2.24.1
PATCH 16/38 dt-bindings: sound: tegra: hda: Document interconnect paths
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
--- .../bindings/sound/nvidia,tegra30-hda.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml +13 -0
@@ -90,6 +90,19 @@ properties: iommus: $ref: "/schemas/types.yaml#/definitions/phandle-array" + interconnects: + description: Description of the interconnect paths for the HDA controller; + see ../interconnect/interconnect.txt for details. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + interconnect-names: + description: A list of names identifying each entry listed in the + "interconnects" property. + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: dma-mem # read + - const: write + nvidia,model: description: The user-visible name of this sound complex. Since the property is optional, legacy boards can use default name provided in HDA
Signature · 1 line
2.24.1
PATCH 17/38 dt-bindings: usb: tegra-xusb: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Tegra XUSB controller bindings from the free-form text format to json-schema.
--- .../bindings/usb/nvidia,tegra124-xusb.txt | 132 ------- .../bindings/usb/nvidia,tegra124-xusb.yaml | 360 ++++++++++++++++++ 2 files changed, 360 insertions(+), 132 deletions(-) delete mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt create mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.yaml
Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt deleted +0 -132
@@ -1,132 +0,0 @@ -NVIDIA Tegra xHCI controller -============================ - -The Tegra xHCI controller supports both USB2 and USB3 interfaces exposed by -the Tegra XUSB pad controller. - -Required properties: --------------------- -- compatible: Must be: - - Tegra124: "nvidia,tegra124-xusb" - - Tegra132: "nvidia,tegra132-xusb", "nvidia,tegra124-xusb" - - Tegra210: "nvidia,tegra210-xusb" - - Tegra186: "nvidia,tegra186-xusb" -- reg: Must contain the base and length of the xHCI host registers, XUSB FPCI - registers and XUSB IPFS registers. -- reg-names: Must contain the following entries: - - "hcd" - - "fpci" - - "ipfs" -- interrupts: Must contain the xHCI host interrupt and the mailbox interrupt. -- clocks: Must contain an entry for each entry in clock-names. - See ../clock/clock-bindings.txt for details. -- clock-names: Must include the following entries: - - xusb_host - - xusb_host_src - - xusb_falcon_src - - xusb_ss - - xusb_ss_src - - xusb_ss_div2 - - xusb_hs_src - - xusb_fs_src - - pll_u_480m - - clk_m - - pll_e -- resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names: Must include the following entries: - - xusb_host - - xusb_ss - - xusb_src - Note that xusb_src is the shared reset for xusb_{ss,hs,fs,falcon,host}_src. -- nvidia,xusb-padctl: phandle to the XUSB pad controller that is used to - configure the USB pads used by the XHCI controller - -For Tegra124 and Tegra132: -- avddio-pex-supply: PCIe/USB3 analog logic power supply. Must supply 1.05 V. -- dvddio-pex-supply: PCIe/USB3 digital logic power supply. Must supply 1.05 V. -- avdd-usb-supply: USB controller power supply. Must supply 3.3 V. -- avdd-pll-utmip-supply: UTMI PLL power supply. Must supply 1.8 V. -- avdd-pll-erefe-supply: PLLE reference PLL power supply. Must supply 1.05 V. -- avdd-usb-ss-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V. -- hvdd-usb-ss-supply: High-voltage PCIe/USB3 power supply. Must supply 3.3 V. -- hvdd-usb-ss-pll-e-supply: High-voltage PLLE power supply. Must supply 3.3 V. - -For Tegra210: -- dvddio-pex-supply: PCIe/USB3 analog logic power supply. Must supply 1.05 V. -- hvddio-pex-supply: High-voltage PCIe/USB3 power supply. Must supply 1.8 V. -- avdd-usb-supply: USB controller power supply. Must supply 3.3 V. -- avdd-pll-utmip-supply: UTMI PLL power supply. Must supply 1.8 V. -- avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V. -- dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V. -- hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V. - -For Tegra210 and Tegra186: -- power-domains: A list of PM domain specifiers that reference each power-domain - used by the xHCI controller. This list must comprise of a specifier for the - XUSBA and XUSBC power-domains. See ../power/power_domain.txt and - ../arm/tegra/nvidia,tegra20-pmc.txt for details. -- power-domain-names: A list of names that represent each of the specifiers in - the 'power-domains' property. Must include 'xusb_ss' and 'xusb_host' which - represent the power-domains XUSBA and XUSBC, respectively. See - ../power/power_domain.txt for details. - -Optional properties: --------------------- -- phys: Must contain an entry for each entry in phy-names. - See ../phy/phy-bindings.txt for details. -- phy-names: Should include an entry for each PHY used by the controller. The - following PHYs are available: - - Tegra124: usb2-0, usb2-1, usb2-2, hsic-0, hsic-1, usb3-0, usb3-1 - - Tegra132: usb2-0, usb2-1, usb2-2, hsic-0, hsic-1, usb3-0, usb3-1 - - Tegra210: usb2-0, usb2-1, usb2-2, usb2-3, hsic-0, usb3-0, usb3-1, usb3-2, - usb3-3 - - Tegra186: usb2-0, usb2-1, usb2-2, hsic-0, usb3-0, usb3-1, usb3-2 - -Example: --------- - - usb@0,70090000 { - compatible = "nvidia,tegra124-xusb"; - reg = <0x0 0x70090000 0x0 0x8000>, - <0x0 0x70098000 0x0 0x1000>, - <0x0 0x70099000 0x0 0x1000>; - reg-names = "hcd", "fpci", "ipfs"; - - interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>; - - clocks = <&tegra_car TEGRA124_CLK_XUSB_HOST>, - <&tegra_car TEGRA124_CLK_XUSB_HOST_SRC>, - <&tegra_car TEGRA124_CLK_XUSB_FALCON_SRC>, - <&tegra_car TEGRA124_CLK_XUSB_SS>, - <&tegra_car TEGRA124_CLK_XUSB_SS_DIV2>, - <&tegra_car TEGRA124_CLK_XUSB_SS_SRC>, - <&tegra_car TEGRA124_CLK_XUSB_HS_SRC>, - <&tegra_car TEGRA124_CLK_XUSB_FS_SRC>, - <&tegra_car TEGRA124_CLK_PLL_U_480M>, - <&tegra_car TEGRA124_CLK_CLK_M>, - <&tegra_car TEGRA124_CLK_PLL_E>; - clock-names = "xusb_host", "xusb_host_src", "xusb_falcon_src", - "xusb_ss", "xusb_ss_div2", "xusb_ss_src", - "xusb_hs_src", "xusb_fs_src", "pll_u_480m", - "clk_m", "pll_e"; - resets = <&tegra_car 89>, <&tegra_car 156>, <&tegra_car 143>; - reset-names = "xusb_host", "xusb_ss", "xusb_src"; - - nvidia,xusb-padctl = <&padctl>; - - phys = <&{/padctl@0,7009f000/pads/usb2/lanes/usb2-1}>, /* mini-PCIe USB */ - <&{/padctl@0,7009f000/pads/usb2/lanes/usb2-2}>, /* USB A */ - <&{/padctl@0,7009f000/pads/pcie/lanes/pcie-0}>; /* USB A */ - phy-names = "usb2-1", "usb2-2", "usb3-0"; - - avddio-pex-supply = <&vdd_1v05_run>; - dvddio-pex-supply = <&vdd_1v05_run>; - avdd-usb-supply = <&vdd_3v3_lp0>; - avdd-pll-utmip-supply = <&vddio_1v8>; - avdd-pll-erefe-supply = <&avdd_1v05_run>; - avdd-usb-ss-pll-supply = <&vdd_1v05_run>; - hvdd-usb-ss-supply = <&vdd_3v3_lp0>; - hvdd-usb-ss-pll-e-supply = <&vdd_3v3_lp0>; - };
Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.yaml new file +360 -0
360 lines not on this page · raw message
Signature · 1 line
2.24.1
PATCH 18/38 dt-bindings: usb: tegra-xusb: Document interconnect paths
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Add optional interconnects and interconnect-names properties to allow describing the interconnect paths to and from the XUSB controller.
--- .../devicetree/bindings/usb/nvidia,tegra124-xusb.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+)
Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.yaml +11 -0
@@ -82,6 +82,17 @@ properties: iommus: $ref: "/schemas/types.yaml#/definitions/phandle-array" + interconnects: + description: Description of the interconnect paths for the XHCI + controller; see ../interconnect/interconnect.txt for details. + + interconnect-names: + description: A list of names identifying each entry listed in the + "interconnects" property. + items: + - const: dma-mem # read + - const: write + phys: description: Must contain an entry for each entry in phy-names. See ../phy/phy-bindings.txt for details.
Signature · 1 line
2.24.1
PATCH 19/38 dt-bindings: net: dwc-qos-ethernet: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Synopsis/DesignWare Ethernet QOS device tree bindings from free-form text format to json-schema.
--- .../bindings/net/snps,dwc-qos-ethernet.txt | 168 ---------- .../bindings/net/snps,dwc-qos-ethernet.yaml | 308 ++++++++++++++++++ 2 files changed, 308 insertions(+), 168 deletions(-) delete mode 100644 Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt create mode 100644 Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.yaml
Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt deleted +0 -168
@@ -1,168 +0,0 @@ -* Synopsys DWC Ethernet QoS IP version 4.10 driver (GMAC) - -This binding is deprecated, but it continues to be supported, but new -features should be preferably added to the stmmac binding document. - -This binding supports the Synopsys Designware Ethernet QoS (Quality Of Service) -IP block. The IP supports multiple options for bus type, clocking and reset -structure, and feature list. Consequently, a number of properties and list -entries in properties are marked as optional, or only required in specific HW -configurations. - -Required properties: -- compatible: One of: - - "axis,artpec6-eqos", "snps,dwc-qos-ethernet-4.10" - Represents the IP core when integrated into the Axis ARTPEC-6 SoC. - - "nvidia,tegra186-eqos", "snps,dwc-qos-ethernet-4.10" - Represents the IP core when integrated into the NVIDIA Tegra186 SoC. - - "snps,dwc-qos-ethernet-4.10" - This combination is deprecated. It should be treated as equivalent to - "axis,artpec6-eqos", "snps,dwc-qos-ethernet-4.10". It is supported to be - compatible with earlier revisions of this binding. -- reg: Address and length of the register set for the device -- clocks: Phandle and clock specifiers for each entry in clock-names, in the - same order. See ../clock/clock-bindings.txt. -- clock-names: May contain any/all of the following depending on the IP - configuration, in any order: - - "tx" - The EQOS transmit path clock. The HW signal name is clk_tx_i. - In some configurations (e.g. GMII/RGMII), this clock also drives the PHY TX - path. In other configurations, other clocks (such as tx_125, rmii) may - drive the PHY TX path. - - "rx" - The EQOS receive path clock. The HW signal name is clk_rx_i. - In some configurations (e.g. GMII/RGMII), this clock is derived from the - PHY's RX clock output. In other configurations, other clocks (such as - rx_125, rmii) may drive the EQOS RX path. - In cases where the PHY clock is directly fed into the EQOS receive path - without intervening logic, the DT need not represent this clock, since it - is assumed to be fully under the control of the PHY device/driver. In - cases where SoC integration adds additional logic to this path, such as a - SW-controlled clock gate, this clock should be represented in DT. - - "slave_bus" - The CPU/slave-bus (CSR) interface clock. This applies to any bus type; - APB, AHB, AXI, etc. The HW signal name is hclk_i (AHB) or clk_csr_i (other - buses). - - "master_bus" - The master bus interface clock. Only required in configurations that use a - separate clock for the master and slave bus interfaces. The HW signal name - is hclk_i (AHB) or aclk_i (AXI). - - "ptp_ref" - The PTP reference clock. The HW signal name is clk_ptp_ref_i. - - "phy_ref_clk" - This clock is deprecated and should not be used by new compatible values. - It is equivalent to "tx". - - "apb_pclk" - This clock is deprecated and should not be used by new compatible values. - It is equivalent to "slave_bus". - - Note: Support for additional IP configurations may require adding the - following clocks to this list in the future: clk_rx_125_i, clk_tx_125_i, - clk_pmarx_0_i, clk_pmarx1_i, clk_rmii_i, clk_revmii_rx_i, clk_revmii_tx_i. - Configurations exist where multiple similar clocks are used at once, e.g. all - of clk_rx_125_i, clk_pmarx_0_i, clk_pmarx1_i. For this reason it is best to - extend the binding with a separate clock-names entry for each of those RX - clocks, rather than repurposing the existing "rx" clock-names entry as a - generic/logical clock in a similar fashion to "master_bus" and "slave_bus". - This will allow easy support for configurations that support multiple PHY - interfaces using a mux, and hence need to have explicit control over - specific RX clocks. - - The following compatible values require the following set of clocks: - - "nvidia,tegra186-eqos", "snps,dwc-qos-ethernet-4.10": - - "slave_bus" - - "master_bus" - - "rx" - - "tx" - - "ptp_ref" - - "axis,artpec6-eqos", "snps,dwc-qos-ethernet-4.10": - - "slave_bus" - - "master_bus" - - "tx" - - "ptp_ref" - - "snps,dwc-qos-ethernet-4.10" (deprecated): - - "phy_ref_clk" - - "apb_clk" -- interrupts: Should contain the core's combined interrupt signal -- phy-mode: See ethernet.txt file in the same directory -- resets: Phandle and reset specifiers for each entry in reset-names, in the - same order. See ../reset/reset.txt. -- reset-names: May contain any/all of the following depending on the IP - configuration, in any order: - - "eqos". The reset to the entire module. The HW signal name is hreset_n - (AHB) or aresetn_i (AXI). - - The following compatible values require the following set of resets: - (the reset properties may be omitted if empty) - - "nvidia,tegra186-eqos", "snps,dwc-qos-ethernet-4.10": - - "eqos". - - "axis,artpec6-eqos", "snps,dwc-qos-ethernet-4.10": - - None. - - "snps,dwc-qos-ethernet-4.10" (deprecated): - - None. - -Optional properties: -- dma-coherent: Present if dma operations are coherent -- phy-reset-gpios: Phandle and specifier for any GPIO used to reset the PHY. - See ../gpio/gpio.txt. -- snps,en-lpi: If present it enables use of the AXI low-power interface -- snps,write-requests: Number of write requests that the AXI port can issue. - It depends on the SoC configuration. -- snps,read-requests: Number of read requests that the AXI port can issue. - It depends on the SoC configuration. -- snps,burst-map: Bitmap of allowed AXI burst lengts, with the LSB - representing 4, then 8 etc. -- snps,txpbl: DMA Programmable burst length for the TX DMA -- snps,rxpbl: DMA Programmable burst length for the RX DMA -- snps,en-tx-lpi-clockgating: Enable gating of the MAC TX clock during - TX low-power mode. -- phy-handle: See ethernet.txt file in the same directory -- mdio device tree subnode: When the GMAC has a phy connected to its local - mdio, there must be device tree subnode with the following - required properties: - - compatible: Must be "snps,dwc-qos-ethernet-mdio". - - #address-cells: Must be <1>. - - #size-cells: Must be <0>. - - For each phy on the mdio bus, there must be a node with the following - fields: - - - reg: phy id used to communicate to phy. - - device_type: Must be "ethernet-phy". - - fixed-mode device tree subnode: see fixed-link.txt in the same directory - -The MAC address will be determined using the optional properties -defined in ethernet.txt. - -Examples: -ethernet2@40010000 { - clock-names = "phy_ref_clk", "apb_pclk"; - clocks = <&clkc 17>, <&clkc 15>; - compatible = "snps,dwc-qos-ethernet-4.10"; - interrupt-parent = <&intc>; - interrupts = <0x0 0x1e 0x4>; - reg = <0x40010000 0x4000>; - phy-handle = <&phy2>; - phy-mode = "gmii"; - phy-reset-gpios = <&gpioctlr 43 GPIO_ACTIVE_LOW>; - - snps,en-tx-lpi-clockgating; - snps,en-lpi; - snps,write-requests = <2>; - snps,read-requests = <16>; - snps,burst-map = <0x7>; - snps,txpbl = <8>; - snps,rxpbl = <2>; - - dma-coherent; - - mdio { - #address-cells = <0x1>; - #size-cells = <0x0>; - phy2: phy@1 { - compatible = "ethernet-phy-ieee802.3-c22"; - device_type = "ethernet-phy"; - reg = <0x1>; - }; - }; -};
Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.yaml new file +308 -0
308 lines not on this page · raw message
Signature · 1 line
2.24.1
PATCH 20/38 dt-bindings: net: dwc-qos-ethernet: Document interconnect paths
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Add optional interconnects and interconnect-names properties to allow describing the interconnect paths to and from the Ethernet device.
--- .../bindings/net/snps,dwc-qos-ethernet.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.yaml +14 -0
@@ -123,6 +123,15 @@ properties: description: Enable gating of the MAC TX clock during TX low-power mode. $ref: "/schemas/types.yaml#/definitions/flag" + interconnects: + description: Description of the interconnect paths for the ethernet + controller; see ../interconnect/interconnect.txt for details. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + interconnect-names: + description: A list of names identifying each entry listed in the + "interconnects" property. + mdio: description: A subnode representing the GMAC's MDIO bus. type: object
@@ -208,6 +217,11 @@ allOf: - const: tx - const: ptp_ref + interconnect-names: + items: + - const: dma-mem # read + - const: write + required: - resets - reset-names
Signature · 1 line
2.24.1
PATCH 21/38 dt-bindings: sound: sgtl5000: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Freescale SGTL5000 device tree bindings from free-form text format to json-schema.
--- .../devicetree/bindings/sound/sgtl5000.txt | 60 ---------- .../devicetree/bindings/sound/sgtl5000.yaml | 103 ++++++++++++++++++ .../devicetree/bindings/trivial-devices.yaml | 2 - 3 files changed, 103 insertions(+), 62 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/sgtl5000.txt create mode 100644 Documentation/devicetree/bindings/sound/sgtl5000.yaml
Documentation/devicetree/bindings/sound/sgtl5000.txt deleted +0 -60
@@ -1,60 +0,0 @@ -* Freescale SGTL5000 Stereo Codec - -Required properties: -- compatible : "fsl,sgtl5000". - -- reg : the I2C address of the device - -- #sound-dai-cells: must be equal to 0 - -- clocks : the clock provider of SYS_MCLK - -- VDDA-supply : the regulator provider of VDDA - -- VDDIO-supply: the regulator provider of VDDIO - -Optional properties: - -- VDDD-supply : the regulator provider of VDDD - -- micbias-resistor-k-ohms : the bias resistor to be used in kOhms - The resistor can take values of 2k, 4k or 8k. - If set to 0 it will be off. - If this node is not mentioned or if the value is unknown, then - micbias resistor is set to 4K. - -- micbias-voltage-m-volts : the bias voltage to be used in mVolts - The voltage can take values from 1.25V to 3V by 250mV steps - If this node is not mentioned or the value is unknown, then - the value is set to 1.25V. - -- lrclk-strength: the LRCLK pad strength. Possible values are: -0, 1, 2 and 3 as per the table below: - -VDDIO 1.8V 2.5V 3.3V -0 = Disable -1 = 1.66 mA 2.87 mA 4.02 mA -2 = 3.33 mA 5.74 mA 8.03 mA -3 = 4.99 mA 8.61 mA 12.05 mA - -- sclk-strength: the SCLK pad strength. Possible values are: -0, 1, 2 and 3 as per the table below: - -VDDIO 1.8V 2.5V 3.3V -0 = Disable -1 = 1.66 mA 2.87 mA 4.02 mA -2 = 3.33 mA 5.74 mA 8.03 mA -3 = 4.99 mA 8.61 mA 12.05 mA - -Example: - -sgtl5000: codec@a { - compatible = "fsl,sgtl5000"; - reg = <0x0a>; - #sound-dai-cells = <0>; - clocks = <&clks 150>; - micbias-resistor-k-ohms = <2>; - micbias-voltage-m-volts = <2250>; - VDDA-supply = <®_3p3v>; - VDDIO-supply = <®_3p3v>; -};
Documentation/devicetree/bindings/sound/sgtl5000.yaml new file +103 -0
103 lines not on this page · raw message
Documentation/devicetree/bindings/trivial-devices.yaml +0 -2
@@ -80,8 +80,6 @@ properties: - fsl,mpl3115 # MPR121: Proximity Capacitive Touch Sensor Controller - fsl,mpr121 - # SGTL5000: Ultra Low-Power Audio Codec - - fsl,sgtl5000 # G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface - gmt,g751 # Infineon IR38064 Voltage Regulator
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 21/38] dt-bindings: sound: sgtl5000: Convert to json-schema
Quoted 51 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the Freescale SGTL5000 device tree bindings from free-form text format to json-schema.
Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/sound/sgtl5000.txt | 60 ---------- .../devicetree/bindings/sound/sgtl5000.yaml | 103 ++++++++++++++++++ .../devicetree/bindings/trivial-devices.yaml | 2 - 3 files changed, 103 insertions(+), 62 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/sgtl5000.txt create mode 100644 Documentation/devicetree/bindings/sound/sgtl5000.yamlDocumentation/devicetree/bindings/sound/sgtl5000.yaml new file +30
-0@@ -0,0 +1,103 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/sgtl5000.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale SGTL5000 Stereo Codec + +maintainers: + - Fabio Estevam <[email protected]> + +properties: + compatible: + const: fsl,sgtl5000 + + reg: + maxItems: 1 + + "#sound-dai-cells": + const: 0 + + clocks: + items: + - description: the clock provider of SYS_MCLK + + VDDA-supply: + description: the regulator provider of VDDA + + VDDIO-supply: + description: the regulator provider of VDDIO
Documentation/devicetree/bindings/sound/sgtl5000.yaml line 40
Quoted 10 lines
Documentation/devicetree/bindings/sound/sgtl5000.yaml new file +10
-0+ + VDDD-supply: + description: the regulator provider of VDDD + + micbias-resistor-k-ohms: + description: The bias resistor to be used in kOhms. The resistor can take + values of 2k, 4k or 8k. If set to 0 it will be off. If this node is not + mentioned or if the value is unknown, then micbias resistor is set to + 4k. + $ref: "/schemas/types.yaml#/definitions/uint32"
Anything with standard unit suffix already has a type.
Quoted 79 lines
Documentation/devicetree/bindings/sound/sgtl5000.yaml new file +63
-0+ enum: [ 0, 2, 4, 8 ] + + micbias-voltage-m-volts: + description: The bias voltage to be used in mVolts. The voltage can take + values from 1.25V to 3V by 250mV steps. If this node is not mentioned + or the value is unknown, then the value is set to 1.25V. + $ref: "/schemas/types.yaml#/definitions/uint32" + enum: [ 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000 ] + + lrclk-strength: + description: | + The LRCLK pad strength. Possible values are: 0, 1, 2 and 3 as per the + table below: + + VDDIO 1.8V 2.5V 3.3V + 0 = Disable + 1 = 1.66 mA 2.87 mA 4.02 mA + 2 = 3.33 mA 5.74 mA 8.03 mA + 3 = 4.99 mA 8.61 mA 12.05 mA + $ref: "/schemas/types.yaml#/definitions/uint32" + enum: [ 0, 1, 2, 3 ] + + sclk-strength: + description: | + The SCLK pad strength. Possible values are: 0, 1, 2 and 3 as per the + table below: + + VDDIO 1.8V 2.5V 3.3V + 0 = Disable + 1 = 1.66 mA 2.87 mA 4.02 mA + 2 = 3.33 mA 5.74 mA 8.03 mA + 3 = 4.99 mA 8.61 mA 12.05 mA + $ref: "/schemas/types.yaml#/definitions/uint32" + enum: [ 0, 1, 2, 3 ] + +required: + - compatible + - reg + - "#sound-dai-cells" + - clocks + - VDDA-supply + - VDDIO-supply + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + codec@a { + compatible = "fsl,sgtl5000"; + reg = <0x0a>; + #sound-dai-cells = <0>; + clocks = <&clks 150>; + micbias-resistor-k-ohms = <2>; + micbias-voltage-m-volts = <2250>; + VDDA-supply = <®_3p3v>; + VDDIO-supply = <®_3p3v>; + }; + }; +...Documentation/devicetree/bindings/trivial-devices.yaml +0
-2@@ -80,8 +80,6 @@ properties: - fsl,mpl3115 # MPR121: Proximity Capacitive Touch Sensor Controller - fsl,mpr121 - # SGTL5000: Ultra Low-Power Audio Codec - - fsl,sgtl5000 # G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface - gmt,g751 # Infineon IR38064 Voltage RegulatorSignature · 1 line
2.24.1
PATCH 22/38 dt-bindings: gpio: tegra186: Use unique include guard
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
This header file can be included from the same source or DTS files as the existing dt-bindings/gpio/tegra-gpio.h header, so make sure its include guard is unique.
--- include/dt-bindings/gpio/tegra186-gpio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/dt-bindings/gpio/tegra186-gpio.h +2 -2
@@ -8,8 +8,8 @@* The second cell contains standard flag values specified in gpio.h. */ -#ifndef _DT_BINDINGS_GPIO_TEGRA_GPIO_H -#define _DT_BINDINGS_GPIO_TEGRA_GPIO_H +#ifndef _DT_BINDINGS_GPIO_TEGRA186_GPIO_H +#define _DT_BINDINGS_GPIO_TEGRA186_GPIO_H#include <dt-bindings/gpio/gpio.h>
Signature · 1 line
2.24.1
PATCH 23/38 dt-bindings: gpio: tegra186: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Tegra186 GPIO controller device tree bindings from free-form text format to json-schema.
--- .../bindings/gpio/nvidia,tegra186-gpio.txt | 165 -------------- .../bindings/gpio/nvidia,tegra186-gpio.yaml | 215 ++++++++++++++++++ 2 files changed, 215 insertions(+), 165 deletions(-) delete mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt create mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt deleted +0 -165
@@ -1,165 +0,0 @@ -NVIDIA Tegra186 GPIO controllers - -Tegra186 contains two GPIO controllers; a main controller and an "AON" -controller. This binding document applies to both controllers. The register -layouts for the controllers share many similarities, but also some significant -differences. Hence, this document describes closely related but different -bindings and compatible values. - -The Tegra186 GPIO controller allows software to set the IO direction of, and -read/write the value of, numerous GPIO signals. Routing of GPIO signals to -package balls is under the control of a separate pin controller HW block. Two -major sets of registers exist: - -a) Security registers, which allow configuration of allowed access to the GPIO -register set. These registers exist in a single contiguous block of physical -address space. The size of this block, and the security features available, -varies between the different GPIO controllers. - -Access to this set of registers is not necessary in all circumstances. Code -that wishes to configure access to the GPIO registers needs access to these -registers to do so. Code which simply wishes to read or write GPIO data does not -need access to these registers. - -b) GPIO registers, which allow manipulation of the GPIO signals. In some GPIO -controllers, these registers are exposed via multiple "physical aliases" in -address space, each of which access the same underlying state. See the hardware -documentation for rationale. Any particular GPIO client is expected to access -just one of these physical aliases. - -Tegra HW documentation describes a unified naming convention for all GPIOs -implemented by the SoC. Each GPIO is assigned to a port, and a port may control -a number of GPIOs. Thus, each GPIO is named according to an alphabetical port -name and an integer GPIO name within the port. For example, GPIO_PA0, GPIO_PN6, -or GPIO_PCC3. - -The number of ports implemented by each GPIO controller varies. The number of -implemented GPIOs within each port varies. GPIO registers within a controller -are grouped and laid out according to the port they affect. - -The mapping from port name to the GPIO controller that implements that port, and -the mapping from port name to register offset within a controller, are both -extremely non-linear. The header file <dt-bindings/gpio/tegra186-gpio.h> -describes the port-level mapping. In that file, the naming convention for ports -matches the HW documentation. The values chosen for the names are alphabetically -sorted within a particular controller. Drivers need to map between the DT GPIO -IDs and HW register offsets using a lookup table. - -Each GPIO controller can generate a number of interrupt signals. Each signal -represents the aggregate status for all GPIOs within a set of ports. Thus, the -number of interrupt signals generated by a controller varies as a rough function -of the number of ports it implements. Note that the HW documentation refers to -both the overall controller HW module and the sets-of-ports as "controllers". - -Each GPIO controller in fact generates multiple interrupts signals for each set -of ports. Each GPIO may be configured to feed into a specific one of the -interrupt signals generated by a set-of-ports. The intent is for each generated -signal to be routed to a different CPU, thus allowing different CPUs to each -handle subsets of the interrupts within a port. The status of each of these -per-port-set signals is reported via a separate register. Thus, a driver needs -to know which status register to observe. This binding currently defines no -configuration mechanism for this. By default, drivers should use register -GPIO_${port}_INTERRUPT_STATUS_G1_0. Future revisions to the binding could -define a property to configure this. - -Required properties: -- compatible - Array of strings. - One of: - - "nvidia,tegra186-gpio". - - "nvidia,tegra186-gpio-aon". - - "nvidia,tegra194-gpio". - - "nvidia,tegra194-gpio-aon". -- reg-names - Array of strings. - Contains a list of names for the register spaces described by the reg - property. May contain the following entries, in any order: - - "gpio": Mandatory. GPIO control registers. This may cover either: - a) The single physical alias that this OS should use. - b) All physical aliases that exist in the controller. This is - appropriate when the OS is responsible for managing assignment of - the physical aliases. - - "security": Optional. Security configuration registers. - Users of this binding MUST look up entries in the reg property by name, - using this reg-names property to do so. -- reg - Array of (physical base address, length) tuples. - Must contain one entry per entry in the reg-names property, in a matching - order. -- interrupts - Array of interrupt specifiers. - The interrupt outputs from the HW block, one per set of ports, in the - order the HW manual describes them. The number of entries required varies - depending on compatible value: - - "nvidia,tegra186-gpio": 6 entries. - - "nvidia,tegra186-gpio-aon": 1 entry. - - "nvidia,tegra194-gpio": 6 entries. - - "nvidia,tegra194-gpio-aon": 1 entry. -- gpio-controller - Boolean. - Marks the device node as a GPIO controller/provider. -- #gpio-cells - Single-cell integer. - Must be <2>. - Indicates how many cells are used in a consumer's GPIO specifier. - In the specifier: - - The first cell is the pin number. - See <dt-bindings/gpio/tegra186-gpio.h>. - - The second cell contains flags: - - Bit 0 specifies polarity - - 0: Active-high (normal). - - 1: Active-low (inverted). -- interrupt-controller - Boolean. - Marks the device node as an interrupt controller/provider. -- #interrupt-cells - Single-cell integer. - Must be <2>. - Indicates how many cells are used in a consumer's interrupt specifier. - In the specifier: - - The first cell is the GPIO number. - See <dt-bindings/gpio/tegra186-gpio.h>. - - The second cell is contains flags: - - Bits [3:0] indicate trigger type and level: - - 1: Low-to-high edge triggered. - - 2: High-to-low edge triggered. - - 4: Active high level-sensitive. - - 8: Active low level-sensitive. - Valid combinations are 1, 2, 3, 4, 8. - -Example: - -#include <dt-bindings/interrupt-controller/irq.h> - -gpio@2200000 { - compatible = "nvidia,tegra186-gpio"; - reg-names = "security", "gpio"; - reg = - <0x0 0x2200000 0x0 0x10000>, - <0x0 0x2210000 0x0 0x10000>; - interrupts = - <0 47 IRQ_TYPE_LEVEL_HIGH>, - <0 50 IRQ_TYPE_LEVEL_HIGH>, - <0 53 IRQ_TYPE_LEVEL_HIGH>, - <0 56 IRQ_TYPE_LEVEL_HIGH>, - <0 59 IRQ_TYPE_LEVEL_HIGH>, - <0 180 IRQ_TYPE_LEVEL_HIGH>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; -}; - -gpio@c2f0000 { - compatible = "nvidia,tegra186-gpio-aon"; - reg-names = "security", "gpio"; - reg = - <0x0 0xc2f0000 0x0 0x1000>, - <0x0 0xc2f1000 0x0 0x1000>; - interrupts = - <0 60 IRQ_TYPE_LEVEL_HIGH>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; -};
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml new file +215 -0
215 lines not on this page · raw message
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 23/38] dt-bindings: gpio: tegra186: Convert to json-schema
Quoted 100 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the Tegra186 GPIO controller device tree bindings from free-form text format to json-schema.
Signed-off-by Thierry Reding <[email protected]>--- .../bindings/gpio/nvidia,tegra186-gpio.txt | 165 -------------- .../bindings/gpio/nvidia,tegra186-gpio.yaml | 215 ++++++++++++++++++ 2 files changed, 215 insertions(+), 165 deletions(-) delete mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.txt create mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yamlDocumentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml new file +80
-0@@ -0,0 +1,215 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/nvidia,tegra186-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra GPIO Controller (Tegra186 and later) + +maintainers: + - Thierry Reding <[email protected]> + - Jon Hunter <[email protected]> + +description: | + Tegra186 contains two GPIO controllers; a main controller and an "AON" + controller. This binding document applies to both controllers. The register + layouts for the controllers share many similarities, but also some + significant differences. Hence, this document describes closely related but + different bindings and compatible values. + + The Tegra186 GPIO controller allows software to set the IO direction of, + and read/write the value of, numerous GPIO signals. Routing of GPIO signals + to package balls is under the control of a separate pin controller hardware + block. Two major sets of registers exist: + + a) Security registers, which allow configuration of allowed access to the + GPIO register set. These registers exist in a single contiguous block + of physical address space. The size of this block, and the security + features available, varies between the different GPIO controllers. + + Access to this set of registers is not necessary in all circumstances. + Code that wishes to configure access to the GPIO registers needs access + to these registers to do so. Code which simply wishes to read or write + GPIO data does not need access to these registers. + + b) GPIO registers, which allow manipulation of the GPIO signals. In some + GPIO controllers, these registers are exposed via multiple "physical + aliases" in address space, each of which access the same underlying + state. See the hardware documentation for rationale. Any particular + GPIO client is expected to access just one of these physical aliases. + + Tegra HW documentation describes a unified naming convention for all GPIOs + implemented by the SoC. Each GPIO is assigned to a port, and a port may + control a number of GPIOs. Thus, each GPIO is named according to an + alphabetical port name and an integer GPIO name within the port. For + example, GPIO_PA0, GPIO_PN6, or GPIO_PCC3. + + The number of ports implemented by each GPIO controller varies. The number + of implemented GPIOs within each port varies. GPIO registers within a + controller are grouped and laid out according to the port they affect. + + The mapping from port name to the GPIO controller that implements that + port, and the mapping from port name to register offset within a + controller, are both extremely non-linear. The header file + <dt-bindings/gpio/tegra186-gpio.h> describes the port-level mapping. In + that file, the naming convention for ports matches the HW documentation. + The values chosen for the names are alphabetically sorted within a + particular controller. Drivers need to map between the DT GPIO IDs and HW + register offsets using a lookup table. + + Each GPIO controller can generate a number of interrupt signals. Each + signal represents the aggregate status for all GPIOs within a set of + ports. Thus, the number of interrupt signals generated by a controller + varies as a rough function of the number of ports it implements. Note + that the HW documentation refers to both the overall controller HW + module and the sets-of-ports as "controllers". + + Each GPIO controller in fact generates multiple interrupts signals for + each set of ports. Each GPIO may be configured to feed into a specific + one of the interrupt signals generated by a set-of-ports. The intent is + for each generated signal to be routed to a different CPU, thus allowing + different CPUs to each handle subsets of the interrupts within a port. + The status of each of these per-port-set signals is reported via a + separate register. Thus, a driver needs to know which status register to + observe. This binding currently defines no configuration mechanism for + this. By default, drivers should use register + GPIO_${port}_INTERRUPT_STATUS_G1_0. Future revisions to the binding could + define a property to configure this. + +properties: + compatible:
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml line 90
Quoted 10 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml new file +10
-0+ enum: + - nvidia,tegra186-gpio + - nvidia,tegra186-gpio-aon + - nvidia,tegra194-gpio + - nvidia,tegra194-gpio-aon + + reg-names: + items: + - const: security + - const: gpio
Wrong order? Doesn't match 'reg' description.
Quoted 14 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml new file +14
-0+ minItems: 1 + maxItems: 2 + + reg: + items: + - description: | + GPIO control registers. This may cover either: + + a) The single physical alias that this OS should use. + b) All physical aliases that exist in the controller. This is + appropriate when the OS is responsible for managing assignment + of the physical aliases. + - description: Security configuration registers. + minItems: 1
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml line 114
Quoted 10 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml new file +10
-0+ maxItems: 2 + + interrupts: + description: The interrupt outputs from the HW block, one per set of + ports, in the order the HW manual describes them. The number of entries + required varies depending on compatible value. + + gpio-controller: + description: Marks the device node as a GPIO controller/provider. + type: boolean
Just:
gpio-controller: true
Quoted 7 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml new file +7
-0+ + "#gpio-cells": + description: | + Indicates how many cells are used in a consumer's GPIO specifier. In the + specifier: + + - The first cell is the pin number.
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml line 131
Quoted 10 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml new file +10
-0+ See <dt-bindings/gpio/tegra186-gpio.h>. + - The second cell contains flags: + - Bit 0 specifies polarity + - 0: Active-high (normal). + - 1: Active-low (inverted). + const: 2 + + interrupt-controller: + description: Marks the device node as an interrupt controller/provider. + type: boolean
Just:
interrupt-controller: true
Quoted 87 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml new file +84
-0+ + "#interrupt-cells": + description: | + Indicates how many cells are used in a consumer's interrupt specifier. + In the specifier: + + - The first cell is the GPIO number. + See <dt-bindings/gpio/tegra186-gpio.h>. + - The second cell is contains flags: + - Bits [3:0] indicate trigger type and level: + - 1: Low-to-high edge triggered. + - 2: High-to-low edge triggered. + - 4: Active high level-sensitive. + - 8: Active low level-sensitive. + + Valid combinations are 1, 2, 3, 4, 8. + +allOf: + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra186-gpio + - nvidia,tegra194-gpio + then: + properties: + interrupts: + minItems: 6 + maxItems: 6 + + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra186-gpio-aon + - nvidia,tegra194-gpio-aon + then: + properties: + interrupts: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - reg-names + - interrupts + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + gpio@2200000 { + compatible = "nvidia,tegra186-gpio"; + reg-names = "security", "gpio"; + reg = <0x0 0x2200000 0x0 0x10000>, + <0x0 0x2210000 0x0 0x10000>; + interrupts = <0 47 IRQ_TYPE_LEVEL_HIGH>, + <0 50 IRQ_TYPE_LEVEL_HIGH>, + <0 53 IRQ_TYPE_LEVEL_HIGH>, + <0 56 IRQ_TYPE_LEVEL_HIGH>, + <0 59 IRQ_TYPE_LEVEL_HIGH>, + <0 180 IRQ_TYPE_LEVEL_HIGH>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio@c2f0000 { + compatible = "nvidia,tegra186-gpio-aon"; + reg-names = "security", "gpio"; + reg = <0x0 0xc2f0000 0x0 0x1000>, + <0x0 0xc2f1000 0x0 0x1000>; + interrupts = <0 60 IRQ_TYPE_LEVEL_HIGH>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + };Signature · 1 line
2.24.1
PATCH 24/38 dt-bindings: mfd: max77620: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Maxim MAX77620 PMIC device tree bindings from free-form text format to json-schema.
This also pulls in the GPIO, regulator, pinmux and thermal bindings for the corresponding subdevices into the top-level binding so that it can be described more consistently.
--- .../bindings/gpio/gpio-max77620.txt | 25 - .../devicetree/bindings/mfd/max77620.txt | 162 ----- .../devicetree/bindings/mfd/max77620.yaml | 662 ++++++++++++++++++ .../bindings/pinctrl/pinctrl-max77620.txt | 127 ---- .../bindings/regulator/regulator-max77620.txt | 222 ------ .../bindings/thermal/max77620_thermal.txt | 70 -- 6 files changed, 662 insertions(+), 606 deletions(-) delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-max77620.txt delete mode 100644 Documentation/devicetree/bindings/mfd/max77620.txt create mode 100644 Documentation/devicetree/bindings/mfd/max77620.yaml delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-max77620.txt delete mode 100644 Documentation/devicetree/bindings/regulator/regulator-max77620.txt delete mode 100644 Documentation/devicetree/bindings/thermal/max77620_thermal.txt
Documentation/devicetree/bindings/gpio/gpio-max77620.txt deleted +0 -25
@@ -1,25 +0,0 @@ -GPIO driver for MAX77620 Power management IC from Maxim Semiconductor. - -Device has 8 GPIO pins which can be configured as GPIO as well as the -special IO functions. - -Required properties: -------------------- -- gpio-controller : Marks the device node as a gpio controller. -- #gpio-cells : Should be two. The first cell is the pin number and - the second cell is used to specify the gpio polarity: - 0 = active high - 1 = active low -For more details, please refer generic GPIO DT binding document -<devicetree/bindings/gpio/gpio.txt>. - -Example: --------- -#include <dt-bindings/mfd/max77620.h> -... -max77620@3c { - compatible = "maxim,max77620"; - - gpio-controller; - #gpio-cells = <2>; -};
Documentation/devicetree/bindings/mfd/max77620.txt deleted +0 -162
162 lines not on this page · raw message
Documentation/devicetree/bindings/mfd/max77620.yaml new file +662 -0
662 lines not on this page · raw message
Documentation/devicetree/bindings/pinctrl/pinctrl-max77620.txt deleted +0 -127
127 lines not on this page · raw message
Documentation/devicetree/bindings/regulator/regulator-max77620.txt deleted +0 -222
222 lines not on this page · raw message
Documentation/devicetree/bindings/thermal/max77620_thermal.txt deleted +0 -70
70 lines not on this page · raw message
Signature · 1 line
2.24.1
PATCH 25/38 dt-bindings: gpio: tegra: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the NVIDIA Tegra GPIO controller device tree bindings from free-form text format to json-schema.
--- .../bindings/gpio/nvidia,tegra20-gpio.txt | 40 ------- .../bindings/gpio/nvidia,tegra20-gpio.yaml | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 40 deletions(-) delete mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.txt create mode 100644 Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.txt deleted +0 -40
@@ -1,40 +0,0 @@ -NVIDIA Tegra GPIO controller - -Required properties: -- compatible : "nvidia,tegra<chip>-gpio" -- reg : Physical base address and length of the controller's registers. -- interrupts : The interrupt outputs from the controller. For Tegra20, - there should be 7 interrupts specified, and for Tegra30, there should - be 8 interrupts specified. -- #gpio-cells : Should be two. The first cell is the pin number and the - second cell is used to specify optional parameters: - - bit 0 specifies polarity (0 for normal, 1 for inverted) -- gpio-controller : Marks the device node as a GPIO controller. -- #interrupt-cells : Should be 2. - The first cell is the GPIO number. - The second cell is used to specify flags: - bits[3:0] trigger type and level flags: - 1 = low-to-high edge triggered. - 2 = high-to-low edge triggered. - 4 = active high level-sensitive. - 8 = active low level-sensitive. - Valid combinations are 1, 2, 3, 4, 8. -- interrupt-controller : Marks the device node as an interrupt controller. - -Example: - -gpio: gpio@6000d000 { - compatible = "nvidia,tegra20-gpio"; - reg = < 0x6000d000 0x1000 >; - interrupts = < 0 32 0x04 - 0 33 0x04 - 0 34 0x04 - 0 35 0x04 - 0 55 0x04 - 0 87 0x04 - 0 89 0x04 >; - #gpio-cells = <2>; - gpio-controller; - #interrupt-cells = <2>; - interrupt-controller; -};
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml new file +111 -0
111 lines not on this page · raw message
Signature · 1 line
2.24.1
Re: [PATCH 25/38] dt-bindings: gpio: tegra: Convert to json-schema
12.06.2020 17:18, Thierry Reding пишет:
...
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml line 65
Quoted 6 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml new file +6
-0+patternProperties: + # GPIO hogs; /schemas/gpio/gpio-hog.yaml will match + "^gpios(-[a-zA-Z0-9-]+)?$": + type: object + required: + - gpio-hog
There are two problems here:
1. This naming limitation didn't exist before this patch, so it's not a part of the conversion.
2. GPIO core uses the node's name for the hog's name. Hence by imposing the "gpios-" prefix, you're forcing all hogs to be named as gpios-xxx, which doesn't make much sense to me.
Please explain the rationale of this change.
Re: [PATCH 25/38] dt-bindings: gpio: tegra: Convert to json-schema
Quoted 11 lines · Dmitry Osipenko
12.06.2020 17:18, Thierry Reding пишет:
...Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml line 65
Quoted 6 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml new file +6
-0+patternProperties: + # GPIO hogs; /schemas/gpio/gpio-hog.yaml will match + "^gpios(-[a-zA-Z0-9-]+)?$": + type: object + required: + - gpio-hogThere are two problems here:
Quoted 8 lines
1. This naming limitation didn't exist before this patch, so it's not a part of the conversion.
2. GPIO core uses the node's name for the hog's name. Hence by imposing the "gpios-" prefix, you're forcing all hogs to be named as gpios-xxx, which doesn't make much sense to me.
Please explain the rationale of this change.
We could probably do without this if we didn't enforce additional or unevaluated properties. Because if we don't match on a pattern here then all of those GPIO hog nodes would show up as "extra" properties and they are currently not allowed. If we do allow them, then we can drop this, but we then have no way to fail validation for whatever else somebody might want to put into these device tree nodes.
That said, I think additionalProperties can be a schema in itself, so maybe there's a way to only allow additional properties if they are of type object and have a gpio-hog property. I'll look into that.
Thierry
Re: [PATCH 25/38] dt-bindings: gpio: tegra: Convert to json-schema
17.06.2020 17:17, Thierry Reding пишет:
Quoted 28 lines · Dmitry Osipenko
Quoted 11 lines
12.06.2020 17:18, Thierry Reding пишет:
...Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml line 65
Quoted 6 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml new file +6
-0+patternProperties: + # GPIO hogs; /schemas/gpio/gpio-hog.yaml will match + "^gpios(-[a-zA-Z0-9-]+)?$": + type: object + required: + - gpio-hogThere are two problems here:
Quoted 8 lines
1. This naming limitation didn't exist before this patch, so it's not a part of the conversion.
2. GPIO core uses the node's name for the hog's name. Hence by imposing the "gpios-" prefix, you're forcing all hogs to be named as gpios-xxx, which doesn't make much sense to me.
Please explain the rationale of this change.
We could probably do without this if we didn't enforce additional or unevaluated properties. Because if we don't match on a pattern here then all of those GPIO hog nodes would show up as "extra" properties and they are currently not allowed. If we do allow them, then we can drop this, but we then have no way to fail validation for whatever else somebody might want to put into these device tree nodes.
Quoted 3 lines
That said, I think additionalProperties can be a schema in itself, so maybe there's a way to only allow additional properties if they are of type object and have a gpio-hog property. I'll look into that.
Isn't it possible to validate the additional properties by checking what properties they have?
For example, if sub-node has a gpio-hog property then this sub-node is okay, otherwise fail.
Re: [PATCH 25/38] dt-bindings: gpio: tegra: Convert to json-schema
17.06.2020 17:24, Dmitry Osipenko пишет:
Quoted 33 lines
17.06.2020 17:17, Thierry Reding пишет:
Quoted 28 lines · Dmitry Osipenko
Quoted 11 lines
12.06.2020 17:18, Thierry Reding пишет:
...Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml line 65
Quoted 6 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml new file +6
-0+patternProperties: + # GPIO hogs; /schemas/gpio/gpio-hog.yaml will match + "^gpios(-[a-zA-Z0-9-]+)?$": + type: object + required: + - gpio-hogThere are two problems here:
Quoted 8 lines
1. This naming limitation didn't exist before this patch, so it's not a part of the conversion.
2. GPIO core uses the node's name for the hog's name. Hence by imposing the "gpios-" prefix, you're forcing all hogs to be named as gpios-xxx, which doesn't make much sense to me.
Please explain the rationale of this change.
We could probably do without this if we didn't enforce additional or unevaluated properties. Because if we don't match on a pattern here then all of those GPIO hog nodes would show up as "extra" properties and they are currently not allowed. If we do allow them, then we can drop this, but we then have no way to fail validation for whatever else somebody might want to put into these device tree nodes.
Quoted 3 lines
That said, I think additionalProperties can be a schema in itself, so maybe there's a way to only allow additional properties if they are of type object and have a gpio-hog property. I'll look into that.
Quoted 6 lines
Isn't it possible to validate the additional properties by checking what properties they have?
For example, if sub-node has a gpio-hog property then this sub-node is okay, otherwise fail.
Ah, I haven't finished reading yours last sentence before started to type :) Yes, it will be nice if we could avoid the naming limitation, or at least change it to something like xxx-hog.
Re: [PATCH 25/38] dt-bindings: gpio: tegra: Convert to json-schema
Quoted 37 lines · Dmitry Osipenko
17.06.2020 17:24, Dmitry Osipenko пишет:
Quoted 36 lines
17.06.2020 17:17, Thierry Reding пишет:
Quoted 28 lines · Dmitry Osipenko
Quoted 11 lines
12.06.2020 17:18, Thierry Reding пишет:
...Review
Quoted 6 lines
(quoted diff) +6
-0+patternProperties: + # GPIO hogs; /schemas/gpio/gpio-hog.yaml will match + "^gpios(-[a-zA-Z0-9-]+)?$": + type: object + required: + - gpio-hogThere are two problems here:
Quoted 8 lines
1. This naming limitation didn't exist before this patch, so it's not a part of the conversion.
2. GPIO core uses the node's name for the hog's name. Hence by imposing the "gpios-" prefix, you're forcing all hogs to be named as gpios-xxx, which doesn't make much sense to me.
Please explain the rationale of this change.
We could probably do without this if we didn't enforce additional or unevaluated properties. Because if we don't match on a pattern here then all of those GPIO hog nodes would show up as "extra" properties and they are currently not allowed. If we do allow them, then we can drop this, but we then have no way to fail validation for whatever else somebody might want to put into these device tree nodes.
Quoted 3 lines
That said, I think additionalProperties can be a schema in itself, so maybe there's a way to only allow additional properties if they are of type object and have a gpio-hog property. I'll look into that.
Isn't it possible to validate the additional properties by checking what properties they have?
Quoted 7 lines
Quoted 3 lines
For example, if sub-node has a gpio-hog property then this sub-node is okay, otherwise fail.
Ah, I haven't finished reading yours last sentence before started to type :) Yes, it will be nice if we could avoid the naming limitation, or at least change it to something like xxx-hog.
So according to the json-schema specification, both additionalProperties and unevaluatedProperties must be a valid JSON schema, which means they can be objects rather than just booleans. Unfortunately, dt-schema tools don't allow these to be objects, so the below currently fails with these tools at the moment.
I can make it work with the following patch against dt-schema.git:
--- >8 ---
meta-schemas/keywords.yaml +10 -2
@@ -79,7 +79,11 @@ properties: additionalItems: type: boolean additionalProperties: - type: boolean + oneOf: + - type: object + allOf: + - $ref: "#/definitions/sub-schemas" + - type: boolean allOf: items: $ref: "#/definitions/sub-schemas"
@@ -140,7 +144,11 @@ properties: type: true typeSize: true unevaluatedProperties: - type: boolean + oneOf: + - type: object + allOf: + - $ref: "#/definitions/sub-schemas" + - type: boolean uniqueItems: type: boolean
--- >8 ---
With that applied, I can make validation of gpio-hog nodes work without requiring the names to change, which incidentally will allow me to drop one of the fixup patches from the ARM/arm64 DTS series.
Here's a hunk that applies on top of this patch and makes this work. I'll squash it in for the next version.
--- >8 ---
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml +4 -8
@@ -57,13 +57,6 @@ properties: interrupt-controller: description: Marks the device node as an interrupt controller. -patternProperties: - # GPIO hogs; /schemas/gpio/gpio-hog.yaml will match - "^gpios(-[a-zA-Z0-9-]+)?$": - type: object - required: - - gpio-hog - allOf: - if: properties:
@@ -90,7 +83,10 @@ required: - "#interrupt-cells" - interrupt-controller -unevaluatedProperties: false +unevaluatedProperties: + type: object + required: + - gpio-hog examples: - |
--- >8 ---
Thierry
Re: [PATCH 25/38] dt-bindings: gpio: tegra: Convert to json-schema
17.06.2020 19:50, Thierry Reding пишет:
Quoted 116 lines · Dmitry Osipenko
Quoted 37 lines
17.06.2020 17:24, Dmitry Osipenko пишет:
Quoted 36 lines
17.06.2020 17:17, Thierry Reding пишет:
Quoted 28 lines · Dmitry Osipenko
Quoted 11 lines
12.06.2020 17:18, Thierry Reding пишет:
...Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml required: · line 89
Quoted 6 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml +6
-0+patternProperties: + # GPIO hogs; /schemas/gpio/gpio-hog.yaml will match + "^gpios(-[a-zA-Z0-9-]+)?$": + type: object + required: + - gpio-hogThere are two problems here:
Quoted 8 lines
1. This naming limitation didn't exist before this patch, so it's not a part of the conversion.
2. GPIO core uses the node's name for the hog's name. Hence by imposing the "gpios-" prefix, you're forcing all hogs to be named as gpios-xxx, which doesn't make much sense to me.
Please explain the rationale of this change.
We could probably do without this if we didn't enforce additional or unevaluated properties. Because if we don't match on a pattern here then all of those GPIO hog nodes would show up as "extra" properties and they are currently not allowed. If we do allow them, then we can drop this, but we then have no way to fail validation for whatever else somebody might want to put into these device tree nodes.
Quoted 3 lines
That said, I think additionalProperties can be a schema in itself, so maybe there's a way to only allow additional properties if they are of type object and have a gpio-hog property. I'll look into that.
Isn't it possible to validate the additional properties by checking what properties they have?
Quoted 7 lines
Quoted 3 lines
For example, if sub-node has a gpio-hog property then this sub-node is okay, otherwise fail.
Ah, I haven't finished reading yours last sentence before started to type :) Yes, it will be nice if we could avoid the naming limitation, or at least change it to something like xxx-hog.
So according to the json-schema specification, both additionalProperties and unevaluatedProperties must be a valid JSON schema, which means they can be objects rather than just booleans. Unfortunately, dt-schema tools don't allow these to be objects, so the below currently fails with these tools at the moment.
I can make it work with the following patch against dt-schema.git:
--- >8 ---
meta-schemas/keywords.yaml +10
-3@@ -79,7 +79,11 @@ properties: additionalItems: type: boolean additionalProperties: - type: boolean + oneOf: + - type: object + allOf: + - $ref: "#/definitions/sub-schemas" + - type: boolean allOf: items: $ref: "#/definitions/sub-schemas"@@ -140,7 +144,11 @@ properties: type: true typeSize: true unevaluatedProperties: - type: boolean + oneOf: + - type: object + allOf: + - $ref: "#/definitions/sub-schemas" + - type: boolean uniqueItems: type: boolean --- >8 ---With that applied, I can make validation of gpio-hog nodes work without requiring the names to change, which incidentally will allow me to drop one of the fixup patches from the ARM/arm64 DTS series.
Here's a hunk that applies on top of this patch and makes this work. I'll squash it in for the next version.
--- >8 ---
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml +0
-7@@ -57,13 +57,6 @@ properties: interrupt-controller: description: Marks the device node as an interrupt controller. -patternProperties: - # GPIO hogs; /schemas/gpio/gpio-hog.yaml will match - "^gpios(-[a-zA-Z0-9-]+)?$": - type: object - required: - - gpio-hog - allOf: - if: properties:@@ -90,7 +83,10 @@ required: - "#interrupt-cells" - interrupt-controller
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml required:
Quoted 10 lines
Documentation/devicetree/bindings/gpio/nvidia,tegra20-gpio.yaml +4
-2-unevaluatedProperties: false +unevaluatedProperties: + type: object + required: + - gpio-hog examples: - | --- >8 ---
Thank you for figuring this out! I see that the dt-schema tool is already updated in the git, very nice!
PATCH 26/38 dt-bindings: pci: iommu: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the PCI IOMMU device tree bindings from free-form text format to json-schema.
--- .../devicetree/bindings/pci/pci-iommu.txt | 171 ------------------ .../devicetree/bindings/pci/pci-iommu.yaml | 168 +++++++++++++++++ 2 files changed, 168 insertions(+), 171 deletions(-) delete mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.txt create mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.yaml
Documentation/devicetree/bindings/pci/pci-iommu.txt deleted +0 -171
@@ -1,171 +0,0 @@ -This document describes the generic device tree binding for describing the -relationship between PCI(e) devices and IOMMU(s). - -Each PCI(e) device under a root complex is uniquely identified by its Requester -ID (AKA RID). A Requester ID is a triplet of a Bus number, Device number, and -Function number. - -For the purpose of this document, when treated as a numeric value, a RID is -formatted such that: - -* Bits [15:8] are the Bus number. -* Bits [7:3] are the Device number. -* Bits [2:0] are the Function number. -* Any other bits required for padding must be zero. - -IOMMUs may distinguish PCI devices through sideband data derived from the -Requester ID. While a given PCI device can only master through one IOMMU, a -root complex may split masters across a set of IOMMUs (e.g. with one IOMMU per -bus). - -The generic 'iommus' property is insufficient to describe this relationship, -and a mechanism is required to map from a PCI device to its IOMMU and sideband -data. - -For generic IOMMU bindings, see -Documentation/devicetree/bindings/iommu/iommu.txt. - - -PCI root complex -================ - -Optional properties -------------------- - -- iommu-map: Maps a Requester ID to an IOMMU and associated IOMMU specifier - data. - - The property is an arbitrary number of tuples of - (rid-base,iommu,iommu-base,length). - - Any RID r in the interval [rid-base, rid-base + length) is associated with - the listed IOMMU, with the IOMMU specifier (r - rid-base + iommu-base). - -- iommu-map-mask: A mask to be applied to each Requester ID prior to being - mapped to an IOMMU specifier per the iommu-map property. - - -Example (1) -=========== - -/ { - #address-cells = <1>; - #size-cells = <1>; - - iommu: iommu@a { - reg = <0xa 0x1>; - compatible = "vendor,some-iommu"; - #iommu-cells = <1>; - }; - - pci: pci@f { - reg = <0xf 0x1>; - compatible = "vendor,pcie-root-complex"; - device_type = "pci"; - - /* - * The sideband data provided to the IOMMU is the RID, - * identity-mapped. - */ - iommu-map = <0x0 &iommu 0x0 0x10000>; - }; -}; - - -Example (2) -=========== - -/ { - #address-cells = <1>; - #size-cells = <1>; - - iommu: iommu@a { - reg = <0xa 0x1>; - compatible = "vendor,some-iommu"; - #iommu-cells = <1>; - }; - - pci: pci@f { - reg = <0xf 0x1>; - compatible = "vendor,pcie-root-complex"; - device_type = "pci"; - - /* - * The sideband data provided to the IOMMU is the RID with the - * function bits masked out. - */ - iommu-map = <0x0 &iommu 0x0 0x10000>; - iommu-map-mask = <0xfff8>; - }; -}; - - -Example (3) -=========== - -/ { - #address-cells = <1>; - #size-cells = <1>; - - iommu: iommu@a { - reg = <0xa 0x1>; - compatible = "vendor,some-iommu"; - #iommu-cells = <1>; - }; - - pci: pci@f { - reg = <0xf 0x1>; - compatible = "vendor,pcie-root-complex"; - device_type = "pci"; - - /* - * The sideband data provided to the IOMMU is the RID, - * but the high bits of the bus number are flipped. - */ - iommu-map = <0x0000 &iommu 0x8000 0x8000>, - <0x8000 &iommu 0x0000 0x8000>; - }; -}; - - -Example (4) -=========== - -/ { - #address-cells = <1>; - #size-cells = <1>; - - iommu_a: iommu@a { - reg = <0xa 0x1>; - compatible = "vendor,some-iommu"; - #iommu-cells = <1>; - }; - - iommu_b: iommu@b { - reg = <0xb 0x1>; - compatible = "vendor,some-iommu"; - #iommu-cells = <1>; - }; - - iommu_c: iommu@c { - reg = <0xc 0x1>; - compatible = "vendor,some-iommu"; - #iommu-cells = <1>; - }; - - pci: pci@f { - reg = <0xf 0x1>; - compatible = "vendor,pcie-root-complex"; - device_type = "pci"; - - /* - * Devices with bus number 0-127 are mastered via IOMMU - * a, with sideband data being RID[14:0]. - * Devices with bus number 128-255 are mastered via - * IOMMU b, with sideband data being RID[14:0]. - * No devices master via IOMMU c. - */ - iommu-map = <0x0000 &iommu_a 0x0000 0x8000>, - <0x8000 &iommu_b 0x0000 0x8000>; - }; -};
Documentation/devicetree/bindings/pci/pci-iommu.yaml new file +168 -0
168 lines not on this page · raw message
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 26/38] dt-bindings: pci: iommu: Convert to json-schema
Quoted 5 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the PCI IOMMU device tree bindings from free-form text format to json-schema.
Quoted 7 lines
Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/pci/pci-iommu.txt | 171 ------------------ .../devicetree/bindings/pci/pci-iommu.yaml | 168 +++++++++++++++++ 2 files changed, 168 insertions(+), 171 deletions(-) delete mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.txt create mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.yaml
This needs to come before you use it.
Quoted 177 lines
Documentation/devicetree/bindings/pci/pci-iommu.yaml new file +168
-0@@ -0,0 +1,168 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/pci-iommu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: PCI IOMMU bindings + +maintainers: + - Rob Herring <[email protected]> + +description: | + This document describes the generic device tree binding for describing the + relationship between PCI(e) devices and IOMMU(s). + + Each PCI(e) device under a root complex is uniquely identified by its + Requester ID (AKA RID). A Requester ID is a triplet of a Bus number, Device + number, and Function number. + + For the purpose of this document, when treated as a numeric value, a RID is + formatted such that: + + * Bits [15:8] are the Bus number. + * Bits [7:3] are the Device number. + * Bits [2:0] are the Function number. + * Any other bits required for padding must be zero. + + IOMMUs may distinguish PCI devices through sideband data derived from the + Requester ID. While a given PCI device can only master through one IOMMU, a + root complex may split masters across a set of IOMMUs (e.g. with one IOMMU + per bus). + + The generic 'iommus' property is insufficient to describe this relationship, + and a mechanism is required to map from a PCI device to its IOMMU and + sideband data. + + For generic IOMMU bindings, see + Documentation/devicetree/bindings/iommu/iommu.txt. + +properties: + iommu-map: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + description: | + Maps a Requester ID to an IOMMU and associated IOMMU specifier data. + + The property is an arbitrary number of tuples of (rid-base, iommu, + iommu-base, length). + + Any RID r in the interval [rid-base, rid-base + length) is associated + with the listed IOMMU, with the IOMMU specifier (r - rid-base + + iommu-base). + + iommu-map-mask: + $ref: "/schemas/types.yaml#/definitions/uint32" + description: + A mask to be applied to each Requester ID prior to being mapped to an + IOMMU specifier per the iommu-map property. + +examples: + - | + iommu0: iommu@a { + reg = <0xa 0x1>; + compatible = "vendor,some-iommu"; + #iommu-cells = <1>; + }; + + pci@f { + reg = <0xf 0x1>; + compatible = "vendor,pcie-root-complex"; + device_type = "pci"; + + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x02000000 0 0x00000000 0x00000000 0 0x00000000>; + + /* + * The sideband data provided to the IOMMU is the RID, + * identity-mapped. + */ + iommu-map = <0x0 &iommu0 0x0 0x10000>; + }; + + - | + iommu1: iommu@a { + reg = <0xa 0x1>; + compatible = "vendor,some-iommu"; + #iommu-cells = <1>; + }; + + pci@f { + reg = <0xf 0x1>; + compatible = "vendor,pcie-root-complex"; + device_type = "pci"; + + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x02000000 0 0x00000000 0x00000000 0 0x00000000>; + + /* + * The sideband data provided to the IOMMU is the RID with the + * function bits masked out. + */ + iommu-map = <0x0 &iommu 0x0 0x10000>; + iommu-map-mask = <0xfff8>; + }; + + - | + iommu2: iommu@a { + reg = <0xa 0x1>; + compatible = "vendor,some-iommu"; + #iommu-cells = <1>; + }; + + pci@f { + reg = <0xf 0x1>; + compatible = "vendor,pcie-root-complex"; + device_type = "pci"; + + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x02000000 0 0x00000000 0x00000000 0 0x00000000>; + + /* + * The sideband data provided to the IOMMU is the RID, + * but the high bits of the bus number are flipped. + */ + iommu-map = <0x0000 &iommu2 0x8000 0x8000>, + <0x8000 &iommu2 0x0000 0x8000>; + }; + + - | + iommu_a: iommu@a { + reg = <0xa 0x1>; + compatible = "vendor,some-iommu"; + #iommu-cells = <1>; + }; + + iommu_b: iommu@b { + reg = <0xb 0x1>; + compatible = "vendor,some-iommu"; + #iommu-cells = <1>; + }; + + iommu_c: iommu@c { + reg = <0xc 0x1>; + compatible = "vendor,some-iommu"; + #iommu-cells = <1>; + }; + + pci@f { + reg = <0xf 0x1>; + compatible = "vendor,pcie-root-complex"; + device_type = "pci"; + + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x02000000 0 0x00000000 0x00000000 0 0x00000000>; + + /* + * Devices with bus number 0-127 are mastered via IOMMU + * a, with sideband data being RID[14:0]. + * Devices with bus number 128-255 are mastered via + * IOMMU b, with sideband data being RID[14:0]. + * No devices master via IOMMU c. + */ + iommu-map = <0x0000 &iommu_a 0x0000 0x8000>, + <0x8000 &iommu_b 0x0000 0x8000>; + };Signature · 1 line
2.24.1
Re: [PATCH 26/38] dt-bindings: pci: iommu: Convert to json-schema
Quoted 14 lines · Rob Herring
Quoted 5 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the PCI IOMMU device tree bindings from free-form text format to json-schema.
Quoted 7 lines
Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/pci/pci-iommu.txt | 171 ------------------ .../devicetree/bindings/pci/pci-iommu.yaml | 168 +++++++++++++++++ 2 files changed, 168 insertions(+), 171 deletions(-) delete mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.txt create mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.yaml
Quoted 1 line
This needs to come before you use it.
Of course, will rearrange the patches.
Thierry
Re: [PATCH 26/38] dt-bindings: pci: iommu: Convert to json-schema
In reply to Rob HerringQuoted 14 lines · Rob Herring
Quoted 5 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the PCI IOMMU device tree bindings from free-form text format to json-schema.
Quoted 7 lines
Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/pci/pci-iommu.txt | 171 ------------------ .../devicetree/bindings/pci/pci-iommu.yaml | 168 +++++++++++++++++ 2 files changed, 168 insertions(+), 171 deletions(-) delete mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.txt create mode 100644 Documentation/devicetree/bindings/pci/pci-iommu.yaml
Quoted 1 line
This needs to come before you use it.
Good point, I'll reorder it.
Thierry
PATCH 27/38 dt-bindings: tegra: Add missing compatible strings
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The Nyan Blaze and Nyan Big, as well as Jetson Nano (P3450-0000), Darcy (P2894-0050-A08) and Pixel C (Smaug) were never mentioned. Add them.
While at it, also fix a typo in the compatible string for Apalis Tegra30 v1.1 evaluation board.
--- .../devicetree/bindings/arm/tegra.yaml | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/arm/tegra.yaml +44 -2
@@ -49,7 +49,7 @@ properties: - const: toradex,apalis_t30 - const: nvidia,tegra30 - items: - - const: toradex,apalis_t30-eval-v1.1 + - const: toradex,apalis_t30-v1.1-eval - const: toradex,apalis_t30-eval - const: toradex,apalis_t30-v1.1 - const: toradex,apalis_t30
@@ -80,6 +80,33 @@ properties: - const: toradex,apalis-tk1-v1.2 - const: toradex,apalis-tk1 - const: nvidia,tegra124 + - items: + - const: google,nyan-big-rev7 + - const: google,nyan-big-rev6 + - const: google,nyan-big-rev5 + - const: google,nyan-big-rev4 + - const: google,nyan-big-rev3 + - const: google,nyan-big-rev2 + - const: google,nyan-big-rev1 + - const: google,nyan-big-rev0 + - const: google,nyan-big + - const: google,nyan + - const: nvidia,tegra124 + - items: + - const: google,nyan-blaze-rev10 + - const: google,nyan-blaze-rev9 + - const: google,nyan-blaze-rev8 + - const: google,nyan-blaze-rev7 + - const: google,nyan-blaze-rev6 + - const: google,nyan-blaze-rev5 + - const: google,nyan-blaze-rev4 + - const: google,nyan-blaze-rev3 + - const: google,nyan-blaze-rev2 + - const: google,nyan-blaze-rev1 + - const: google,nyan-blaze-rev0 + - const: google,nyan-blaze + - const: google,nyan + - const: nvidia,tegra124 - items: - enum: - nvidia,norrin
@@ -91,7 +118,22 @@ properties: - nvidia,p2371-0000 - nvidia,p2371-2180 - nvidia,p2571 - - nvidia,p2894-0050-a08 + - nvidia,p3450-0000 + - const: nvidia,tegra210 + - items: + - const: nvidia,p2894-0050-a08 + - const: nvidia,darcy + - const: nvidia,tegra210 + - items: + - const: google,smaug-rev8 + - const: google,smaug-rev7 + - const: google,smaug-rev6 + - const: google,smaug-rev5 + - const: google,smaug-rev4 + - const: google,smaug-rev3 + - const: google,smaug-rev2 + - const: google,smaug-rev1 + - const: google,smaug - const: nvidia,tegra210 - items: - enum:
Signature · 1 line
2.24.1
PATCH 28/38 dt-bindings: phy: tegra-xusb: Convert to json-schema
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Convert the Tegra XUSB pad controller bindings from free-form text format to json-schema.
--- .../phy/nvidia,tegra124-xusb-padctl.txt | 778 ----- .../phy/nvidia,tegra124-xusb-padctl.yaml | 2800 +++++++++++++++++ 2 files changed, 2800 insertions(+), 778 deletions(-) delete mode 100644 Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt create mode 100644 Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.yaml
Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt deleted +0 -778
@@ -1,778 +0,0 @@ -Device tree binding for NVIDIA Tegra XUSB pad controller -======================================================== - -The Tegra XUSB pad controller manages a set of I/O lanes (with differential -signals) which connect directly to pins/pads on the SoC package. Each lane -is controlled by a HW block referred to as a "pad" in the Tegra hardware -documentation. Each such "pad" may control either one or multiple lanes, -and thus contains any logic common to all its lanes. Each lane can be -separately configured and powered up. - -Some of the lanes are high-speed lanes, which can be used for PCIe, SATA or -super-speed USB. Other lanes are for various types of low-speed, full-speed -or high-speed USB (such as UTMI, ULPI and HSIC). The XUSB pad controller -contains a software-configurable mux that sits between the I/O controller -ports (e.g. PCIe) and the lanes. - -In addition to per-lane configuration, USB 3.0 ports may require additional -settings on a per-board basis. - -Pads will be represented as children of the top-level XUSB pad controller -device tree node. Each lane exposed by the pad will be represented by its -own subnode and can be referenced by users of the lane using the standard -PHY bindings, as described by the phy-bindings.txt file in this directory. - -The Tegra hardware documentation refers to the connection between the XUSB -pad controller and the XUSB controller as "ports". This is confusing since -"port" is typically used to denote the physical USB receptacle. The device -tree binding in this document uses the term "port" to refer to the logical -abstraction of the signals that are routed to a USB receptacle (i.e. a PHY -for the USB signal, the VBUS power supply, the USB 2.0 companion port for -USB 3.0 receptacles, ...). - -Required properties: --------------------- -- compatible: Must be: - - Tegra124: "nvidia,tegra124-xusb-padctl" - - Tegra132: "nvidia,tegra132-xusb-padctl", "nvidia,tegra124-xusb-padctl" - - Tegra210: "nvidia,tegra210-xusb-padctl" - - Tegra186: "nvidia,tegra186-xusb-padctl" - - Tegra194: "nvidia,tegra194-xusb-padctl" -- reg: Physical base address and length of the controller's registers. -- resets: Must contain an entry for each entry in reset-names. -- reset-names: Must include the following entries: - - "padctl" - -For Tegra124: -- avdd-pll-utmip-supply: UTMI PLL power supply. Must supply 1.8 V. -- avdd-pll-erefe-supply: PLLE reference PLL power supply. Must supply 1.05 V. -- avdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V. -- hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 3.3 V. - -For Tegra210: -- avdd-pll-utmip-supply: UTMI PLL power supply. Must supply 1.8 V. -- avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V. -- dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V. -- hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V. - -For Tegra186: -- avdd-pll-erefeut-supply: UPHY brick and reference clock as well as UTMI PHY - power supply. Must supply 1.8 V. -- avdd-usb-supply: USB I/Os, VBUS, ID, REXT, D+/D- power supply. Must supply - 3.3 V. -- vclamp-usb-supply: Bias rail for USB pad. Must supply 1.8 V. -- vddio-hsic-supply: HSIC PHY power supply. Must supply 1.2 V. - -For Tegra194: -- avdd-usb-supply: USB I/Os, VBUS, ID, REXT, D+/D- power supply. Must supply - 3.3 V. -- vclamp-usb-supply: Bias rail for USB pad. Must supply 1.8 V. - -Pad nodes: -========== - -A required child node named "pads" contains a list of subnodes, one for each -of the pads exposed by the XUSB pad controller. Each pad may need additional -resources that can be referenced in its pad node. - -The "status" property is used to enable or disable the use of a pad. If set -to "disabled", the pad will not be used on the given board. In order to use -the pad and any of its lanes, this property must be set to "okay". - -For Tegra124 and Tegra132, the following pads exist: usb2, ulpi, hsic, pcie -and sata. No extra resources are required for operation of these pads. - -For Tegra210, the following pads exist: usb2, hsic, pcie and sata. Below is -a description of the properties of each pad. - -UTMI pad: ---------- - -Required properties: -- clocks: Must contain an entry for each entry in clock-names. -- clock-names: Must contain the following entries: - - "trk": phandle and specifier referring to the USB2 tracking clock - -HSIC pad: ---------- - -Required properties: -- clocks: Must contain an entry for each entry in clock-names. -- clock-names: Must contain the following entries: - - "trk": phandle and specifier referring to the HSIC tracking clock - -PCIe pad: ---------- - -Required properties: -- clocks: Must contain an entry for each entry in clock-names. -- clock-names: Must contain the following entries: - - "pll": phandle and specifier referring to the PLLE -- resets: Must contain an entry for each entry in reset-names. -- reset-names: Must contain the following entries: - - "phy": reset for the PCIe UPHY block - -SATA pad: ---------- - -Required properties: -- resets: Must contain an entry for each entry in reset-names. -- reset-names: Must contain the following entries: - - "phy": reset for the SATA UPHY block - - -PHY nodes: -========== - -Each pad node has a child named "lanes" that contains one or more children of -its own, each representing one of the lanes controlled by the pad. - -Required properties: --------------------- -- status: Defines the operation status of the PHY. Valid values are: - - "disabled": the PHY is disabled - - "okay": the PHY is enabled -- #phy-cells: Should be 0. Since each lane represents a single PHY, there is - no need for an additional specifier. -- nvidia,function: The output function of the PHY. See below for a list of - valid functions per SoC generation. - -For Tegra124 and Tegra132, the list of valid PHY nodes is given below: -- usb2: usb2-0, usb2-1, usb2-2 - - functions: "snps", "xusb", "uart" -- ulpi: ulpi-0 - - functions: "snps", "xusb" -- hsic: hsic-0, hsic-1 - - functions: "snps", "xusb" -- pcie: pcie-0, pcie-1, pcie-2, pcie-3, pcie-4 - - functions: "pcie", "usb3-ss" -- sata: sata-0 - - functions: "usb3-ss", "sata" - -For Tegra210, the list of valid PHY nodes is given below: -- usb2: usb2-0, usb2-1, usb2-2, usb2-3 - - functions: "snps", "xusb", "uart" -- hsic: hsic-0, hsic-1 - - functions: "snps", "xusb" -- pcie: pcie-0, pcie-1, pcie-2, pcie-3, pcie-4, pcie-5, pcie-6 - - functions: "pcie-x1", "usb3-ss", "pcie-x4" -- sata: sata-0 - - functions: "usb3-ss", "sata" - -For Tegra194, the list of valid PHY nodes is given below: -- usb2: usb2-0, usb2-1, usb2-2, usb2-3 - - functions: "xusb" -- usb3: usb3-0, usb3-1, usb3-2, usb3-3 - - functions: "xusb" - -Port nodes: -=========== - -A required child node named "ports" contains a list of all the ports exposed -by the XUSB pad controller. Per-port configuration is only required for USB. - -USB2 ports: ------------ - -Required properties: -- status: Defines the operation status of the port. Valid values are: - - "disabled": the port is disabled - - "okay": the port is enabled -- mode: A string that determines the mode in which to run the port. Valid - values are: - - "host": for USB host mode - - "device": for USB device mode - - "otg": for USB OTG mode - -Required properties for OTG/Peripheral capable USB2 ports: -- usb-role-switch: Boolean property to indicate that the port support OTG or - peripheral mode. If present, the port supports switching between USB host - and peripheral roles. Connector should be added as subnode. - See usb/usb-conn-gpio.txt. - -Optional properties: -- nvidia,internal: A boolean property whose presence determines that a port - is internal. In the absence of this property the port is considered to be - external. -- vbus-supply: phandle to a regulator supplying the VBUS voltage. - -ULPI ports: ------------ - -Optional properties: -- status: Defines the operation status of the port. Valid values are: - - "disabled": the port is disabled - - "okay": the port is enabled -- nvidia,internal: A boolean property whose presence determines that a port - is internal. In the absence of this property the port is considered to be - external. -- vbus-supply: phandle to a regulator supplying the VBUS voltage. - -HSIC ports: ------------ - -Required properties: -- status: Defines the operation status of the port. Valid values are: - - "disabled": the port is disabled - - "okay": the port is enabled - -Optional properties: -- vbus-supply: phandle to a regulator supplying the VBUS voltage. - -Super-speed USB ports: ----------------------- - -Required properties: -- status: Defines the operation status of the port. Valid values are: - - "disabled": the port is disabled - - "okay": the port is enabled -- nvidia,usb2-companion: A single cell that specifies the physical port number - to map this super-speed USB port to. The range of valid port numbers varies - with the SoC generation: - - 0-2: for Tegra124 and Tegra132 - - 0-3: for Tegra210 - -Optional properties: -- nvidia,internal: A boolean property whose presence determines that a port - is internal. In the absence of this property the port is considered to be - external. - -- maximum-speed: Only for Tegra194. A string property that specifies maximum - supported speed of a usb3 port. Valid values are: - - "super-speed-plus": default, the usb3 port supports USB 3.1 Gen 2 speed. - - "super-speed": the usb3 port supports USB 3.1 Gen 1 speed only. - -For Tegra124 and Tegra132, the XUSB pad controller exposes the following -ports: -- 3x USB2: usb2-0, usb2-1, usb2-2 -- 1x ULPI: ulpi-0 -- 2x HSIC: hsic-0, hsic-1 -- 2x super-speed USB: usb3-0, usb3-1 - -For Tegra210, the XUSB pad controller exposes the following ports: -- 4x USB2: usb2-0, usb2-1, usb2-2, usb2-3 -- 2x HSIC: hsic-0, hsic-1 -- 4x super-speed USB: usb3-0, usb3-1, usb3-2, usb3-3 - -For Tegra194, the XUSB pad controller exposes the following ports: -- 4x USB2: usb2-0, usb2-1, usb2-2, usb2-3 -- 4x super-speed USB: usb3-0, usb3-1, usb3-2, usb3-3 - -Examples: -========= - -Tegra124 and Tegra132: ----------------------- - -SoC include: - - padctl@7009f000 { - /* for Tegra124 */ - compatible = "nvidia,tegra124-xusb-padctl"; - /* for Tegra132 */ - compatible = "nvidia,tegra132-xusb-padctl", - "nvidia,tegra124-xusb-padctl"; - reg = <0x0 0x7009f000 0x0 0x1000>; - resets = <&tegra_car 142>; - reset-names = "padctl"; - - pads { - usb2 { - status = "disabled"; - - lanes { - usb2-0 { - status = "disabled"; - #phy-cells = <0>; - }; - - usb2-1 { - status = "disabled"; - #phy-cells = <0>; - }; - - usb2-2 { - status = "disabled"; - #phy-cells = <0>; - }; - }; - }; - - ulpi { - status = "disabled"; - - lanes { - ulpi-0 { - status = "disabled"; - #phy-cells = <0>; - }; - }; - }; - - hsic { - status = "disabled"; - - lanes { - hsic-0 { - status = "disabled"; - #phy-cells = <0>; - }; - - hsic-1 { - status = "disabled"; - #phy-cells = <0>; - }; - }; - }; - - pcie { - status = "disabled"; - - lanes { - pcie-0 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-1 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-2 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-3 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-4 { - status = "disabled"; - #phy-cells = <0>; - }; - }; - }; - - sata { - status = "disabled"; - - lanes { - sata-0 { - status = "disabled"; - #phy-cells = <0>; - }; - }; - }; - }; - - ports { - usb2-0 { - status = "disabled"; - }; - - usb2-1 { - status = "disabled"; - }; - - usb2-2 { - status = "disabled"; - }; - - ulpi-0 { - status = "disabled"; - }; - - hsic-0 { - status = "disabled"; - }; - - hsic-1 { - status = "disabled"; - }; - - usb3-0 { - status = "disabled"; - }; - - usb3-1 { - status = "disabled"; - }; - }; - }; - -Board file: - - padctl@7009f000 { - status = "okay"; - - pads { - usb2 { - status = "okay"; - - lanes { - usb2-0 { - nvidia,function = "xusb"; - status = "okay"; - }; - - usb2-1 { - nvidia,function = "xusb"; - status = "okay"; - }; - - usb2-2 { - nvidia,function = "xusb"; - status = "okay"; - }; - }; - }; - - pcie { - status = "okay"; - - lanes { - pcie-0 { - nvidia,function = "usb3-ss"; - status = "okay"; - }; - - pcie-2 { - nvidia,function = "pcie"; - status = "okay"; - }; - - pcie-4 { - nvidia,function = "pcie"; - status = "okay"; - }; - }; - }; - - sata { - status = "okay"; - - lanes { - sata-0 { - nvidia,function = "sata"; - status = "okay"; - }; - }; - }; - }; - - ports { - /* Micro A/B */ - usb2-0 { - status = "okay"; - mode = "otg"; - }; - - /* Mini PCIe */ - usb2-1 { - status = "okay"; - mode = "host"; - }; - - /* USB3 */ - usb2-2 { - status = "okay"; - mode = "host"; - - vbus-supply = <&vdd_usb3_vbus>; - }; - - usb3-0 { - nvidia,port = <2>; - status = "okay"; - }; - }; - }; - -Tegra210: ---------- - -SoC include: - - padctl@7009f000 { - compatible = "nvidia,tegra210-xusb-padctl"; - reg = <0x0 0x7009f000 0x0 0x1000>; - resets = <&tegra_car 142>; - reset-names = "padctl"; - - status = "disabled"; - - pads { - usb2 { - clocks = <&tegra_car TEGRA210_CLK_USB2_TRK>; - clock-names = "trk"; - status = "disabled"; - - lanes { - usb2-0 { - status = "disabled"; - #phy-cells = <0>; - }; - - usb2-1 { - status = "disabled"; - #phy-cells = <0>; - }; - - usb2-2 { - status = "disabled"; - #phy-cells = <0>; - }; - - usb2-3 { - status = "disabled"; - #phy-cells = <0>; - }; - }; - }; - - hsic { - clocks = <&tegra_car TEGRA210_CLK_HSIC_TRK>; - clock-names = "trk"; - status = "disabled"; - - lanes { - hsic-0 { - status = "disabled"; - #phy-cells = <0>; - }; - - hsic-1 { - status = "disabled"; - #phy-cells = <0>; - }; - }; - }; - - pcie { - clocks = <&tegra_car TEGRA210_CLK_PLL_E>; - clock-names = "pll"; - resets = <&tegra_car 205>; - reset-names = "phy"; - status = "disabled"; - - lanes { - pcie-0 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-1 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-2 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-3 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-4 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-5 { - status = "disabled"; - #phy-cells = <0>; - }; - - pcie-6 { - status = "disabled"; - #phy-cells = <0>; - }; - }; - }; - - sata { - clocks = <&tegra_car TEGRA210_CLK_PLL_E>; - clock-names = "pll"; - resets = <&tegra_car 204>; - reset-names = "phy"; - status = "disabled"; - - lanes { - sata-0 { - status = "disabled"; - #phy-cells = <0>; - }; - }; - }; - }; - - ports { - usb2-0 { - status = "disabled"; - }; - - usb2-1 { - status = "disabled"; - }; - - usb2-2 { - status = "disabled"; - }; - - usb2-3 { - status = "disabled"; - }; - - hsic-0 { - status = "disabled"; - }; - - hsic-1 { - status = "disabled"; - }; - - usb3-0 { - status = "disabled"; - }; - - usb3-1 { - status = "disabled"; - }; - - usb3-2 { - status = "disabled"; - }; - - usb3-3 { - status = "disabled"; - }; - }; - }; - -Board file: - - padctl@7009f000 { - status = "okay"; - - pads { - usb2 { - status = "okay"; - - lanes { - usb2-0 { - nvidia,function = "xusb"; - status = "okay"; - }; - - usb2-1 { - nvidia,function = "xusb"; - status = "okay"; - }; - - usb2-2 { - nvidia,function = "xusb"; - status = "okay"; - }; - - usb2-3 { - nvidia,function = "xusb"; - status = "okay"; - }; - }; - }; - - pcie { - status = "okay"; - - lanes { - pcie-0 { - nvidia,function = "pcie-x1"; - status = "okay"; - }; - - pcie-1 { - nvidia,function = "pcie-x4"; - status = "okay"; - }; - - pcie-2 { - nvidia,function = "pcie-x4"; - status = "okay"; - }; - - pcie-3 { - nvidia,function = "pcie-x4"; - status = "okay"; - }; - - pcie-4 { - nvidia,function = "pcie-x4"; - status = "okay"; - }; - - pcie-5 { - nvidia,function = "usb3-ss"; - status = "okay"; - }; - - pcie-6 { - nvidia,function = "usb3-ss"; - status = "okay"; - }; - }; - }; - - sata { - status = "okay"; - - lanes { - sata-0 { - nvidia,function = "sata"; - status = "okay"; - }; - }; - }; - }; - - ports { - usb2-0 { - status = "okay"; - mode = "otg"; - }; - - usb2-1 { - status = "okay"; - vbus-supply = <&vdd_5v0_rtl>; - mode = "host"; - }; - - usb2-2 { - status = "okay"; - vbus-supply = <&vdd_usb_vbus>; - mode = "host"; - }; - - usb2-3 { - status = "okay"; - mode = "host"; - }; - - usb3-0 { - status = "okay"; - nvidia,lanes = "pcie-6"; - nvidia,port = <1>; - }; - - usb3-1 { - status = "okay"; - nvidia,lanes = "pcie-5"; - nvidia,port = <2>; - }; - }; - };
Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.yaml new file +2800 -0
2,222 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.24.1
Part of the diff is not shown here. View the raw message.
Rob Herring
maintainerRe: [PATCH 28/38] dt-bindings: phy: tegra-xusb: Convert to json-schema
Quoted 5 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the Tegra XUSB pad controller bindings from free-form text format to json-schema.
Quoted 7 lines
Signed-off-by Thierry Reding <[email protected]>--- .../phy/nvidia,tegra124-xusb-padctl.txt | 778 ----- .../phy/nvidia,tegra124-xusb-padctl.yaml | 2800 +++++++++++++++++ 2 files changed, 2800 insertions(+), 778 deletions(-) delete mode 100644 Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt create mode 100644 Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.yaml
This one I definitely think should be split up into multiple schema files. There's very little shared.
Rob
Re: [PATCH 28/38] dt-bindings: phy: tegra-xusb: Convert to json-schema
Quoted 14 lines · Rob Herring
Quoted 5 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Convert the Tegra XUSB pad controller bindings from free-form text format to json-schema.
Quoted 7 lines
Signed-off-by Thierry Reding <[email protected]>--- .../phy/nvidia,tegra124-xusb-padctl.txt | 778 ----- .../phy/nvidia,tegra124-xusb-padctl.yaml | 2800 +++++++++++++++++ 2 files changed, 2800 insertions(+), 778 deletions(-) delete mode 100644 Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt create mode 100644 Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.yaml
Quoted 2 lines
This one I definitely think should be split up into multiple schema files. There's very little shared.
Okay, I think I can do that. It's going to be a little annoying because then there's going to be at least four bindings to check, but I don't think it'll be all that bad. Once the bindings are merged I think I'll end up mostly running dtbs_check anyway, in which case the number of files doesn't really matter.
Thierry
PATCH 29/38 dt-bindings: tegra: pmc: Increase clock limit for power domains
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Power domains (such as the SOR domain) can have more than 8 clocks. Bump the limit to 10 which is enough as of now.
--- .../devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.yaml +1 -1
@@ -213,7 +213,7 @@ properties: patternProperties: clocks: minItems: 1 - maxItems: 8 + maxItems: 10 description: Must contain an entry for each clock required by the PMC for controlling a power-gate.
Signature · 1 line
2.24.1
PATCH 30/38 dt-bindings: panel: Allow reg property for DSI panels
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
For DSI panels the "reg" property is needed to represent the virtual channel of the given panel.
--- .../devicetree/bindings/display/panel/panel-simple.yaml | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/display/panel/panel-simple.yaml +3 -0
@@ -267,6 +267,9 @@ properties: # Winstar Display Corporation 3.5" QVGA (320x240) TFT LCD panel - winstar,wf35ltiacd + reg: + description: virtual channel for DSI panels + backlight: true enable-gpios: true port: true
Signature · 1 line
2.24.1
Re: [PATCH 30/38] dt-bindings: panel: Allow reg property for DSI panels
Quoted 16 lines · Thierry Reding
From: Thierry Reding <[email protected]>
For DSI panels the "reg" property is needed to represent the virtual channel of the given panel.
Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/display/panel/panel-simple.yaml | 3 +++ 1 file changed, 3 insertions(+)Documentation/devicetree/bindings/display/panel/panel-simple.yaml +0
-0
Documentation/devicetree/bindings/display/panel/panel-simple.yaml properties: · line 272
Quoted 6 lines
Documentation/devicetree/bindings/display/panel/panel-simple.yaml +3
-0@@ -267,6 +267,9 @@ properties: # Winstar Display Corporation 3.5" QVGA (320x240) TFT LCD panel - winstar,wf35ltiacd + reg: + description: virtual channel for DSI panels +
panel-simple-dsi.yaml?
Quoted 6 lines
Documentation/devicetree/bindings/display/panel/panel-simple.yaml +0
-1backlight: true enable-gpios: true port: true --2.24.1
Re: [PATCH 30/38] dt-bindings: panel: Allow reg property for DSI panels
Quoted 20 lines · Rob Herring
Quoted 19 lines · Thierry Reding
From: Thierry Reding <[email protected]>
For DSI panels the "reg" property is needed to represent the virtual channel of the given panel.
Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/display/panel/panel-simple.yaml | 3 +++ 1 file changed, 3 insertions(+)Documentation/devicetree/bindings/display/panel/panel-simple.yaml +0
-0@@ -267,6 +267,9 @@ properties: # Winstar Display Corporation 3.5" QVGA (320x240) TFT LCD panel - winstar,wf35ltiacd
Quoted 5 lines
Documentation/devicetree/bindings/display/panel/panel-simple.yaml properties: · line 272
Quoted 3 lines
Documentation/devicetree/bindings/display/panel/panel-simple.yaml +3
-0+ reg: + description: virtual channel for DSI panels +
panel-simple-dsi.yaml?
Heh... I had completely missed that. I've now replaced this patch with one that moves the lg,lh500wx1-sd03 compatible string to the DSI schema.
Thierry
PATCH 31/38 dt-bindings: panel: simple: Use unevaluatedProperties
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Using "additionalProperties: false" results in rejecting any of the properties defined in panel-common.yaml, whereas the intent is to inherit the common properties defined in that file.
--- .../devicetree/bindings/display/panel/panel-simple.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/display/panel/panel-simple.yaml +1 -1
@@ -275,7 +275,7 @@ properties: port: true power-supply: true -additionalProperties: false +unevaluatedProperties: false required: - compatible
Signature · 1 line
2.24.1
Re: [PATCH 31/38] dt-bindings: panel: simple: Use unevaluatedProperties
Quoted 17 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Using "additionalProperties: false" results in rejecting any of the properties defined in
panel-common.yaml, whereas the intent is to inherit the common properties defined in that file.Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/display/panel/panel-simple.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/devicetree/bindings/display/panel/panel-simple.yaml +0
-0
Documentation/devicetree/bindings/display/panel/panel-simple.yaml properties: · line 278
Quoted 5 lines
Documentation/devicetree/bindings/display/panel/panel-simple.yaml +1
-1@@ -275,7 +275,7 @@ properties: port: true power-supply: true -additionalProperties: false +unevaluatedProperties: false
But we've listed the properties we use here. Some of the common ones may not be applicable. Maybe they are and if so, then you should drop all the ones listed with 'true' with this change.
Rob
Re: [PATCH 31/38] dt-bindings: panel: simple: Use unevaluatedProperties
Quoted 21 lines · Rob Herring
Quoted 20 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Using "additionalProperties: false" results in rejecting any of the properties defined in
panel-common.yaml, whereas the intent is to inherit the common properties defined in that file.Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/display/panel/panel-simple.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/devicetree/bindings/display/panel/panel-simple.yaml +0
-0@@ -275,7 +275,7 @@ properties: port: true power-supply: true
Quoted 6 lines
Documentation/devicetree/bindings/display/panel/panel-simple.yaml properties: · line 278
Quoted 2 lines
Documentation/devicetree/bindings/display/panel/panel-simple.yaml +1
-1-additionalProperties: false +unevaluatedProperties: falseBut we've listed the properties we use here. Some of the common ones may not be applicable. Maybe they are and if so, then you should drop all the ones listed with 'true' with this change.
Looks like the only one I need this for is ddc-i2c-bus, which is already contained in panel-common.yaml. unevaluatedProperties: false is able to look into that and hence doesn't flag this as extra.
However, I can also work around that by adding a "ddc-i2c-bus: true" to panel-simple.yaml, which seems like it's the currently preferred way to do this. Is it expected that once jsonschema/dt-schema support the unevaluatedProperties keyword that we'd move towards using that instead?
Thierry
PATCH 32/38 dt-bindings: leds: Document rfkill* trigger
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
LEDs can use rfkill events as a trigger source, so document these in the device tree bindings.
--- .../devicetree/bindings/leds/common.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/leds/common.yaml +9 -8
@@ -79,24 +79,25 @@ properties: the LED. $ref: /schemas/types.yaml#definitions/string - enum: + oneOf: # LED will act as a back-light, controlled by the framebuffer system - - backlight + - const: backlight # LED will turn on (but for leds-gpio see "default-state" property in # Documentation/devicetree/bindings/leds/leds-gpio.yaml) - - default-on + - const: default-on # LED "double" flashes at a load average based rate - - heartbeat + - const: heartbeat # LED indicates disk activity - - disk-activity + - const: disk-activity # LED indicates IDE disk activity (deprecated), in new implementations # use "disk-activity" - - ide-disk + - const: ide-disk # LED flashes at a fixed, configurable rate - - timer + - const: timer # LED alters the brightness for the specified duration with one software # timer (requires "led-pattern" property) - - pattern + - const: pattern + - pattern: "^rfkill[0-9]+$" led-pattern: description: |
Signature · 1 line
2.24.1
PATCH 33/38 dt-bindings: memory-controller: Document Tegra132 EMC
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
Document the compatible string for the Tegra132 variant of the external memory controller.
--- .../bindings/memory-controllers/nvidia,tegra124-emc.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-emc.yaml +3 -1
@@ -16,7 +16,9 @@ description: | properties: compatible: - const: nvidia,tegra124-emc + enum: + - nvidia,tegra124-emc + - nvidia,tegra132-emc reg: maxItems: 1
Signature · 1 line
2.24.1
PATCH 34/38 dt-bindings: memory-controller: Fix "reg" entries on Tegra194
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The Tegra194 memory controller needs a couple more "reg" entries. Document this properly so that device trees can be validated.
--- .../nvidia,tegra186-mc.yaml | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +29 -10
@@ -27,13 +27,15 @@ properties: pattern: "^memory-controller@[0-9a-f]+$" compatible: - items: - - enum: - - nvidia,tegra186-mc - - nvidia,tegra194-mc + oneOf: + - description: NVIDIA Tegra186 memory controller + const: nvidia,tegra186-mc + - description: NVIDIA Tegra194 memory controller + const: nvidia,tegra194-mc reg: - maxItems: 1 + minItems: 1 + maxItems: 3 interrupts: maxItems: 1
@@ -74,12 +76,13 @@ patternProperties: - nvidia,tegra186-emc - nvidia,tegra194-emc - reg: - maxItems: 1 - interrupts: maxItems: 1 + reg: + minItems: 1 + maxItems: 2 + clocks: items: - description: external memory clock
@@ -107,11 +110,18 @@ allOf: properties: compatible: contains: - const: nvidia,tegra194-mc + anyOf: + - const: nvidia,tegra194-mc then: properties: reg: + minItems: 3 maxItems: 3 + else: + properties: + reg: + minItems: 1 + maxItems: 1 - if: patternProperties:
@@ -119,13 +129,22 @@ allOf: properties: compatible: contains: - const: nvidia,tegra194-emc + anyOf: + - const: nvidia,tegra194-emc then: patternProperties: "^external-memory-controller@[0-9a-f]+$": properties: reg: + minItems: 2 maxItems: 2 + else: + patternProperties: + "^external-memory-controller@[0-9a-f]+$": + properties: + reg: + minItems: 1 + maxItems: 1 examples: - |
Signature · 1 line
2.24.1
PATCH 35/38 dt-bindings: memory: Update Tegra210 EMC bindings
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The Tegra210 EMC is a cooling device because it can throttle the EMC frequency if the chip gets too hot. The device tree node therefore needs to contain the "#cooling-cells" property. Furthermore, multiple reserved memory regions can now be attached to the EMC device tree node, and the new memory-region-names property can be used to differentiate between them.
While at it, update the example to make it more fully-featured.
--- .../nvidia,tegra210-emc.yaml | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml +26 -8
@@ -34,16 +34,25 @@ properties: - description: EMC general interrupt memory-region: - $ref: /schemas/types.yaml#/definitions/phandle - description: - phandle to a reserved memory region describing the table of EMC - frequencies trained by the firmware + description: List of phandles to reserved memory regions describing the + nominal and derated tables of EMC frequencies trained by the firmware. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + memory-region-names: + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: nominal + - const: derated nvidia,memory-controller: - $ref: /schemas/types.yaml#/definitions/phandle + $ref: "/schemas/types.yaml#/definitions/phandle" description: phandle of the memory controller node + "#cooling-cells": + $ref: "/schemas/types.yaml#/definitions/uint32" + const: 2 + required: - compatible - reg
@@ -51,7 +60,10 @@ required: - clock-names - nvidia,memory-controller -additionalProperties: false +dependencies: + memory-region-names: [ memory-region ] + +unevaluatedProperties: false examples: - |
@@ -63,10 +75,15 @@ examples: #size-cells = <1>; ranges; - emc_table: emc-table@83400000 { + nominal: emc-table@83400000 { compatible = "nvidia,tegra210-emc-table"; reg = <0x83400000 0x10000>; }; + + derated: emc-table@83410000 { + compatible = "nvidia,tegar210-emc-table"; + reg = <0x83410000 0x10000>; + }; }; external-memory-controller@7001b000 {
@@ -77,6 +94,7 @@ examples: clocks = <&tegra_car TEGRA210_CLK_EMC>; clock-names = "emc"; interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>; - memory-region = <&emc_table>; + memory-region-names = "nominal", "derated"; + memory-region = <&nominal>, <&derated>; nvidia,memory-controller = <&mc>; };
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 35/38] dt-bindings: memory: Update Tegra210 EMC bindings
Quoted 24 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The Tegra210 EMC is a cooling device because it can throttle the EMC frequency if the chip gets too hot. The device tree node therefore needs to contain the "#cooling-cells" property. Furthermore, multiple reserved memory regions can now be attached to the EMC device tree node, and the new memory-region-names property can be used to differentiate between them.
While at it, update the example to make it more fully-featured.
Signed-off-by Thierry Reding <[email protected]>--- .../nvidia,tegra210-emc.yaml | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-)Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml +0
-0@@ -34,16 +34,25 @@ properties: - description: EMC general interrupt memory-region:
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml properties: · line 42
Quoted 10 lines
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml +6
-4- $ref: /schemas/types.yaml#/definitions/phandle - description: - phandle to a reserved memory region describing the table of EMC - frequencies trained by the firmware + description: List of phandles to reserved memory regions describing the + nominal and derated tables of EMC frequencies trained by the firmware. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + memory-region-names: + $ref: "/schemas/types.yaml#/definitions/string-array"
*-names has a type, so can be dropped.
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml properties: · line 48
Quoted 7 lines
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml +4
-1+ items: + - const: nominal + - const: derated nvidia,memory-controller: - $ref: /schemas/types.yaml#/definitions/phandle + $ref: "/schemas/types.yaml#/definitions/phandle"
Quotes aren't needed here. (We haven't been consistent on this).
Quoted 11 lines
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml +4
-0description: phandle of the memory controller node + "#cooling-cells": + $ref: "/schemas/types.yaml#/definitions/uint32" + const: 2 + required: - compatible - reg
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml required: · line 64
Quoted 6 lines
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml +2
-1@@ -51,7 +60,10 @@ required: - clock-names - nvidia,memory-controller -additionalProperties: false +dependencies: + memory-region-names: [ memory-region ]
The core schema should handle this (probably needs to be added).
Quoted 34 lines
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.yaml +10
-2+ +unevaluatedProperties: false examples: - |@@ -63,10 +75,15 @@ examples: #size-cells = <1>; ranges; - emc_table: emc-table@83400000 { + nominal: emc-table@83400000 { compatible = "nvidia,tegra210-emc-table"; reg = <0x83400000 0x10000>; }; + + derated: emc-table@83410000 { + compatible = "nvidia,tegar210-emc-table"; + reg = <0x83410000 0x10000>; + }; }; external-memory-controller@7001b000 {@@ -77,6 +94,7 @@ examples: clocks = <&tegra_car TEGRA210_CLK_EMC>; clock-names = "emc"; interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>; - memory-region = <&emc_table>; + memory-region-names = "nominal", "derated"; + memory-region = <&nominal>, <&derated>; nvidia,memory-controller = <&mc>; };Signature · 1 line
2.24.1
PATCH 36/38 dt-bindings: power: supply: sbs-battery: Document TI BQ20Z45 compatible
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The TI BQ20Z45 battery is used for example on Tegra114 Dalmore but was never documented. Add the missing compatible string.
While at it, also pull in the power-supply.yaml core bindings so that the standard power-supplies property is properly validated. Also switch to unevaluatedProperties to make sure the power-supply.yaml snippet is properly validated against (additionalProperties doesn't have visibility across a $ref).
--- .../devicetree/bindings/power/supply/sbs,sbs-battery.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/power/supply/sbs,sbs-battery.yaml +5 -1
@@ -18,6 +18,7 @@ properties: oneOf: - items: - enum: + - ti,bq20z45 - ti,bq20z65 - ti,bq20z75 - enum:
@@ -62,7 +63,10 @@ required: - compatible - reg -additionalProperties: false +allOf: + - $ref: power-supply.yaml# + +unevaluatedProperties: false examples: - |
Signature · 1 line
2.24.1
PATCH 37/38 dt-bindings: pwm: Explicitly include pwm.yaml
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
For PWM controller device tree bindings, make sure that they include the pwm.yaml controller core bindings explicitly. This prevents the tooling from matching on the $nodename pattern, which can falsely match things like pinmux nodes, etc.
--- .../bindings/pwm/allwinner,sun4i-a10-pwm.yaml | 51 ++++++++++--------- .../bindings/pwm/google,cros-ec-pwm.yaml | 4 +- .../devicetree/bindings/pwm/iqs620a-pwm.yaml | 4 +- .../devicetree/bindings/pwm/pwm-samsung.yaml | 1 - .../devicetree/bindings/pwm/pwm.yaml | 2 + .../bindings/pwm/renesas,pwm-rcar.yaml | 4 +- .../bindings/pwm/renesas,tpu-pwm.yaml | 4 +- 7 files changed, 40 insertions(+), 30 deletions(-)
Documentation/devicetree/bindings/pwm/allwinner,sun4i-a10-pwm.yaml +26 -25
@@ -50,33 +50,34 @@ properties: resets: maxItems: 1 -if: - properties: - compatible: - contains: - const: allwinner,sun50i-h6-pwm - -then: - properties: - clocks: - maxItems: 2 - - clock-names: - items: - - const: mod - - const: bus - - required: - - clock-names - - resets - -else: - properties: - clocks: - maxItems: 1 +allOf: + - $ref: pwm.yaml# + - if: + properties: + compatible: + contains: + const: allwinner,sun50i-h6-pwm + + then: + properties: + clocks: + maxItems: 2 + + clock-names: + items: + - const: mod + - const: bus + + required: + - clock-names + - resets + + else: + properties: + clocks: + maxItems: 1 required: - - "#pwm-cells" - compatible - reg - clocks
Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.yaml +3 -1
@@ -25,7 +25,9 @@ properties: required: - compatible - - '#pwm-cells' + +allOf: + - $ref: pwm.yaml# additionalProperties: false
Documentation/devicetree/bindings/pwm/iqs620a-pwm.yaml +3 -1
@@ -25,7 +25,9 @@ properties: required: - compatible - - "#pwm-cells" + +allOf: + - $ref: pwm.yaml# additionalProperties: false
Documentation/devicetree/bindings/pwm/pwm-samsung.yaml +0 -1
@@ -89,7 +89,6 @@ required: - clock-names - compatible - interrupts - - "#pwm-cells" - reg additionalProperties: false
Documentation/devicetree/bindings/pwm/pwm.yaml +2 -0
@@ -9,6 +9,8 @@ title: PWM controllers (providers) maintainers: - Thierry Reding <[email protected]> +select: false + properties: $nodename: pattern: "^pwm(@.*|-[0-9a-f])*$"
Documentation/devicetree/bindings/pwm/renesas,pwm-rcar.yaml +3 -1
@@ -57,9 +57,11 @@ properties: required: - compatible - reg - - '#pwm-cells' - clocks +allOf: + - $ref: pwm.yaml# + additionalProperties: false examples:
Documentation/devicetree/bindings/pwm/renesas,tpu-pwm.yaml +3 -1
@@ -56,7 +56,9 @@ properties: required: - compatible - reg - - '#pwm-cells' + +allOf: + - $ref: pwm.yaml# additionalProperties: false
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 37/38] dt-bindings: pwm: Explicitly include pwm.yaml
Quoted 6 lines · Thierry Reding
From: Thierry Reding <[email protected]>
For PWM controller device tree bindings, make sure that they include the
pwm.yamlcontroller core bindings explicitly. This prevents the tooling from matching on the $nodename pattern, which can falsely match things like pinmux nodes, etc.
My preference here is to clean-up the mess that is pinmux nodes.
This has the side effect of no longer checking pwm nodes that didn't have explicit schema. Perhaps that's of somewhat limited value.
Rob
Re: [PATCH 37/38] dt-bindings: pwm: Explicitly include pwm.yaml
Quoted 9 lines · Rob Herring
Quoted 6 lines · Thierry Reding
From: Thierry Reding <[email protected]>
For PWM controller device tree bindings, make sure that they include the
pwm.yamlcontroller core bindings explicitly. This prevents the tooling from matching on the $nodename pattern, which can falsely match things like pinmux nodes, etc.My preference here is to clean-up the mess that is pinmux nodes.
Any suggestions on how to do that? Do you just want to rename the problematic nodes? Or do you want to introduce a standard naming scheme? As an example, I was running into the issue with this node:
pinmux@70000014 {
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
state_default: pinmux {
...
pwm-a-b {
nvidia,pins = "sdc";
nvidia,function = "pwm";
nvidia,tristate = <TEGRA_PIN_ENABLE>;
};
...
};
};My first instinct was to just add some sort of prefix to this, but then I realized that might not be the best option because there could be countless other nodes whose names might start with "pwm-" but that had nothing to do with PWM controllers whatsoever.
You could for example have some node named "pwm-fan" and then these standard bindings will require that to be have a #pwm-cells property.
So I think the solution of only explicitly "activating" PWM controller bindings would work well in this particular case because it would only apply the bindings where explicitly requested. That way it doesn't matter what nodes are named.
Quoted 2 lines
This has the side effect of no longer checking pwm nodes that didn't have explicit schema. Perhaps that's of somewhat limited value.
There are two easy solutions to this: 1) convert all PWM bindings to YAML so that they have an explicit schema or 2) consider the presence of the #pwm-cells property as a marker that the node represents a PWM controller/provider, irrespective of the name. The latter would be much like gpio-controller or interrupt-controller, though less redundant.
We could even go as far as using #pwm-cells as the definitive marker and then require that it has a certain name, like we do for other types of nodes. I did a quick audit and came up with the following results. These are all the PWM controller nodes that I could find that don't follow the "^pwm(@.*)?$" pattern. The files are only one example of where I found them and there were often others that used the same pattern.
- arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi
- ec-pwm
It should be trivial to rename these to just "pwm" since I don't see the cros-ec driver relying on the exact name.
- arch/arm/boot/dts/am5729-beagleboneai.dts
- stmpe_pwm
The stmpe MFD driver actually relies on this name, so not sure if there's a lot we can do about that.
- arch/arm/boot/dts/armada-38x.dtsi
- gpio@...
This is both a GPIO and PWM controller, so can't really do much about the name.
- arch/arm/boot/dts/at91-kizbox.dts
- pwm
Actually also matches the pattern because the '@.*' part is optional.
- arch/arm/boot/dts/at91sam9n12.dtsi
- hlcdc-pwm
The MFD driver matches on the compatible string, so we should be able to just rename this to "pwm".
- arch/arm/boot/dts/da850.dtsi
- ecap@...
No matching on the name as far as I can tell, so we should be able to rename this 'pwm@...'.
- arch/arm/boot/dts/logicpd-torpedo-baseboard.dtsi
- dmtimer-pwm
Could probably be renamed 'pwm'.
- arch/arm/boot/dts/lpc32xx.dtsi
- mpwm@...
Could probably be renamed 'pwm'.
- arch/arm/boot/dts/motorola-mapphone-common.dtsi
- dmtimer-pwm-*
Maybe these should be renamed 'pwm@*' instead?
- arch/arm/boot/dts/s3c24xx.dtsi
- timer@...
This is a variant similar to dmtimer-pwm above and is driven by a timer that can run in PWM mode. I think this is the same category as the GPIO/PWM controller hybrid above.
Not much we can do about the name.
- arch/arm/boot/dts/stm32f429.dtsi
- pwm
Matches the pattern.
- arch/arm/boot/dts/twl4030.dtsi
- pwm
Matches the pattern.
- pwmled
Perhaps both of the above should be named 'pwm@*'? There doesn't seem to be any matching on the name.
For many of the above it should be possible to rename them. But then we will always have exceptions where we can't do that because then it might conflict with other bindings.
Two interesting things I gathered from the above are that:
1) nothing in the above actually matches the pwm-* variant that's part of the current pattern defined in pwm.yaml and which is causing the problem for the pinmux nodes, so an easy solution would be to simply drop that part of the pattern since it is useless anyway.
2) There are actually quite a few PWM controllers that currently are not checked because of the name matching. Now I haven't actually checked the reverse, i.e. to see if all nodes matching the pattern actually have a #pwm-cells property, but given that we miss a number of controller because they don't match the pattern makes me think that that aspect isn't actually very helpful.
All of the above makes me think even more that we should just abandon the idea of matching on the names for PWM controller because in some instances we can't change the name for backwards-compatibility or because the names would then conflict with other bindings.
Thierry
Rob Herring
maintainerRe: [PATCH 37/38] dt-bindings: pwm: Explicitly include pwm.yaml
Quoted 10 lines · Thierry Reding
Quoted 8 lines · Rob Herring
Quoted 6 lines · Thierry Reding
From: Thierry Reding <[email protected]>
For PWM controller device tree bindings, make sure that they include the
pwm.yamlcontroller core bindings explicitly. This prevents the tooling from matching on the $nodename pattern, which can falsely match things like pinmux nodes, etc.
Quoted 4 lines
Quoted 1 line
My preference here is to clean-up the mess that is pinmux nodes.
Any suggestions on how to do that? Do you just want to rename the problematic nodes? Or do you want to introduce a standard naming scheme?
.*-pins$ is what I've been using/proposing. Doing that also helps writing pinctrl schemas.
Quoted 19 lines
As an example, I was running into the issue with this node:
pinmux@70000014 { pinctrl-names = "default"; pinctrl-0 = <&state_default>; state_default: pinmux { ... pwm-a-b { nvidia,pins = "sdc"; nvidia,function = "pwm"; nvidia,tristate = <TEGRA_PIN_ENABLE>; }; ... }; };
Quoted 7 lines
My first instinct was to just add some sort of prefix to this, but then I realized that might not be the best option because there could be countless other nodes whose names might start with "pwm-" but that had nothing to do with PWM controllers whatsoever.
You could for example have some node named "pwm-fan" and then these standard bindings will require that to be have a #pwm-cells property.
Pretty sure we only allow pwm@.* or pwm-[0-9a-f]+, so this would not match.
Plus shouldn't it be just 'fan' to be what the class is, not how it is implemented/controlled.
Quoted 5 lines
So I think the solution of only explicitly "activating" PWM controller bindings would work well in this particular case because it would only apply the bindings where explicitly requested. That way it doesn't matter what nodes are named.
Quoted 8 lines
Quoted 2 lines
This has the side effect of no longer checking pwm nodes that didn't have explicit schema. Perhaps that's of somewhat limited value.
There are two easy solutions to this: 1) convert all PWM bindings to YAML so that they have an explicit schema or 2) consider the presence of the #pwm-cells property as a marker that the node represents a PWM controller/provider, irrespective of the name. The latter would be much like gpio-controller or interrupt-controller, though less redundant.
There's only 2 things we can generically check, #pwm-cells and the node name. If we match on one, then we're really only checking the other one. We could match on #pwm-cells presence and then check its value is 2 or 3, but then we can do that without a select (i.e. always apply the schema).
So I guess I'm convinced there's not much value here and we should just do 1). Patches welcome. :) (BTW, I do think we should do some mass conversions by class. That I think would be a bit more efficient in both converting and reviewing. My calculation is something like 6 years to finish (3K bindings left and doing 100-150 a cycle).)
Quoted 10 lines
We could even go as far as using #pwm-cells as the definitive marker and then require that it has a certain name, like we do for other types of nodes. I did a quick audit and came up with the following results. These are all the PWM controller nodes that I could find that don't follow the "^pwm(@.*)?$" pattern. The files are only one example of where I found them and there were often others that used the same pattern.
-
arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi
- ec-pwm
Quoted 8 lines
It should be trivial to rename these to just "pwm" since I don't see the cros-ec driver relying on the exact name.
-
arch/arm/boot/dts/am5729-beagleboneai.dts
-stmpe_pwmThe stmpe MFD driver actually relies on this name, so not sure if there's a lot we can do about that.
That's unfortunate...
The question is how do we allow this, but at the same time prevent more cases.
Quoted 5 lines
-
arch/arm/boot/dts/armada-38x.dtsi
- gpio@...This is both a GPIO and PWM controller, so can't really do much about the name.
In general, we need some solution for the more than 1 function nodes. Combo clock and reset controllers are a common one.
Quoted 75 lines
-
arch/arm/boot/dts/at91-kizbox.dts
- pwmActually also matches the pattern because the '@.*' part is optional.
-
arch/arm/boot/dts/at91sam9n12.dtsi
- hlcdc-pwmThe MFD driver matches on the compatible string, so we should be able to just rename this to "pwm".
-
arch/arm/boot/dts/da850.dtsi
- ecap@...No matching on the name as far as I can tell, so we should be able to rename this 'pwm@...'.
-
arch/arm/boot/dts/logicpd-torpedo-baseboard.dtsi
- dmtimer-pwmCould probably be renamed 'pwm'.
-
arch/arm/boot/dts/lpc32xx.dtsi
- mpwm@...Could probably be renamed 'pwm'.
-
arch/arm/boot/dts/motorola-mapphone-common.dtsi
- dmtimer-pwm-*Maybe these should be renamed 'pwm@*' instead?
-
arch/arm/boot/dts/s3c24xx.dtsi
- timer@...This is a variant similar to dmtimer-pwm above and is driven by a timer that can run in PWM mode. I think this is the same category as the GPIO/PWM controller hybrid above.
Not much we can do about the name.
-
arch/arm/boot/dts/stm32f429.dtsi
- pwmMatches the pattern.
-
arch/arm/boot/dts/twl4030.dtsi
- pwmMatches the pattern.
- pwmled
Perhaps both of the above should be named 'pwm@*'? There doesn't seem to be any matching on the name.
For many of the above it should be possible to rename them. But then we will always have exceptions where we can't do that because then it might conflict with other bindings.
Two interesting things I gathered from the above are that:
1) nothing in the above actually matches the pwm-* variant that's part of the current pattern defined in
pwm.yamland which is causing the problem for the pinmux nodes, so an easy solution would be to simply drop that part of the pattern since it is useless anyway.2) There are actually quite a few PWM controllers that currently are not checked because of the name matching. Now I haven't actually checked the reverse, i.e. to see if all nodes matching the pattern actually have a #pwm-cells property, but given that we miss a number of controller because they don't match the pattern makes me think that that aspect isn't actually very helpful.
Quoted 4 lines
All of the above makes me think even more that we should just abandon the idea of matching on the names for PWM controller because in some instances we can't change the name for backwards-compatibility or because the names would then conflict with other bindings.
Yes. :(
Maybe node name checks can be an optional thing to enable until we come up with a more general way to opt-in/out of specific checks.
Rob
PATCH 38/38 dt-bindings: serial: Document Tegra-specific properties
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
On Tegra the UART is described using additional properties, such as clock-names, reset-names, dmas and dma-names. Document them in the bindings so that Tegra device trees are properly validated.
--- .../devicetree/bindings/serial/8250.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+)
Documentation/devicetree/bindings/serial/8250.yaml +26 -0
@@ -28,6 +28,32 @@ allOf: const: 2 required: - reg-shift + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-uart + then: + properties: + clock-names: + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: serial + + dmas: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + + dma-names: + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: rx + - const: tx + + reset-names: + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: serial - if: not: properties:
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 38/38] dt-bindings: serial: Document Tegra-specific properties
Quoted 16 lines · Thierry Reding
From: Thierry Reding <[email protected]>
On Tegra the UART is described using additional properties, such as clock-names, reset-names, dmas and dma-names. Document them in the bindings so that Tegra device trees are properly validated.
Signed-off-by Thierry Reding <[email protected]>--- .../devicetree/bindings/serial/8250.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+)Documentation/devicetree/bindings/serial/8250.yaml +0
-0
Documentation/devicetree/bindings/serial/8250.yaml allOf: · line 36
Quoted 9 lines
Documentation/devicetree/bindings/serial/8250.yaml +6
-0@@ -28,6 +28,32 @@ allOf: const: 2 required: - reg-shift + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra20-uart
Can use 'const' here instead.
Documentation/devicetree/bindings/serial/8250.yaml allOf: · line 40
Quoted 4 lines
Documentation/devicetree/bindings/serial/8250.yaml +4
-0+ then: + properties: + clock-names: + $ref: "/schemas/types.yaml#/definitions/string-array"
Don't need type.
Documentation/devicetree/bindings/serial/8250.yaml allOf: · line 45
Quoted 5 lines
Documentation/devicetree/bindings/serial/8250.yaml +5
-0+ items: + - const: serial + + dmas: + $ref: "/schemas/types.yaml#/definitions/phandle-array"
How many?
Quoted 17 lines
Documentation/devicetree/bindings/serial/8250.yaml +11
-0+ + dma-names: + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: rx + - const: tx + + reset-names: + $ref: "/schemas/types.yaml#/definitions/string-array" + items: + - const: serial - if: not: properties:Signature · 1 line
2.24.1