On Mon, Sep 16, 2019 at 10:35 AM Simon Horman <horms+renesas@xxxxxxxxxxxx> wrote: > > Convert Simple Power-Managed Bus bindings documentation to json-schema. > > As a side effect of this change only simple-pm-bus is used in example. A > follow-up patch will provide an example for the separately documented > Renesas Bus State Controller (BSC) that uses "renesas,bsc-sh73a0" and > "renesas,bsc" compat strings. > > Signed-off-by: Simon Horman <horms+renesas@xxxxxxxxxxxx> > --- > * Tested using: > # ARCH=arm64 make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > # ARCH=arm make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > --- > .../devicetree/bindings/bus/simple-pm-bus.txt | 44 -------------- > .../devicetree/bindings/bus/simple-pm-bus.yaml | 68 ++++++++++++++++++++++ > 2 files changed, 68 insertions(+), 44 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.txt > create mode 100644 Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > diff --git a/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > new file mode 100644 > index 000000000000..72a3644974e3 > --- /dev/null > +++ b/Documentation/devicetree/bindings/bus/simple-pm-bus.yaml > @@ -0,0 +1,68 @@ SPDX tag? > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/bus/simple-pm-bus.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Simple Power-Managed Bus > + > +maintainers: > + - Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > + > +description: | > + A Simple Power-Managed Bus is a transparent bus that doesn't need a real > + driver, as it's typically initialized by the boot loader. > + > + However, its bus controller is part of a PM domain, or under the control > + of a functional clock. Hence, the bus controller's PM domain and/or > + clock must be enabled for child devices connected to the bus (either > + on-SoC or externally) to function. > + > + While "simple-pm-bus" follows the "simple-bus" set of properties, as > + specified in the Devicetree Specification, it is not an extension of > + "simple-bus". > + > + > +properties: Add $nodename in here. > + compatible: > + items: > + - const: simple-pm-bus extra leading space. > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 1 1 or 2 should be valid... > + > + ranges: > + # Mapping between parent address and child address spaces. > + maxItems: 1 empty or multiple ranges should be possible. > + > + clocks: > + # Functional clocks > + # Required if power-domains is absent, optional otherwise > + minItems: 1 This will imply maxItems is 1 which I don't think you want. Though more than 1 starts to mean you need to know specifically what the h/w is. > + > + power-domains: > + # Required if clocks is absent, optional otherwise > + minItems: 1 > + > +required: > + - compatible > + - '#address-cells' > + - '#size-cells' > + - ranges This will capture what you commented above: oneOf: - required: - clocks - required: - power-domains > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + > + bsc: bus@fec10000 { > + compatible = "simple-pm-bus"; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges = <0 0 0x20000000>; > + reg = <0xfec10000 0x400>; If you have reg, then it shouldn't be "simple-pm-bus" unless you can function without accessing the regs. > + interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>; Not documented? > + clocks = <&zb_clk>; > + power-domains = <&pd_a4s>; > + }; > -- > 2.11.0 >