Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2650158ybz; Sun, 19 Apr 2020 06:28:44 -0700 (PDT) X-Google-Smtp-Source: APiQypLnOuNGu62ia7n08MGpR09wUHSI+8uu9aJEJyINo7X+WzDORUw9M6nL1F7OyI7CPeBD+IdB X-Received: by 2002:a05:6402:1b91:: with SMTP id cc17mr1675918edb.46.1587302923968; Sun, 19 Apr 2020 06:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587302923; cv=none; d=google.com; s=arc-20160816; b=NL3mkPQv4nFPZagU/CWGWIxqOKYuu7tOG6siyZQgFkYie7Inw21GVuLwRkyeeHj8mG d5JKfntY+nm7Vo9Ror1VXy0UkZy0DLR+1s6fYTa4XEJPM8TqrEM5tfARLXKpkY4WA8Nc g2oY1v5dA1vXowA1K5N5/Z6Xucu0XEdEyR+FSq8IuLcTXKgbf7gYguMw7BZNWQJXJYAS b93D0OX8PA5DH3R65kQV7LT6v7Q8xLaKf9o1/b06MICokfbt//VmI+hLfOf2K8KGNKb2 zYTf/9f7v5PTfKFOzu0CfjunYOzh0gDmvg3paJ4zN4Q+KMsRt/MKsXEbriPVe77zew8w hjXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=WcCDCW73IshaCuBWdCv1Ox2uhWFqYdx5hZXNQlvYAFU=; b=bSUuIyT/zYfttApn/1+y73SAW3NAICYK3c1f+GgcUcLFVe8e5c/XxCw7FnavtzafhY etm6FIPK++X8yjQrnnJ0zofG7VR0I1UJaAtV+dr3zU8CbNjhEq86vYOYgEjuakDC5sA2 jWnXAQQPBMiXYjiJmLNRBaPxpFQQMh9RhhDDAJge3YSgG7FVf5U3Q/J9pxZuu4FrMKgD g/QEgk6TXvzTK3siKWY3RCmurOT6+lqkFxN7KB62vqK1XwQMFtbO35+P+3RHv7Io1l3J b1LyjyGOCWb6KFqLBpXtGawLVDbIpcB/9cTRDVQBJ4xAVNY8+cKDek4UE7DeLKcwK4Rp SLjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de14si5685071edb.283.2020.04.19.06.28.20; Sun, 19 Apr 2020 06:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726112AbgDSN1S (ORCPT + 99 others); Sun, 19 Apr 2020 09:27:18 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:12666 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725793AbgDSN1R (ORCPT ); Sun, 19 Apr 2020 09:27:17 -0400 X-IronPort-AV: E=Sophos;i="5.72,403,1580742000"; d="scan'208";a="44894763" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 19 Apr 2020 22:27:15 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B93BD422C025; Sun, 19 Apr 2020 22:27:10 +0900 (JST) From: Lad Prabhakar To: Yoshihiro Shimoda , Kishon Vijay Abraham I , Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Andrew Murray , Tom Joseph , Jingoo Han , Gustavo Pimentel , Marek Vasut , Shawn Lin , Heiko Stuebner Cc: Geert Uytterhoeven , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Lad Prabhakar , Lad Prabhakar Subject: [PATCH v8 0/8] Add support for PCIe controller to work in endpoint mode on R-Car/RZ/G2x SoCs Date: Sun, 19 Apr 2020 14:26:55 +0100 Message-Id: <1587302823-4435-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, This patch series adds support for PCIe controller on R-Car/RZ-G2x to work in endpoint mode, this also extends the epf framework to handle base region for mapping PCI address locally. Note: The cadence/rockchip/designware endpoint drivers are build tested only. Changes for v8: * Dropped adding R8A774C0 (0x002d) pci-id in pci_ids.h * Fixed typo in commit message for patch 2/8 * Reworded commit message for patch 5/8 as suggested by Bjorn * Split up patch to add pci_epc_mem_init() interface to add page_size argument as suggested by Bjorn. Changes for v7: * Fixed review comments pointed by Shimoda-san 1] Made DT bindings dual licensed, added Shimoda-san as maintainer and fixed the example as its built with #{address,size}-cells = <1>. I have still restored the Ack from Rob and Shimoda-san with these changes. 2] Split up the patches so that they can be picked up by respective subsystem patches 1/4-9/11 are now part of this series. 3] Dropped altering a comment in pci-epc.h 4] Used a local variable align_size in pci_epc_mem_alloc_addr() so that size variable doesn't get overwritten in the loop. 5] Replaced i-=1 with i-- 6] Replaced rcar with R-Car in patch subject and description. 7] Set MACCTLR in init() callback Changes for v6: 1] Rebased patches on endpoint branch of https://git.kernel.org/pub/ scm/linux/kernel/git/lpieralisi/pci.git/ 2] Fixed review comments from Shimoda-san a] Made sure defconfig changes were in separate patch b] Created rcar_pcie_host/rcar_pcie_ep structures c] Added pci-id for R8A774C0 d] Added entry in MAINTAINERS for dt-binding e] Dropped unnecessary braces 3] Added support for msi. Changes for v5: 1] Rebased patches on next branch of https://git.kernel.org/pub/scm/ linux/kernel/git/helgaas/pci.git 2] Fixed review comments reported by Kishon while fetching the matching window in function pci_epc_get_matching_window() 3] Fixed review comments reported by Bjorn a] Split patch up first patch so that its easier to review and incremental b] Fixed typos 4] Included Reviewed tag from Rob for the dt-binding patch 5] Fixed issue reported by Nathan for assigning variable to itself Changes for v4: 1] Fixed dtb_check error reported by Rob 2] Fixed review comments reported by Kishon a] Dropped pci_epc_find_best_fit_window() b] Fixed initializing mem ptr in __pci_epc_mem_init() c] Dropped map_size from pci_epc_mem_window structure Changes for v3: 1] Fixed review comments from Bjorn and Kishon. 3] Converted to DT schema Changes for v2: 1] Fixed review comments from Biju for dt-bindings to include an example for a tested platform. 2] Fixed review comments from Kishon to extend the features of outbound regions in epf framework. 3] Added support to parse outbound-ranges in OF. Lad Prabhakar (8): PCI: rcar: Rename pcie-rcar.c to pcie-rcar-host.c PCI: rcar: Move shareable code to a common file PCI: rcar: Fix calculating mask for PCIEPAMR register PCI: endpoint: Pass page size as argument to pci_epc_mem_init() PCI: endpoint: Add support to handle multiple base for mapping outbound memory dt-bindings: PCI: rcar: Add bindings for R-Car PCIe endpoint controller PCI: rcar: Add endpoint mode support MAINTAINERS: Add file patterns for rcar PCI device tree bindings .../devicetree/bindings/pci/rcar-pci-ep.yaml | 77 ++ MAINTAINERS | 1 + drivers/pci/controller/Kconfig | 18 + drivers/pci/controller/Makefile | 3 +- .../pci/controller/cadence/pcie-cadence-ep.c | 2 +- .../pci/controller/dwc/pcie-designware-ep.c | 16 +- drivers/pci/controller/pcie-rcar-ep.c | 555 ++++++++ drivers/pci/controller/pcie-rcar-host.c | 1065 +++++++++++++++ drivers/pci/controller/pcie-rcar.c | 1206 +---------------- drivers/pci/controller/pcie-rcar.h | 140 ++ drivers/pci/controller/pcie-rockchip-ep.c | 2 +- drivers/pci/endpoint/pci-epc-mem.c | 201 ++- include/linux/pci-epc.h | 38 +- 13 files changed, 2073 insertions(+), 1251 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