mbox series

[00/54] ARM: dts: Last round of DT schema fixes

Message ID 20210721140424.725744-1-maxime@cerno.tech
Headers show
Series ARM: dts: Last round of DT schema fixes | expand

Message

Maxime Ripard July 21, 2021, 2:03 p.m. UTC
Hi,

Here's another round of schema warnings fixes for the Allwinner platform.

There's a fair share of new schemas in there since the schema tools now warn
when a compatible is not documented in a schema.

We don't have any warning anymore if we use the OPP binding Rob submitted, and
since that means we have all our devices properly validated I don't expect more
fixes now, aside from the usual bunch of regressions.

Let me know what you think,
Maxime

Maxime Ripard (54):
  ASoC: dt-bindings: Add WM8978 Binding
  ASoC: dt-bindings: Convert Bluetooth SCO Link binding to a schema
  ASoC: dt-bindings: Convert SPDIF Transmitter binding to a schema
  ASoC: dt-bindings: Convert Simple Amplifier binding to a schema
  dt-bindings: Convert Reserved Memory binding to a schema
  dt-bindings: arm: Convert ARM CCI-400 binding to a schema
  dt-bindings: bluetooth: broadcom: Fix clocks check
  dt-bindings: bluetooth: realtek: Add missing max-speed
  dt-bindings: clocks: Fix typo in the H6 compatible
  dt-bindings: display: panel-lvds: Document panel compatibles
  dt-bindings: display: simple-bridge: Add corpro,gm7123 compatible
  dt-bindings: gnss: Convert UBlox Neo-6M binding to a schema
  dt-bindings: gpio: Convert X-Powers AXP209 GPIO binding to a schema
  dt-bindings: hwmon: Add IIO HWMON binding
  dt-bindings: iio: st: Remove wrong items length check
  dt-bindings: input: Convert ChipOne ICN8318 binding to a schema
  dt-bindings: input: Convert Pixcir Touchscreen binding to a schema
  dt-bindings: input: Convert Regulator Haptic binding to a schema
  dt-bindings: input: Convert Silead GSL1680 binding to a schema
  dt-bindings: input: sun4i-lradc: Add wakeup-source
  dt-bindings: interconnect: sunxi: Add R40 MBUS compatible
  dt-bindings: media: Convert OV5640 binding to a schema
  dt-bindings: mfd: Convert X-Powers AC100 binding to a schema
  dt-bindings: mfd: Convert X-Powers AXP binding to a schema
  dt-bindings: mmc: Convert MMC Card binding to a schema
  dt-bindings: net: dwmac: Fix typo in the R40 compatible
  dt-bindings: net: wireless: Convert ESP ESP8089 binding to a schema
  dt-bindings: power: supply: axp20x: Add AXP803 compatible
  dt-bindings: power: supply: axp20x-battery: Add AXP209 compatible
  dt-bindings: regulator: Convert SY8106A binding to a schema
  dt-bindings: sunxi: Add CPU Configuration Controller Binding
  dt-bindings: sunxi: Add Allwinner A80 PRCM Binding
  dt-bindings: thermal: Make trips node optional
  dt-bindings: usb: Convert SMSC USB3503 binding to a schema
  dt-bindings: usb: dwc3: Fix usb-phy check
  dt-bindings: usb: ehci: Add Allwinner A83t compatible
  dt-bindings: usb: ohci: Add Allwinner A83t compatible
  dt-bindings: w1: Convert 1-Wire GPIO binding to a schema
  ARM: dts: sunxi: Rename power-supply names
  ARM: dts: sunxi: Rename gpio pinctrl names
  ARM: dts: sunxi: Fix OPP arrays
  ARM: dts: sunxi: Fix OPPs node name
  ARM: dts: sunxi: Fix the SPI NOR node names
  ARM: dts: v3s: Remove useless DMA properties
  ARM: dts: tbs711: Fix touchscreen compatible
  ARM: dts: cubieboard4: Remove the dumb-vga-dac compatible
  arm64: dts: allwinner: h5: Fix GPU thermal zone node name
  arm64: dts: allwinner: h6: Fix de3 parent clocks ordering
  arm64: dts: allwinner: a100: Fix thermal zone node name
  arm64: dts: allwinner: pinetab: Change regulator node name to avoid
    warning
  arm64: dts: allwinner: teres-i: Add missing reg
  arm64: dts: allwinner: Remove regulator-ramp-delay
  arm64: dts: allwinner: teres-i: Remove wakekup-source from the PMIC
  arm64: dts: allwinner: pinephone: Fix BT SCO codec cells size

 .../devicetree/bindings/arm/arm,cci-400.yaml  | 216 ++++++++++
 .../bindings/arm/cci-control-port.yaml        |  38 ++
 Documentation/devicetree/bindings/arm/cci.txt | 224 ----------
 .../arm/sunxi/allwinner,sun4i-a10-mbus.yaml   |   1 +
 .../sunxi/allwinner,sun6i-a31-cpuconfig.yaml  |  38 ++
 .../arm/sunxi/allwinner,sun9i-a80-prcm.yaml   |  33 ++
 .../clock/allwinner,sun8i-a83t-de2-clk.yaml   |   2 +-
 .../display/bridge/simple-bridge.yaml         |   3 +
 .../bindings/display/panel/lvds.yaml          |  18 +-
 .../bindings/gnss/u-blox,neo-6m.yaml          |  62 +++
 .../devicetree/bindings/gnss/u-blox.txt       |  45 ---
 .../devicetree/bindings/gpio/gpio-axp209.txt  |  75 ----
 .../bindings/gpio/x-powers,axp209-gpio.yaml   |  84 ++++
 .../devicetree/bindings/hwmon/iio-hwmon.yaml  |  37 ++
 .../bindings/iio/st,st-sensors.yaml           |  41 --
 .../input/allwinner,sun4i-a10-lradc-keys.yaml |   2 +
 .../bindings/input/regulator-haptic.txt       |  21 -
 .../bindings/input/regulator-haptic.yaml      |  43 ++
 .../input/touchscreen/chipone,icn8318.yaml    |  62 +++
 .../input/touchscreen/chipone_icn8318.txt     |  44 --
 .../input/touchscreen/pixcir,pixcir_ts.yaml   |  68 ++++
 .../input/touchscreen/pixcir_i2c_ts.txt       |  31 --
 .../input/touchscreen/silead,gsl1680.yaml     |  90 +++++
 .../input/touchscreen/silead_gsl1680.txt      |  44 --
 .../devicetree/bindings/media/i2c/ov5640.txt  |  92 -----
 .../bindings/media/i2c/ovti,ov5640.yaml       | 154 +++++++
 .../devicetree/bindings/mfd/ac100.txt         |  50 ---
 .../devicetree/bindings/mfd/axp20x.txt        | 272 -------------
 .../bindings/mfd/x-powers,ac100.yaml          | 113 ++++++
 .../bindings/mfd/x-powers,axp152.yaml         | 381 ++++++++++++++++++
 .../devicetree/bindings/mmc/mmc-card.txt      |  30 --
 .../devicetree/bindings/mmc/mmc-card.yaml     |  48 +++
 .../bindings/mmc/mmc-controller.yaml          |   6 -
 .../net/allwinner,sun8i-a83t-emac.yaml        |   4 +-
 .../bindings/net/broadcom-bluetooth.yaml      |  17 +-
 .../bindings/net/realtek-bluetooth.yaml       |   2 +
 .../devicetree/bindings/net/snps,dwmac.yaml   |   6 +-
 .../bindings/net/wireless/esp,esp8089.txt     |  30 --
 .../bindings/net/wireless/esp,esp8089.yaml    |  43 ++
 .../x-powers,axp20x-ac-power-supply.yaml      |  11 +-
 .../x-powers,axp20x-battery-power-supply.yaml |  12 +-
 .../x-powers,axp20x-usb-power-supply.yaml     |  14 +-
 .../bindings/regulator/silergy,sy8106a.yaml   |  52 +++
 .../bindings/regulator/sy8106a-regulator.txt  |  23 --
 .../reserved-memory/reserved-memory.txt       | 141 -------
 .../reserved-memory/reserved-memory.yaml      | 167 ++++++++
 .../devicetree/bindings/sound/bt-sco.txt      |  13 -
 .../bindings/sound/linux,bt-sco.yaml          |  34 ++
 .../bindings/sound/linux,spdif-dit.yaml       |  32 ++
 .../bindings/sound/simple-amplifier.txt       |  17 -
 .../sound/simple-audio-amplifier.yaml         |  45 +++
 .../bindings/sound/spdif-transmitter.txt      |  10 -
 .../devicetree/bindings/sound/wlf,wm8978.yaml |  58 +++
 .../bindings/thermal/thermal-zones.yaml       |   2 +-
 .../devicetree/bindings/usb/generic-ehci.yaml |   1 +
 .../devicetree/bindings/usb/generic-ohci.yaml |   1 +
 .../devicetree/bindings/usb/smsc,usb3503.yaml | 104 +++++
 .../devicetree/bindings/usb/snps,dwc3.yaml    |  10 +-
 .../devicetree/bindings/usb/usb3503.txt       |  39 --
 .../devicetree/bindings/w1/w1-gpio.txt        |  27 --
 .../devicetree/bindings/w1/w1-gpio.yaml       |  43 ++
 arch/arm/boot/dts/axp209.dtsi                 |   6 +-
 arch/arm/boot/dts/axp22x.dtsi                 |   6 +-
 arch/arm/boot/dts/axp81x.dtsi                 |  10 +-
 .../arm/boot/dts/sun4i-a10-olinuxino-lime.dts |  11 +-
 arch/arm/boot/dts/sun4i-a10.dtsi              |  11 +-
 arch/arm/boot/dts/sun5i-a13.dtsi              |  15 +-
 arch/arm/boot/dts/sun6i-a31.dtsi              |  44 +-
 arch/arm/boot/dts/sun7i-a20-bananapi.dts      |  17 +-
 arch/arm/boot/dts/sun7i-a20.dtsi              |  34 +-
 arch/arm/boot/dts/sun8i-a33.dtsi              |   4 +-
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts     |   2 +-
 arch/arm/boot/dts/sun8i-a83t.dtsi             |   4 +-
 arch/arm/boot/dts/sun8i-h3.dtsi               |   4 +-
 arch/arm/boot/dts/sun8i-v3-sl631.dtsi         |   2 +-
 arch/arm/boot/dts/sun8i-v3s.dtsi              |   2 -
 arch/arm/boot/dts/sun9i-a80-cubieboard4.dts   |   2 +-
 .../boot/dts/sunxi-libretech-all-h3-it.dtsi   |   2 +-
 arch/arm64/boot/dts/allwinner/axp803.dtsi     |  10 +-
 .../arm64/boot/dts/allwinner/sun50i-a100.dtsi |   6 +-
 .../dts/allwinner/sun50i-a64-cpu-opp.dtsi     |   2 +-
 .../dts/allwinner/sun50i-a64-orangepi-win.dts |   2 +-
 .../dts/allwinner/sun50i-a64-pinephone.dtsi   |   2 +-
 .../boot/dts/allwinner/sun50i-a64-pinetab.dts |   2 +-
 .../boot/dts/allwinner/sun50i-a64-teres-i.dts |   3 +-
 .../boot/dts/allwinner/sun50i-h5-cpu-opp.dtsi |   2 +-
 arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi  |   2 +-
 .../dts/allwinner/sun50i-h6-beelink-gs1.dts   |   2 -
 .../boot/dts/allwinner/sun50i-h6-cpu-opp.dtsi |   2 +-
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    |   2 -
 .../boot/dts/allwinner/sun50i-h6-pine-h64.dts |   2 -
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi  |   8 +-
 92 files changed, 2221 insertions(+), 1428 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/arm,cci-400.yaml
 create mode 100644 Documentation/devicetree/bindings/arm/cci-control-port.yaml
 delete mode 100644 Documentation/devicetree/bindings/arm/cci.txt
 create mode 100644 Documentation/devicetree/bindings/arm/sunxi/allwinner,sun6i-a31-cpuconfig.yaml
 create mode 100644 Documentation/devicetree/bindings/arm/sunxi/allwinner,sun9i-a80-prcm.yaml
 create mode 100644 Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
 delete mode 100644 Documentation/devicetree/bindings/gnss/u-blox.txt
 delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-axp209.txt
 create mode 100644 Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.yaml
 create mode 100644 Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/regulator-haptic.txt
 create mode 100644 Documentation/devicetree/bindings/input/regulator-haptic.yaml
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/chipone,icn8318.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/chipone_icn8318.txt
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/pixcir,pixcir_ts.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/pixcir_i2c_ts.txt
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/silead,gsl1680.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt
 delete mode 100644 Documentation/devicetree/bindings/media/i2c/ov5640.txt
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov5640.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/ac100.txt
 delete mode 100644 Documentation/devicetree/bindings/mfd/axp20x.txt
 create mode 100644 Documentation/devicetree/bindings/mfd/x-powers,ac100.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
 delete mode 100644 Documentation/devicetree/bindings/mmc/mmc-card.txt
 create mode 100644 Documentation/devicetree/bindings/mmc/mmc-card.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/wireless/esp,esp8089.txt
 create mode 100644 Documentation/devicetree/bindings/net/wireless/esp,esp8089.yaml
 create mode 100644 Documentation/devicetree/bindings/regulator/silergy,sy8106a.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
 delete mode 100644 Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/bt-sco.txt
 create mode 100644 Documentation/devicetree/bindings/sound/linux,bt-sco.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/linux,spdif-dit.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/simple-amplifier.txt
 create mode 100644 Documentation/devicetree/bindings/sound/simple-audio-amplifier.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/spdif-transmitter.txt
 create mode 100644 Documentation/devicetree/bindings/sound/wlf,wm8978.yaml
 create mode 100644 Documentation/devicetree/bindings/usb/smsc,usb3503.yaml
 delete mode 100644 Documentation/devicetree/bindings/usb/usb3503.txt
 delete mode 100644 Documentation/devicetree/bindings/w1/w1-gpio.txt
 create mode 100644 Documentation/devicetree/bindings/w1/w1-gpio.yaml

-- 
2.31.1

Comments

Rob Herring July 21, 2021, 2:30 p.m. UTC | #1
On Wed, Jul 21, 2021 at 8:04 AM Maxime Ripard <maxime@cerno.tech> wrote:
>
> The Reserved Memory mechanism is supported by Linux thanks to its device
> tree binding.
>
> Now that we have the DT validation in place, let's convert the device
> tree bindings for that driver over to a YAML schema.

Thanks for this!

>
> Cc: Mailing List <devicetree-spec@vger.kernel.org>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>  .../reserved-memory/reserved-memory.txt       | 141 ---------------
>  .../reserved-memory/reserved-memory.yaml      | 167 ++++++++++++++++++
>  2 files changed, 167 insertions(+), 141 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
>  create mode 100644 Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml

> diff --git a/Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml b/Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml
> new file mode 100644
> index 000000000000..b61527f11953
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml
> @@ -0,0 +1,167 @@
> +# SPDX-License-Identifier: GPL-2.0

I think this is okay to dual license. Grant (Linaro) is the original
author and there's only a few lines from other authors.

> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/reserved-memory/reserved-memory.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: /reserved-memory Node
> +
> +maintainers:
> +  - Devicetree Specification Mailing List <devicetree-spec@vger.kernel.org>
> +
> +description: >
> +  Reserved memory is specified as a node under the /reserved-memory node. The
> +  operating system shall exclude reserved memory from normal usage one can
> +  create child nodes describing particular reserved (excluded from normal use)
> +  memory regions. Such memory regions are usually designed for the special
> +  usage by various device drivers.
> +
> +properties:
> +  $nodename:
> +    const: reserved-memory
> +
> +  "#address-cells": true
> +  "#size-cells": true
> +  ranges: true
> +
> +patternProperties:
> +  "^(?!(ranges))[a-z,-]*(@[0-9]+)?$":

Note that you could drop this and put under 'additionalProperties'.
You would lose some node name checking, but there's really little
standard on these nodes.

> +    type: object
> +
> +    description: >
> +      Each child of the reserved-memory node specifies one or more regions of
> +      reserved memory. Each child node may either use a 'reg' property to
> +      specify a specific range of reserved memory, or a 'size' property with
> +      optional constraints to request a dynamically allocated block of memory.
> +
> +      Following the generic-names recommended practice, node names should
> +      reflect the purpose of the node (ie. "framebuffer" or "dma-pool"). Unit
> +      address (@<address>) should be appended to the name if the node is a
> +      static allocation.
> +
> +    properties:
> +      reg: true
> +
> +      size:
> +        $ref: /schemas/types.yaml#/definitions/uint32-array
> +        description: >
> +          Length based on parent's \#size-cells. Size in bytes of memory to
> +          reserve.
> +
> +      alignment:
> +        $ref: /schemas/types.yaml#/definitions/uint32-array
> +        description: >
> +          Length based on parent's \#size-cells. Address boundary for
> +          alignment of allocation.
> +
> +      alloc-ranges:
> +        $ref: /schemas/types.yaml#/definitions/uint32-array
> +        description: >
> +          Address and Length pairs. Specifies regions of memory that are
> +          acceptable to allocate from.
> +
> +      compatible:
> +        oneOf:
> +          - const: shared-dma-pool
> +            description: >
> +              This indicates a region of memory meant to be used as a shared
> +              pool of DMA buffers for a set of devices. It can be used by an
> +              operating system to instantiate the necessary pool management
> +              subsystem if necessary.
> +
> +          # Vendor-specific compatibles in the form <vendor>,[<device>-]<usage>
> +          - const: mediatek,trustzone-bootinfo

