Skip to contentSkip to conversation

dt-bindings: PCI: brcm,iproc-pcie: Fix example indentation

PATCH Applied Rob Herring 3 participants 13 messages Sep 26, 2023 – Oct 6, 2023

Subsystems (4)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/3 dt-bindings: PCI: brcm,iproc-pcie: Fix example indentation

The example's indentation is off. While fixing this, the 'bus' node is unnecessary and can be dropped. It is also preferred to split up unrelated examples to their own entries.

---
 .../bindings/pci/brcm,iproc-pcie.yaml         | 124 +++++++++---------
 1 file changed, 60 insertions(+), 64 deletions(-)
Documentation/devicetree/bindings/pci/brcm,iproc-pcie.yaml +60 -64
index 0972868735fc..0cb5bd6cffa1 100644
@@ -117,68 +117,64 @@ unevaluatedProperties: false
 
 examples:
   - |
-   #include <dt-bindings/interrupt-controller/arm-gic.h>
-
-   bus {
-      #address-cells = <1>;
-      #size-cells = <1>;
-           pcie0: pcie@18012000 {
-              compatible = "brcm,iproc-pcie";
-              reg = <0x18012000 0x1000>;
-
-              #interrupt-cells = <1>;
-              interrupt-map-mask = <0 0 0 0>;
-              interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_NONE>;
-
-              linux,pci-domain = <0>;
-
-              bus-range = <0x00 0xff>;
-
-              #address-cells = <3>;
-              #size-cells = <2>;
-              device_type = "pci";
-              ranges = <0x81000000 0 0     0x28000000 0 0x00010000>,
-                   <0x82000000 0 0x20000000 0x20000000 0 0x04000000>;
-
-              phys = <&phy 0 5>;
-              phy-names = "pcie-phy";
-
-              brcm,pcie-ob;
-              brcm,pcie-ob-axi-offset = <0x00000000>;
-
-              msi-parent = <&msi0>;
-
-              /* iProc event queue based MSI */
-              msi0: msi {
-                 compatible = "brcm,iproc-msi";
-                 msi-controller;
-                 interrupt-parent = <&gic>;
-                 interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>,
-                         <GIC_SPI 97 IRQ_TYPE_NONE>,
-                         <GIC_SPI 98 IRQ_TYPE_NONE>,
-                         <GIC_SPI 99 IRQ_TYPE_NONE>;
-              };
-           };
-
-           pcie1: pcie@18013000 {
-              compatible = "brcm,iproc-pcie";
-              reg = <0x18013000 0x1000>;
-
-              #interrupt-cells = <1>;
-              interrupt-map-mask = <0 0 0 0>;
-              interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_NONE>;
-
-              linux,pci-domain = <1>;
-
-              bus-range = <0x00 0xff>;
-
-              #address-cells = <3>;
-              #size-cells = <2>;
-              device_type = "pci";
-              ranges = <0x81000000 0 0     0x48000000 0 0x00010000>,
-                   <0x82000000 0 0x40000000 0x40000000 0 0x04000000>;
-
-              phys = <&phy 1 6>;
-              phy-names = "pcie-phy";
-           };
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    pcie@18012000 {
+        compatible = "brcm,iproc-pcie";
+        reg = <0x18012000 0x1000>;
+
+        #interrupt-cells = <1>;
+        interrupt-map-mask = <0 0 0 0>;
+        interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_NONE>;
+
+        linux,pci-domain = <0>;
+
+        bus-range = <0x00 0xff>;
+
+        #address-cells = <3>;
+        #size-cells = <2>;
+        device_type = "pci";
+        ranges = <0x81000000 0          0 0x28000000 0 0x00010000>,
+                 <0x82000000 0 0x20000000 0x20000000 0 0x04000000>;
+
+        phys = <&phy 0 5>;
+        phy-names = "pcie-phy";
+
+        brcm,pcie-ob;
+        brcm,pcie-ob-axi-offset = <0x00000000>;
+
+        msi-parent = <&msi0>;
+
+        /* iProc event queue based MSI */
+        msi0: msi {
+            compatible = "brcm,iproc-msi";
+            msi-controller;
+            interrupt-parent = <&gic>;
+            interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>,
+                    <GIC_SPI 97 IRQ_TYPE_NONE>,
+                    <GIC_SPI 98 IRQ_TYPE_NONE>,
+                    <GIC_SPI 99 IRQ_TYPE_NONE>;
+        };
+    };
+  - |
+    pcie@18013000 {
+        compatible = "brcm,iproc-pcie";
+        reg = <0x18013000 0x1000>;
+
+        #interrupt-cells = <1>;
+        interrupt-map-mask = <0 0 0 0>;
+        interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_NONE>;
+
+        linux,pci-domain = <1>;
+
+        bus-range = <0x00 0xff>;
+
+        #address-cells = <3>;
+        #size-cells = <2>;
+        device_type = "pci";
+        ranges = <0x81000000 0          0 0x48000000 0 0x00010000>,
+                 <0x82000000 0 0x40000000 0x40000000 0 0x04000000>;
+
+        phys = <&phy 1 6>;
+        phy-names = "pcie-phy";
     };
Signature · 1 line
2.40.1
author maintainer
#1 lore raw

PATCH 2/3 dt-bindings: PCI: brcm,iproc-pcie: Drop common pci-bus properties

Drop the unnecessary listing of properties already defined in pci-bus.yaml. Unless there are additional constraints, it is not necessary.

---
 .../devicetree/bindings/pci/brcm,iproc-pcie.yaml  | 15 ---------------
 1 file changed, 15 deletions(-)
Documentation/devicetree/bindings/pci/brcm,iproc-pcie.yaml +0 -15
index 0cb5bd6cffa1..6730d68fedc7 100644
@@ -34,13 +34,6 @@ properties:
     description: >
        Base address and length of the PCIe controller I/O register space
 
-  interrupt-map: true
-
-  interrupt-map-mask: true
-
-  "#interrupt-cells":
-    const: 1
-
   ranges:
     minItems: 1
     maxItems: 2
@@ -54,16 +47,8 @@ properties:
     items:
       - const: pcie-phy
 
-  bus-range: true
-
   dma-coherent: true
 
-  "#address-cells": true
-
-  "#size-cells": true
-
-  device_type: true
-
   brcm,pcie-ob:
     type: boolean
     description: >
Signature · 1 line
2.40.1
Acked-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] dt-bindings: PCI: brcm,iproc-pcie: Drop common pci-bus properties

