diff mbox series

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

Message ID 20240919-pcie_ep_range-v1-4-b3e9d62780b7@nxp.com (mailing list archive)
State New
Delegated to: Manivannan Sadhasivam
Headers show
Series PCI-EP: Add 'ranges' support for PCI endpoint devices | expand

Commit Message

Frank Li Sept. 19, 2024, 10:03 p.m. UTC
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@nxp.com>
---
 .../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 mbox series

Patch

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: