[PATCH 4/9] dt-bindings: PCI: snps,dw-pcie-ep: 'addr_space' not required if 'ranges' present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do not require 'addr_space' in 'reg-names' when the device uses the
'ranges' property to indicate the outbound address space. This maintains
the same restriction for cases where 'ranges' is absent.

minItems of 'reg' and 'reg-names' change to 1 because only one 'dbi'
register space is required if use 'ranges' describe outbound memory space.

minItems of 'reg' and 'reg-names' in snps,dw-pcie-common.yaml also change
to 1 from 2. It doesn't loss restriction because it is 2 in
snps,dw-pcie.yaml.

Signed-off-by: Frank Li <Frank.Li@xxxxxxx>
---
 .../bindings/pci/snps,dw-pcie-common.yaml           |  4 ++--
 .../devicetree/bindings/pci/snps,dw-pcie-ep.yaml    | 21 +++++++++++++++++----
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/pci/snps,dw-pcie-common.yaml b/Documentation/devicetree/bindings/pci/snps,dw-pcie-common.yaml
index dc05761c5cf93..16d5fe77d117a 100644
--- a/Documentation/devicetree/bindings/pci/snps,dw-pcie-common.yaml
+++ b/Documentation/devicetree/bindings/pci/snps,dw-pcie-common.yaml
@@ -32,11 +32,11 @@ properties:
       is selected. Note the PCIe CFG-space, PL and Shadow registers are
       specific for each activated function, while the rest of the sub-spaces
       are common for all of them (if there are more than one).
-    minItems: 2
+    minItems: 1
     maxItems: 7
 
   reg-names:
-    minItems: 2
+    minItems: 1
     maxItems: 7
 
   interrupts:
diff --git a/Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml b/Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
index f474b9e3fc7e2..184c519d2b7c6 100644
--- a/Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
@@ -25,18 +25,33 @@ select:
 allOf:
   - $ref: /schemas/pci/pci-ep.yaml#
   - $ref: /schemas/pci/snps,dw-pcie-common.yaml#
+  - if:
+      not:
+        required:
+          - ranges
+    then:
+      properties:
+        reg:
+          minItems: 2
+        reg-names:
+          minItems: 2
+          allOf:
+            - contains:
+                const: addr_space
 
 properties:
+  ranges: true
+
   reg:
     description:
       DBI, DBI2 reg-spaces and outbound memory window are required for the
       normal controller functioning. iATU memory IO region is also required
       if the space is unrolled (IP-core version >= 4.80a).
-    minItems: 2
+    minItems: 1
     maxItems: 7
 
   reg-names:
-    minItems: 2
+    minItems: 1
     maxItems: 7
     items:
       oneOf:
@@ -106,8 +121,6 @@ properties:
     allOf:
       - contains:
           const: dbi
-      - contains:
-          const: addr_space
 
   interrupts:
     description:

-- 
2.34.1





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux