Skip to contentSkip to conversation

dt-bindings: pci: layerscape-pci: Convert to yaml format

PATCH In review Frank Li 2 participants 2 messages Feb 26, 2024

Subsystems (4)
lore
Share & tools
lore

Frank Li

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: pci: layerscape-pci: Convert to yaml format

Convert the layerscape-pci PCIe binding document to yaml format.

Additionally, changes for the layerscape-pci endpoint part:
- Add interrupt name 'pme' restriction for fsl,ls1028a-pcie-ep, fsl,ls1046a-pcie-ep, and fsl,ls1088a-pcie-ep.
- Add register name restrictions: 'reg' and 'addr_space'. 'addr_space' is required by snps,dw-pcie-ep.
- Add an example.

Changes for the layerscape-pci root complex part:
- Add required property: 'reg-names', "#address-cells", "#size-cells", 'device_type', 'bus-range', 'ranges', "#interrupt-cells", 'interrupt-map-mask' and 'interrupt-map'.
- Interrupt-names requirement split to each compatible string.
- Add register name restrictions: 'reg' and 'config'. 'config' is required by snps,dw-pcie.

---

Notes:
There are log discuss at v1. If I missed something, let me know.

Change from v3 to v4
- remove ep label
- remove status="disabled"
- remove deprecated property
- fixed irq max-numbers
- because dts still use "reg" instead "dbi", to avoid dtb check warning, not referernece to snps,dwc-pcie yet.

Change from v2 to v3
- update commit message, show change compare txt file
- add failback compatible fsl,ls-pcie-ep.
- add commit message about 'addr_space' and 'config'.

Change from v1 to v2
- remove '|-'
- dma-coherent: true
- add interrupts and interrupt-names at before Allof
- remove ref to snps,pcie*.yaml, some reg-names are not aligned with in drivers
- Add an example for pcie-ep

 .../bindings/pci/fsl,layerscape-pcie-ep.yaml  | 107 +++++++++++
 .../bindings/pci/fsl,layerscape-pcie.yaml     | 175 ++++++++++++++++++
 .../bindings/pci/layerscape-pci.txt           |  79 --------
 3 files changed, 282 insertions(+), 79 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pci/fsl,layerscape-pcie-ep.yaml
 create mode 100644 Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml
 delete mode 100644 Documentation/devicetree/bindings/pci/layerscape-pci.txt
Documentation/devicetree/bindings/pci/fsl,layerscape-pcie-ep.yaml new file +107 -0
new file mode 100644
index 0000000000000..c230446bbab1d
@@ -0,0 +1,107 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pci/fsl,layerscape-pcie-ep.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale Layerscape PCIe Endpoint(EP) controller
+
+maintainers:
+  - Frank Li <[email protected]>
+
+description:
+  This PCIe EP controller is based on the Synopsys DesignWare PCIe IP.
+
+  This controller derives its clocks from the Reset Configuration Word (RCW)
+  which is used to describe the PLL settings at the time of chip-reset.
+
+  Also as per the available Reference Manuals, there is no specific 'version'
+  register available in the Freescale PCIe controller register set,
+  which can allow determining the underlying DesignWare PCIe controller version
+  information.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - fsl,ls2088a-pcie-ep
+          - fsl,ls1088a-pcie-ep
+          - fsl,ls1046a-pcie-ep
+          - fsl,ls1028a-pcie-ep
+          - fsl,lx2160ar2-pcie-ep
+      - const: fsl,ls-pcie-ep
+
+  reg:
+    maxItems: 2
+
+  reg-names:
+    items:
+      - const: regs
+      - const: addr_space
+
+  fsl,pcie-scfg:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: A phandle to the SCFG device node. The second entry is the
+      physical PCIe controller index starting from '0'. This is used to get
+      SCFG PEXN registers.
+
+  big-endian:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: If the PEX_LUT and PF register block is in big-endian, specify
+      this property.
+
+  dma-coherent: true
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 2
+    oneOf:
+      - anyOf:
+          - const: pme
+          - const: aer
+      - const: intr
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          enum:
+            - fsl,ls1028a-pcie-ep
+            - fsl,ls1046a-pcie-ep
+            - fsl,ls1088a-pcie-ep
+    then:
+      properties:
+        interrupt-names:
+          items:
+            - const: pme
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    soc {
+      #address-cells = <2>;
+      #size-cells = <2>;
+
+      pcie-ep@3400000 {
+        compatible = "fsl,ls1028a-pcie-ep", "fsl,ls-pcie-ep";
+        reg = <0x00 0x03400000 0x0 0x00100000
+              0x80 0x00000000 0x8 0x00000000>;
+        reg-names = "regs", "addr_space";
+        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; /* PME interrupt */
+        interrupt-names = "pme";
+      };
+    };
+...
Documentation/devicetree/bindings/pci/fsl,layerscape-pcie.yaml new file +175 -0

175 lines not on this page · raw message

Documentation/devicetree/bindings/pci/layerscape-pci.txt deleted +0 -79

79 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw
Quoted 8 lines · Frank Li

Convert the layerscape-pci PCIe binding document to yaml format.

Additionally, changes for the layerscape-pci endpoint part:
- Add interrupt name 'pme' restriction for fsl,ls1028a-pcie-ep, fsl,ls1046a-pcie-ep, and fsl,ls1088a-pcie-ep.
- Add register name restrictions: 'reg' and 'addr_space'. 'addr_space' is required by snps,dw-pcie-ep.
- Add an example.

Not for me to say since this would go via some other tree, but in general, I would prefer to see this as two or three patches:

1) Strict conversion to yaml with no additional changes
2) Add new layerscape-ep stuff
3) Add new layerscape root complex stuff

That makes it easier to see what is actually being added.

Quoted 7 lines

Changes for the layerscape-pci root complex part:
- Add required property: 'reg-names', "#address-cells", "#size-cells", 'device_type', 'bus-range', 'ranges', "#interrupt-cells", 'interrupt-map-mask' and 'interrupt-map'.
- Interrupt-names requirement split to each compatible string.
- Add register name restrictions: 'reg' and 'config'. 'config' is required by snps,dw-pcie.