diff mbox series

[01/16] dt-bindings: fpga: convert Lattice MachXO2 Slave binding to YAML

Message ID 20220825141343.1375690-2-j.zink@pengutronix.de (mailing list archive)
State New
Headers show
Series Add support for Lattice MachXO2 programming via I2C | expand

Commit Message

Johannes Zink Aug. 25, 2022, 2:13 p.m. UTC
This commit prepares adding additional properties to the machxo2-slave
device. No functional changes.

Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
---
 .../bindings/fpga/lattice,machxo2-slave.yaml  | 46 +++++++++++++++++++
 .../bindings/fpga/lattice-machxo2-spi.txt     | 29 ------------
 2 files changed, 46 insertions(+), 29 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml
 delete mode 100644 Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt

Comments

Rob Herring (Arm) Aug. 30, 2022, 8:30 p.m. UTC | #1
On Thu, Aug 25, 2022 at 04:13:28PM +0200, Johannes Zink wrote:
> This commit prepares adding additional properties to the machxo2-slave
> device. No functional changes.

Please use get_maintainers.pl so *all* the maintainers/lists get Cc'ed. 

> 
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
> ---
>  .../bindings/fpga/lattice,machxo2-slave.yaml  | 46 +++++++++++++++++++
>  .../bindings/fpga/lattice-machxo2-spi.txt     | 29 ------------
>  2 files changed, 46 insertions(+), 29 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml
>  delete mode 100644 Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt
> 
> diff --git a/Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml b/Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml
> new file mode 100644
> index 000000000000..d05acd6b0fc6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml
> @@ -0,0 +1,46 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/fpga/lattice,machxo2-slave.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Lattice MachXO2 Slave FPGA Manager Device Tree Bindings
> +
> +maintainers:
> +  - Johannes Zink <j.zink@pengutronix.de>
> +
> +description: |
> +  Device used for loading the bitstream of Lattice MachXO2 FPGAs. The
> +  programming sequence is described in FPGA-TN-02155 on www.latticesemi.com
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: lattice,machxo2-slave-spi
> +    then:
> +      $ref: /schemas/spi/spi-peripheral-props.yaml#

You don't need the 'if' because the schema is only applied if the 
compatible matches.

Blank line needed here.

