xref: /linux/Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml (revision 56d020296a122f814b65f3fb5b3f90d7c4533042)
10956dcb8SJim Quinlan# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
20956dcb8SJim Quinlan%YAML 1.2
30956dcb8SJim Quinlan---
40956dcb8SJim Quinlan$id: http://devicetree.org/schemas/pci/brcm,stb-pcie.yaml#
50956dcb8SJim Quinlan$schema: http://devicetree.org/meta-schemas/core.yaml#
60956dcb8SJim Quinlan
7dd3cb467SAndrew Lunntitle: Brcmstb PCIe Host Controller
80956dcb8SJim Quinlan
90956dcb8SJim Quinlanmaintainers:
108a4db021SJim Quinlan  - Jim Quinlan <james.quinlan@broadcom.com>
110956dcb8SJim Quinlan
120956dcb8SJim Quinlanproperties:
130956dcb8SJim Quinlan  compatible:
14e6f98b29SJim Quinlan    items:
15e6f98b29SJim Quinlan      - enum:
16e6f98b29SJim Quinlan          - brcm,bcm2711-pcie # The Raspberry Pi 4
17f435ce7eSRafał Miłecki          - brcm,bcm4908-pcie
18e6f98b29SJim Quinlan          - brcm,bcm7211-pcie # Broadcom STB version of RPi4
19e6f98b29SJim Quinlan          - brcm,bcm7216-pcie # Broadcom 7216 Arm
208a4db021SJim Quinlan          - brcm,bcm7278-pcie # Broadcom 7278 Arm
21145790e5SJim Quinlan          - brcm,bcm7425-pcie # Broadcom 7425 MIPs
22145790e5SJim Quinlan          - brcm,bcm7435-pcie # Broadcom 7435 MIPs
238a4db021SJim Quinlan          - brcm,bcm7445-pcie # Broadcom 7445 Arm
24*56d02029SJim Quinlan          - brcm,bcm7712-pcie # Broadcom STB sibling of Rpi 5
250956dcb8SJim Quinlan
260956dcb8SJim Quinlan  reg:
270956dcb8SJim Quinlan    maxItems: 1
280956dcb8SJim Quinlan
290956dcb8SJim Quinlan  interrupts:
300956dcb8SJim Quinlan    minItems: 1
310956dcb8SJim Quinlan    items:
320956dcb8SJim Quinlan      - description: PCIe host controller
330956dcb8SJim Quinlan      - description: builtin MSI controller
340956dcb8SJim Quinlan
350956dcb8SJim Quinlan  interrupt-names:
360956dcb8SJim Quinlan    minItems: 1
370956dcb8SJim Quinlan    items:
380956dcb8SJim Quinlan      - const: pcie
390956dcb8SJim Quinlan      - const: msi
400956dcb8SJim Quinlan
410956dcb8SJim Quinlan  ranges:
42e6f98b29SJim Quinlan    minItems: 1
43e6f98b29SJim Quinlan    maxItems: 4
440956dcb8SJim Quinlan
450956dcb8SJim Quinlan  dma-ranges:
46e6f98b29SJim Quinlan    minItems: 1
47e6f98b29SJim Quinlan    maxItems: 6
480956dcb8SJim Quinlan
490956dcb8SJim Quinlan  clocks:
500956dcb8SJim Quinlan    maxItems: 1
510956dcb8SJim Quinlan
520956dcb8SJim Quinlan  clock-names:
530956dcb8SJim Quinlan    items:
540956dcb8SJim Quinlan      - const: sw_pcie
550956dcb8SJim Quinlan
560956dcb8SJim Quinlan  msi-controller:
570956dcb8SJim Quinlan    description: Identifies the node as an MSI controller.
580956dcb8SJim Quinlan
590956dcb8SJim Quinlan  msi-parent:
600956dcb8SJim Quinlan    description: MSI controller the device is capable of using.
610956dcb8SJim Quinlan
620956dcb8SJim Quinlan  brcm,enable-ssc:
630956dcb8SJim Quinlan    description: Indicates usage of spread-spectrum clocking.
640956dcb8SJim Quinlan    type: boolean
650956dcb8SJim Quinlan
66420c517bSJim Quinlan  aspm-no-l0s: true
67420c517bSJim Quinlan
6814b15aebSJim Quinlan  brcm,clkreq-mode:
6914b15aebSJim Quinlan    description: A string that determines the operating
7014b15aebSJim Quinlan      clkreq mode of the PCIe RC HW with respect to controlling the refclk
7114b15aebSJim Quinlan      signal.  There are three different modes -- "safe", which drives the
7214b15aebSJim Quinlan      refclk signal unconditionally and will work for all devices but does
7314b15aebSJim Quinlan      not provide any power savings; "no-l1ss" -- which provides Clock
7414b15aebSJim Quinlan      Power Management, L0s, and L1, but cannot provide L1 substate (L1SS)
7514b15aebSJim Quinlan      power savings. If the downstream device connected to the RC is L1SS
7614b15aebSJim Quinlan      capable AND the OS enables L1SS, all PCIe traffic may abruptly halt,
7714b15aebSJim Quinlan      potentially hanging the system; "default" -- which provides L0s, L1,
7814b15aebSJim Quinlan      and L1SS, but not compliant to provide Clock Power Management;
7914b15aebSJim Quinlan      specifically, may not be able to meet the T_CLRon max timing of 400ns
8014b15aebSJim Quinlan      as specified in "Dynamic Clock Control", section 3.2.5.2.2 PCI
8114b15aebSJim Quinlan      Express Mini CEM 2.1 specification.  This situation is atypical and
8214b15aebSJim Quinlan      should happen only with older devices.
8314b15aebSJim Quinlan    $ref: /schemas/types.yaml#/definitions/string
8414b15aebSJim Quinlan    enum: [ safe, no-l1ss, default ]
8514b15aebSJim Quinlan
86e6f98b29SJim Quinlan  brcm,scb-sizes:
87e6f98b29SJim Quinlan    description: u64 giving the 64bit PCIe memory
88e6f98b29SJim Quinlan      viewport size of a memory controller.  There may be up to
89e6f98b29SJim Quinlan      three controllers, and each size must be a power of two
90e6f98b29SJim Quinlan      with a size greater or equal to the amount of memory the
91e6f98b29SJim Quinlan      controller supports.  Note that each memory controller
92e6f98b29SJim Quinlan      may have two component regions -- base and extended -- so
93e6f98b29SJim Quinlan      this information cannot be deduced from the dma-ranges.
94e6f98b29SJim Quinlan    $ref: /schemas/types.yaml#/definitions/uint64-array
95e6f98b29SJim Quinlan    items:
96e6f98b29SJim Quinlan      minItems: 1
97e6f98b29SJim Quinlan      maxItems: 3
98e6f98b29SJim Quinlan
99c64e40caSJim Quinlan  resets:
100*56d02029SJim Quinlan    minItems: 1
101*56d02029SJim Quinlan    maxItems: 3
102c64e40caSJim Quinlan
103c64e40caSJim Quinlan  reset-names:
104*56d02029SJim Quinlan    minItems: 1
105*56d02029SJim Quinlan    maxItems: 3
106c64e40caSJim Quinlan
1070956dcb8SJim Quinlanrequired:
1085e8a7d26SFlorian Fainelli  - compatible
1090956dcb8SJim Quinlan  - reg
110e6f98b29SJim Quinlan  - ranges
1110956dcb8SJim Quinlan  - dma-ranges
1120956dcb8SJim Quinlan  - "#interrupt-cells"
1130956dcb8SJim Quinlan  - interrupts
1140956dcb8SJim Quinlan  - interrupt-names
1150956dcb8SJim Quinlan  - interrupt-map-mask
1160956dcb8SJim Quinlan  - interrupt-map
1170956dcb8SJim Quinlan  - msi-controller
1180956dcb8SJim Quinlan
119e6f98b29SJim QuinlanallOf:
1205db62b7dSKrzysztof Kozlowski  - $ref: /schemas/pci/pci-host-bridge.yaml#
1212e8b4b6eSMark Kettenis  - $ref: /schemas/interrupt-controller/msi-controller.yaml#
122e6f98b29SJim Quinlan  - if:
123e6f98b29SJim Quinlan      properties:
124e6f98b29SJim Quinlan        compatible:
125e6f98b29SJim Quinlan          contains:
126f435ce7eSRafał Miłecki            const: brcm,bcm4908-pcie
127f435ce7eSRafał Miłecki    then:
128f435ce7eSRafał Miłecki      properties:
129f435ce7eSRafał Miłecki        resets:
130c64e40caSJim Quinlan          maxItems: 1
131f435ce7eSRafał Miłecki
132f435ce7eSRafał Miłecki        reset-names:
133f435ce7eSRafał Miłecki          items:
134f435ce7eSRafał Miłecki            - const: perst
135f435ce7eSRafał Miłecki
136f435ce7eSRafał Miłecki      required:
137f435ce7eSRafał Miłecki        - resets
138f435ce7eSRafał Miłecki        - reset-names
139f435ce7eSRafał Miłecki  - if:
140f435ce7eSRafał Miłecki      properties:
141f435ce7eSRafał Miłecki        compatible:
142f435ce7eSRafał Miłecki          contains:
143e6f98b29SJim Quinlan            const: brcm,bcm7216-pcie
144e6f98b29SJim Quinlan    then:
145f435ce7eSRafał Miłecki      properties:
146f435ce7eSRafał Miłecki        resets:
147c64e40caSJim Quinlan          maxItems: 1
148f435ce7eSRafał Miłecki
149f435ce7eSRafał Miłecki        reset-names:
150f435ce7eSRafał Miłecki          items:
151f435ce7eSRafał Miłecki            - const: rescal
152f435ce7eSRafał Miłecki
153e6f98b29SJim Quinlan      required:
154e6f98b29SJim Quinlan        - resets
155e6f98b29SJim Quinlan        - reset-names
156e6f98b29SJim Quinlan
157*56d02029SJim Quinlan  - if:
158*56d02029SJim Quinlan      properties:
159*56d02029SJim Quinlan        compatible:
160*56d02029SJim Quinlan          contains:
161*56d02029SJim Quinlan            const: brcm,bcm7712-pcie
162*56d02029SJim Quinlan    then:
163*56d02029SJim Quinlan      properties:
164*56d02029SJim Quinlan        resets:
165*56d02029SJim Quinlan          minItems: 3
166*56d02029SJim Quinlan          maxItems: 3
167*56d02029SJim Quinlan
168*56d02029SJim Quinlan        reset-names:
169*56d02029SJim Quinlan          items:
170*56d02029SJim Quinlan            - const: rescal
171*56d02029SJim Quinlan            - const: bridge
172*56d02029SJim Quinlan            - const: swinit
173*56d02029SJim Quinlan
174*56d02029SJim Quinlan      required:
175*56d02029SJim Quinlan        - resets
176*56d02029SJim Quinlan        - reset-names
177*56d02029SJim Quinlan
1780956dcb8SJim QuinlanunevaluatedProperties: false
1790956dcb8SJim Quinlan
1800956dcb8SJim Quinlanexamples:
1810956dcb8SJim Quinlan  - |
1820956dcb8SJim Quinlan    #include <dt-bindings/interrupt-controller/irq.h>
1830956dcb8SJim Quinlan    #include <dt-bindings/interrupt-controller/arm-gic.h>
1840956dcb8SJim Quinlan
1850956dcb8SJim Quinlan    scb {
1860956dcb8SJim Quinlan            #address-cells = <2>;
1870956dcb8SJim Quinlan            #size-cells = <1>;
1880956dcb8SJim Quinlan            pcie0: pcie@7d500000 {
1890956dcb8SJim Quinlan                    compatible = "brcm,bcm2711-pcie";
1900956dcb8SJim Quinlan                    reg = <0x0 0x7d500000 0x9310>;
1910956dcb8SJim Quinlan                    device_type = "pci";
1920956dcb8SJim Quinlan                    #address-cells = <3>;
1930956dcb8SJim Quinlan                    #size-cells = <2>;
1940956dcb8SJim Quinlan                    #interrupt-cells = <1>;
195504253e4SJim Quinlan                    interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
1960956dcb8SJim Quinlan                                 <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
1970956dcb8SJim Quinlan                    interrupt-names = "pcie", "msi";
1980956dcb8SJim Quinlan                    interrupt-map-mask = <0x0 0x0 0x0 0x7>;
199504253e4SJim Quinlan                    interrupt-map = <0 0 0 1 &gicv2 GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH
200504253e4SJim Quinlan                                     0 0 0 2 &gicv2 GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH
201504253e4SJim Quinlan                                     0 0 0 3 &gicv2 GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH
202504253e4SJim Quinlan                                     0 0 0 4 &gicv2 GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>;
203504253e4SJim Quinlan
2040956dcb8SJim Quinlan                    msi-parent = <&pcie0>;
2050956dcb8SJim Quinlan                    msi-controller;
2060956dcb8SJim Quinlan                    ranges = <0x02000000 0x0 0xf8000000 0x6 0x00000000 0x0 0x04000000>;
207e6f98b29SJim Quinlan                    dma-ranges = <0x42000000 0x1 0x00000000 0x0 0x40000000 0x0 0x80000000>,
208e6f98b29SJim Quinlan                                 <0x42000000 0x1 0x80000000 0x3 0x00000000 0x0 0x80000000>;
2090956dcb8SJim Quinlan                    brcm,enable-ssc;
210e6f98b29SJim Quinlan                    brcm,scb-sizes =  <0x0000000080000000 0x0000000080000000>;
211ea372f45SJim Quinlan
212ea372f45SJim Quinlan                    /* PCIe bridge, Root Port */
213ea372f45SJim Quinlan                    pci@0,0 {
214ea372f45SJim Quinlan                            #address-cells = <3>;
215ea372f45SJim Quinlan                            #size-cells = <2>;
216ea372f45SJim Quinlan                            reg = <0x0 0x0 0x0 0x0 0x0>;
217ea372f45SJim Quinlan                            compatible = "pciclass,0604";
218ea372f45SJim Quinlan                            device_type = "pci";
219ea372f45SJim Quinlan                            vpcie3v3-supply = <&vreg7>;
220ea372f45SJim Quinlan                            ranges;
221ea372f45SJim Quinlan
222ea372f45SJim Quinlan                            /* PCIe endpoint */
223ea372f45SJim Quinlan                            pci-ep@0,0 {
224ea372f45SJim Quinlan                                    assigned-addresses =
225ea372f45SJim Quinlan                                        <0x82010000 0x0 0xf8000000 0x6 0x00000000 0x0 0x2000>;
226ea372f45SJim Quinlan                                    reg = <0x0 0x0 0x0 0x0 0x0>;
227ea372f45SJim Quinlan                                    compatible = "pci14e4,1688";
228ea372f45SJim Quinlan                            };
229ea372f45SJim Quinlan                    };
2300956dcb8SJim Quinlan            };
2310956dcb8SJim Quinlan    };
232