Re: [PATCH 1/3] dt-bindings: Add YAML bindings for Host1x and NVDEC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 18, 2021 at 5:04 AM Mikko Perttunen <cyndis@xxxxxxxx> wrote:
>
> On 2/17/21 11:49 PM, Rob Herring wrote:
> > On Sat, Feb 13, 2021 at 12:15:10PM +0200, Mikko Perttunen wrote:
> >> Convert the original Host1x bindings to YAML and add new bindings for
> >> NVDEC, now in a more appropriate location. The old text bindings
> >> for Host1x and engines are still kept at display/tegra/ since they
> >> encompass a lot more engines that haven't been converted over yet.
> >>
> >> Signed-off-by: Mikko Perttunen <mperttunen@xxxxxxxxxx>
> >> ---
> >>   .../gpu/host1x/nvidia,tegra20-host1x.yaml     | 129 ++++++++++++++++++
> >>   .../gpu/host1x/nvidia,tegra210-nvdec.yaml     |  90 ++++++++++++
> >>   MAINTAINERS                                   |   1 +
> >>   3 files changed, 220 insertions(+)
> >>   create mode 100644 Documentation/devicetree/bindings/gpu/host1x/nvidia,tegra20-host1x.yaml
> >>   create mode 100644 Documentation/devicetree/bindings/gpu/host1x/nvidia,tegra210-nvdec.yaml
> >>
> >> diff --git a/Documentation/devicetree/bindings/gpu/host1x/nvidia,tegra20-host1x.yaml b/Documentation/devicetree/bindings/gpu/host1x/nvidia,tegra20-host1x.yaml
> >> new file mode 100644
> >> index 000000000000..613c6601f0f1
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/gpu/host1x/nvidia,tegra20-host1x.yaml
> >> @@ -0,0 +1,129 @@
> >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> >> +%YAML 1.2
> >> +---
> >> +$id: "http://devicetree.org/schemas/gpu/host1x/nvidia,tegra20-host1x.yaml#";
> >> +$schema: "http://devicetree.org/meta-schemas/core.yaml#";
> >> +
> >> +title: Device tree binding for NVIDIA Host1x
> >> +
> >> +maintainers:
> >> +  - Thierry Reding <treding@xxxxxxxxx>
> >> +  - Mikko Perttunen <mperttunen@xxxxxxxxxx>
> >> +
> >> +properties:
> >> +  $nodename:
> >> +    pattern: "^host1x@[0-9a-f]*$"
> >> +
> >> +  compatible:
> >> +    oneOf:
> >> +      - const: nvidia,tegra20-host1x
> >> +      - const: nvidia,tegra30-host1x
> >> +      - const: nvidia,tegra114-host1x
> >> +      - const: nvidia,tegra124-host1x
> >> +      - items:
> >> +          - const: nvidia,tegra132-host1x
> >> +          - const: nvidia,tegra124-host1x
> >> +      - const: nvidia,tegra210-host1x
> >> +
> >> +  reg:
> >> +    maxItems: 1
> >> +
> >> +  interrupts:
> >> +    items:
> >> +      - description: Syncpoint threshold interrupt
> >> +      - description: General interrupt
> >> +
> >> +  interrupt-names:
> >> +    items:
> >> +      - const: syncpt
> >> +      - const: host1x
> >> +
> >> +  clocks:
> >> +    maxItems: 1
> >> +
> >> +  clock-names:
> >> +    items:
> >> +      - const: host1x
> >> +
> >> +  resets:
> >> +    maxItems: 1
> >> +
> >> +  reset-names:
> >> +    items:
> >> +      - const: host1x
> >> +
> >> +  iommus:
> >> +    maxItems: 1
> >> +
> >> +  interconnects:
> >> +    maxItems: 1
> >> +
> >> +  interconnect-names:
> >> +    items:
> >> +      - const: dma-mem
> >> +
> >> +  '#address-cells':
> >> +    const: 1
> >> +
> >> +  '#size-cells':
> >> +    const: 1
> >> +
> >> +  ranges: true
> >> +
> >> +required:
> >> +  - compatible
> >> +  - reg
> >> +  - interrupts
> >> +  - interrupt-names
> >> +  - clocks
> >> +  - clock-names
> >> +  - resets
> >> +  - reset-names
> >> +  - '#address-cells'
> >> +  - '#size-cells'
> >> +  - ranges
> >> +
> >> +additionalProperties:
> >> +  type: object
> >> +
> >> +if:
> >> +  properties:
> >> +    compatible:
> >> +      contains:
> >> +        anyOf:
> >> +          - const: nvidia,tegra186-host1x
> >> +          - const: nvidia,tegra194-host1x
> >
> > Just use 'enum' instead of 'anyOf' and 'const'.
>
> Yep, will fix.
>
> >
> >> +then:
> >> +  properties:
> >> +    reg:
> >> +      items:
> >> +        - description: Hypervisor-accessible register area
> >> +        - description: VM-accessible register area
> >
> > If you test this, it will fail due to the 'maxItems: 1' above. The main
> > section has to pass for all conditions and then if/them schema add
> > constraints.
>
> Interesting, I did run the schema check and DTB check but I didn't see
> issues there. In any case, will fix.

It may pass if you had 'reg = <base1 size1 base2 size2>' rather than
'reg = <base1 size1>, <base2 size2>'. While the bracketing doesn't
matter for dtbs, it does currently for the schema.

Rob



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux