Hi All, This patch series adds support for PCIe EP on Renesas R-Car Gen3 and RZ/G2x platforms. * Required EP framework changes and fixes are ported as well. * All the patches have been cheery picked from upstream kernel. * Patches [43, 44, 45, 46, 48]/50 are picked from linux-next. * I was skeptic with patch 36/50 "Rename pcie-rcar.c to pcie-rcar-host.c" this is required as patch 38/50 adds a new file named pcie-rcar.c. Open for suggestions if this can be handled differently. * In patch 37/48 I have dropped the changes for host driver as the patch doesn't apply cleanly and manually applying it was resulting in a big diff. * As the changes touches three other controller drivers I have build tested them as done similarly while upstreaming R-Car Gen3 PCIe EP driver. * Since the changes are huge I am sending the patches as RFC. Cheers, Prabhakar Alan Mikhak (5): PCI: endpoint: Set endpoint controller pointer to NULL PCI: endpoint: Allocate enough space for fixed size BAR PCI: endpoint: Skip odd BAR when skipping 64bit BAR PCI: endpoint: Clear BAR before freeing its space PCI: endpoint: Cast the page number to phys_addr_t Hewenliang (1): tools: PCI: Fix fd leakage Jean-Jacques Hiblot (1): tools: PCI: Exit with error code when test fails Kangjie Lu (1): PCI: endpoint: Fix a potential NULL pointer dereference Kishon Vijay Abraham I (23): PCI: endpoint: Add new pci_epc_ops to get EPC features PCI: dwc: Add ->get_features() callback function to dw_pcie_ep_ops PCI: designware-plat: Populate ->get_features() dw_pcie_ep_ops PCI: pci-dra7xx: Populate ->get_features() dw_pcie_ep_ops PCI: rockchip: Populate ->get_features() dw_pcie_ep_ops PCI: cadence: Populate ->get_features() cdns_pcie_epc_ops PCI: endpoint: Add helper to get first unreserved BAR PCI: endpoint: Fix pci_epf_alloc_space() to set correct MEM TYPE flags PCI: pci-epf-test: Remove setting epf_bar flags in function driver PCI: pci-epf-test: Do not allocate next BARs memory if current BAR is 64Bit PCI: pci-epf-test: Use pci_epc_get_features() to get EPC features PCI: cadence: Remove pci_epf_linkup() from Cadence EP driver PCI: rockchip: Remove pci_epf_linkup() from Rockchip EP driver PCI: designware-plat: Remove setting epc->features in Designware plat EP driver PCI: endpoint: Remove features member in struct pci_epc PCI: endpoint: Add support to specify alignment for buffers allocated to BARs PCI: endpoint: Use notification chain mechanism to notify EPC events to EPF PCI: endpoint: Replace spinlock with mutex PCI: endpoint: Protect concurrent access to pci_epf_ops with mutex PCI: endpoint: Assign function number for each PF in EPC core PCI: endpoint: Fix ->set_msix() to take BIR and offset as arguments PCI: dwc: Fix dw_pcie_ep_raise_msix_irq() to get correct MSI-X table address PCI: endpoint: functions/pci-epf-test: Print throughput information Kunihiko Hayashi (1): PCI: endpoint: Fix clearing start entry in configfs Lad Prabhakar (15): PCI: endpoint: Pass page size as argument to pci_epc_mem_init() PCI: endpoint: Add support to handle multiple base for mapping outbound memory PCI: rcar: Rename pcie-rcar.c to pcie-rcar-host.c arm64: defconfig: Enable CONFIG_PCIE_RCAR_HOST PCI: rcar: Move shareable code to a common file PCI: rcar: Fix calculating mask for PCIEPAMR register dt-bindings: PCI: rcar: Add bindings for R-Car PCIe endpoint controller PCI: rcar: Add endpoint mode support arm64: defconfig: Enable R-Car PCIe endpoint driver dt-bindings: pci: rcar-pci-ep: Document r8a774a1 and r8a774b1 arm64: dts: renesas: r8a774c0: Add PCIe EP node arm64: dts: renesas: r8a774a1: Add PCIe EP nodes arm64: dts: renesas: r8a774b1: Add PCIe EP nodes misc: pci_endpoint_test: Add Device ID for RZ/G2E PCIe controller misc: pci_endpoint_test: Add Device ID for RZ/G2M and RZ/G2N PCIe controllers Vidya Sagar (3): PCI: endpoint: Add core init notifying feature PCI: endpoint: Add notification for core init completion PCI: pci-epf-test: Add support to defer core initialization .../devicetree/bindings/pci/rcar-pci-ep.yaml | 80 ++ arch/arm64/boot/dts/renesas/r8a774a1.dtsi | 38 + arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 38 + arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 19 + arch/arm64/configs/defconfig | 7 +- drivers/misc/pci_endpoint_test.c | 7 + drivers/pci/controller/Kconfig | 18 + drivers/pci/controller/Makefile | 3 +- drivers/pci/controller/dwc/pci-dra7xx.c | 13 + .../pci/controller/dwc/pcie-designware-ep.c | 39 +- .../pci/controller/dwc/pcie-designware-plat.c | 17 +- drivers/pci/controller/dwc/pcie-designware.h | 1 + drivers/pci/controller/pcie-cadence-ep.c | 27 +- drivers/pci/controller/pcie-rcar-ep.c | 563 ++++++++ drivers/pci/controller/pcie-rcar-host.c | 1264 +++++++++++++++++ drivers/pci/controller/pcie-rcar.c | 1224 +--------------- drivers/pci/controller/pcie-rcar.h | 140 ++ drivers/pci/controller/pcie-rockchip-ep.c | 18 +- drivers/pci/endpoint/functions/pci-epf-test.c | 295 +++- drivers/pci/endpoint/pci-ep-cfs.c | 28 +- drivers/pci/endpoint/pci-epc-core.c | 187 ++- drivers/pci/endpoint/pci-epc-mem.c | 204 ++- drivers/pci/endpoint/pci-epf-core.c | 49 +- include/linux/pci-epc.h | 95 +- include/linux/pci-epf.h | 32 +- tools/pci/pcitest.c | 5 +- 26 files changed, 2919 insertions(+), 1492 deletions(-) create mode 100644 Documentation/devicetree/bindings/pci/rcar-pci-ep.yaml create mode 100644 drivers/pci/controller/pcie-rcar-ep.c create mode 100644 drivers/pci/controller/pcie-rcar-host.c create mode 100644 drivers/pci/controller/pcie-rcar.h -- 2.17.1