linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: fpga: xilinx-spi: convert bindings to json-schema
@ 2023-02-27 11:02 Nava kishore Manne
  2023-02-28 10:25 ` Krzysztof Kozlowski
  2023-03-07 22:41 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Nava kishore Manne @ 2023-02-27 11:02 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, trix, robh+dt, krzysztof.kozlowski+dt,
	michal.simek, nava.kishore.manne, linux-fpga, devicetree,
	linux-arm-kernel, linux-kernel

Convert xilinx-spi bindings to DT schema format using json-schema.

Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
---
Changes for v2:
              - Removed 'fpga-region.txt' relevant info from the description
                and addressed some minor comments as suggested by Krzysztof.

 .../bindings/fpga/xilinx-slave-serial.txt     | 51 ------------
 .../bindings/fpga/xlnx,fpga-slave-serial.yaml | 80 +++++++++++++++++++
 2 files changed, 80 insertions(+), 51 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/fpga/xilinx-slave-serial.txt
 create mode 100644 Documentation/devicetree/bindings/fpga/xlnx,fpga-slave-serial.yaml

diff --git a/Documentation/devicetree/bindings/fpga/xilinx-slave-serial.txt b/Documentation/devicetree/bindings/fpga/xilinx-slave-serial.txt
deleted file mode 100644
index 5ef659c1394d..000000000000
--- a/Documentation/devicetree/bindings/fpga/xilinx-slave-serial.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-Xilinx Slave Serial SPI FPGA Manager
-
-Xilinx Spartan-6 and 7 Series FPGAs support a method of loading the
-bitstream over what is referred to as "slave serial" interface.
-The slave serial link is not technically SPI, and might require extra
-circuits in order to play nicely with other SPI slaves on the same bus.
-
-See:
-- https://www.xilinx.com/support/documentation/user_guides/ug380.pdf
-- https://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf
-- https://www.xilinx.com/support/documentation/application_notes/xapp583-fpga-configuration.pdf
-
-Required properties:
-- compatible: should contain "xlnx,fpga-slave-serial"
-- reg: spi chip select of the FPGA
-- prog_b-gpios: config pin (referred to as PROGRAM_B in the manual)
-- done-gpios: config status pin (referred to as DONE in the manual)
-
-Optional properties:
-- init-b-gpios: initialization status and configuration error pin
-                (referred to as INIT_B in the manual)
-
-Example for full FPGA configuration:
-
-	fpga-region0 {
-		compatible = "fpga-region";
-		fpga-mgr = <&fpga_mgr_spi>;
-		#address-cells = <0x1>;
-		#size-cells = <0x1>;
-	};
-
-	spi1: spi@10680 {
-		compatible = "marvell,armada-xp-spi", "marvell,orion-spi";
-		pinctrl-0 = <&spi0_pins>;
-		pinctrl-names = "default";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		cell-index = <1>;
-		interrupts = <92>;
-		clocks = <&coreclk 0>;
-
-		fpga_mgr_spi: fpga-mgr@0 {
-			compatible = "xlnx,fpga-slave-serial";
-			spi-max-frequency = <60000000>;
-			spi-cpha;
-			reg = <0>;
-			prog_b-gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
-			init-b-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
-			done-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
-		};
-	};
diff --git a/Documentation/devicetree/bindings/fpga/xlnx,fpga-slave-serial.yaml b/Documentation/devicetree/bindings/fpga/xlnx,fpga-slave-serial.yaml
new file mode 100644
index 000000000000..614d86ad825f
--- /dev/null
+++ b/Documentation/devicetree/bindings/fpga/xlnx,fpga-slave-serial.yaml
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/fpga/xlnx,fpga-slave-serial.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Slave Serial SPI FPGA
+
+maintainers:
+  - Nava kishore Manne <nava.kishore.manne@amd.com>
+
+description: |
+  Xilinx Spartan-6 and 7 Series FPGAs support a method of loading the bitstream
+  over what is referred to as slave serial interface.The slave serial link is
+  not technically SPI, and might require extra circuits in order to play nicely
+  with other SPI slaves on the same bus.
+
+  Datasheets:
+    https://www.xilinx.com/support/documentation/user_guides/ug380.pdf
+    https://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf
+    https://www.xilinx.com/support/documentation/application_notes/xapp583-fpga-configuration.pdf
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+  compatible:
+    enum:
+      - xlnx,fpga-slave-serial
+
+  spi-cpha: true
+
+  spi-max-frequency:
+    maximum: 60000000
+
+  reg:
+    maxItems: 1
+
+  prog_b-gpios:
+    description:
+      config pin (referred to as PROGRAM_B in the manual)
+    maxItems: 1
+
+  done-gpios:
+    description:
+      config status pin (referred to as DONE in the manual)
+    maxItems: 1
+
+  init-b-gpios:
+    description:
+      initialization status and configuration error pin
+      (referred to as INIT_B in the manual)
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - prog_b-gpios
+  - done-gpios
+  - init-b-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      fpga_mgr_spi: fpga-mgr@0 {
+        compatible = "xlnx,fpga-slave-serial";
+        spi-max-frequency = <60000000>;
+        spi-cpha;
+        reg = <0>;
+        prog_b-gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
+        init-b-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
+        done-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
+      };
+    };
+...
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] dt-bindings: fpga: xilinx-spi: convert bindings to json-schema
  2023-02-27 11:02 [PATCH v2] dt-bindings: fpga: xilinx-spi: convert bindings to json-schema Nava kishore Manne
@ 2023-02-28 10:25 ` Krzysztof Kozlowski
  2023-03-07 22:41 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-28 10:25 UTC (permalink / raw)
  To: Nava kishore Manne, mdf, hao.wu, yilun.xu, trix, robh+dt,
	krzysztof.kozlowski+dt, michal.simek, linux-fpga, devicetree,
	linux-arm-kernel, linux-kernel