I think these should be separate schema files. At least, we're going
to need to support separate files because I don't think we want ones
adding custom properties here. This would fail unless we add every
compatible here. We could also be a bit more exact as to which
properties below apply (e.g. linux,.*-default is only valid for
shared-dma-pool).

> +
> +      no-map:
> +        type: boolean
> +        description: >
> +          Indicates the operating system must not create a virtual mapping of
> +          the region as part of its standard mapping of system memory, nor
> +          permit speculative access to it under any circumstances other than
> +          under the control of the device driver using the region.
> +
> +      reusable:
> +        type: boolean
> +        description: >
> +          The operating system can use the memory in this region with the
> +          limitation that the device driver(s) owning the region need to be
> +          able to reclaim it back. Typically that means that the operating
> +          system can use that region to store volatile or cached data that
> +          can be otherwise regenerated or migrated elsewhere.
> +
> +      linux,cma-default:
> +        type: boolean
> +        description: >
> +          If this property is present, then Linux will use the region for the
> +          default pool of the contiguous memory allocator.
> +
> +      linux,dma-default:
> +        type: boolean
> +        description: >
> +          If this property is present, then Linux will use the region for the
> +          default pool of the consistent DMA allocator.
> +
> +    allOf:
> +      - if:
> +          required:
> +            - no-map
> +
> +        then:
> +          not:
> +            required:
> +              - reusable
> +
> +      - if:
> +          required:
> +            - reusable
> +
> +        then:
> +          not:
> +            required:
> +              - no-map
> +
> +    oneOf:
> +      - required:
> +          - reg
> +
> +      - required:
> +          - size
> +
> +    additionalProperties: true
> +
> +additionalProperties: true

This should be false, right?

> +
> +examples:
> +  - |
> +      / {
> +          #address-cells = <1>;
> +          #size-cells = <1>;
> +          model = "MediaTek MT2701 evaluation board";
> +          compatible = "mediatek,mt2701-evb", "mediatek,mt2701";
> +
> +          reserved-memory {
> +              #address-cells = <1>;
> +              #size-cells = <1>;
> +              ranges;
> +
> +              /* global autoconfigured region for contiguous allocations */
> +              linux,cma {
> +                  compatible = "shared-dma-pool";
> +                  reusable;
> +                  size = <0x4000000>;
> +                  alignment = <0x2000>;
> +                  linux,cma-default;
> +              };
> +
> +              display_reserved: framebuffer@78000000 {
> +                  reg = <0x78000000 0x800000>;
> +              };
> +
> +              trustzone-bootinfo@80002000 {
> +                  compatible = "mediatek,trustzone-bootinfo";
> +                  reg = <0x80002000 0x1000>;
> +              };
> +          };
> +      };
> +
> +...
> --
> 2.31.1
>
Rob Herring (Arm) July 22, 2021, 2:09 a.m. UTC | #2
On Wed, 21 Jul 2021 16:03:35 +0200, Maxime Ripard wrote:
> The Reserved Memory mechanism is supported by Linux thanks to its device

> tree binding.

> 

> Now that we have the DT validation in place, let's convert the device

> tree bindings for that driver over to a YAML schema.

> 

> Cc: Mailing List <devicetree-spec@vger.kernel.org>

> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

> ---

>  .../reserved-memory/reserved-memory.txt       | 141 ---------------

>  .../reserved-memory/reserved-memory.yaml      | 167 ++++++++++++++++++

>  2 files changed, 167 insertions(+), 141 deletions(-)

>  delete mode 100644 Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt

>  create mode 100644 Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml

> 


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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/nvmem/rmem.example.dt.yaml: reserved-memory: nvram@10000000:compatible: 'oneOf' conditional failed, one must be fixed:
	['raspberrypi,bootloader-config', 'nvmem-rmem'] is too long
	Additional items are not allowed ('nvmem-rmem' was unexpected)
	'shared-dma-pool' was expected
	'mediatek,trustzone-bootinfo' was expected
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra210-emc.example.dt.yaml: reserved-memory: emc-table@83400000:compatible: 'oneOf' conditional failed, one must be fixed:
	'shared-dma-pool' was expected
	'mediatek,trustzone-bootinfo' was expected
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml
\ndoc reference errors (make refcheckdocs):
Documentation/devicetree/bindings/display/arm,hdlcd.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/display/arm,komeda.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/display/arm,malidp.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/display/arm,pl11x.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/gpu/aspeed-gfx.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/media/aspeed-video.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/media/mediatek-vpu.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/remoteproc/ti,k3-dsp-rproc.yaml: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/remoteproc/ti,k3-r5f-rproc.yaml: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/remoteproc/ti,keystone-rproc.txt: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
Documentation/devicetree/bindings/remoteproc/ti,omap-remoteproc.yaml: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
arch/arm/mm/dma-mapping-nommu.c: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt

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

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

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

pip3 install dtschema --upgrade

Please check and re-submit.
Rob Herring (Arm) July 22, 2021, 2:09 a.m. UTC | #3
On Wed, 21 Jul 2021 16:03:43 +0200, Maxime Ripard wrote:
> The X-Powers AXP PMICs feature a GPIO Controller supported by Linux
> thanks to its device tree binding.
> 
> Now that we have the DT validation in place, let's convert the device
> tree bindings for that driver over to a YAML schema.
> 
> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>  .../devicetree/bindings/gpio/gpio-axp209.txt  | 75 -----------------
>  .../bindings/gpio/x-powers,axp209-gpio.yaml   | 84 +++++++++++++++++++
>  2 files changed, 84 insertions(+), 75 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-axp209.txt
>  create mode 100644 Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.yaml
> 

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.example.dt.yaml:0:0: /example-0/i2c/pmic@34: failed to match any schema with compatible: ['x-powers,axp209']
\ndoc reference errors (make refcheckdocs):

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

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

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

pip3 install dtschema --upgrade

Please check and re-submit.
Samuel Holland July 22, 2021, 5:35 a.m. UTC | #4
On 7/21/21 9:03 AM, Maxime Ripard wrote:
> Bluetooth SCO Link are supported by Linux with a matching device tree

> binding.

> 

> Now that we have the DT validation in place, let's convert the device

> tree bindings for that driver over to a YAML schema.

> 

> The value expected for #sound-dai-cells wasn't documented though, and

> the users were inconsistent. The example didn't list it, and across the

> 4 users we have in tree:

>   - 1 had a cells value of 1, but using only 0 as argument

>   - 1 had a cells value of 0,

>   - 2 didn't have this property at all, behaving as if it was 0,

> 

> It seems like the consensus seems to be that it should be 0, so let's

> enforce it.


The driver has two DAIs: "bt-sco-pcm" and "bt-sco-pcm-wb". If
#sound-dai-cells is 0, only the first DAI can be referenced from a
device tree. So to declare support for wideband PCM, or explicitly
declare a lack of support for it, #sound-dai-cells must be 1.

Regards,
Samuel

> Cc: alsa-devel@alsa-project.org

> Cc: devicetree@vger.kernel.org

> Cc: Liam Girdwood <lgirdwood@gmail.com>

> Cc: Mark Brown <broonie@kernel.org>

> Cc: Samuel Holland <samuel@sholland.org>

> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

> ---

>  .../devicetree/bindings/sound/bt-sco.txt      | 13 -------

>  .../bindings/sound/linux,bt-sco.yaml          | 34 +++++++++++++++++++

>  2 files changed, 34 insertions(+), 13 deletions(-)

>  delete mode 100644 Documentation/devicetree/bindings/sound/bt-sco.txt

>  create mode 100644 Documentation/devicetree/bindings/sound/linux,bt-sco.yaml

> 

> diff --git a/Documentation/devicetree/bindings/sound/bt-sco.txt b/Documentation/devicetree/bindings/sound/bt-sco.txt

> deleted file mode 100644

> index 641edf75e184..000000000000

> --- a/Documentation/devicetree/bindings/sound/bt-sco.txt

> +++ /dev/null

> @@ -1,13 +0,0 @@

> -Bluetooth-SCO audio CODEC

> -

> -This device support generic Bluetooth SCO link.

> -

> -Required properties:

> -

> -  - compatible : "delta,dfbmcs320" or "linux,bt-sco"

> -

> -Example:

> -

> -codec: bt_sco {

> -	compatible = "delta,dfbmcs320";

> -};

> diff --git a/Documentation/devicetree/bindings/sound/linux,bt-sco.yaml b/Documentation/devicetree/bindings/sound/linux,bt-sco.yaml

> new file mode 100644

> index 000000000000..334b508205cd

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/sound/linux,bt-sco.yaml

> @@ -0,0 +1,34 @@

> +# SPDX-License-Identifier: GPL-2.0

> +%YAML 1.2

> +---

> +$id: http://devicetree.org/schemas/sound/linux,bt-sco.yaml#

> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> +

> +title: Bluetooth SCO Audio Codec Device Tree Bindings

> +

> +maintainers:

> +  - Mark Brown <broonie@kernel.org>

> +

> +properties:

> +  '#sound-dai-cells':

> +    const: 0

> +

> +  compatible:

> +    enum:

> +      - delta,dfbmcs320

> +      - linux,bt-sco

> +

> +required:

> +  - '#sound-dai-cells'

> +  - compatible

> +

> +additionalProperties: false

> +

> +examples:

> +  - |

> +    codec {

> +        #sound-dai-cells = <0>;

> +        compatible = "linux,bt-sco";

> +    };

> +

> +...

>
Maxime Ripard July 22, 2021, 7:58 a.m. UTC | #5
Hi Samuel,

On Thu, Jul 22, 2021 at 12:35:33AM -0500, Samuel Holland wrote:
> On 7/21/21 9:03 AM, Maxime Ripard wrote:

> > Bluetooth SCO Link are supported by Linux with a matching device tree

> > binding.

> > 

> > Now that we have the DT validation in place, let's convert the device

> > tree bindings for that driver over to a YAML schema.

> > 

> > The value expected for #sound-dai-cells wasn't documented though, and

> > the users were inconsistent. The example didn't list it, and across the

> > 4 users we have in tree:

> >   - 1 had a cells value of 1, but using only 0 as argument

> >   - 1 had a cells value of 0,

> >   - 2 didn't have this property at all, behaving as if it was 0,

> > 

> > It seems like the consensus seems to be that it should be 0, so let's

> > enforce it.

> 

> The driver has two DAIs: "bt-sco-pcm" and "bt-sco-pcm-wb". If

> #sound-dai-cells is 0, only the first DAI can be referenced from a

> device tree. So to declare support for wideband PCM, or explicitly

> declare a lack of support for it, #sound-dai-cells must be 1.


