Skip to contentSkip to conversation

dt-bindings: spi: convert spi-brcm63xx.txt to YAML

PATCH Superseded Jonas Gorski 2 participants 3 messages Jul 15, 2023 – Jul 27, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jonas Gorski

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: spi: convert spi-brcm63xx.txt to YAML

Changes done during conversion:

* added a description, lifting and adapting the limitation sentence from brcm,bcm63xx-hsspi.yml
* added appropriate compatibles for all SoCs that are supported by bcm63xx/bmips

---
 .../bindings/spi/brcm,bcm63xx-spi.yaml        | 71 +++++++++++++++++++
 .../devicetree/bindings/spi/spi-bcm63xx.txt   | 33 ---------
 MAINTAINERS                                   |  2 +-
 3 files changed, 72 insertions(+), 34 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/brcm,bcm63xx-spi.yaml
 delete mode 100644 Documentation/devicetree/bindings/spi/spi-bcm63xx.txt
Documentation/devicetree/bindings/spi/brcm,bcm63xx-spi.yaml new file +71 -0
new file mode 100644
index 000000000000..53e0c058b8b1
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/brcm,bcm63xx-spi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom BCM6348/BCM6358 SPI controller
+
+maintainers:
+  - Jonas Gorski <[email protected]>
+
+description: |
+  Broadcom "Low Speed" SPI controller found in many older MIPS based Broadband
+  SoCs.
+
+  This controller has a limitation that can not keep the chip select line active
+  between the SPI transfers within the same SPI message. This can terminate the
+  transaction to some SPI devices prematurely. The issue can be worked around by
+  the controller's prepend mode.
+
+allOf:
+  - $ref: spi-controller.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - brcm,bcm6368-spi
+              - brcm,bcm6362-spi
+              - brcm,bcm63268-spi
+          - const: brcm,bcm6358-spi
+      - const: brcm,bcm6348-spi
+      - const: brcm,bcm6358-spi
+
+  reg:
+    items:
+      - description: main registers
+
+  clocks:
+    items:
+      - description: SPI master reference clock
+
+  clock-names:
+    items:
+      - const: spi
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    spi@10000800 {
+        compatible = "brcm,bcm6368-spi", "brcm,bcm6358-spi";
+        reg = <0x10000800 0x70c>;
+        interrupts = <1>;
+        clocks = <&clkctl 9>;
+        clock-names = "spi";
+        num-cs = <5>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+    };
Documentation/devicetree/bindings/spi/spi-bcm63xx.txt deleted +0 -33
deleted file mode 100644
index 1c16f6692613..000000000000
@@ -1,33 +0,0 @@
-Binding for Broadcom BCM6348/BCM6358 SPI controller
-
-Required properties:
-- compatible: must contain one of "brcm,bcm6348-spi", "brcm,bcm6358-spi".
-- reg: Base address and size of the controllers memory area.
-- interrupts: Interrupt for the SPI block.
-- clocks: phandle of the SPI clock.
-- clock-names: has to be "spi".
-- #address-cells: <1>, as required by generic SPI binding.
-- #size-cells: <0>, also as required by generic SPI binding.
-
-Optional properties:
-- num-cs: some controllers have less than 8 cs signals. Defaults to 8
-  if absent.
-
-Child nodes as per the generic SPI binding.
-
-Example:
-
-	spi@10000800 {
-		compatible = "brcm,bcm6368-spi", "brcm,bcm6358-spi";
-		reg = <0x10000800 0x70c>;
-
-		interrupts = <1>;
-
-		clocks = <&clkctl 9>;
-		clock-names = "spi";
-
-		num-cs = <5>;
-
-		#address-cells = <1>;
-		#size-cells = <0>;
-	};
MAINTAINERS +1 -1
index 238f50f9498e..3cb77cdb92f7 100644
@@ -4125,7 +4125,7 @@ BROADCOM BCM6348/BCM6358 SPI controller DRIVER
 M:	Jonas Gorski <[email protected]>
 L:	[email protected]
 S:	Odd Fixes
-F:	Documentation/devicetree/bindings/spi/spi-bcm63xx.txt
+F:	Documentation/devicetree/bindings/spi/brcm,bcm63xx-spi.yaml
 F:	drivers/spi/spi-bcm63xx.c
 
 BROADCOM ETHERNET PHY DRIVERS
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jonas Gorski

Changes done during conversion:

* added a description, lifting and adapting the limitation sentence from brcm,bcm63xx-hsspi.yml
* added appropriate compatibles for

...

Documentation/devicetree/bindings/spi/brcm,bcm63xx-spi.yaml line 34

Quoted 11 lines
Documentation/devicetree/bindings/spi/brcm,bcm63xx-spi.yaml new file +11 -0
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - brcm,bcm6368-spi
+              - brcm,bcm6362-spi
+              - brcm,bcm63268-spi
+          - const: brcm,bcm6358-spi
+      - const: brcm,bcm6348-spi
+      - const: brcm,bcm6358-spi

These two are just enum. It's preferred syntax.

Documentation/devicetree/bindings/spi/brcm,bcm63xx-spi.yaml line 38

Quoted 4 lines
Documentation/devicetree/bindings/spi/brcm,bcm63xx-spi.yaml new file +4 -0
+
+  reg:
+    items:
+      - description: main registers

Instead shorter:
maxItems: 1

With above:

Best regards,
Krzysztof