Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: PCI: mediatek: Update the Device tree bindings

There are two independent PCIe controllers in MT2712 and MT7622
platform. Each of them should contain an independent MSI domain.

In old dts architecture, MSI domain will be inherited from the root
bridge, and all of the devices will share the same MSI domain.
Hence that, the PCIe devices will not work properly if the irq number
which required is more than 32.

Split the PCIe node for MT2712 and MT7622 platform to comply with
the hardware design and fix MSI issue.

Link: https://lore.kernel.org/r/20210823032800.1660-2-chuanjia.liu@mediatek.com
Signed-off-by: Chuanjia Liu <chuanjia.liu@mediatek.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Rob Herring <robh+dt@kernel.org>
Acked-by: Ryder Lee <ryder.lee@mediatek.com>

authored by

Chuanjia Liu and committed by
Lorenzo Pieralisi
aa6eca5b e73f0f0e

+150 -95
+39
Documentation/devicetree/bindings/pci/mediatek-pcie-cfg.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pci/mediatek-pcie-cfg.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MediaTek PCIECFG controller 8 + 9 + maintainers: 10 + - Chuanjia Liu <chuanjia.liu@mediatek.com> 11 + - Jianjun Wang <jianjun.wang@mediatek.com> 12 + 13 + description: | 14 + The MediaTek PCIECFG controller controls some feature about 15 + LTSSM, ASPM and so on. 16 + 17 + properties: 18 + compatible: 19 + items: 20 + - enum: 21 + - mediatek,generic-pciecfg 22 + - const: syscon 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + required: 28 + - compatible 29 + - reg 30 + 31 + additionalProperties: false 32 + 33 + examples: 34 + - | 35 + pciecfg: pciecfg@1a140000 { 36 + compatible = "mediatek,generic-pciecfg", "syscon"; 37 + reg = <0x1a140000 0x1000>; 38 + }; 39 + ...
+111 -95
Documentation/devicetree/bindings/pci/mediatek-pcie.txt
··· 8 8 "mediatek,mt7623-pcie" 9 9 "mediatek,mt7629-pcie" 10 10 - device_type: Must be "pci" 11 - - reg: Base addresses and lengths of the PCIe subsys and root ports. 11 + - reg: Base addresses and lengths of the root ports. 12 12 - reg-names: Names of the above areas to use during resource lookup. 13 13 - #address-cells: Address representation for root ports (must be 3) 14 14 - #size-cells: Size representation for root ports (must be 2) ··· 47 47 - reset-names: Must be "pcie-rst0", "pcie-rst1", "pcie-rstN".. based on the 48 48 number of root ports. 49 49 50 - Required properties for MT2712/MT7622: 50 + Required properties for MT2712/MT7622/MT7629: 51 51 -interrupts: A list of interrupt outputs of the controller, must have one 52 52 entry for each PCIe port 53 + - interrupt-names: Must include the following entries: 54 + - "pcie_irq": The interrupt that is asserted when an MSI/INTX is received 55 + - linux,pci-domain: PCI domain ID. Should be unique for each host controller 53 56 54 57 In addition, the device tree node must have sub-nodes describing each 55 58 PCIe port interface, having the following mandatory properties: ··· 146 143 147 144 Examples for MT2712: 148 145 149 - pcie: pcie@11700000 { 146 + pcie1: pcie@112ff000 { 150 147 compatible = "mediatek,mt2712-pcie"; 151 148 device_type = "pci"; 152 - reg = <0 0x11700000 0 0x1000>, 153 - <0 0x112ff000 0 0x1000>; 154 - reg-names = "port0", "port1"; 149 + reg = <0 0x112ff000 0 0x1000>; 150 + reg-names = "port1"; 151 + linux,pci-domain = <1>; 155 152 #address-cells = <3>; 156 153 #size-cells = <2>; 157 - interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>, 158 - <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; 159 - clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>, 160 - <&topckgen CLK_TOP_PE2_MAC_P1_SEL>, 161 - <&pericfg CLK_PERI_PCIE0>, 154 + interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; 155 + interrupt-names = "pcie_irq"; 156 + clocks = <&topckgen CLK_TOP_PE2_MAC_P1_SEL>, 162 157 <&pericfg CLK_PERI_PCIE1>; 163 - clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1"; 164 - phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>; 165 - phy-names = "pcie-phy0", "pcie-phy1"; 158 + clock-names = "sys_ck1", "ahb_ck1"; 159 + phys = <&u3port1 PHY_TYPE_PCIE>; 160 + phy-names = "pcie-phy1"; 166 161 bus-range = <0x00 0xff>; 167 - ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; 162 + ranges = <0x82000000 0 0x11400000 0x0 0x11400000 0 0x300000>; 163 + status = "disabled"; 168 164 169 - pcie0: pcie@0,0 { 170 - reg = <0x0000 0 0 0 0>; 171 - #address-cells = <3>; 172 - #size-cells = <2>; 165 + #interrupt-cells = <1>; 166 + interrupt-map-mask = <0 0 0 7>; 167 + interrupt-map = <0 0 0 1 &pcie_intc1 0>, 168 + <0 0 0 2 &pcie_intc1 1>, 169 + <0 0 0 3 &pcie_intc1 2>, 170 + <0 0 0 4 &pcie_intc1 3>; 171 + pcie_intc1: interrupt-controller { 172 + interrupt-controller; 173 + #address-cells = <0>; 173 174 #interrupt-cells = <1>; 174 - ranges; 175 - interrupt-map-mask = <0 0 0 7>; 176 - interrupt-map = <0 0 0 1 &pcie_intc0 0>, 177 - <0 0 0 2 &pcie_intc0 1>, 178 - <0 0 0 3 &pcie_intc0 2>, 179 - <0 0 0 4 &pcie_intc0 3>; 180 - pcie_intc0: interrupt-controller { 181 - interrupt-controller; 182 - #address-cells = <0>; 183 - #interrupt-cells = <1>; 184 - }; 185 175 }; 176 + }; 186 177 187 - pcie1: pcie@1,0 { 188 - reg = <0x0800 0 0 0 0>; 189 - #address-cells = <3>; 190 - #size-cells = <2>; 178 + pcie0: pcie@11700000 { 179 + compatible = "mediatek,mt2712-pcie"; 180 + device_type = "pci"; 181 + reg = <0 0x11700000 0 0x1000>; 182 + reg-names = "port0"; 183 + linux,pci-domain = <0>; 184 + #address-cells = <3>; 185 + #size-cells = <2>; 186 + interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>; 187 + interrupt-names = "pcie_irq"; 188 + clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>, 189 + <&pericfg CLK_PERI_PCIE0>; 190 + clock-names = "sys_ck0", "ahb_ck0"; 191 + phys = <&u3port0 PHY_TYPE_PCIE>; 192 + phy-names = "pcie-phy0"; 193 + bus-range = <0x00 0xff>; 194 + ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; 195 + status = "disabled"; 196 + 197 + #interrupt-cells = <1>; 198 + interrupt-map-mask = <0 0 0 7>; 199 + interrupt-map = <0 0 0 1 &pcie_intc0 0>, 200 + <0 0 0 2 &pcie_intc0 1>, 201 + <0 0 0 3 &pcie_intc0 2>, 202 + <0 0 0 4 &pcie_intc0 3>; 203 + pcie_intc0: interrupt-controller { 204 + interrupt-controller; 205 + #address-cells = <0>; 191 206 #interrupt-cells = <1>; 192 - ranges; 193 - interrupt-map-mask = <0 0 0 7>; 194 - interrupt-map = <0 0 0 1 &pcie_intc1 0>, 195 - <0 0 0 2 &pcie_intc1 1>, 196 - <0 0 0 3 &pcie_intc1 2>, 197 - <0 0 0 4 &pcie_intc1 3>; 198 - pcie_intc1: interrupt-controller { 199 - interrupt-controller; 200 - #address-cells = <0>; 201 - #interrupt-cells = <1>; 202 - }; 203 207 }; 204 208 }; 205 209 206 210 Examples for MT7622: 207 211 208 - pcie: pcie@1a140000 { 212 + pcie0: pcie@1a143000 { 209 213 compatible = "mediatek,mt7622-pcie"; 210 214 device_type = "pci"; 211 - reg = <0 0x1a140000 0 0x1000>, 212 - <0 0x1a143000 0 0x1000>, 213 - <0 0x1a145000 0 0x1000>; 214 - reg-names = "subsys", "port0", "port1"; 215 + reg = <0 0x1a143000 0 0x1000>; 216 + reg-names = "port0"; 217 + linux,pci-domain = <0>; 215 218 #address-cells = <3>; 216 219 #size-cells = <2>; 217 - interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_LOW>, 218 - <GIC_SPI 229 IRQ_TYPE_LEVEL_LOW>; 220 + interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_LOW>; 221 + interrupt-names = "pcie_irq"; 219 222 clocks = <&pciesys CLK_PCIE_P0_MAC_EN>, 220 - <&pciesys CLK_PCIE_P1_MAC_EN>, 221 223 <&pciesys CLK_PCIE_P0_AHB_EN>, 222 - <&pciesys CLK_PCIE_P1_AHB_EN>, 223 224 <&pciesys CLK_PCIE_P0_AUX_EN>, 224 - <&pciesys CLK_PCIE_P1_AUX_EN>, 225 225 <&pciesys CLK_PCIE_P0_AXI_EN>, 226 - <&pciesys CLK_PCIE_P1_AXI_EN>, 227 226 <&pciesys CLK_PCIE_P0_OBFF_EN>, 228 - <&pciesys CLK_PCIE_P1_OBFF_EN>, 229 - <&pciesys CLK_PCIE_P0_PIPE_EN>, 230 - <&pciesys CLK_PCIE_P1_PIPE_EN>; 231 - clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1", 232 - "aux_ck0", "aux_ck1", "axi_ck0", "axi_ck1", 233 - "obff_ck0", "obff_ck1", "pipe_ck0", "pipe_ck1"; 234 - phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>; 235 - phy-names = "pcie-phy0", "pcie-phy1"; 227 + <&pciesys CLK_PCIE_P0_PIPE_EN>; 228 + clock-names = "sys_ck0", "ahb_ck0", "aux_ck0", 229 + "axi_ck0", "obff_ck0", "pipe_ck0"; 230 + 236 231 power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; 237 232 bus-range = <0x00 0xff>; 238 - ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; 233 + ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x8000000>; 234 + status = "disabled"; 239 235 240 - pcie0: pcie@0,0 { 241 - reg = <0x0000 0 0 0 0>; 242 - #address-cells = <3>; 243 - #size-cells = <2>; 236 + #interrupt-cells = <1>; 237 + interrupt-map-mask = <0 0 0 7>; 238 + interrupt-map = <0 0 0 1 &pcie_intc0 0>, 239 + <0 0 0 2 &pcie_intc0 1>, 240 + <0 0 0 3 &pcie_intc0 2>, 241 + <0 0 0 4 &pcie_intc0 3>; 242 + pcie_intc0: interrupt-controller { 243 + interrupt-controller; 244 + #address-cells = <0>; 244 245 #interrupt-cells = <1>; 245 - ranges; 246 - interrupt-map-mask = <0 0 0 7>; 247 - interrupt-map = <0 0 0 1 &pcie_intc0 0>, 248 - <0 0 0 2 &pcie_intc0 1>, 249 - <0 0 0 3 &pcie_intc0 2>, 250 - <0 0 0 4 &pcie_intc0 3>; 251 - pcie_intc0: interrupt-controller { 252 - interrupt-controller; 253 - #address-cells = <0>; 254 - #interrupt-cells = <1>; 255 - }; 256 246 }; 247 + }; 257 248 258 - pcie1: pcie@1,0 { 259 - reg = <0x0800 0 0 0 0>; 260 - #address-cells = <3>; 261 - #size-cells = <2>; 249 + pcie1: pcie@1a145000 { 250 + compatible = "mediatek,mt7622-pcie"; 251 + device_type = "pci"; 252 + reg = <0 0x1a145000 0 0x1000>; 253 + reg-names = "port1"; 254 + linux,pci-domain = <1>; 255 + #address-cells = <3>; 256 + #size-cells = <2>; 257 + interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_LOW>; 258 + interrupt-names = "pcie_irq"; 259 + clocks = <&pciesys CLK_PCIE_P1_MAC_EN>, 260 + /* designer has connect RC1 with p0_ahb clock */ 261 + <&pciesys CLK_PCIE_P0_AHB_EN>, 262 + <&pciesys CLK_PCIE_P1_AUX_EN>, 263 + <&pciesys CLK_PCIE_P1_AXI_EN>, 264 + <&pciesys CLK_PCIE_P1_OBFF_EN>, 265 + <&pciesys CLK_PCIE_P1_PIPE_EN>; 266 + clock-names = "sys_ck1", "ahb_ck1", "aux_ck1", 267 + "axi_ck1", "obff_ck1", "pipe_ck1"; 268 + 269 + power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; 270 + bus-range = <0x00 0xff>; 271 + ranges = <0x82000000 0 0x28000000 0x0 0x28000000 0 0x8000000>; 272 + status = "disabled"; 273 + 274 + #interrupt-cells = <1>; 275 + interrupt-map-mask = <0 0 0 7>; 276 + interrupt-map = <0 0 0 1 &pcie_intc1 0>, 277 + <0 0 0 2 &pcie_intc1 1>, 278 + <0 0 0 3 &pcie_intc1 2>, 279 + <0 0 0 4 &pcie_intc1 3>; 280 + pcie_intc1: interrupt-controller { 281 + interrupt-controller; 282 + #address-cells = <0>; 262 283 #interrupt-cells = <1>; 263 - ranges; 264 - interrupt-map-mask = <0 0 0 7>; 265 - interrupt-map = <0 0 0 1 &pcie_intc1 0>, 266 - <0 0 0 2 &pcie_intc1 1>, 267 - <0 0 0 3 &pcie_intc1 2>, 268 - <0 0 0 4 &pcie_intc1 3>; 269 - pcie_intc1: interrupt-controller { 270 - interrupt-controller; 271 - #address-cells = <0>; 272 - #interrupt-cells = <1>; 273 - }; 274 284 }; 275 285 };