xref: /linux/Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml (revision 3fd6c59042dbba50391e30862beac979491145fe)
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    minItems: 1
96e6f98b29SJim Quinlan    maxItems: 3
97e6f98b29SJim Quinlan
98e6f98b29SJim Quinlan  resets:
99c64e40caSJim Quinlan    minItems: 1
100*56d02029SJim Quinlan    maxItems: 3
101*56d02029SJim Quinlan
102c64e40caSJim Quinlan  reset-names:
103c64e40caSJim Quinlan    minItems: 1
104*56d02029SJim Quinlan    maxItems: 3
105*56d02029SJim Quinlan
106c64e40caSJim Quinlanrequired:
1070956dcb8SJim Quinlan  - compatible
1085e8a7d26SFlorian Fainelli  - reg
1090956dcb8SJim Quinlan  - ranges
110e6f98b29SJim Quinlan  - dma-ranges
1110956dcb8SJim Quinlan  - "#interrupt-cells"
1120956dcb8SJim Quinlan  - interrupts
1130956dcb8SJim Quinlan  - interrupt-names
1140956dcb8SJim Quinlan  - interrupt-map-mask
1150956dcb8SJim Quinlan  - interrupt-map
1160956dcb8SJim Quinlan  - msi-controller
1170956dcb8SJim Quinlan
1180956dcb8SJim QuinlanallOf:
119e6f98b29SJim Quinlan  - $ref: /schemas/pci/pci-host-bridge.yaml#
1205db62b7dSKrzysztof Kozlowski  - $ref: /schemas/interrupt-controller/msi-controller.yaml#
1212e8b4b6eSMark Kettenis  - if:
122e6f98b29SJim Quinlan      properties:
123e6f98b29SJim Quinlan        compatible:
124e6f98b29SJim Quinlan          contains:
125e6f98b29SJim Quinlan            const: brcm,bcm4908-pcie
126f435ce7eSRafał Miłecki    then:
127f435ce7eSRafał Miłecki      properties:
128f435ce7eSRafał Miłecki        resets:
129f435ce7eSRafał Miłecki          maxItems: 1
130c64e40caSJim Quinlan
131f435ce7eSRafał Miłecki        reset-names:
132f435ce7eSRafał Miłecki          items:
133f435ce7eSRafał Miłecki            - const: perst
134f435ce7eSRafał Miłecki
135f435ce7eSRafał Miłecki      required:
136f435ce7eSRafał Miłecki        - resets
137f435ce7eSRafał Miłecki        - reset-names
138f435ce7eSRafał Miłecki  - if:
139f435ce7eSRafał Miłecki      properties:
140f435ce7eSRafał Miłecki        compatible:
141f435ce7eSRafał Miłecki          contains:
142f435ce7eSRafał Miłecki            const: brcm,bcm7216-pcie
143e6f98b29SJim Quinlan    then:
144e6f98b29SJim Quinlan      properties:
145f435ce7eSRafał Miłecki        resets:
146f435ce7eSRafał Miłecki          maxItems: 1
147c64e40caSJim Quinlan
148f435ce7eSRafał Miłecki        reset-names:
149f435ce7eSRafał Miłecki          items:
150f435ce7eSRafał Miłecki            - const: rescal
151f435ce7eSRafał Miłecki
152f435ce7eSRafał Miłecki      required:
153e6f98b29SJim Quinlan        - resets
154e6f98b29SJim Quinlan        - reset-names
155e6f98b29SJim Quinlan
156e6f98b29SJim Quinlan  - if:
157*56d02029SJim Quinlan      properties:
158*56d02029SJim Quinlan        compatible:
159*56d02029SJim Quinlan          contains:
160*56d02029SJim Quinlan            const: brcm,bcm7712-pcie
161*56d02029SJim Quinlan    then:
162*56d02029SJim Quinlan      properties:
163*56d02029SJim Quinlan        resets:
164*56d02029SJim Quinlan          minItems: 3
165*56d02029SJim Quinlan          maxItems: 3
166*56d02029SJim Quinlan
167*56d02029SJim Quinlan        reset-names:
168*56d02029SJim Quinlan          items:
169*56d02029SJim Quinlan            - const: rescal
170*56d02029SJim Quinlan            - const: bridge
171*56d02029SJim Quinlan            - const: swinit
172*56d02029SJim Quinlan
173*56d02029SJim Quinlan      required:
174*56d02029SJim Quinlan        - resets
175*56d02029SJim Quinlan        - reset-names
176*56d02029SJim Quinlan
177*56d02029SJim QuinlanunevaluatedProperties: false
1780956dcb8SJim Quinlan
1790956dcb8SJim Quinlanexamples:
1800956dcb8SJim Quinlan  - |
1810956dcb8SJim Quinlan    #include <dt-bindings/interrupt-controller/irq.h>
1820956dcb8SJim Quinlan    #include <dt-bindings/interrupt-controller/arm-gic.h>
1830956dcb8SJim Quinlan
1840956dcb8SJim Quinlan    scb {
1850956dcb8SJim Quinlan            #address-cells = <2>;
1860956dcb8SJim Quinlan            #size-cells = <1>;
1870956dcb8SJim Quinlan            pcie0: pcie@7d500000 {
1880956dcb8SJim Quinlan                    compatible = "brcm,bcm2711-pcie";
1890956dcb8SJim Quinlan                    reg = <0x0 0x7d500000 0x9310>;
1900956dcb8SJim Quinlan                    device_type = "pci";
1910956dcb8SJim Quinlan                    #address-cells = <3>;
1920956dcb8SJim Quinlan                    #size-cells = <2>;
1930956dcb8SJim Quinlan                    #interrupt-cells = <1>;
1940956dcb8SJim Quinlan                    interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
195504253e4SJim Quinlan                                 <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
1960956dcb8SJim Quinlan                    interrupt-names = "pcie", "msi";
1970956dcb8SJim Quinlan                    interrupt-map-mask = <0x0 0x0 0x0 0x7>;
1980956dcb8SJim Quinlan                    interrupt-map = <0 0 0 1 &gicv2 GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH
199504253e4SJim Quinlan                                     0 0 0 2 &gicv2 GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH
200504253e4SJim Quinlan                                     0 0 0 3 &gicv2 GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH
201504253e4SJim Quinlan                                     0 0 0 4 &gicv2 GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>;
202504253e4SJim Quinlan
203504253e4SJim Quinlan                    msi-parent = <&pcie0>;
2040956dcb8SJim Quinlan                    msi-controller;
2050956dcb8SJim Quinlan                    ranges = <0x02000000 0x0 0xf8000000 0x6 0x00000000 0x0 0x04000000>;
2060956dcb8SJim Quinlan                    dma-ranges = <0x42000000 0x1 0x00000000 0x0 0x40000000 0x0 0x80000000>,
207e6f98b29SJim Quinlan                                 <0x42000000 0x1 0x80000000 0x3 0x00000000 0x0 0x80000000>;
208e6f98b29SJim Quinlan                    brcm,enable-ssc;
2090956dcb8SJim Quinlan                    brcm,scb-sizes =  <0x0000000080000000 0x0000000080000000>;
210e6f98b29SJim Quinlan
211ea372f45SJim Quinlan                    /* PCIe bridge, Root Port */
212ea372f45SJim Quinlan                    pci@0,0 {
213ea372f45SJim Quinlan                            #address-cells = <3>;
214ea372f45SJim Quinlan                            #size-cells = <2>;
215ea372f45SJim Quinlan                            reg = <0x0 0x0 0x0 0x0 0x0>;
216ea372f45SJim Quinlan                            compatible = "pciclass,0604";
217ea372f45SJim Quinlan                            device_type = "pci";
218ea372f45SJim Quinlan                            vpcie3v3-supply = <&vreg7>;
219ea372f45SJim Quinlan                            ranges;
220ea372f45SJim Quinlan
221ea372f45SJim Quinlan                            /* PCIe endpoint */
222ea372f45SJim Quinlan                            pci-ep@0,0 {
223ea372f45SJim Quinlan                                    assigned-addresses =
224ea372f45SJim Quinlan                                        <0x82010000 0x0 0xf8000000 0x6 0x00000000 0x0 0x2000>;
225ea372f45SJim Quinlan                                    reg = <0x0 0x0 0x0 0x0 0x0>;
226ea372f45SJim Quinlan                                    compatible = "pci14e4,1688";
227ea372f45SJim Quinlan                            };
228ea372f45SJim Quinlan                    };
229ea372f45SJim Quinlan            };
2300956dcb8SJim Quinlan    };
2310956dcb8SJim Quinlan