xref: /freebsd/sys/contrib/device-tree/Bindings/pci/hisilicon,kirin-pcie.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1354d7675SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2354d7675SEmmanuel Vadot%YAML 1.2
3354d7675SEmmanuel Vadot---
4354d7675SEmmanuel Vadot$id: http://devicetree.org/schemas/pci/hisilicon,kirin-pcie.yaml#
5354d7675SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6354d7675SEmmanuel Vadot
7354d7675SEmmanuel Vadottitle: HiSilicon Kirin SoCs PCIe host DT description
8354d7675SEmmanuel Vadot
9354d7675SEmmanuel Vadotmaintainers:
10354d7675SEmmanuel Vadot  - Xiaowei Song <songxiaowei@hisilicon.com>
11354d7675SEmmanuel Vadot  - Binghui Wang <wangbinghui@hisilicon.com>
12354d7675SEmmanuel Vadot
13354d7675SEmmanuel Vadotdescription: |
14354d7675SEmmanuel Vadot  Kirin PCIe host controller is based on the Synopsys DesignWare PCI core.
15354d7675SEmmanuel Vadot  It shares common functions with the PCIe DesignWare core driver and
16354d7675SEmmanuel Vadot  inherits common properties defined in
17354d7675SEmmanuel Vadot  Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml.
18354d7675SEmmanuel Vadot
19354d7675SEmmanuel VadotallOf:
20354d7675SEmmanuel Vadot  - $ref: /schemas/pci/snps,dw-pcie.yaml#
21354d7675SEmmanuel Vadot
22354d7675SEmmanuel Vadotproperties:
23354d7675SEmmanuel Vadot  compatible:
24354d7675SEmmanuel Vadot    contains:
25354d7675SEmmanuel Vadot      enum:
26354d7675SEmmanuel Vadot        - hisilicon,kirin960-pcie
27354d7675SEmmanuel Vadot        - hisilicon,kirin970-pcie
28354d7675SEmmanuel Vadot
29354d7675SEmmanuel Vadot  reg:
30354d7675SEmmanuel Vadot    description: |
31354d7675SEmmanuel Vadot      Should contain dbi, apb, config registers location and length.
32354d7675SEmmanuel Vadot      For hisilicon,kirin960-pcie, it should also contain phy.
33354d7675SEmmanuel Vadot    minItems: 3
34354d7675SEmmanuel Vadot    maxItems: 4
35354d7675SEmmanuel Vadot
36354d7675SEmmanuel Vadot  reg-names:
37354d7675SEmmanuel Vadot    minItems: 3
38354d7675SEmmanuel Vadot    maxItems: 4
39354d7675SEmmanuel Vadot
40*b2d2a78aSEmmanuel Vadot  clocks:
41*b2d2a78aSEmmanuel Vadot    maxItems: 5
42e67e8565SEmmanuel Vadot
43e67e8565SEmmanuel Vadot  clock-names:
44e67e8565SEmmanuel Vadot    items:
45e67e8565SEmmanuel Vadot      - const: pcie_phy_ref
46e67e8565SEmmanuel Vadot      - const: pcie_aux
47e67e8565SEmmanuel Vadot      - const: pcie_apb_phy
48e67e8565SEmmanuel Vadot      - const: pcie_apb_sys
49e67e8565SEmmanuel Vadot      - const: pcie_aclk
50e67e8565SEmmanuel Vadot
51e67e8565SEmmanuel Vadot  phys:
52e67e8565SEmmanuel Vadot    maxItems: 1
53e67e8565SEmmanuel Vadot
54354d7675SEmmanuel Vadot  hisilicon,clken-gpios:
55354d7675SEmmanuel Vadot    description: |
56354d7675SEmmanuel Vadot      Clock input enablement GPIOs from PCI devices like Ethernet, M.2 and
57354d7675SEmmanuel Vadot      mini-PCIe slots.
58354d7675SEmmanuel Vadot
59354d7675SEmmanuel Vadotrequired:
60354d7675SEmmanuel Vadot  - compatible
61354d7675SEmmanuel Vadot  - reg
62354d7675SEmmanuel Vadot  - reg-names
63354d7675SEmmanuel Vadot
64354d7675SEmmanuel VadotunevaluatedProperties: false
65354d7675SEmmanuel Vadot
66354d7675SEmmanuel Vadotexamples:
67354d7675SEmmanuel Vadot  - |
68354d7675SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
69354d7675SEmmanuel Vadot    #include <dt-bindings/clock/hi3660-clock.h>
70354d7675SEmmanuel Vadot    #include <dt-bindings/clock/hi3670-clock.h>
71354d7675SEmmanuel Vadot
72354d7675SEmmanuel Vadot    soc {
73354d7675SEmmanuel Vadot      #address-cells = <2>;
74354d7675SEmmanuel Vadot      #size-cells = <2>;
75354d7675SEmmanuel Vadot
76354d7675SEmmanuel Vadot      pcie@f4000000 {
77354d7675SEmmanuel Vadot        compatible = "hisilicon,kirin960-pcie";
78354d7675SEmmanuel Vadot        reg = <0x0 0xf4000000 0x0 0x1000>,
79354d7675SEmmanuel Vadot              <0x0 0xff3fe000 0x0 0x1000>,
80354d7675SEmmanuel Vadot              <0x0 0xf3f20000 0x0 0x40000>,
81354d7675SEmmanuel Vadot              <0x0 0xf5000000 0x0 0x2000>;
82354d7675SEmmanuel Vadot        reg-names = "dbi", "apb", "phy", "config";
83354d7675SEmmanuel Vadot        bus-range = <0x0  0xff>;
84354d7675SEmmanuel Vadot        #address-cells = <3>;
85354d7675SEmmanuel Vadot        #size-cells = <2>;
86354d7675SEmmanuel Vadot        device_type = "pci";
87354d7675SEmmanuel Vadot        ranges = <0x02000000 0x0 0x00000000
88354d7675SEmmanuel Vadot                  0x0 0xf6000000
89354d7675SEmmanuel Vadot                  0x0 0x02000000>;
90354d7675SEmmanuel Vadot        num-lanes = <1>;
91354d7675SEmmanuel Vadot        #interrupt-cells = <1>;
92354d7675SEmmanuel Vadot        interrupts = <0 283 4>;
93354d7675SEmmanuel Vadot        interrupt-names = "msi";
94354d7675SEmmanuel Vadot        interrupt-map-mask = <0xf800 0 0 7>;
95354d7675SEmmanuel Vadot        interrupt-map = <0x0 0 0 1 &gic GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>,
96354d7675SEmmanuel Vadot                        <0x0 0 0 2 &gic GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>,
97354d7675SEmmanuel Vadot                        <0x0 0 0 3 &gic GIC_SPI 284 IRQ_TYPE_LEVEL_HIGH>,
98354d7675SEmmanuel Vadot                        <0x0 0 0 4 &gic GIC_SPI 285 IRQ_TYPE_LEVEL_HIGH>;
99354d7675SEmmanuel Vadot        clocks = <&crg_ctrl HI3660_PCIEPHY_REF>,
100354d7675SEmmanuel Vadot                 <&crg_ctrl HI3660_CLK_GATE_PCIEAUX>,
101354d7675SEmmanuel Vadot                 <&crg_ctrl HI3660_PCLK_GATE_PCIE_PHY>,
102354d7675SEmmanuel Vadot                 <&crg_ctrl HI3660_PCLK_GATE_PCIE_SYS>,
103354d7675SEmmanuel Vadot                 <&crg_ctrl HI3660_ACLK_GATE_PCIE>;
104354d7675SEmmanuel Vadot        clock-names = "pcie_phy_ref", "pcie_aux", "pcie_apb_phy",
105354d7675SEmmanuel Vadot                      "pcie_apb_sys", "pcie_aclk";
106354d7675SEmmanuel Vadot      };
107354d7675SEmmanuel Vadot
108354d7675SEmmanuel Vadot      pcie@f5000000 {
109354d7675SEmmanuel Vadot        compatible = "hisilicon,kirin970-pcie";
110354d7675SEmmanuel Vadot        reg = <0x0 0xf4000000 0x0 0x1000000>,
111354d7675SEmmanuel Vadot              <0x0 0xfc180000 0x0 0x1000>,
112354d7675SEmmanuel Vadot              <0x0 0xf5000000 0x0 0x2000>;
113354d7675SEmmanuel Vadot        reg-names = "dbi", "apb", "config";
114354d7675SEmmanuel Vadot        bus-range = <0x0  0xff>;
115354d7675SEmmanuel Vadot        #address-cells = <3>;
116354d7675SEmmanuel Vadot        #size-cells = <2>;
117354d7675SEmmanuel Vadot        device_type = "pci";
118354d7675SEmmanuel Vadot        phys = <&pcie_phy>;
119354d7675SEmmanuel Vadot        ranges = <0x02000000 0x0 0x00000000
120354d7675SEmmanuel Vadot                  0x0 0xf6000000
121354d7675SEmmanuel Vadot                  0x0 0x02000000>;
122354d7675SEmmanuel Vadot        num-lanes = <1>;
123354d7675SEmmanuel Vadot        #interrupt-cells = <1>;
124354d7675SEmmanuel Vadot        interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>;
125354d7675SEmmanuel Vadot        interrupt-names = "msi";
126354d7675SEmmanuel Vadot        interrupt-map-mask = <0 0 0 7>;
127354d7675SEmmanuel Vadot        interrupt-map = <0x0 0 0 1 &gic GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>,
128354d7675SEmmanuel Vadot                        <0x0 0 0 2 &gic GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>,
129354d7675SEmmanuel Vadot                        <0x0 0 0 3 &gic GIC_SPI 284 IRQ_TYPE_LEVEL_HIGH>,
130354d7675SEmmanuel Vadot                        <0x0 0 0 4 &gic GIC_SPI 285 IRQ_TYPE_LEVEL_HIGH>;
131354d7675SEmmanuel Vadot        reset-gpios = <&gpio7 0 0>;
132354d7675SEmmanuel Vadot        hisilicon,clken-gpios = <&gpio27 3 0>, <&gpio17 0 0>, <&gpio20 6 0>;
133354d7675SEmmanuel Vadot        pcie@0,0 { // Lane 0: PCIe switch: Bus 1, Device 0
134354d7675SEmmanuel Vadot          reg = <0 0 0 0 0>;
135354d7675SEmmanuel Vadot          compatible = "pciclass,0604";
136354d7675SEmmanuel Vadot          device_type = "pci";
137354d7675SEmmanuel Vadot          #address-cells = <3>;
138354d7675SEmmanuel Vadot          #size-cells = <2>;
139354d7675SEmmanuel Vadot          ranges;
140354d7675SEmmanuel Vadot
141354d7675SEmmanuel Vadot          pcie@0,0 { // Lane 0: upstream
142354d7675SEmmanuel Vadot            reg = <0 0 0 0 0>;
143354d7675SEmmanuel Vadot            compatible = "pciclass,0604";
144354d7675SEmmanuel Vadot            device_type = "pci";
145354d7675SEmmanuel Vadot            #address-cells = <3>;
146354d7675SEmmanuel Vadot            #size-cells = <2>;
147354d7675SEmmanuel Vadot            ranges;
148354d7675SEmmanuel Vadot
149354d7675SEmmanuel Vadot            pcie@1,0 { // Lane 4: M.2
150354d7675SEmmanuel Vadot              reg = <0x0800 0 0 0 0>;
151354d7675SEmmanuel Vadot              compatible = "pciclass,0604";
152354d7675SEmmanuel Vadot              device_type = "pci";
153354d7675SEmmanuel Vadot              reset-gpios = <&gpio3 1 0>;
154354d7675SEmmanuel Vadot              #address-cells = <3>;
155354d7675SEmmanuel Vadot              #size-cells = <2>;
156354d7675SEmmanuel Vadot              ranges;
157354d7675SEmmanuel Vadot            };
158354d7675SEmmanuel Vadot
159354d7675SEmmanuel Vadot            pcie@5,0 { // Lane 5: Mini PCIe
160354d7675SEmmanuel Vadot              reg = <0x2800 0 0 0 0>;
161354d7675SEmmanuel Vadot              compatible = "pciclass,0604";
162354d7675SEmmanuel Vadot              device_type = "pci";
163354d7675SEmmanuel Vadot              reset-gpios = <&gpio27 4 0 >;
164354d7675SEmmanuel Vadot              #address-cells = <3>;
165354d7675SEmmanuel Vadot              #size-cells = <2>;
166354d7675SEmmanuel Vadot              ranges;
167354d7675SEmmanuel Vadot            };
168354d7675SEmmanuel Vadot
169354d7675SEmmanuel Vadot            pcie@7,0 { // Lane 6: Ethernet
170354d7675SEmmanuel Vadot              reg = <0x03800 0 0 0 0>;
171354d7675SEmmanuel Vadot              compatible = "pciclass,0604";
172354d7675SEmmanuel Vadot              device_type = "pci";
173354d7675SEmmanuel Vadot              reset-gpios = <&gpio25 2 0 >;
174354d7675SEmmanuel Vadot              #address-cells = <3>;
175354d7675SEmmanuel Vadot              #size-cells = <2>;
176354d7675SEmmanuel Vadot              ranges;
177354d7675SEmmanuel Vadot            };
178354d7675SEmmanuel Vadot          };
179354d7675SEmmanuel Vadot        };
180354d7675SEmmanuel Vadot      };
181354d7675SEmmanuel Vadot    };
182