> +properties:
> +  compatible:
> +    enum:
> +      - lattice,machxo2-slave-spi
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    spi0 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        fpga@0 {
> +            compatible = "lattice,machxo2-slave-spi";
> +            spi-max-frequency = <8000000>;
> +            reg = <0>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt b/Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt
> deleted file mode 100644
> index a8c362eb160c..000000000000
> --- a/Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -Lattice MachXO2 Slave SPI FPGA Manager
> -
> -Lattice MachXO2 FPGAs support a method of loading the bitstream over
> -'slave SPI' interface.
> -
> -See 'MachXO2ProgrammingandConfigurationUsageGuide.pdf' on www.latticesemi.com
> -
> -Required properties:
> -- compatible: should contain "lattice,machxo2-slave-spi"
> -- reg: spi chip select of the FPGA
> -
> -Example for full FPGA configuration:
> -
> -	fpga-region0 {
> -		compatible = "fpga-region";
> -		fpga-mgr = <&fpga_mgr_spi>;
> -		#address-cells = <0x1>;
> -		#size-cells = <0x1>;
> -	};
> -
> -	spi1: spi@2000 {
> -        ...
> -
> -		fpga_mgr_spi: fpga-mgr@0 {
> -			compatible = "lattice,machxo2-slave-spi";
> -			spi-max-frequency = <8000000>;
> -			reg = <0>;
> -		};
> -	};
> -- 
> 2.30.2
> 
>
Johannes Zink Aug. 31, 2022, 7:12 a.m. UTC | #2
Hi Rob,

On Tue, 2022-08-30 at 15:30 -0500, Rob Herring wrote:
> On Thu, Aug 25, 2022 at 04:13:28PM +0200, Johannes Zink wrote:
> > This commit prepares adding additional properties to the machxo2-
> > slave
> > device. No functional changes.
> 
> Please use get_maintainers.pl so *all* the maintainers/lists get
> Cc'ed. 
> 

ok, will do that in the future.

> > 
> > Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
> > ---
> >  .../bindings/fpga/lattice,machxo2-slave.yaml  | 46
> > +++++++++++++++++++
> >  .../bindings/fpga/lattice-machxo2-spi.txt     | 29 ------------
> >  2 files changed, 46 insertions(+), 29 deletions(-)
> >  create mode 100644
> > Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/fpga/lattice-
> > machxo2-spi.txt
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml
> > b/Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml
> > new file mode 100644
> > index 000000000000..d05acd6b0fc6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/fpga/lattice,machxo2-
> > slave.yaml
> > @@ -0,0 +1,46 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id:  
> > http://devicetree.org/schemas/fpga/lattice,machxo2-slave.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Lattice MachXO2 Slave FPGA Manager Device Tree Bindings
> > +
> > +maintainers:
> > +  - Johannes Zink <j.zink@pengutronix.de>
> > +
> > +description: |
> > +  Device used for loading the bitstream of Lattice MachXO2 FPGAs.
> > The
> > +  programming sequence is described in FPGA-TN-02155 on  
> > www.latticesemi.com
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: lattice,machxo2-slave-spi
> > +    then:
> > +      $ref: /schemas/spi/spi-peripheral-props.yaml#
> 
> You don't need the 'if' because the schema is only applied if the 
> compatible matches.
> 
> Blank line needed here.

ack, will fix it in v2

Best regards
Johannes

> 
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - lattice,machxo2-slave-spi
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +    spi0 {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        fpga@0 {
> > +            compatible = "lattice,machxo2-slave-spi";
> > +            spi-max-frequency = <8000000>;
> > +            reg = <0>;
> > +        };
> > +    };
> > diff --git a/Documentation/devicetree/bindings/fpga/lattice-
> > machxo2-spi.txt b/Documentation/devicetree/bindings/fpga/lattice-
> > machxo2-spi.txt
> > deleted file mode 100644
> > index a8c362eb160c..000000000000
> > --- a/Documentation/devicetree/bindings/fpga/lattice-machxo2-
> > spi.txt
> > +++ /dev/null
> > @@ -1,29 +0,0 @@
> > -Lattice MachXO2 Slave SPI FPGA Manager
> > -
> > -Lattice MachXO2 FPGAs support a method of loading the bitstream
> > over
> > -'slave SPI' interface.
> > -
> > -See 'MachXO2ProgrammingandConfigurationUsageGuide.pdf' on  
> > www.latticesemi.com
> > -
> > -Required properties:
> > -- compatible: should contain "lattice,machxo2-slave-spi"
> > -- reg: spi chip select of the FPGA
> > -
> > -Example for full FPGA configuration:
> > -
> > -       fpga-region0 {
> > -               compatible = "fpga-region";
> > -               fpga-mgr = <&fpga_mgr_spi>;
> > -               #address-cells = <0x1>;
> > -               #size-cells = <0x1>;
> > -       };
> > -
> > -       spi1: spi@2000 {
> > -        ...
> > -
> > -               fpga_mgr_spi: fpga-mgr@0 {
> > -                       compatible = "lattice,machxo2-slave-spi";
> > -                       spi-max-frequency = <8000000>;
> > -                       reg = <0>;
> > -               };
> > -       };
> > -- 
> > 2.30.2
> > 
> > 
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml b/Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml
new file mode 100644
index 000000000000..d05acd6b0fc6
--- /dev/null
+++ b/Documentation/devicetree/bindings/fpga/lattice,machxo2-slave.yaml
@@ -0,0 +1,46 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/fpga/lattice,machxo2-slave.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lattice MachXO2 Slave FPGA Manager Device Tree Bindings
+
+maintainers:
+  - Johannes Zink <j.zink@pengutronix.de>
+
+description: |
+  Device used for loading the bitstream of Lattice MachXO2 FPGAs. The
+  programming sequence is described in FPGA-TN-02155 on www.latticesemi.com
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: lattice,machxo2-slave-spi
+    then:
+      $ref: /schemas/spi/spi-peripheral-props.yaml#
+properties:
+  compatible:
+    enum:
+      - lattice,machxo2-slave-spi
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    spi0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        fpga@0 {
+            compatible = "lattice,machxo2-slave-spi";
+            spi-max-frequency = <8000000>;
+            reg = <0>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt b/Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt
deleted file mode 100644
index a8c362eb160c..000000000000
--- a/Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt
+++ /dev/null
@@ -1,29 +0,0 @@ 
-Lattice MachXO2 Slave SPI FPGA Manager
-
-Lattice MachXO2 FPGAs support a method of loading the bitstream over
-'slave SPI' interface.
-
-See 'MachXO2ProgrammingandConfigurationUsageGuide.pdf' on www.latticesemi.com
-
-Required properties:
-- compatible: should contain "lattice,machxo2-slave-spi"
-- reg: spi chip select of the FPGA
-
-Example for full FPGA configuration:
-
-	fpga-region0 {
-		compatible = "fpga-region";
-		fpga-mgr = <&fpga_mgr_spi>;
-		#address-cells = <0x1>;
-		#size-cells = <0x1>;
-	};
-
-	spi1: spi@2000 {
-        ...
-
-		fpga_mgr_spi: fpga-mgr@0 {
-			compatible = "lattice,machxo2-slave-spi";
-			spi-max-frequency = <8000000>;
-			reg = <0>;
-		};
-	};