Quoted 5 lines · Rob Herring

Drop the unnecessary listing of properties already defined in pci-bus.yaml. Unless there are additional constraints, it is not necessary.

Thanks,
Conor.

Quoted 42 lines
---
 .../devicetree/bindings/pci/brcm,iproc-pcie.yaml  | 15 ---------------
 1 file changed, 15 deletions(-)
Documentation/devicetree/bindings/pci/brcm,iproc-pcie.yaml +0 -15
index 0cb5bd6cffa1..6730d68fedc7 100644
@@ -34,13 +34,6 @@ properties:
     description: >
        Base address and length of the PCIe controller I/O register space
 
-  interrupt-map: true
-
-  interrupt-map-mask: true
-
-  "#interrupt-cells":
-    const: 1
-
   ranges:
     minItems: 1
     maxItems: 2
@@ -54,16 +47,8 @@ properties:
     items:
       - const: pcie-phy
 
-  bus-range: true
-
   dma-coherent: true
 
-  "#address-cells": true
-
-  "#size-cells": true
-
-  device_type: true
-
   brcm,pcie-ob:
     type: boolean
     description: >
Signature · 1 line
2.40.1
author maintainer Applied
#4 lore raw

Re: [PATCH 2/3] dt-bindings: PCI: brcm,iproc-pcie: Drop common pci-bus properties

In reply to Rob Herring
Quoted 9 lines · Rob Herring

Drop the unnecessary listing of properties already defined in pci-bus.yaml. Unless there are additional constraints, it is not necessary.

---
 .../devicetree/bindings/pci/brcm,iproc-pcie.yaml  | 15 ---------------
 1 file changed, 15 deletions(-)

Applied, thanks!

author maintainer
#5 lore raw

PATCH 3/3 dt-bindings: PCI: brcm,iproc-pcie: Fix 'msi' child node schema