Yeah, I knew there was something else to it :)

I'll fix it for the next iteration.

Thanks!
Maxime
Maxime Ripard July 22, 2021, 9:44 a.m. UTC | #6
On Wed, Jul 21, 2021 at 04:16:13PM +0200, Sam Ravnborg wrote:
> On Wed, Jul 21, 2021 at 04:03:41PM +0200, Maxime Ripard wrote:

> > The corpro,gm7123 was in use in a DT but was never properly documented,

> > let's add it.

> > 

> > Cc: dri-devel@lists.freedesktop.org

> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > Signed-off-by: Maxime Ripard <maxime@cerno.tech>

> Acked-by: Sam Ravnborg <sam@ravnborg.org>


Applied to drm-misc-next, thanks!
Maxime
Maxime Ripard July 29, 2021, 12:03 p.m. UTC | #7
On Wed, Jul 21, 2021 at 10:48:26AM -0600, Rob Herring wrote:
> On Wed, Jul 21, 2021 at 04:03:30PM +0200, Maxime Ripard wrote:

> > Hi,

> > 

> > Here's another round of schema warnings fixes for the Allwinner platform.

> > 

> > There's a fair share of new schemas in there since the schema tools now warn

> > when a compatible is not documented in a schema.

> > 

> > We don't have any warning anymore if we use the OPP binding Rob submitted, and

> > since that means we have all our devices properly validated I don't expect more

> > fixes now, aside from the usual bunch of regressions.

> 

> Great! You deserve a prize. 

> 

> I want to start enabling the schema checks by default. (Though then I'd 

> have to worry about new warnings.) This should be pretty easy to do 

> where we have subdirs per family, but for arm32 we'd need to move dts 

> files to subdirs if we don't want a flag per dts file.


That's definitely something that I'd be interested in. It's very easy
for a warning / error to slip through during review, so having some
builders somewhere reporting new issues would be awesome.

On arm32 though, we have per-family defconfig so maybe we can opt-in by
defconfig? It should work in most case

Maxime
Maxime Ripard Aug. 18, 2021, 10 a.m. UTC | #8
Hi Rob,

On Wed, Jul 21, 2021 at 08:30:43AM -0600, Rob Herring wrote:
> > +%YAML 1.2

> > +---

> > +$id: http://devicetree.org/schemas/reserved-memory/reserved-memory.yaml#

> > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > +

> > +title: /reserved-memory Node

> > +

> > +maintainers:

> > +  - Devicetree Specification Mailing List <devicetree-spec@vger.kernel.org>

> > +

> > +description: >

> > +  Reserved memory is specified as a node under the /reserved-memory node. The

> > +  operating system shall exclude reserved memory from normal usage one can

> > +  create child nodes describing particular reserved (excluded from normal use)

> > +  memory regions. Such memory regions are usually designed for the special

> > +  usage by various device drivers.

> > +

> > +properties:

> > +  $nodename:

> > +    const: reserved-memory

> > +

> > +  "#address-cells": true

> > +  "#size-cells": true

> > +  ranges: true

> > +

> > +patternProperties:

> > +  "^(?!(ranges))[a-z,-]*(@[0-9]+)?$":

> 

> Note that you could drop this and put under 'additionalProperties'.

> You would lose some node name checking, but there's really little

> standard on these nodes.


I didn't realise it could be used that way too, I'll change it.

> > +    type: object

> > +

> > +    description: >

> > +      Each child of the reserved-memory node specifies one or more regions of

> > +      reserved memory. Each child node may either use a 'reg' property to

> > +      specify a specific range of reserved memory, or a 'size' property with

> > +      optional constraints to request a dynamically allocated block of memory.

> > +

> > +      Following the generic-names recommended practice, node names should

> > +      reflect the purpose of the node (ie. "framebuffer" or "dma-pool"). Unit

> > +      address (@<address>) should be appended to the name if the node is a

> > +      static allocation.

> > +

> > +    properties:

> > +      reg: true

> > +

> > +      size:

> > +        $ref: /schemas/types.yaml#/definitions/uint32-array

> > +        description: >

> > +          Length based on parent's \#size-cells. Size in bytes of memory to

> > +          reserve.

> > +

> > +      alignment:

> > +        $ref: /schemas/types.yaml#/definitions/uint32-array

> > +        description: >

> > +          Length based on parent's \#size-cells. Address boundary for

> > +          alignment of allocation.

> > +

> > +      alloc-ranges:

> > +        $ref: /schemas/types.yaml#/definitions/uint32-array

> > +        description: >

> > +          Address and Length pairs. Specifies regions of memory that are

> > +          acceptable to allocate from.

> > +

> > +      compatible:

> > +        oneOf:

> > +          - const: shared-dma-pool

> > +            description: >

> > +              This indicates a region of memory meant to be used as a shared

