10f8b97d8SMauro Carvalho Chehab# SPDX-License-Identifier: GPL-2.0
20f8b97d8SMauro Carvalho Chehab%YAML 1.2
30f8b97d8SMauro Carvalho Chehab---
40f8b97d8SMauro Carvalho Chehab$id: http://devicetree.org/schemas/pci/snps,dw-pcie-ep.yaml#
50f8b97d8SMauro Carvalho Chehab$schema: http://devicetree.org/meta-schemas/core.yaml#
60f8b97d8SMauro Carvalho Chehab
70f8b97d8SMauro Carvalho Chehabtitle: Synopsys DesignWare PCIe endpoint interface
80f8b97d8SMauro Carvalho Chehab
90f8b97d8SMauro Carvalho Chehabmaintainers:
100f8b97d8SMauro Carvalho Chehab  - Jingoo Han <jingoohan1@gmail.com>
110f8b97d8SMauro Carvalho Chehab  - Gustavo Pimentel <gustavo.pimentel@synopsys.com>
120f8b97d8SMauro Carvalho Chehab
130f8b97d8SMauro Carvalho Chehabdescription: |
140f8b97d8SMauro Carvalho Chehab  Synopsys DesignWare PCIe host controller endpoint
150f8b97d8SMauro Carvalho Chehab
16f133396eSSerge Semin# Please create a separate DT-schema for your DWC PCIe Endpoint controller
17f133396eSSerge Semin# and make sure it's assigned with the vendor-specific compatible string.
18f133396eSSerge Seminselect:
19f133396eSSerge Semin  properties:
20f133396eSSerge Semin    compatible:
21f133396eSSerge Semin      const: snps,dw-pcie-ep
22f133396eSSerge Semin  required:
23f133396eSSerge Semin    - compatible
24f133396eSSerge Semin
250f8b97d8SMauro Carvalho ChehaballOf:
260f8b97d8SMauro Carvalho Chehab  - $ref: /schemas/pci/pci-ep.yaml#
27057646a5SSerge Semin  - $ref: /schemas/pci/snps,dw-pcie-common.yaml#
280f8b97d8SMauro Carvalho Chehab
290f8b97d8SMauro Carvalho Chehabproperties:
300f8b97d8SMauro Carvalho Chehab  reg:
314cc13eedSSerge Semin    description:
324cc13eedSSerge Semin      DBI, DBI2 reg-spaces and outbound memory window are required for the
334cc13eedSSerge Semin      normal controller functioning. iATU memory IO region is also required
344cc13eedSSerge Semin      if the space is unrolled (IP-core version >= 4.80a).
350f8b97d8SMauro Carvalho Chehab    minItems: 2
364cc13eedSSerge Semin    maxItems: 5
370f8b97d8SMauro Carvalho Chehab
380f8b97d8SMauro Carvalho Chehab  reg-names:
390f8b97d8SMauro Carvalho Chehab    minItems: 2
404cc13eedSSerge Semin    maxItems: 5
410f8b97d8SMauro Carvalho Chehab    items:
424cc13eedSSerge Semin      oneOf:
434cc13eedSSerge Semin        - description:
444cc13eedSSerge Semin            Basic DWC PCIe controller configuration-space accessible over
454cc13eedSSerge Semin            the DBI interface. This memory space is either activated with
464cc13eedSSerge Semin            CDM/ELBI = 0 and CS2 = 0 or is a contiguous memory region
474cc13eedSSerge Semin            with all spaces. Note iATU/eDMA CSRs are indirectly accessible
484cc13eedSSerge Semin            via the PL viewports on the DWC PCIe controllers older than
494cc13eedSSerge Semin            v4.80a.
504cc13eedSSerge Semin          const: dbi
514cc13eedSSerge Semin        - description:
524cc13eedSSerge Semin            Shadow DWC PCIe config-space registers. This space is selected
534cc13eedSSerge Semin            by setting CDM/ELBI = 0 and CS2 = 1. This is an intermix of
544cc13eedSSerge Semin            the PCI-SIG PCIe CFG-space with the shadow registers for some
554cc13eedSSerge Semin            PCI Header space, PCI Standard and Extended Structures. It's
564cc13eedSSerge Semin            mainly relevant for the end-point controller configuration,
574cc13eedSSerge Semin            but still there are some shadow registers available for the
584cc13eedSSerge Semin            Root Port mode too.
594cc13eedSSerge Semin          const: dbi2
604cc13eedSSerge Semin        - description:
614cc13eedSSerge Semin            External Local Bus registers. It's an application-dependent
624cc13eedSSerge Semin            registers normally defined by the platform engineers. The space
634cc13eedSSerge Semin            can be selected by setting CDM/ELBI = 1 and CS2 = 0 wires or can
644cc13eedSSerge Semin            be accessed over some platform-specific means (for instance
654cc13eedSSerge Semin            as a part of a system controller).
664cc13eedSSerge Semin          enum: [ elbi, app ]
674cc13eedSSerge Semin        - description:
684cc13eedSSerge Semin            iATU/eDMA registers common for all device functions. It's an
694cc13eedSSerge Semin            unrolled memory space with the internal Address Translation
704cc13eedSSerge Semin            Unit and Enhanced DMA, which is selected by setting CDM/ELBI = 1
714cc13eedSSerge Semin            and CS2 = 1. For IP-core releases prior v4.80a, these registers
724cc13eedSSerge Semin            have been programmed via an indirect addressing scheme using a
734cc13eedSSerge Semin            set of viewport CSRs mapped into the PL space. Note iATU is
744cc13eedSSerge Semin            normally mapped to the 0x0 address of this region, while eDMA
754cc13eedSSerge Semin            is available at 0x80000 base address.
764cc13eedSSerge Semin          const: atu
774cc13eedSSerge Semin        - description:
784cc13eedSSerge Semin            Platform-specific eDMA registers. Some platforms may have eDMA
794cc13eedSSerge Semin            CSRs mapped in a non-standard base address. The registers offset
804cc13eedSSerge Semin            can be changed or the MS/LS-bits of the address can be attached
814cc13eedSSerge Semin            in an additional RTL block before the MEM-IO transactions reach
824cc13eedSSerge Semin            the DW PCIe slave interface.
834cc13eedSSerge Semin          const: dma
844cc13eedSSerge Semin        - description:
854cc13eedSSerge Semin            PHY/PCS configuration registers. Some platforms can have the
864cc13eedSSerge Semin            PCS and PHY CSRs accessible over a dedicated memory mapped
874cc13eedSSerge Semin            region, but mainly these registers are indirectly accessible
884cc13eedSSerge Semin            either by means of the embedded PHY viewport schema or by some
894cc13eedSSerge Semin            platform-specific method.
904cc13eedSSerge Semin          const: phy
914cc13eedSSerge Semin        - description:
924cc13eedSSerge Semin            Outbound iATU-capable memory-region which will be used to
934cc13eedSSerge Semin            generate various application-specific traffic on the PCIe bus
944cc13eedSSerge Semin            hierarchy. It's usage scenario depends on the endpoint
954cc13eedSSerge Semin            functionality, for instance it can be used to create MSI(X)
964cc13eedSSerge Semin            messages.
974cc13eedSSerge Semin          const: addr_space
984cc13eedSSerge Semin        - description:
994cc13eedSSerge Semin            Vendor-specific CSR names. Consider using the generic names above
1004cc13eedSSerge Semin            for new bindings.
1014cc13eedSSerge Semin          oneOf:
1024cc13eedSSerge Semin            - description: See native 'elbi/app' CSR region for details.
1034cc13eedSSerge Semin              enum: [ link, appl ]
1044cc13eedSSerge Semin            - description: See native 'atu' CSR region for details.
1054cc13eedSSerge Semin              enum: [ atu_dma ]
1064cc13eedSSerge Semin    allOf:
1074cc13eedSSerge Semin      - contains:
1084cc13eedSSerge Semin          const: dbi
1094cc13eedSSerge Semin      - contains:
1104cc13eedSSerge Semin          const: addr_space
1110f8b97d8SMauro Carvalho Chehab
11235486813SSerge Semin  interrupts:
11335486813SSerge Semin    description:
11435486813SSerge Semin      There is no mandatory IRQ signals for the normal controller functioning,
11535486813SSerge Semin      but in addition to the native set the platforms may have a link- or
11635486813SSerge Semin      PM-related IRQs specified.
11735486813SSerge Semin    minItems: 1
11835486813SSerge Semin    maxItems: 20
11935486813SSerge Semin
12035486813SSerge Semin  interrupt-names:
12135486813SSerge Semin    minItems: 1
12235486813SSerge Semin    maxItems: 20
12335486813SSerge Semin    items:
12435486813SSerge Semin      oneOf:
12535486813SSerge Semin        - description:
12635486813SSerge Semin            Controller request to read or write virtual product data
12735486813SSerge Semin            from/to the VPD capability registers.
12835486813SSerge Semin          const: vpd
12935486813SSerge Semin        - description:
13035486813SSerge Semin            Link Equalization Request flag is set in the Link Status 2
13135486813SSerge Semin            register (applicable if the corresponding IRQ is enabled in
13235486813SSerge Semin            the Link Control 3 register).
13335486813SSerge Semin          const: l_eq
13435486813SSerge Semin        - description:
13535486813SSerge Semin            Indicates that the eDMA Tx/Rx transfer is complete or that an
13635486813SSerge Semin            error has occurred on the corresponding channel. eDMA can have
13735486813SSerge Semin            eight Tx (Write) and Rx (Read) eDMA channels thus supporting up
13835486813SSerge Semin            to 16 IRQ signals all together. Write eDMA channels shall go
13935486813SSerge Semin            first in the ordered row as per default edma_int[*] bus setup.
14035486813SSerge Semin          pattern: '^dma([0-9]|1[0-5])?$'
14135486813SSerge Semin        - description:
14235486813SSerge Semin            PCIe protocol correctable error or a Data Path protection
14335486813SSerge Semin            correctable error is detected by the automotive/safety
14435486813SSerge Semin            feature.
14535486813SSerge Semin          const: sft_ce
14635486813SSerge Semin        - description:
14735486813SSerge Semin            Indicates that the internal safety mechanism has detected an
14835486813SSerge Semin            uncorrectable error.
14935486813SSerge Semin          const: sft_ue
15035486813SSerge Semin        - description:
15135486813SSerge Semin            Application-specific IRQ raised depending on the vendor-specific
15235486813SSerge Semin            events basis.
15335486813SSerge Semin          const: app
15435486813SSerge Semin        - description:
15535486813SSerge Semin            Vendor-specific IRQ names. Consider using the generic names above
15635486813SSerge Semin            for new bindings.
15735486813SSerge Semin          oneOf:
15835486813SSerge Semin            - description: See native "app" IRQ for details
15935486813SSerge Semin              enum: [ intr ]
16035486813SSerge Semin
16112f7936cSSerge Semin  max-functions:
16212f7936cSSerge Semin    maximum: 32
16312f7936cSSerge Semin
1640f8b97d8SMauro Carvalho Chehabrequired:
165f133396eSSerge Semin  - compatible
1660f8b97d8SMauro Carvalho Chehab  - reg
1670f8b97d8SMauro Carvalho Chehab  - reg-names
1680f8b97d8SMauro Carvalho Chehab
169b92225b0SRob HerringadditionalProperties: true
1700f8b97d8SMauro Carvalho Chehab
1710f8b97d8SMauro Carvalho Chehabexamples:
1720f8b97d8SMauro Carvalho Chehab  - |
1730f8b97d8SMauro Carvalho Chehab    pcie-ep@dfd00000 {
1740f8b97d8SMauro Carvalho Chehab      compatible = "snps,dw-pcie-ep";
1750f8b97d8SMauro Carvalho Chehab      reg = <0xdfc00000 0x0001000>, /* IP registers 1 */
1760f8b97d8SMauro Carvalho Chehab            <0xdfc01000 0x0001000>, /* IP registers 2 */
1770f8b97d8SMauro Carvalho Chehab            <0xd0000000 0x2000000>; /* Configuration space */
1780f8b97d8SMauro Carvalho Chehab      reg-names = "dbi", "dbi2", "addr_space";
17987559636SSerge Semin
18035486813SSerge Semin      interrupts = <23>, <24>;
18135486813SSerge Semin      interrupt-names = "dma0", "dma1";
18235486813SSerge Semin
183*bd9504afSSerge Semin      clocks = <&sys_clk 12>, <&sys_clk 24>;
184*bd9504afSSerge Semin      clock-names = "dbi", "ref";
185*bd9504afSSerge Semin
186*bd9504afSSerge Semin      resets = <&sys_rst 12>, <&sys_rst 24>;
187*bd9504afSSerge Semin      reset-names = "dbi", "phy";
188*bd9504afSSerge Semin
18987559636SSerge Semin      phys = <&pcie_phy0>, <&pcie_phy1>, <&pcie_phy2>, <&pcie_phy3>;
19087559636SSerge Semin      phy-names = "pcie0", "pcie1", "pcie2", "pcie3";
191eaa9d886SSerge Semin
192eaa9d886SSerge Semin      max-link-speed = <3>;
19312f7936cSSerge Semin      max-functions = /bits/ 8 <4>;
1940f8b97d8SMauro Carvalho Chehab    };
195