In reply to Rob Herring

The 'msi' child node schema is missing constraints on additional properties. It turns out it is incomplete and properties for it are documented in the parent node by mistake. Move the reference to msi-controller.yaml and the custom properties to the 'msi' node. Adding 'unevaluatedProperties' ensures all the properties in the 'msi' node are documented.

With the schema corrected, a minimal interrupt controller node is needed to properly decode the interrupt properties since the example has multiple interrupt parents.

---
 .../bindings/pci/brcm,iproc-pcie.yaml         | 24 ++++++++++++-------
 1 file changed, 16 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/pci/brcm,iproc-pcie.yaml +16 -8
index 6730d68fedc7..0e07ab61a48d 100644
@@ -12,7 +12,6 @@ maintainers:
 
 allOf:
   - $ref: /schemas/pci/pci-bus.yaml#
-  - $ref: /schemas/interrupt-controller/msi-controller.yaml#
 
 properties:
   compatible:
@@ -63,20 +62,24 @@ properties:
 
   msi:
     type: object
+    $ref: /schemas/interrupt-controller/msi-controller.yaml#
+    unevaluatedProperties: false
+
     properties:
       compatible:
         items:
           - const: brcm,iproc-msi
 
-  msi-parent: true
+      interrupts:
+        maxItems: 4
 
-  msi-controller: true
+      brcm,pcie-msi-inten:
+        type: boolean
+        description:
+          Needs to be present for some older iProc platforms that require the
+          interrupt enable registers to be set explicitly to enable MSI
 
-  brcm,pcie-msi-inten:
-    type: boolean
-    description: >
-      Needs to be present for some older iProc platforms that require the
-      interrupt enable registers to be set explicitly to enable MSI
+  msi-parent: true
 
 dependencies:
   brcm,pcie-ob-axi-offset: ["brcm,pcie-ob"]
@@ -104,6 +107,11 @@ examples:
   - |
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
+    gic: interrupt-controller {
+        interrupt-controller;
+        #interrupt-cells = <3>;
+    };
+
     pcie@18012000 {
         compatible = "brcm,iproc-pcie";
         reg = <0x18012000 0x1000>;
Signature · 1 line
2.40.1
Acked-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] dt-bindings: PCI: brcm,iproc-pcie: Fix 'msi' child node schema

Quoted 9 lines · Rob Herring

The 'msi' child node schema is missing constraints on additional properties. It turns out it is incomplete and properties for it are documented in the parent node by mistake. Move the reference to msi-controller.yaml and the custom properties to the 'msi' node. Adding 'unevaluatedProperties' ensures all the properties in the 'msi' node are documented.

With the schema corrected, a minimal interrupt controller node is needed to properly decode the interrupt properties since the example has multiple interrupt parents.

I suppose this is an ABI break, but the patch just makes the binding match the example and intent. Feels like of all the patches doing the unevaluatedProperty additions, this one is the most deserving of a fixes tag, since the original binding just seems to be completely wrong?

Otherwise,

Thanks,
Conor.

Quoted 65 lines
---
 .../bindings/pci/brcm,iproc-pcie.yaml         | 24 ++++++++++++-------
 1 file changed, 16 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/pci/brcm,iproc-pcie.yaml +16 -8
index 6730d68fedc7..0e07ab61a48d 100644
@@ -12,7 +12,6 @@ maintainers:
 
 allOf:
   - $ref: /schemas/pci/pci-bus.yaml#
-  - $ref: /schemas/interrupt-controller/msi-controller.yaml#
 
 properties:
   compatible:
@@ -63,20 +62,24 @@ properties:
 
   msi:
     type: object
+    $ref: /schemas/interrupt-controller/msi-controller.yaml#
+    unevaluatedProperties: false
+
     properties:
       compatible:
         items:
           - const: brcm,iproc-msi
 
-  msi-parent: true
+      interrupts:
+        maxItems: 4
 
-  msi-controller: true
+      brcm,pcie-msi-inten:
+        type: boolean
+        description:
+          Needs to be present for some older iProc platforms that require the
+          interrupt enable registers to be set explicitly to enable MSI
 
