2020-05-21 09:15:58

by Lubomir Rintel

[permalink] [raw]
Subject: [PATCH 0/9] DT: Improve validation for Marvell SoCs

Hi,

chained to this message is a second version of remaining patches from the
first spin of the "DT: Improve validation for Marvell SoCs" [1] patch set.

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

I've attempted to address the review of the v1, each patch includes a
detailed change log.

Compared to v1, wherever the license or maintainer information was
missing, I've filled in GPL-2.0-only and people listed in MAINTAINERS
file. As I've indicated in v1 cover letter, am not sure whether this is
the optimal course of action. However I've included the relevant people
in v1 Cc list and asked for clarifications, but didn't really get any
feedback to that.

Cheers
Lubo




2020-05-21 09:15:59

by Lubomir Rintel

[permalink] [raw]
Subject: [PATCH v2 6/9] dt-bindings: rtc: Convert sa1100-rtc to json-schema

Convert the sa1100-rtc binding to DT schema format using json-schema.
While add that, add clocks and resets that are actually used.

Signed-off-by: Lubomir Rintel <[email protected]>

---
Changes since v1:
- Remove interrupts/maxItems
- Mention clocks and resets in the patch description
- Add default GPL-2.0-only license tag
- Fill in maintainers from MAINTAINERS file

.../devicetree/bindings/rtc/sa1100-rtc.txt | 17 ------
.../devicetree/bindings/rtc/sa1100-rtc.yaml | 57 +++++++++++++++++++
2 files changed, 57 insertions(+), 17 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/rtc/sa1100-rtc.txt
create mode 100644 Documentation/devicetree/bindings/rtc/sa1100-rtc.yaml

diff --git a/Documentation/devicetree/bindings/rtc/sa1100-rtc.txt b/Documentation/devicetree/bindings/rtc/sa1100-rtc.txt
deleted file mode 100644
index 968ac820254b..000000000000
--- a/Documentation/devicetree/bindings/rtc/sa1100-rtc.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-* Marvell Real Time Clock controller
-
-Required properties:
-- compatible: should be "mrvl,sa1100-rtc"
-- reg: physical base address of the controller and length of memory mapped
- region.
-- interrupts: Should be two. The first interrupt number is the rtc alarm
- interrupt and the second interrupt number is the rtc hz interrupt.
-- interrupt-names: Assign name of irq resource.
-
-Example:
- rtc: rtc@d4010000 {
- compatible = "mrvl,mmp-rtc";
- reg = <0xd4010000 0x1000>;
- interrupts = <5>, <6>;
- interrupt-names = "rtc 1Hz", "rtc alarm";
- };
diff --git a/Documentation/devicetree/bindings/rtc/sa1100-rtc.yaml b/Documentation/devicetree/bindings/rtc/sa1100-rtc.yaml
new file mode 100644
index 000000000000..482e5af215b3
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/sa1100-rtc.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/sa1100-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell Real Time Clock controller bindings
+
+allOf:
+ - $ref: rtc.yaml#
+
+maintainers:
+ - Alessandro Zummo <[email protected]>
+ - Alexandre Belloni <[email protected]>
+ - Rob Herring <[email protected]>
+
+properties:
+ compatible:
+ enum:
+ - mrvl,sa1100-rtc
+ - mrvl,mmp-rtc
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ interrupts:
+ minItems: 2
+
+ interrupt-names:
+ items:
+ - const: 'rtc 1Hz'
+ - const: 'rtc alarm'
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+
+additionalProperties: false
+
+examples:
+ - |
+ rtc: rtc@d4010000 {
+ compatible = "mrvl,mmp-rtc";
+ reg = <0xd4010000 0x1000>;
+ interrupts = <5>, <6>;
+ interrupt-names = "rtc 1Hz", "rtc alarm";
+ };
+
+...
--
2.26.2

2020-05-21 09:16:17

by Lubomir Rintel

[permalink] [raw]
Subject: [PATCH v2 8/9] dt-bindings: timer: Convert mrvl,mmp-timer to json-schema

A straightforward conversion of the mrvl,mmp-timer binding to DT schema
format using json-schema.

Signed-off-by: Lubomir Rintel <[email protected]>

---
Changes since v1:
- Add default GPL-2.0-only license tag
- Fill in maintainers from MAINTAINERS file

.../bindings/timer/mrvl,mmp-timer.txt | 17 -------
.../bindings/timer/mrvl,mmp-timer.yaml | 46 +++++++++++++++++++
2 files changed, 46 insertions(+), 17 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt
create mode 100644 Documentation/devicetree/bindings/timer/mrvl,mmp-timer.yaml

diff --git a/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt b/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt
deleted file mode 100644
index b8f02c663521..000000000000
--- a/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-* Marvell MMP Timer controller
-
-Required properties:
-- compatible : Should be "mrvl,mmp-timer".
-- reg : Address and length of the register set of timer controller.
-- interrupts : Should be the interrupt number.
-
-Optional properties:
-- clocks : Should contain a single entry describing the clock input.
-
-Example:
- timer0: timer@d4014000 {
- compatible = "mrvl,mmp-timer";
- reg = <0xd4014000 0x100>;
- interrupts = <13>;
- clocks = <&coreclk 2>;
- };
diff --git a/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.yaml b/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.yaml
new file mode 100644
index 000000000000..1fbc260a0cbd
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.yaml
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/mrvl,mmp-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell MMP Timer bindings
+
+maintainers:
+ - Daniel Lezcano <[email protected]>
+ - Thomas Gleixner <[email protected]>
+ - Rob Herring <[email protected]>
+
+properties:
+ $nodename:
+ pattern: '^timer@[a-f0-9]+$'
+
+ compatible:
+ const: mrvl,mmp-timer
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ timer@d4014000 {
+ compatible = "mrvl,mmp-timer";
+ reg = <0xd4014000 0x100>;
+ interrupts = <13>;
+ clocks = <&coreclk 2>;
+ };
+
+...
--
2.26.2

2020-05-21 09:16:28

by Lubomir Rintel

[permalink] [raw]
Subject: [PATCH v2 7/9] dt-bindings: spi: Convert spi-pxa2xx to json-schema

A straightforward conversion of the the spi-pxa2xx binding to DT schema
format using json-schema.

Signed-off-by: Lubomir Rintel <[email protected]>

---
Changes since v1:
- Drop #address-cells and #size-cells
- s/GPL-2.0-or-later/GPL-2.0-only/

.../bindings/spi/marvell,mmp2-ssp.yaml | 56 +++++++++++++++++++
.../devicetree/bindings/spi/spi-pxa2xx.txt | 27 ---------
2 files changed, 56 insertions(+), 27 deletions(-)
create mode 100644 Documentation/devicetree/bindings/spi/marvell,mmp2-ssp.yaml
delete mode 100644 Documentation/devicetree/bindings/spi/spi-pxa2xx.txt

diff --git a/Documentation/devicetree/bindings/spi/marvell,mmp2-ssp.yaml b/Documentation/devicetree/bindings/spi/marvell,mmp2-ssp.yaml
new file mode 100644
index 000000000000..09bd831250a2
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/marvell,mmp2-ssp.yaml
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2019,2020 Lubomir Rintel <[email protected]>
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/marvell,mmp2-ssp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: PXA2xx SSP SPI Controller bindings
+
+maintainers:
+ - Lubomir Rintel <[email protected]>
+
+allOf:
+ - $ref: spi-controller.yaml#
+
+properties:
+ compatible:
+ const: marvell,mmp2-ssp
+
+ interrupts:
+ maxItems: 1
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ ready-gpios:
+ description: |
+ GPIO used to signal a SPI master that the FIFO is filled and we're
+ ready to service a transfer. Only useful in slave mode.
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+
+dependencies:
+ ready-gpios: [ spi-slave ]
+
+examples:
+ - |
+ #include <dt-bindings/clock/marvell,mmp2.h>
+ spi@d4035000 {
+ compatible = "marvell,mmp2-ssp";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0xd4035000 0x1000>;
+ clocks = <&soc_clocks MMP2_CLK_SSP0>;
+ interrupts = <0>;
+ };
+
+...
diff --git a/Documentation/devicetree/bindings/spi/spi-pxa2xx.txt b/Documentation/devicetree/bindings/spi/spi-pxa2xx.txt
deleted file mode 100644
index e30e0c2a4bce..000000000000
--- a/Documentation/devicetree/bindings/spi/spi-pxa2xx.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-PXA2xx SSP SPI Controller
-
-Required properties:
-- compatible: Must be "marvell,mmp2-ssp".
-- reg: Offset and length of the device's register set.
-- interrupts: Should be the interrupt number.
-- clocks: Should contain a single entry describing the clock input.
-- #address-cells: Number of cells required to define a chip select address.
-- #size-cells: Should be zero.
-
-Optional properties:
-- cs-gpios: list of GPIO chip selects. See the SPI bus bindings,
- Documentation/devicetree/bindings/spi/spi-bus.txt
-- spi-slave: Empty property indicating the SPI controller is used in slave mode.
-- ready-gpios: GPIO used to signal a SPI master that the FIFO is filled
- and we're ready to service a transfer. Only useful in slave mode.
-
-Child nodes represent devices on the SPI bus
- See ../spi/spi-bus.txt
-
-Example:
- ssp1: spi@d4035000 {
- compatible = "marvell,mmp2-ssp";
- reg = <0xd4035000 0x1000>;
- clocks = <&soc_clocks MMP2_CLK_SSP0>;
- interrupts = <0>;
- };
--
2.26.2