> > +              pool of DMA buffers for a set of devices. It can be used by an

> > +              operating system to instantiate the necessary pool management

> > +              subsystem if necessary.

> > +

> > +          # Vendor-specific compatibles in the form <vendor>,[<device>-]<usage>

> > +          - const: mediatek,trustzone-bootinfo

> 

> I think these should be separate schema files. At least, we're going

> to need to support separate files because I don't think we want ones

> adding custom properties here. This would fail unless we add every

> compatible here. We could also be a bit more exact as to which

> properties below apply (e.g. linux,.*-default is only valid for

> shared-dma-pool).


I'm not entirely sure how we can just ignore the vendor compatibles
without raising a warning. Do you have any suggestion?

Thanks!
Maxime
Rob Herring Aug. 18, 2021, 12:54 p.m. UTC | #9
On Wed, Aug 18, 2021 at 5:00 AM Maxime Ripard <maxime@cerno.tech> wrote:
>

> Hi Rob,

>

> On Wed, Jul 21, 2021 at 08:30:43AM -0600, Rob Herring wrote:

> > > +%YAML 1.2

> > > +---

> > > +$id: http://devicetree.org/schemas/reserved-memory/reserved-memory.yaml#

> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > > +

> > > +title: /reserved-memory Node

> > > +

> > > +maintainers:

> > > +  - Devicetree Specification Mailing List <devicetree-spec@vger.kernel.org>

> > > +

> > > +description: >

> > > +  Reserved memory is specified as a node under the /reserved-memory node. The

> > > +  operating system shall exclude reserved memory from normal usage one can

> > > +  create child nodes describing particular reserved (excluded from normal use)

> > > +  memory regions. Such memory regions are usually designed for the special

> > > +  usage by various device drivers.

> > > +

> > > +properties:

> > > +  $nodename:

> > > +    const: reserved-memory

> > > +

> > > +  "#address-cells": true

> > > +  "#size-cells": true

> > > +  ranges: true

> > > +

> > > +patternProperties:

> > > +  "^(?!(ranges))[a-z,-]*(@[0-9]+)?$":

> >

> > Note that you could drop this and put under 'additionalProperties'.

> > You would lose some node name checking, but there's really little

> > standard on these nodes.

>

> I didn't realise it could be used that way too, I'll change it.

>

> > > +    type: object

> > > +

> > > +    description: >

> > > +      Each child of the reserved-memory node specifies one or more regions of

> > > +      reserved memory. Each child node may either use a 'reg' property to

> > > +      specify a specific range of reserved memory, or a 'size' property with

> > > +      optional constraints to request a dynamically allocated block of memory.

> > > +

> > > +      Following the generic-names recommended practice, node names should

> > > +      reflect the purpose of the node (ie. "framebuffer" or "dma-pool"). Unit

> > > +      address (@<address>) should be appended to the name if the node is a

> > > +      static allocation.

> > > +

> > > +    properties:

> > > +      reg: true

> > > +

> > > +      size:

> > > +        $ref: /schemas/types.yaml#/definitions/uint32-array

> > > +        description: >

> > > +          Length based on parent's \#size-cells. Size in bytes of memory to

> > > +          reserve.

> > > +

> > > +      alignment:

> > > +        $ref: /schemas/types.yaml#/definitions/uint32-array

> > > +        description: >

> > > +          Length based on parent's \#size-cells. Address boundary for

> > > +          alignment of allocation.

> > > +

> > > +      alloc-ranges:

> > > +        $ref: /schemas/types.yaml#/definitions/uint32-array

> > > +        description: >

> > > +          Address and Length pairs. Specifies regions of memory that are

> > > +          acceptable to allocate from.

> > > +

> > > +      compatible:

> > > +        oneOf:

> > > +          - const: shared-dma-pool

> > > +            description: >

> > > +              This indicates a region of memory meant to be used as a shared

> > > +              pool of DMA buffers for a set of devices. It can be used by an

> > > +              operating system to instantiate the necessary pool management

> > > +              subsystem if necessary.

> > > +

> > > +          # Vendor-specific compatibles in the form <vendor>,[<device>-]<usage>

> > > +          - const: mediatek,trustzone-bootinfo

> >

> > I think these should be separate schema files. At least, we're going

> > to need to support separate files because I don't think we want ones

> > adding custom properties here. This would fail unless we add every

> > compatible here. We could also be a bit more exact as to which

> > properties below apply (e.g. linux,.*-default is only valid for

> > shared-dma-pool).

>

> I'm not entirely sure how we can just ignore the vendor compatibles

> without raising a warning. Do you have any suggestion?


You need 1 schema file with all the common (child) properties and then
1 schema file for each compatible (maybe some can be grouped) that
references the common schema.

You'd lose checking that the child nodes are actually children of
/reserved-memory, but I'm not too worried about that.

Rob