-  brcm,pcie-msi-inten:
-    type: boolean
-    description: >
-      Needs to be present for some older iProc platforms that require the
-      interrupt enable registers to be set explicitly to enable MSI
+  msi-parent: true
 
 dependencies:
   brcm,pcie-ob-axi-offset: ["brcm,pcie-ob"]
@@ -104,6 +107,11 @@ examples:
   - |
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
+    gic: interrupt-controller {
+        interrupt-controller;
+        #interrupt-cells = <3>;
+    };
+
     pcie@18012000 {
         compatible = "brcm,iproc-pcie";
         reg = <0x18012000 0x1000>;
Signature · 1 line
2.40.1
author maintainer
#7 lore raw

Re: [PATCH 3/3] dt-bindings: PCI: brcm,iproc-pcie: Fix 'msi' child node schema

Quoted 8 lines · Conor Dooley
Quoted 6 lines · Rob Herring

The 'msi' child node schema is missing constraints on additional properties. It turns out it is incomplete and properties for it are documented in the parent node by mistake. Move the reference to msi-controller.yaml and the custom properties to the 'msi' node. Adding 'unevaluatedProperties' ensures all the properties in the 'msi' node are documented.

Quoted 6 lines
Quoted 3 lines

With the schema corrected, a minimal interrupt controller node is needed to properly decode the interrupt properties since the example has multiple interrupt parents.

I suppose this is an ABI break, but the patch just makes the binding match the example and intent.

It also matches what the in tree users do, so not an ABI break. I imagine the .txt binding just listed out properties and the conversion carried that over.

Quoted 3 lines

Feels like of all the patches doing the
unevaluatedProperty additions, this one is the most deserving of a fixes tag, since the original binding just seems to be completely wrong?

Yes, though the example fix is a dependency, so probably not worth backporting.

Fixes 905b986d099c ("dt-bindings: pci: Convert iProc PCIe to YAML")

Rob

Reviewed-by on v1 3/3
#8 lore raw

Re: [PATCH 3/3] dt-bindings: PCI: brcm,iproc-pcie: Fix 'msi' child node schema

In reply to Rob Herring
Quoted 11 lines · Rob Herring

The 'msi' child node schema is missing constraints on additional properties. It turns out it is incomplete and properties for it are documented in the parent node by mistake. Move the reference to msi-controller.yaml and the custom properties to the 'msi' node. Adding 'unevaluatedProperties' ensures all the properties in the 'msi' node are documented.

With the schema corrected, a minimal interrupt controller node is needed to properly decode the interrupt properties since the example has multiple interrupt parents.

Signature · 1 line
Florian
author maintainer Applied
#9 lore raw

Re: [PATCH 3/3] dt-bindings: PCI: brcm,iproc-pcie: Fix 'msi' child node schema

In reply to Rob Herring
Quoted 6 lines · Rob Herring

The 'msi' child node schema is missing constraints on additional properties. It turns out it is incomplete and properties for it are documented in the parent node by mistake. Move the reference to msi-controller.yaml and the custom properties to the 'msi' node. Adding 'unevaluatedProperties' ensures all the properties in the 'msi' node are documented.

Quoted 9 lines

With the schema corrected, a minimal interrupt controller node is needed to properly decode the interrupt properties since the example has multiple interrupt parents.

---
 .../bindings/pci/brcm,iproc-pcie.yaml         | 24 ++++++++++++-------
 1 file changed, 16 insertions(+), 8 deletions(-)

Applied, thanks!

Acked-by on v1 1/3
#10 lore raw
In reply to Rob Herring
Quoted 3 lines · Rob Herring

The example's indentation is off. While fixing this, the 'bus' node is unnecessary and can be dropped. It is also preferred to split up unrelated examples to their own entries.

Damn, it really was all over the shop..

Thanks,
Conor.

author maintainer Applied
#12 lore raw
In reply to Rob Herring
Quoted 9 lines · Rob Herring

The example's indentation is off. While fixing this, the 'bus' node is unnecessary and can be dropped. It is also preferred to split up unrelated examples to their own entries.

---
 .../bindings/pci/brcm,iproc-pcie.yaml         | 124 +++++++++---------
 1 file changed, 60 insertions(+), 64 deletions(-)

Applied, thanks!