2020-05-21 09:17:27

by Lubomir Rintel

[permalink] [raw]
Subject: [PATCH v2 3/9] dt-bindings: i2c: Convert i2c-pxa to json-schema

A conversion of the i2c-pxa binding to DT schema format using json-schema.

This also cleans ups some errors in the binding: The compatible string
description suggested that "mmp" in "mrvl,mmp-twsi" is to be substituted
with a processor model, which wouldn't be a right thing to do and indeed
nobody seems to have been doing that. There also was "Recommended
properties" section that included optional as well as mandatory
properties. Missing mandatory properties were added to the example.

Signed-off-by: Lubomir Rintel <[email protected]>

---
Changes since v1:
- Add default GPL-2.0-only license tag
- Fill in maintainers from MAINTAINERS file

.../devicetree/bindings/i2c/i2c-pxa.txt | 31 --------
.../devicetree/bindings/i2c/i2c-pxa.yaml | 72 +++++++++++++++++++
2 files changed, 72 insertions(+), 31 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-pxa.txt
create mode 100644 Documentation/devicetree/bindings/i2c/i2c-pxa.yaml

diff --git a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt b/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
deleted file mode 100644
index c30783c0eca0..000000000000
--- a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-* Marvell MMP I2C controller
-
-Required properties :
-
- - reg : Offset and length of the register set for the device
- - compatible : should be "mrvl,mmp-twsi" where mmp is the name of a
- compatible processor, e.g. pxa168, pxa910, mmp2, mmp3.
- For the pxa2xx/pxa3xx, an additional node "mrvl,pxa-i2c" is required
- as shown in the example below.
- For the Armada 3700, the compatible should be "marvell,armada-3700-i2c".
-
-Recommended properties :
-
- - interrupts : the interrupt number
- - mrvl,i2c-polling : Disable interrupt of i2c controller. Polling
- status register of i2c controller instead.
- - mrvl,i2c-fast-mode : Enable fast mode of i2c controller.
-
-Examples:
- twsi1: i2c@d4011000 {
- compatible = "mrvl,mmp-twsi";
- reg = <0xd4011000 0x1000>;
- interrupts = <7>;
- mrvl,i2c-fast-mode;
- };
-
- twsi2: i2c@d4025000 {
- compatible = "mrvl,mmp-twsi";
- reg = <0xd4025000 0x1000>;
- interrupts = <58>;
- };
diff --git a/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml b/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml
new file mode 100644
index 000000000000..19c81972243d
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/i2c-pxa.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell MMP I2C controller bindings
+
+maintainers:
+ - Rob Herring <[email protected]>
+
+allOf:
+ - $ref: /schemas/i2c/i2c-controller.yaml#
+ - if:
+ not:
+ required:
+ - mrvl,i2c-polling
+ then:
+ required:
+ - interrupts
+
+properties:
+ compatible:
+ enum:
+ - mrvl,mmp-twsi
+ - mrvl,pxa-i2c
+ - marvell,armada-3700-i2c
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ minItems: 1
+
+ resets:
+ minItems: 1
+
+ mrvl,i2c-polling:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description: |
+ Disable interrupt of i2c controller. Polling status register of i2c
+ controller instead.
+
+ mrvl,i2c-fast-mode:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description: Enable fast mode of i2c controller.
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - '#address-cells'
+ - '#size-cells'
+
+examples:
+ - |
+ #include <dt-bindings/clock/marvell,mmp2.h>
+ i2c@d4011000 {
+ compatible = "mrvl,mmp-twsi";
+ reg = <0xd4011000 0x1000>;
+ interrupts = <7>;
+ clocks = <&soc_clocks MMP2_CLK_TWSI1>;
+ mrvl,i2c-fast-mode;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+...
--
2.26.2

2020-05-21 09:18:05

by Lubomir Rintel

[permalink] [raw]
Subject: [PATCH v2 9/9] dt-bindings: usb: Convert ehci-mv to json-schema

A straightforward conversion of the ehci-mv binding to DT schema format
using json-schema.

Signed-off-by: Lubomir Rintel <[email protected]>

---
Changes since v1:
- s/GPL-2.0-or-later/GPL-2.0-only/

.../devicetree/bindings/usb/ehci-mv.txt | 23 -------
.../bindings/usb/marvell,pxau2o-ehci.yaml | 60 +++++++++++++++++++
2 files changed, 60 insertions(+), 23 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/usb/ehci-mv.txt
create mode 100644 Documentation/devicetree/bindings/usb/marvell,pxau2o-ehci.yaml

diff --git a/Documentation/devicetree/bindings/usb/ehci-mv.txt b/Documentation/devicetree/bindings/usb/ehci-mv.txt
deleted file mode 100644
index 335589895763..000000000000
--- a/Documentation/devicetree/bindings/usb/ehci-mv.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-* Marvell PXA/MMP EHCI controller.
-
-Required properties:
-
-- compatible: must be "marvell,pxau2o-ehci"
-- reg: physical base addresses of the controller and length of memory mapped region
-- interrupts: one EHCI controller interrupt should be described here
-- clocks: phandle list of usb clocks
-- clock-names: should be "USBCLK"
-- phys: phandle for the PHY device
-- phy-names: should be "usb"
-
-Example:
-
- ehci0: usb-ehci@d4208000 {
- compatible = "marvell,pxau2o-ehci";
- reg = <0xd4208000 0x200>;
- interrupts = <44>;
- clocks = <&soc_clocks MMP2_CLK_USB>;
- clock-names = "USBCLK";
- phys = <&usb_otg_phy>;
- phy-names = "usb";
- };
diff --git a/Documentation/devicetree/bindings/usb/marvell,pxau2o-ehci.yaml b/Documentation/devicetree/bindings/usb/marvell,pxau2o-ehci.yaml
new file mode 100644
index 000000000000..eccd8cb45f77
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/marvell,pxau2o-ehci.yaml
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2019,2020 Lubomir Rintel <[email protected]>
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/marvell,pxau2o-ehci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell PXA/MMP EHCI bindings
+
+maintainers:
+ - Lubomir Rintel <[email protected]>
+
+allOf:
+ - $ref: usb-hcd.yaml#
+
+properties:
+ compatible:
+ const: marvell,pxau2o-ehci
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ const: USBCLK
+
+ phys:
+ maxItems: 1
+
+ phy-names:
+ const: usb
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+ - phys
+ - phy-names
+
+examples:
+ - |
+ #include <dt-bindings/clock/marvell,mmp2.h>
+ usb@d4208000 {
+ compatible = "marvell,pxau2o-ehci";
+ reg = <0xd4208000 0x200>;
+ interrupts = <44>;
+ clocks = <&soc_clocks MMP2_CLK_USB>;
+ clock-names = "USBCLK";
+ phys = <&usb_otg_phy>;
+ phy-names = "usb";
+ };
+
+...
--
2.26.2

2020-05-21 09:18:07

by Lubomir Rintel

[permalink] [raw]
Subject: [PATCH v2 4/9] dt-bindings: interrupt-controller: Convert mrvl,intc to json-schema

Convert the mrvl,intc binding to DT schema format using json-schema.

Signed-off-by: Lubomir Rintel <[email protected]>

---
Changes since v1:
- Move minItems/maxItems to main reg property definition from the
conditional one
- Drop the condition for marvell,orion-intc
- Add default GPL-2.0-only license tag
- Fill in maintainers from MAINTAINERS file

.../interrupt-controller/mrvl,intc.txt | 64 ---------
.../interrupt-controller/mrvl,intc.yaml | 134 ++++++++++++++++++
2 files changed, 134 insertions(+), 64 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/mrvl,intc.txt
create mode 100644 Documentation/devicetree/bindings/interrupt-controller/mrvl,intc.yaml

diff --git a/Documentation/devicetree/bindings/interrupt-controller/mrvl,intc.txt b/Documentation/devicetree/bindings/interrupt-controller/mrvl,intc.txt
deleted file mode 100644
index a0ed02725a9d..000000000000
--- a/Documentation/devicetree/bindings/interrupt-controller/mrvl,intc.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-* Marvell MMP Interrupt controller
-
-Required properties:
-- compatible : Should be
- "mrvl,mmp-intc" on Marvel MMP,
- "mrvl,mmp2-intc" along with "mrvl,mmp2-mux-intc" on MMP2 or
- "marvell,mmp3-intc" with "mrvl,mmp2-mux-intc" on MMP3
-- reg : Address and length of the register set of the interrupt controller.
- If the interrupt controller is intc, address and length means the range
- of the whole interrupt controller. The "marvell,mmp3-intc" controller
- also has a secondary range for the second CPU core. If the interrupt
- controller is mux-intc, address and length means one register. Since
- address of mux-intc is in the range of intc. mux-intc is secondary
- interrupt controller.
-- reg-names : Name of the register set of the interrupt controller. It's
- only required in mux-intc interrupt controller.
-- interrupts : Should be the port interrupt shared by mux interrupts. It's
- only required in mux-intc interrupt controller.
-- interrupt-controller : Identifies the node as an interrupt controller.
-- #interrupt-cells : Specifies the number of cells needed to encode an
- interrupt source.
-- mrvl,intc-nr-irqs : Specifies the number of interrupts in the interrupt
- controller.
-- mrvl,clr-mfp-irq : Specifies the interrupt that needs to clear MFP edge
- detection first.
-
-Example:
- intc: interrupt-controller@d4282000 {
- compatible = "mrvl,mmp2-intc";
- interrupt-controller;
- #interrupt-cells = <1>;
- reg = <0xd4282000 0x1000>;
- mrvl,intc-nr-irqs = <64>;
- };
-
- intcmux4@d4282150 {
- compatible = "mrvl,mmp2-mux-intc";
- interrupts = <4>;
- interrupt-controller;
- #interrupt-cells = <1>;
- reg = <0x150 0x4>, <0x168 0x4>;
- reg-names = "mux status", "mux mask";
- mrvl,intc-nr-irqs = <2>;
- };
-
-* Marvell Orion Interrupt controller
-
-Required properties
-- compatible : Should be "marvell,orion-intc".
-- #interrupt-cells: Specifies the number of cells needed to encode an
- interrupt source. Supported value is <1>.
-- interrupt-controller : Declare this node to be an interrupt controller.
-- reg : Interrupt mask address. A list of 4 byte ranges, one per controller.
- One entry in the list represents 32 interrupts.
-
-Example:
-
- intc: interrupt-controller {
- compatible = "marvell,orion-intc", "marvell,intc";
- interrupt-controller;
- #interrupt-cells = <1>;
- reg = <0xfed20204 0x04>,
- <0xfed20214 0x04>;
- };
diff --git a/Documentation/devicetree/bindings/interrupt-controller/mrvl,intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/mrvl,intc.yaml
new file mode 100644
index 000000000000..372ccbfae771
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/mrvl,intc.yaml
@@ -0,0 +1,134 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/mrvl,intc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell MMP/Orion Interrupt controller bindings
+
+maintainers:
+ - Thomas Gleixner <[email protected]>
+ - Jason Cooper <[email protected]>
+ - Marc Zyngier <[email protected]>
+ - Rob Herring <[email protected]>
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ not:
+ contains:
+ const: marvell,orion-intc
+ then:
+ required:
+ - mrvl,intc-nr-irqs
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - mrvl,mmp-intc
+ - mrvl,mmp2-intc
+ then:
+ properties:
+ reg:
+ maxItems: 1
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - marvell,mmp3-intc
+ - mrvl,mmp2-mux-intc
+ then:
+ properties:
+ reg:
+ minItems: 2
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mrvl,mmp2-mux-intc
+ then:
+ properties:
+ interrupts:
+ maxItems: 1
+ reg-names:
+ items:
+ - const: 'mux status'
+ - const: 'mux mask'
+ required:
+ - interrupts
+ else:
+ properties:
+ interrupts: false
+
+properties:
+ '#interrupt-cells':
+ const: 1
+
+ compatible:
+ enum:
+ - mrvl,mmp-intc
+ - mrvl,mmp2-intc
+ - marvell,mmp3-intc
+ - marvell,orion-intc
+ - mrvl,mmp2-mux-intc
+
+ reg:
+ minItems: 1
+ maxItems: 2
+
+ reg-names: true
+
+ interrupts: true
+
+ interrupt-controller: true
+
+ mrvl,intc-nr-irqs:
+ description: |
+ Specifies the number of interrupts in the interrupt controller.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ mrvl,clr-mfp-irq:
+ description: |
+ Specifies the interrupt that needs to clear MFP edge detection first.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+required:
+ - '#interrupt-cells'
+ - compatible
+ - reg
+ - interrupt-controller
+
+additionalProperties: false
+
+examples:
+ - |
+ interrupt-controller@d4282000 {
+ compatible = "mrvl,mmp2-intc";
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ reg = <0xd4282000 0x1000>;
+ mrvl,intc-nr-irqs = <64>;
+ };
+
+ interrupt-controller@d4282150 {
+ compatible = "mrvl,mmp2-mux-intc";
+ interrupts = <4>;
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ reg = <0x150 0x4>, <0x168 0x4>;
+ reg-names = "mux status", "mux mask";
+ mrvl,intc-nr-irqs = <2>;
+ };
+ - |
+ interrupt-controller@fed20204 {
+ compatible = "marvell,orion-intc";
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ reg = <0xfed20204 0x04>,
+ <0xfed20214 0x04>;
+ };
+
+...
--
2.26.2

2020-05-21 09:19:45

by Lubomir Rintel

[permalink] [raw]
Subject: [PATCH v2 5/9] dt-bindings: media: Convert marvell,mmp2-ccic to json-schema

Convert the marvell,mmp2-ccic binding to DT schema format using
json-schema. While at that this drops the "func" and "phy" clocks.

The driver consumes clocks with those names, but it's not clear
what are they for and they are not used in DT systems. "phy" is
probably a clock for the sensor and it would belong in the sensor
node.

Signed-off-by: Lubomir Rintel <[email protected]>

---
Changes since v1:
- Fix indentation
- Drop clocks other than "axi"
- s/GPL-2.0-or-later/GPL-2.0-only/

.../bindings/media/marvell,mmp2-ccic.txt | 50 ----------
.../bindings/media/marvell,mmp2-ccic.yaml | 97 +++++++++++++++++++
2 files changed, 97 insertions(+), 50 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/media/marvell,mmp2-ccic.txt
create mode 100644 Documentation/devicetree/bindings/media/marvell,mmp2-ccic.yaml

diff --git a/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.txt b/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.txt
deleted file mode 100644
index 7ec2c8c8a3b9..000000000000
--- a/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-Marvell MMP2 camera host interface
-
-Required properties:
- - compatible: Should be "marvell,mmp2-ccic".
- - reg: Register base and size.
- - interrupts: The interrupt number.
- - #clock-cells: Must be 0.
-
-Optional properties:
- - clocks: Reference to the input clock as specified by
- Documentation/devicetree/bindings/clock/clock-bindings.txt.
- - clock-names: Names of the clocks used; "axi" for the AXI bus interface,
- "func" for the peripheral clock and "phy" for the parallel
- video bus interface.
- - clock-output-names: Optional clock source for sensors. Shall be "mclk".
-
-Required subnodes:
- - port: The parallel bus interface port with a single endpoint linked to
- the sensor's endpoint as described in
- Documentation/devicetree/bindings/media/video-interfaces.txt.
-
-Required endpoint properties:
- - bus-type: data bus type, <5> or <6> for Parallel or Bt.656 respectively
- - pclk-sample: pixel clock polarity
- - hsync-active: horizontal synchronization polarity (only required for
- parallel bus)
- - vsync-active: vertical synchronization polarity (only required for
- parallel bus)
-
-Example:
-
- camera0: camera@d420a000 {
- compatible = "marvell,mmp2-ccic";
- reg = <0xd420a000 0x800>;
- interrupts = <42>;
- clocks = <&soc_clocks MMP2_CLK_CCIC0>;
- clock-names = "axi";
- #clock-cells = <0>;
- clock-output-names = "mclk";
-
- port {
- camera0_0: endpoint {
- remote-endpoint = <&ov7670_0>;
- bus-type = <5>; /* Parallel */
- hsync-active = <1>; /* Active high */
- vsync-active = <1>; /* Active high */
- pclk-sample = <0>; /* Falling */
- };
- };
- };
diff --git a/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.yaml b/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.yaml
new file mode 100644
index 000000000000..fb399de668bb
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/marvell,mmp2-ccic.yaml
@@ -0,0 +1,97 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2019,2020 Lubomir Rintel <[email protected]>
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/marvell,mmp2-ccic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell MMP2 camera host interface bindings
+
+maintainers:
+ - Lubomir Rintel <[email protected]>
+
+properties:
+ $nodename:
+ pattern: '^camera@[a-f0-9]+$'
+
+ compatible:
+ const: marvell,mmp2-ccic
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ port:
+ type: object
+ additionalProperties: false
+
+ properties:
+ endpoint:
+ type: object
+ additionalProperties: false
+
+ # Properties described in
+ # Documentation/devicetree/bindings/media/video-interfaces.txt
+ properties:
+ remote-endpoint: true
+ hsync-active: true
+ vsync-active: true
+ pclk-sample: true
+ bus-type: true
+
+ required:
+ - remote-endpoint
+
+ required:
+ - endpoint
+
+ clocks:
+ minItems: 1
+ maxItems: 3
+ items:
+ - description: AXI bus interface clock
+ - description: Peripheral clock
+ - description: Parallel video bus interface clock
+
+ clock-names:
+ const: axi
+
+ '#clock-cells':
+ const: 0
+
+ clock-output-names:
+ const: mclk
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - port
+
+examples:
+ - |
+ #include <dt-bindings/clock/marvell,mmp2.h>
+
+ camera@d420a000 {
+ compatible = "marvell,mmp2-ccic";
+ reg = <0xd420a000 0x800>;
+ interrupts = <42>;
+ clocks = <&soc_clocks MMP2_CLK_CCIC0>;
+ clock-names = "axi";
+ #clock-cells = <0>;
+ clock-output-names = "mclk";
+
+ port {
+ camera0_0: endpoint {
+ remote-endpoint = <&ov7670_0>;
+ bus-type = <5>; /* Parallel */
+ hsync-active = <1>; /* Active high */
+ vsync-active = <1>; /* Active high */
+ pclk-sample = <0>; /* Falling */
+ };
+ };
+ };
+
+...
--
2.26.2

2020-05-28 22:57:33

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH 0/9] DT: Improve validation for Marvell SoCs

On Thu, May 21, 2020 at 11:13:47AM +0200, Lubomir Rintel wrote:
> Hi,
>
> chained to this message is a second version of remaining patches from the
> first spin of the "DT: Improve validation for Marvell SoCs" [1] patch set.
>
> [1] https://lore.kernel.org/lkml/[email protected]/
>
> I've attempted to address the review of the v1, each patch includes a
> detailed change log.
>
> Compared to v1, wherever the license or maintainer information was
> missing, I've filled in GPL-2.0-only and people listed in MAINTAINERS
> file. As I've indicated in v1 cover letter, am not sure whether this is
> the optimal course of action. However I've included the relevant people
> in v1 Cc list and asked for clarifications, but didn't really get any
> feedback to that.

Find someone that would care if the bindings are deleted. I'm fine
if you put yourself. Maybe subsystem maintainers are willing to take
orphans. I really only want my name on common things.

Rob

2020-05-28 23:00:11

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 3/9] dt-bindings: i2c: Convert i2c-pxa to json-schema

On Thu, May 21, 2020 at 11:13:50AM +0200, Lubomir Rintel wrote:
> A conversion of the i2c-pxa binding to DT schema format using json-schema.
>
> This also cleans ups some errors in the binding: The compatible string
> description suggested that "mmp" in "mrvl,mmp-twsi" is to be substituted
> with a processor model, which wouldn't be a right thing to do and indeed
> nobody seems to have been doing that. There also was "Recommended
> properties" section that included optional as well as mandatory
> properties. Missing mandatory properties were added to the example.
>
> Signed-off-by: Lubomir Rintel <[email protected]>
>
> ---
> Changes since v1:
> - Add default GPL-2.0-only license tag
> - Fill in maintainers from MAINTAINERS file
>
> .../devicetree/bindings/i2c/i2c-pxa.txt | 31 --------
> .../devicetree/bindings/i2c/i2c-pxa.yaml | 72 +++++++++++++++++++
> 2 files changed, 72 insertions(+), 31 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-pxa.txt
> create mode 100644 Documentation/devicetree/bindings/i2c/i2c-pxa.yaml
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt b/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
> deleted file mode 100644
> index c30783c0eca0..000000000000
> --- a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -* Marvell MMP I2C controller
> -
> -Required properties :
> -
> - - reg : Offset and length of the register set for the device
> - - compatible : should be "mrvl,mmp-twsi" where mmp is the name of a
> - compatible processor, e.g. pxa168, pxa910, mmp2, mmp3.
> - For the pxa2xx/pxa3xx, an additional node "mrvl,pxa-i2c" is required
> - as shown in the example below.
> - For the Armada 3700, the compatible should be "marvell,armada-3700-i2c".
> -
> -Recommended properties :
> -
> - - interrupts : the interrupt number
> - - mrvl,i2c-polling : Disable interrupt of i2c controller. Polling
> - status register of i2c controller instead.
> - - mrvl,i2c-fast-mode : Enable fast mode of i2c controller.
> -
> -Examples:
> - twsi1: i2c@d4011000 {
> - compatible = "mrvl,mmp-twsi";
> - reg = <0xd4011000 0x1000>;
> - interrupts = <7>;
> - mrvl,i2c-fast-mode;
> - };
> -
> - twsi2: i2c@d4025000 {
> - compatible = "mrvl,mmp-twsi";
> - reg = <0xd4025000 0x1000>;
> - interrupts = <58>;
> - };
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml b/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml
> new file mode 100644
> index 000000000000..19c81972243d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml
> @@ -0,0 +1,72 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/i2c-pxa.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Marvell MMP I2C controller bindings
> +
> +maintainers:
> + - Rob Herring <[email protected]>
> +
> +allOf:
> + - $ref: /schemas/i2c/i2c-controller.yaml#
> + - if:
> + not:
> + required:
> + - mrvl,i2c-polling
> + then:
> + required:
> + - interrupts
> +
> +properties:
> + compatible:
> + enum:
> + - mrvl,mmp-twsi
> + - mrvl,pxa-i2c
> + - marvell,armada-3700-i2c
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + clocks:
> + minItems: 1
> +
> + resets:
> + minItems: 1
> +
> + mrvl,i2c-polling:
> + $ref: /schemas/types.yaml#/definitions/flag
> + description: |
> + Disable interrupt of i2c controller. Polling status register of i2c
> + controller instead.
> +
> + mrvl,i2c-fast-mode:
> + $ref: /schemas/types.yaml#/definitions/flag
> + description: Enable fast mode of i2c controller.
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> + - '#address-cells'
> + - '#size-cells'

