xref: /freebsd/sys/contrib/device-tree/Bindings/pci/snps,dw-pcie.yaml (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1354d7675SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2354d7675SEmmanuel Vadot%YAML 1.2
3354d7675SEmmanuel Vadot---
4354d7675SEmmanuel Vadot$id: http://devicetree.org/schemas/pci/snps,dw-pcie.yaml#
5354d7675SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6354d7675SEmmanuel Vadot
7354d7675SEmmanuel Vadottitle: Synopsys DesignWare PCIe interface
8354d7675SEmmanuel Vadot
9354d7675SEmmanuel Vadotmaintainers:
10354d7675SEmmanuel Vadot  - Jingoo Han <jingoohan1@gmail.com>
11354d7675SEmmanuel Vadot  - Gustavo Pimentel <gustavo.pimentel@synopsys.com>
12354d7675SEmmanuel Vadot
13354d7675SEmmanuel Vadotdescription: |
14354d7675SEmmanuel Vadot  Synopsys DesignWare PCIe host controller
15354d7675SEmmanuel Vadot
168bab661aSEmmanuel Vadot# Please create a separate DT-schema for your DWC PCIe Root Port controller
178bab661aSEmmanuel Vadot# and make sure it's assigned with the vendor-specific compatible string.
188bab661aSEmmanuel Vadotselect:
19354d7675SEmmanuel Vadot  properties:
20354d7675SEmmanuel Vadot    compatible:
218bab661aSEmmanuel Vadot      const: snps,dw-pcie
228bab661aSEmmanuel Vadot  required:
238bab661aSEmmanuel Vadot    - compatible
24354d7675SEmmanuel Vadot
258bab661aSEmmanuel VadotallOf:
26*7d0873ebSEmmanuel Vadot  - $ref: /schemas/pci/pci-host-bridge.yaml#
278bab661aSEmmanuel Vadot  - $ref: /schemas/pci/snps,dw-pcie-common.yaml#
28aa1a8ff2SEmmanuel Vadot  - if:
29aa1a8ff2SEmmanuel Vadot      not:
30aa1a8ff2SEmmanuel Vadot        required:
31aa1a8ff2SEmmanuel Vadot          - msi-map
32aa1a8ff2SEmmanuel Vadot    then:
33aa1a8ff2SEmmanuel Vadot      properties:
34aa1a8ff2SEmmanuel Vadot        interrupt-names:
35aa1a8ff2SEmmanuel Vadot          contains:
36aa1a8ff2SEmmanuel Vadot            const: msi
378bab661aSEmmanuel Vadot
388bab661aSEmmanuel Vadotproperties:
39354d7675SEmmanuel Vadot  reg:
408bab661aSEmmanuel Vadot    description:
418bab661aSEmmanuel Vadot      At least DBI reg-space and peripheral devices CFG-space outbound window
428bab661aSEmmanuel Vadot      are required for the normal controller work. iATU memory IO region is
438bab661aSEmmanuel Vadot      also required if the space is unrolled (IP-core version >= 4.80a).
44354d7675SEmmanuel Vadot    minItems: 2
4584943d6fSEmmanuel Vadot    maxItems: 7
46354d7675SEmmanuel Vadot
47354d7675SEmmanuel Vadot  reg-names:
48354d7675SEmmanuel Vadot    minItems: 2
4984943d6fSEmmanuel Vadot    maxItems: 7
50354d7675SEmmanuel Vadot    items:
518bab661aSEmmanuel Vadot      oneOf:
528bab661aSEmmanuel Vadot        - description:
538bab661aSEmmanuel Vadot            Basic DWC PCIe controller configuration-space accessible over
548bab661aSEmmanuel Vadot            the DBI interface. This memory space is either activated with
558bab661aSEmmanuel Vadot            CDM/ELBI = 0 and CS2 = 0 or is a contiguous memory region
568bab661aSEmmanuel Vadot            with all spaces. Note iATU/eDMA CSRs are indirectly accessible
578bab661aSEmmanuel Vadot            via the PL viewports on the DWC PCIe controllers older than
588bab661aSEmmanuel Vadot            v4.80a.
598bab661aSEmmanuel Vadot          const: dbi
608bab661aSEmmanuel Vadot        - description:
618bab661aSEmmanuel Vadot            Shadow DWC PCIe config-space registers. This space is selected
628bab661aSEmmanuel Vadot            by setting CDM/ELBI = 0 and CS2 = 1. This is an intermix of
638bab661aSEmmanuel Vadot            the PCI-SIG PCIe CFG-space with the shadow registers for some
648bab661aSEmmanuel Vadot            PCI Header space, PCI Standard and Extended Structures. It's
658bab661aSEmmanuel Vadot            mainly relevant for the end-point controller configuration,
668bab661aSEmmanuel Vadot            but still there are some shadow registers available for the
678bab661aSEmmanuel Vadot            Root Port mode too.
688bab661aSEmmanuel Vadot          const: dbi2
698bab661aSEmmanuel Vadot        - description:
708bab661aSEmmanuel Vadot            External Local Bus registers. It's an application-dependent
718bab661aSEmmanuel Vadot            registers normally defined by the platform engineers. The space
728bab661aSEmmanuel Vadot            can be selected by setting CDM/ELBI = 1 and CS2 = 0 wires or can
738bab661aSEmmanuel Vadot            be accessed over some platform-specific means (for instance
748bab661aSEmmanuel Vadot            as a part of a system controller).
758bab661aSEmmanuel Vadot          enum: [ elbi, app ]
768bab661aSEmmanuel Vadot        - description:
778bab661aSEmmanuel Vadot            iATU/eDMA registers common for all device functions. It's an
788bab661aSEmmanuel Vadot            unrolled memory space with the internal Address Translation
798bab661aSEmmanuel Vadot            Unit and Enhanced DMA, which is selected by setting CDM/ELBI = 1
808bab661aSEmmanuel Vadot            and CS2 = 1. For IP-core releases prior v4.80a, these registers
818bab661aSEmmanuel Vadot            have been programmed via an indirect addressing scheme using a
828bab661aSEmmanuel Vadot            set of viewport CSRs mapped into the PL space. Note iATU is
838bab661aSEmmanuel Vadot            normally mapped to the 0x0 address of this region, while eDMA
848bab661aSEmmanuel Vadot            is available at 0x80000 base address.
858bab661aSEmmanuel Vadot          const: atu
868bab661aSEmmanuel Vadot        - description:
878bab661aSEmmanuel Vadot            Platform-specific eDMA registers. Some platforms may have eDMA
888bab661aSEmmanuel Vadot            CSRs mapped in a non-standard base address. The registers offset
898bab661aSEmmanuel Vadot            can be changed or the MS/LS-bits of the address can be attached
908bab661aSEmmanuel Vadot            in an additional RTL block before the MEM-IO transactions reach
918bab661aSEmmanuel Vadot            the DW PCIe slave interface.
928bab661aSEmmanuel Vadot          const: dma
938bab661aSEmmanuel Vadot        - description:
948bab661aSEmmanuel Vadot            PHY/PCS configuration registers. Some platforms can have the
958bab661aSEmmanuel Vadot            PCS and PHY CSRs accessible over a dedicated memory mapped
968bab661aSEmmanuel Vadot            region, but mainly these registers are indirectly accessible
978bab661aSEmmanuel Vadot            either by means of the embedded PHY viewport schema or by some
988bab661aSEmmanuel Vadot            platform-specific method.
998bab661aSEmmanuel Vadot          const: phy
1008bab661aSEmmanuel Vadot        - description:
1018bab661aSEmmanuel Vadot            Outbound iATU-capable memory-region which will be used to access
1028bab661aSEmmanuel Vadot            the peripheral PCIe devices configuration space.
1038bab661aSEmmanuel Vadot          const: config
1048bab661aSEmmanuel Vadot        - description:
1058bab661aSEmmanuel Vadot            Vendor-specific CSR names. Consider using the generic names above
1068bab661aSEmmanuel Vadot            for new bindings.
1078bab661aSEmmanuel Vadot          oneOf:
1088bab661aSEmmanuel Vadot            - description: See native 'elbi/app' CSR region for details.
1098bab661aSEmmanuel Vadot              enum: [ apb, mgmt, link, ulreg, appl ]
1108bab661aSEmmanuel Vadot            - description: See native 'atu' CSR region for details.
1118bab661aSEmmanuel Vadot              enum: [ atu_dma ]
1128bab661aSEmmanuel Vadot            - description: Syscon-related CSR regions.
1138bab661aSEmmanuel Vadot              enum: [ smu, mpu ]
1148bab661aSEmmanuel Vadot            - description: Tegra234 aperture
1158bab661aSEmmanuel Vadot              enum: [ ecam ]
1168bab661aSEmmanuel Vadot    allOf:
1178bab661aSEmmanuel Vadot      - contains:
1188bab661aSEmmanuel Vadot          const: dbi
1198bab661aSEmmanuel Vadot      - contains:
1208bab661aSEmmanuel Vadot          const: config
121354d7675SEmmanuel Vadot
1228bab661aSEmmanuel Vadot  interrupts:
1238bab661aSEmmanuel Vadot    description:
1248bab661aSEmmanuel Vadot      DWC PCIe Root Port/Complex specific IRQ signals. At least MSI interrupt
1258bab661aSEmmanuel Vadot      signal is supposed to be specified for the host controller.
1268bab661aSEmmanuel Vadot    minItems: 1
1278bab661aSEmmanuel Vadot    maxItems: 26
128354d7675SEmmanuel Vadot
1298bab661aSEmmanuel Vadot  interrupt-names:
1308bab661aSEmmanuel Vadot    minItems: 1
1318bab661aSEmmanuel Vadot    maxItems: 26
1328bab661aSEmmanuel Vadot    items:
1338bab661aSEmmanuel Vadot      oneOf:
1348bab661aSEmmanuel Vadot        - description:
1358bab661aSEmmanuel Vadot            Controller request to read or write virtual product data
1368bab661aSEmmanuel Vadot            from/to the VPD capability registers.
1378bab661aSEmmanuel Vadot          const: vpd
1388bab661aSEmmanuel Vadot        - description:
1398bab661aSEmmanuel Vadot            Link Equalization Request flag is set in the Link Status 2
1408bab661aSEmmanuel Vadot            register (applicable if the corresponding IRQ is enabled in
1418bab661aSEmmanuel Vadot            the Link Control 3 register).
1428bab661aSEmmanuel Vadot          const: l_eq
1438bab661aSEmmanuel Vadot        - description:
1448bab661aSEmmanuel Vadot            Indicates that the eDMA Tx/Rx transfer is complete or that an
1458bab661aSEmmanuel Vadot            error has occurred on the corresponding channel. eDMA can have
1468bab661aSEmmanuel Vadot            eight Tx (Write) and Rx (Read) eDMA channels thus supporting up
1478bab661aSEmmanuel Vadot            to 16 IRQ signals all together. Write eDMA channels shall go
1488bab661aSEmmanuel Vadot            first in the ordered row as per default edma_int[*] bus setup.
1498bab661aSEmmanuel Vadot          pattern: '^dma([0-9]|1[0-5])?$'
1508bab661aSEmmanuel Vadot        - description:
1518bab661aSEmmanuel Vadot            PCIe protocol correctable error or a Data Path protection
1528bab661aSEmmanuel Vadot            correctable error is detected by the automotive/safety
1538bab661aSEmmanuel Vadot            feature.
1548bab661aSEmmanuel Vadot          const: sft_ce
1558bab661aSEmmanuel Vadot        - description:
1568bab661aSEmmanuel Vadot            Indicates that the internal safety mechanism has detected an
1578bab661aSEmmanuel Vadot            uncorrectable error.
1588bab661aSEmmanuel Vadot          const: sft_ue
1598bab661aSEmmanuel Vadot        - description:
1608bab661aSEmmanuel Vadot            Application-specific IRQ raised depending on the vendor-specific
1618bab661aSEmmanuel Vadot            events basis.
1628bab661aSEmmanuel Vadot          const: app
1638bab661aSEmmanuel Vadot        - description:
1648bab661aSEmmanuel Vadot            DSP AXI MSI Interrupt detected. It gets de-asserted when there is
1658bab661aSEmmanuel Vadot            no more MSI interrupt pending. The interrupt is relevant to the
1668bab661aSEmmanuel Vadot            iMSI-RX - Integrated MSI Receiver (AXI bridge).
1678bab661aSEmmanuel Vadot          const: msi
1688bab661aSEmmanuel Vadot        - description:
1698bab661aSEmmanuel Vadot            Legacy A/B/C/D interrupt signal. Basically it's triggered by
1708bab661aSEmmanuel Vadot            receiving a Assert_INT{A,B,C,D}/Desassert_INT{A,B,C,D} message
1718bab661aSEmmanuel Vadot            from the downstream device.
1728bab661aSEmmanuel Vadot          pattern: "^int(a|b|c|d)$"
1738bab661aSEmmanuel Vadot        - description:
1748bab661aSEmmanuel Vadot            Error condition detected and a flag is set in the Root Error Status
1758bab661aSEmmanuel Vadot            register of the AER capability. It's asserted when the RC
1768bab661aSEmmanuel Vadot            internally generated an error or an error message is received by
1778bab661aSEmmanuel Vadot            the RC.
1788bab661aSEmmanuel Vadot          const: aer
1798bab661aSEmmanuel Vadot        - description:
1808bab661aSEmmanuel Vadot            PME message is received by the port. That means having the PME
1818bab661aSEmmanuel Vadot            status bit set in the Root Status register (the event is
1828bab661aSEmmanuel Vadot            supposed to be unmasked in the Root Control register).
1838bab661aSEmmanuel Vadot          const: pme
1848bab661aSEmmanuel Vadot        - description:
1858bab661aSEmmanuel Vadot            Hot-plug event is detected. That is a bit has been set in the
1868bab661aSEmmanuel Vadot            Slot Status register and the corresponding event is enabled in
1878bab661aSEmmanuel Vadot            the Slot Control register.
1888bab661aSEmmanuel Vadot          const: hp
1898bab661aSEmmanuel Vadot        - description:
1908bab661aSEmmanuel Vadot            Link Autonomous Bandwidth Status flag has been set in the Link
1918bab661aSEmmanuel Vadot            Status register (the event is supposed to be unmasked in the
1928bab661aSEmmanuel Vadot            Link Control register).
1938bab661aSEmmanuel Vadot          const: bw_au
1948bab661aSEmmanuel Vadot        - description:
1958bab661aSEmmanuel Vadot            Bandwidth Management Status flag has been set in the Link
1968bab661aSEmmanuel Vadot            Status register (the event is supposed to be unmasked in the
1978bab661aSEmmanuel Vadot            Link Control register).
1988bab661aSEmmanuel Vadot          const: bw_mg
1998bab661aSEmmanuel Vadot        - description:
200aa1a8ff2SEmmanuel Vadot            Combined Legacy A/B/C/D interrupt signal. See "^int(a|b|c|d)$" for
201aa1a8ff2SEmmanuel Vadot            details.
202aa1a8ff2SEmmanuel Vadot          const: legacy
203aa1a8ff2SEmmanuel Vadot        - description:
2048bab661aSEmmanuel Vadot            Vendor-specific IRQ names. Consider using the generic names above
2058bab661aSEmmanuel Vadot            for new bindings.
2068bab661aSEmmanuel Vadot          oneOf:
2078bab661aSEmmanuel Vadot            - description: See native "app" IRQ for details
208aa1a8ff2SEmmanuel Vadot              enum: [ intr, sys, pmc, msg, err ]
209354d7675SEmmanuel Vadot
210e67e8565SEmmanuel VadotadditionalProperties: true
211354d7675SEmmanuel Vadot
212354d7675SEmmanuel Vadotrequired:
2138bab661aSEmmanuel Vadot  - compatible
214354d7675SEmmanuel Vadot  - reg
215354d7675SEmmanuel Vadot  - reg-names
216354d7675SEmmanuel Vadot
217354d7675SEmmanuel Vadotexamples:
218354d7675SEmmanuel Vadot  - |
219354d7675SEmmanuel Vadot    pcie@dfc00000 {
220354d7675SEmmanuel Vadot      compatible = "snps,dw-pcie";
2218bab661aSEmmanuel Vadot      device_type = "pci";
222354d7675SEmmanuel Vadot      reg = <0xdfc00000 0x0001000>, /* IP registers */
223354d7675SEmmanuel Vadot            <0xd0000000 0x0002000>; /* Configuration space */
224354d7675SEmmanuel Vadot      reg-names = "dbi", "config";
225354d7675SEmmanuel Vadot      #address-cells = <3>;
226354d7675SEmmanuel Vadot      #size-cells = <2>;
227354d7675SEmmanuel Vadot      ranges = <0x81000000 0 0x00000000 0xde000000 0 0x00010000>,
228354d7675SEmmanuel Vadot               <0x82000000 0 0xd0400000 0xd0400000 0 0x0d000000>;
2298bab661aSEmmanuel Vadot      bus-range = <0x0 0xff>;
2308bab661aSEmmanuel Vadot
231354d7675SEmmanuel Vadot      interrupts = <25>, <24>;
2328bab661aSEmmanuel Vadot      interrupt-names = "msi", "hp";
233354d7675SEmmanuel Vadot      #interrupt-cells = <1>;
2348bab661aSEmmanuel Vadot
2358bab661aSEmmanuel Vadot      reset-gpios = <&port0 0 1>;
2368bab661aSEmmanuel Vadot
2378bab661aSEmmanuel Vadot      phys = <&pcie_phy>;
2388bab661aSEmmanuel Vadot      phy-names = "pcie";
2398bab661aSEmmanuel Vadot
240354d7675SEmmanuel Vadot      num-lanes = <1>;
2418bab661aSEmmanuel Vadot      max-link-speed = <3>;
242354d7675SEmmanuel Vadot    };
243