On 27/02/2023 12:02, Nava kishore Manne wrote:
> Convert xilinx-spi bindings to DT schema format using json-schema.
> 
> Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
> ---
> Changes for v2:
>               - Removed 'fpga-region.txt' relevant info from the description
>                 and addressed some minor comments as suggested by Krzysztof.
> 
>  .../bindings/fpga/xilinx-slave-serial.txt     | 51 ------------
>  .../bindings/fpga/xlnx,fpga-slave-serial.yaml | 80 +++++++++++++++++++
>  2 files changed, 80 insertions(+), 51 deletions(-)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] dt-bindings: fpga: xilinx-spi: convert bindings to json-schema
  2023-02-27 11:02 [PATCH v2] dt-bindings: fpga: xilinx-spi: convert bindings to json-schema Nava kishore Manne
  2023-02-28 10:25 ` Krzysztof Kozlowski
@ 2023-03-07 22:41 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2023-03-07 22:41 UTC (permalink / raw)
  To: Nava kishore Manne
  Cc: yilun.xu, robh+dt, mdf, krzysztof.kozlowski+dt, michal.simek,
	hao.wu, linux-arm-kernel, trix, devicetree, linux-fpga,
	linux-kernel


On Mon, 27 Feb 2023 16:32:13 +0530, Nava kishore Manne wrote:
> Convert xilinx-spi bindings to DT schema format using json-schema.
> 
> Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
> ---
> Changes for v2:
>               - Removed 'fpga-region.txt' relevant info from the description
>                 and addressed some minor comments as suggested by Krzysztof.
> 
>  .../bindings/fpga/xilinx-slave-serial.txt     | 51 ------------
>  .../bindings/fpga/xlnx,fpga-slave-serial.yaml | 80 +++++++++++++++++++
>  2 files changed, 80 insertions(+), 51 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/fpga/xilinx-slave-serial.txt
>  create mode 100644 Documentation/devicetree/bindings/fpga/xlnx,fpga-slave-serial.yaml
> 

Applied, thanks!


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-07 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 11:02 [PATCH v2] dt-bindings: fpga: xilinx-spi: convert bindings to json-schema Nava kishore Manne
2023-02-28 10:25 ` Krzysztof Kozlowski
2023-03-07 22:41 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).