Add:

unevaluatedProperties: false

> +
> +examples:
> + - |
> + #include <dt-bindings/clock/marvell,mmp2.h>
> + i2c@d4011000 {
> + compatible = "mrvl,mmp-twsi";
> + reg = <0xd4011000 0x1000>;
> + interrupts = <7>;
> + clocks = <&soc_clocks MMP2_CLK_TWSI1>;
> + mrvl,i2c-fast-mode;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + };
> +
> +...
> --
> 2.26.2
>

2020-05-28 23:02:19

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 5/9] dt-bindings: media: Convert marvell,mmp2-ccic to json-schema

On Thu, 21 May 2020 11:13:52 +0200, Lubomir Rintel wrote:
> Convert the marvell,mmp2-ccic binding to DT schema format using
> json-schema. While at that this drops the "func" and "phy" clocks.
>
> The driver consumes clocks with those names, but it's not clear
> what are they for and they are not used in DT systems. "phy" is
> probably a clock for the sensor and it would belong in the sensor
> node.
>
> Signed-off-by: Lubomir Rintel <[email protected]>
>
> ---
> Changes since v1:
> - Fix indentation
> - Drop clocks other than "axi"
> - s/GPL-2.0-or-later/GPL-2.0-only/
>
> .../bindings/media/marvell,mmp2-ccic.txt | 50 ----------
> .../bindings/media/marvell,mmp2-ccic.yaml | 97 +++++++++++++++++++
> 2 files changed, 97 insertions(+), 50 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/media/marvell,mmp2-ccic.txt
> create mode 100644 Documentation/devicetree/bindings/media/marvell,mmp2-ccic.yaml
>

