18c2ecf20Sopenharmony_ci* Broadcom iProc PCIe controller with the platform bus interface
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciRequired properties:
48c2ecf20Sopenharmony_ci- compatible:
58c2ecf20Sopenharmony_ci      "brcm,iproc-pcie" for the first generation of PAXB based controller,
68c2ecf20Sopenharmony_ciused in SoCs including NSP, Cygnus, NS2, and Pegasus
78c2ecf20Sopenharmony_ci      "brcm,iproc-pcie-paxb-v2" for the second generation of PAXB-based
88c2ecf20Sopenharmony_cicontrollers, used in Stingray
98c2ecf20Sopenharmony_ci      "brcm,iproc-pcie-paxc" for the first generation of PAXC based
108c2ecf20Sopenharmony_cicontroller, used in NS2
118c2ecf20Sopenharmony_ci      "brcm,iproc-pcie-paxc-v2" for the second generation of PAXC based
128c2ecf20Sopenharmony_cicontroller, used in Stingray
138c2ecf20Sopenharmony_ci  PAXB-based root complex is used for external endpoint devices. PAXC-based
148c2ecf20Sopenharmony_ciroot complex is connected to emulated endpoint devices internal to the ASIC
158c2ecf20Sopenharmony_ci- reg: base address and length of the PCIe controller I/O register space
168c2ecf20Sopenharmony_ci- #interrupt-cells: set to <1>
178c2ecf20Sopenharmony_ci- interrupt-map-mask and interrupt-map, standard PCI properties to define the
188c2ecf20Sopenharmony_ci  mapping of the PCIe interface to interrupt numbers
198c2ecf20Sopenharmony_ci- linux,pci-domain: PCI domain ID. Should be unique for each host controller
208c2ecf20Sopenharmony_ci- bus-range: PCI bus numbers covered
218c2ecf20Sopenharmony_ci- #address-cells: set to <3>
228c2ecf20Sopenharmony_ci- #size-cells: set to <2>
238c2ecf20Sopenharmony_ci- device_type: set to "pci"
248c2ecf20Sopenharmony_ci- ranges: ranges for the PCI memory and I/O regions
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciOptional properties:
278c2ecf20Sopenharmony_ci- phys: phandle of the PCIe PHY device
288c2ecf20Sopenharmony_ci- phy-names: must be "pcie-phy"
298c2ecf20Sopenharmony_ci- dma-coherent: present if DMA operations are coherent
308c2ecf20Sopenharmony_ci- dma-ranges: Some PAXB-based root complexes do not have inbound mapping done
318c2ecf20Sopenharmony_ci  by the ASIC after power on reset.  In this case, SW is required to configure
328c2ecf20Sopenharmony_cithe mapping, based on inbound memory regions specified by this property.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci- brcm,pcie-ob: Some iProc SoCs do not have the outbound address mapping done
358c2ecf20Sopenharmony_ciby the ASIC after power on reset. In this case, SW needs to configure it
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciIf the brcm,pcie-ob property is present, the following properties become
388c2ecf20Sopenharmony_cieffective:
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciRequired:
418c2ecf20Sopenharmony_ci- brcm,pcie-ob-axi-offset: The offset from the AXI address to the internal
428c2ecf20Sopenharmony_ciaddress used by the iProc PCIe core (not the PCIe address)
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ciMSI support (optional):
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ciFor older platforms without MSI integrated in the GIC, iProc PCIe core provides
478c2ecf20Sopenharmony_cian event queue based MSI support.  The iProc MSI uses host memories to store
488c2ecf20Sopenharmony_ciMSI posted writes in the event queues
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ciOn newer iProc platforms, gicv2m or gicv3-its based MSI support should be used
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci- msi-map: Maps a Requester ID to an MSI controller and associated MSI
538c2ecf20Sopenharmony_cisideband data
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci- msi-parent: Link to the device node of the MSI controller, used when no MSI
568c2ecf20Sopenharmony_cisideband data is passed between the iProc PCIe controller and the MSI
578c2ecf20Sopenharmony_cicontroller
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ciRefer to the following binding documents for more detailed description on
608c2ecf20Sopenharmony_cithe use of 'msi-map' and 'msi-parent':
618c2ecf20Sopenharmony_ci  Documentation/devicetree/bindings/pci/pci-msi.txt
628c2ecf20Sopenharmony_ci  Documentation/devicetree/bindings/interrupt-controller/msi.txt
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ciWhen the iProc event queue based MSI is used, one needs to define the
658c2ecf20Sopenharmony_cifollowing properties in the MSI device node:
668c2ecf20Sopenharmony_ci- compatible: Must be "brcm,iproc-msi"
678c2ecf20Sopenharmony_ci- msi-controller: claims itself as an MSI controller
688c2ecf20Sopenharmony_ci- interrupts: List of interrupt IDs from its parent interrupt device
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ciOptional properties:
718c2ecf20Sopenharmony_ci- brcm,pcie-msi-inten: Needs to be present for some older iProc platforms that
728c2ecf20Sopenharmony_cirequire the interrupt enable registers to be set explicitly to enable MSI
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ciExample:
758c2ecf20Sopenharmony_ci	pcie0: pcie@18012000 {
768c2ecf20Sopenharmony_ci		compatible = "brcm,iproc-pcie";
778c2ecf20Sopenharmony_ci		reg = <0x18012000 0x1000>;
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci		#interrupt-cells = <1>;
808c2ecf20Sopenharmony_ci		interrupt-map-mask = <0 0 0 0>;
818c2ecf20Sopenharmony_ci		interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_NONE>;
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci		linux,pci-domain = <0>;
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci		bus-range = <0x00 0xff>;
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci		#address-cells = <3>;
888c2ecf20Sopenharmony_ci		#size-cells = <2>;
898c2ecf20Sopenharmony_ci		device_type = "pci";
908c2ecf20Sopenharmony_ci		ranges = <0x81000000 0 0	  0x28000000 0 0x00010000
918c2ecf20Sopenharmony_ci			  0x82000000 0 0x20000000 0x20000000 0 0x04000000>;
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci		phys = <&phy 0 5>;
948c2ecf20Sopenharmony_ci		phy-names = "pcie-phy";
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci		brcm,pcie-ob;
978c2ecf20Sopenharmony_ci		brcm,pcie-ob-axi-offset = <0x00000000>;
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci		msi-parent = <&msi0>;
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci		/* iProc event queue based MSI */
1028c2ecf20Sopenharmony_ci		msi0: msi@18012000 {
1038c2ecf20Sopenharmony_ci			compatible = "brcm,iproc-msi";
1048c2ecf20Sopenharmony_ci			msi-controller;
1058c2ecf20Sopenharmony_ci			interrupt-parent = <&gic>;
1068c2ecf20Sopenharmony_ci			interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>,
1078c2ecf20Sopenharmony_ci				     <GIC_SPI 97 IRQ_TYPE_NONE>,
1088c2ecf20Sopenharmony_ci				     <GIC_SPI 98 IRQ_TYPE_NONE>,
1098c2ecf20Sopenharmony_ci				     <GIC_SPI 99 IRQ_TYPE_NONE>,
1108c2ecf20Sopenharmony_ci		};
1118c2ecf20Sopenharmony_ci	};
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci	pcie1: pcie@18013000 {
1148c2ecf20Sopenharmony_ci		compatible = "brcm,iproc-pcie";
1158c2ecf20Sopenharmony_ci		reg = <0x18013000 0x1000>;
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci		#interrupt-cells = <1>;
1188c2ecf20Sopenharmony_ci		interrupt-map-mask = <0 0 0 0>;
1198c2ecf20Sopenharmony_ci		interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_NONE>;
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci		linux,pci-domain = <1>;
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci		bus-range = <0x00 0xff>;
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci		#address-cells = <3>;
1268c2ecf20Sopenharmony_ci		#size-cells = <2>;
1278c2ecf20Sopenharmony_ci		device_type = "pci";
1288c2ecf20Sopenharmony_ci		ranges = <0x81000000 0 0	  0x48000000 0 0x00010000
1298c2ecf20Sopenharmony_ci			  0x82000000 0 0x40000000 0x40000000 0 0x04000000>;
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci		phys = <&phy 1 6>;
1328c2ecf20Sopenharmony_ci		phy-names = "pcie-phy";
1338c2ecf20Sopenharmony_ci	};
134