Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1007049ybx; Wed, 6 Nov 2019 11:40:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwIrNxmPvjkH3IQQ2Kf/Qja9llmGCHZsTzaM6rrvspFRNQ7Rd2aziKo+PhbKHjzccFOv8KU X-Received: by 2002:a17:907:2122:: with SMTP id qo2mr25250890ejb.12.1573069217831; Wed, 06 Nov 2019 11:40:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573069217; cv=none; d=google.com; s=arc-20160816; b=L292xyP+2wTEwZJkWPBke+156V3ppnwWEBcTdbIi/aCAThacrVhnkcYmX51pTe68KU fNyAF+nWUv4fR3ldK19zZxMhJq4OYNZXLY5hshN9ansZgA3iU0G7RzrwSjVp3U/rZNta TWPGN3heSat5PHld++BntfGEjHrrugj2rGJlp1pXMAPqYPndOcWR85IncoB4UMdvJxxi aQCA6I+WG3+VJnAQjLB6c0KGbznFunsEf5Ce+45U4rhr7RhB2l8QN0x8FaWh7s5wqwNm uMuMbWIhXXfQAG1+sWeOyndZGcn5qflMmn5ifrO81Ww0grzL2qP612/EzR4ns5ho7Kdv rk5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WZ6A0u9VmEvIT2gJ+ANYj5GDOWs+Sp/CGhdOzWgLIBw=; b=aKiDNz4+hvQo5NiQ0OP4IO84rO/ORL2fDSpwpLGab8QE7FxrbdcvL6Ibg41VQ6sYwm WSohZlGXqBetxc6bpnH9br56dcPmlyzFbTh+yCKzKr/L11gQq4q/N3w/9uP+qAfyAhys hIJV+okejHx0FNvu6kWlp5B/cPS8HeUSF8pwLUF+oZXTCI943bQ02aZMdRBScRHM+ku5 WR8KH6XYu7fF0zipOWEiN6PJTZn/AL+qQBYDSB7hrb3eJRNwZE3brpuLWS8tLdbnJqoN Vxv/qvPsLLkrEmhNGRJJYfK7SZoJaB5RusYvhA2gdGdP+2K8betNr1g4izQXk56xkMOc T+Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VQOR9XFk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18si16399646ejo.78.2019.11.06.11.39.53; Wed, 06 Nov 2019 11:40:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VQOR9XFk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731977AbfKFTga (ORCPT + 99 others); Wed, 6 Nov 2019 14:36:30 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36004 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbfKFTga (ORCPT ); Wed, 6 Nov 2019 14:36:30 -0500 Received: by mail-wr1-f68.google.com with SMTP id r10so694429wrx.3; Wed, 06 Nov 2019 11:36:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WZ6A0u9VmEvIT2gJ+ANYj5GDOWs+Sp/CGhdOzWgLIBw=; b=VQOR9XFkF8hzle1zZL3VAmZJDpl3K8c+jey857IVovrFUFF1ZhuV9CjTF2nBrIInwk 3bVlfw+gMxMQZKPLDq+BDw/OrnpkKBmIG+KSYsb3K72SApeUA/QBwWU9kd9RsivWGXKE EpxQQjDrrsXXfqPT+BmeSCale7/ciRoWA4XnzLdz6ypBJQwhv9nNDMKedlU62lTLGae+ ISK864iEH/Dq413wdgMMChtxCja6Stncx990/jFAag/E8wggtonMTKZLdB0QSPUiuyJp kOjwuVnHoziVTs/JT/6hiAf3stbEy02IKu3PgWysPzXGZ2qtvJhLxmrYx8Sr0sjtuPD6 vthg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WZ6A0u9VmEvIT2gJ+ANYj5GDOWs+Sp/CGhdOzWgLIBw=; b=sMeF8dWrXTozPaZ4ihmNLmkngaNxMYdpci9Q3IVSQbNpZ4P96JtyU4268aJQyU+zG4 LA78jKuLUgBEifEI8StSehgu03n2nxvv2UudmfqiqKHSnrKUUjCI7e1z5tZ8qdZgpDxj FYwZKIaJ677Rp64iJ09YA5JecNOeX2rpABhhJ8CYoaWkEXH0Kc8vZA7u22i9gpsBVLU5 ktM55qjsvt8nSf/Nq57uVY3/Y9RjM81O9eeKRWE9YiLVi9PuUjto2aKZaO+mlooJjRHM 6AcoaOwFnjGBh0VtDpWVDHxWkaYsalpc85I3wAOcR/xIHVZKEgoUP1cX4pVAYBLEHRRN xPgQ== X-Gm-Message-State: APjAAAVvT26B5GSbEAFRfSsS3o78ZJw0aaMusB/yZVZd4NmkdNqkiIWe VOljOno0Te55Hd4JtM5ehJg= X-Received: by 2002:a5d:4885:: with SMTP id g5mr4588945wrq.287.1573068987422; Wed, 06 Nov 2019 11:36:27 -0800 (PST) Received: from prasmi.home ([2a00:23c6:d18:6d00:1d3d:daa8:4e74:8240]) by smtp.gmail.com with ESMTPSA id 76sm4311737wma.0.2019.11.06.11.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 11:36:26 -0800 (PST) From: Lad Prabhakar X-Google-Original-From: Lad Prabhakar To: Bjorn Helgaas , Rob Herring , Mark Rutland , Geert Uytterhoeven , Magnus Damm , Kishon Vijay Abraham I , Marek Vasut , Yoshihiro Shimoda , linux-pci@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Lorenzo Pieralisi , Arnd Bergmann , Greg Kroah-Hartman , Andrew Murray , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , "Lad, Prabhakar" Subject: [PATCH 0/5] Add support for PCIe controller to work in endpoint mode on R-Car SoCs. Date: Wed, 6 Nov 2019 19:36:04 +0000 Message-Id: <20191106193609.19645-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Lad, Prabhakar" This patch series adds support for PCIe controller on rcar to work in endpoint mode, this also extends the epf framework to handle multiple outbound regions. Note: The cadence/rockchip/designware endpoint drivers are build tested only. Endpoint configuration: $ cd /sys/kernel/config/pci_ep $ mkdir functions/pci_epf_test/func1 $ echo 0x1912 > functions/pci_epf_test/func1/vendorid $ echo 0x002d > functions/pci_epf_test/func1/deviceid $ echo 32 > functions/pci_epf_test/func1/msi_interrupts $ ln -s functions/pci_epf_test/func1/ controllers/fe000000.pcie_ep/ $ echo 1 > controllers/fe000000.pcie_ep/start Host side results: lspci output: 01:00.0 Unassigned class [ff00]: Renesas Technology Corp. Device 002d Flags: bus master, fast devsel, latency 0, IRQ 103 Memory at fe200200 (64-bit, non-prefetchable) [size=128] Memory at fe200000 (64-bit, non-prefetchable) [size=256] Memory at fe200100 (64-bit, non-prefetchable) [size=256] Capabilities: [40] Power Management version 3 Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+ Capabilities: [70] Express Endpoint, MSI 00 Capabilities: [100] Virtual Channel Kernel driver in use: pci-endpoint-test pcitest results: BAR tests BAR0: OKAY BAR1: NOT OKAY BAR2: OKAY BAR3: NOT OKAY BAR4: OKAY BAR5: NOT OKAY Interrupt tests SET IRQ TYPE TO LEGACY: OKAY LEGACY IRQ: OKAY Read Tests SET IRQ TYPE TO LEGACY: OKAY READ ( 1 bytes): OKAY READ ( 1024 bytes): OKAY READ ( 1025 bytes): OKAY READ (1024000 bytes): OKAY READ (1024001 bytes): OKAY Write Tests WRITE ( 1 bytes): OKAY WRITE ( 1024 bytes): OKAY WRITE ( 1025 bytes): OKAY WRITE (1024000 bytes): OKAY WRITE (1024001 bytes): OKAY Copy Tests COPY ( 1 bytes): OKAY COPY ( 1024 bytes): OKAY COPY ( 1025 bytes): OKAY COPY (1024000 bytes): OKAY COPY (1024001 bytes): OKAY BAR tests for 1/3/5 fail because its configured to use 64bit bars Lad, Prabhakar (5): pci: pcie-rcar: preparation for adding endpoint support pci: endpoint: add support to handle multiple base for mapping outbound memory PCI: rcar: Add R-Car PCIe endpoint device tree bindings pci: rcar: add support for rcar pcie controller in endpoint mode misc: pci_endpoint_test: add device-id for RZ/G2 pcie controller .../devicetree/bindings/pci/rcar-pci-ep.txt | 43 + arch/arm64/configs/defconfig | 2 +- arch/arm64/configs/renesas_defconfig | 2 +- drivers/misc/pci_endpoint_test.c | 3 + drivers/pci/controller/Kconfig | 11 +- drivers/pci/controller/Makefile | 3 +- .../pci/controller/dwc/pcie-designware-ep.c | 30 +- drivers/pci/controller/pcie-cadence-ep.c | 11 +- drivers/pci/controller/pcie-rcar-ep.c | 483 +++++++ drivers/pci/controller/pcie-rcar-host.c | 1058 ++++++++++++++ drivers/pci/controller/pcie-rcar.c | 1231 +---------------- drivers/pci/controller/pcie-rcar.h | 129 ++ drivers/pci/controller/pcie-rockchip-ep.c | 13 +- drivers/pci/endpoint/functions/pci-epf-test.c | 29 +- drivers/pci/endpoint/pci-epc-core.c | 7 +- drivers/pci/endpoint/pci-epc-mem.c | 189 ++- include/linux/pci-epc.h | 43 +- 17 files changed, 2016 insertions(+), 1271 deletions(-) create mode 100644 Documentation/devicetree/bindings/pci/rcar-pci-ep.txt 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.20.1