Applied, thanks!

2020-05-28 23:07:51

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 7/9] dt-bindings: spi: Convert spi-pxa2xx to json-schema

On Thu, 21 May 2020 11:13:54 +0200, Lubomir Rintel wrote:
> A straightforward conversion of the the spi-pxa2xx binding to DT schema
> format using json-schema.
>
> Signed-off-by: Lubomir Rintel <[email protected]>
>
> ---
> Changes since v1:
> - Drop #address-cells and #size-cells
> - s/GPL-2.0-or-later/GPL-2.0-only/
>
> .../bindings/spi/marvell,mmp2-ssp.yaml | 56 +++++++++++++++++++
> .../devicetree/bindings/spi/spi-pxa2xx.txt | 27 ---------
> 2 files changed, 56 insertions(+), 27 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/spi/marvell,mmp2-ssp.yaml
> delete mode 100644 Documentation/devicetree/bindings/spi/spi-pxa2xx.txt
>

Applied, thanks!

2020-05-28 23:08:04

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 9/9] dt-bindings: usb: Convert ehci-mv to json-schema

On Thu, 21 May 2020 11:13:56 +0200, Lubomir Rintel wrote:
> A straightforward conversion of the ehci-mv binding to DT schema format
> using json-schema.
>
> Signed-off-by: Lubomir Rintel <[email protected]>
>
> ---
> Changes since v1:
> - s/GPL-2.0-or-later/GPL-2.0-only/
>
> .../devicetree/bindings/usb/ehci-mv.txt | 23 -------
> .../bindings/usb/marvell,pxau2o-ehci.yaml | 60 +++++++++++++++++++
> 2 files changed, 60 insertions(+), 23 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/usb/ehci-mv.txt
> create mode 100644 Documentation/devicetree/bindings/usb/marvell,pxau2o-ehci.yaml
>

Applied, thanks!

2020-05-30 18:17:31

by Lubomir Rintel

[permalink] [raw]
Subject: Re: [PATCH 0/9] DT: Improve validation for Marvell SoCs

On Thu, May 28, 2020 at 04:52:44PM -0600, Rob Herring wrote:
> On Thu, May 21, 2020 at 11:13:47AM +0200, Lubomir Rintel wrote:
> > Hi,
> >
> > chained to this message is a second version of remaining patches from the
> > first spin of the "DT: Improve validation for Marvell SoCs" [1] patch set.
> >
> > [1] https://lore.kernel.org/lkml/[email protected]/
> >
> > I've attempted to address the review of the v1, each patch includes a
> > detailed change log.
> >
> > Compared to v1, wherever the license or maintainer information was
> > missing, I've filled in GPL-2.0-only and people listed in MAINTAINERS
> > file. As I've indicated in v1 cover letter, am not sure whether this is
> > the optimal course of action. However I've included the relevant people
> > in v1 Cc list and asked for clarifications, but didn't really get any
> > feedback to that.
>
> Find someone that would care if the bindings are deleted. I'm fine
> if you put yourself. Maybe subsystem maintainers are willing to take
> orphans. I really only want my name on common things.

Thanks for clarification & fixups to the patches.

I'm wondering if Documentation/devicetree/writing-schema.rst could
perhaps be made a bit clearer about how the maintainer key in a binding
document is different from what is in the MAINTAINERS file.

> Rob

Lubo