From patchwork Fri Sep 21 10:21:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 973067 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HYRF0Hl2"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="UJCT09uV"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42GqSt4Kvdz9sCR for ; Fri, 21 Sep 2018 20:23:58 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/k6C93nSHIsCUtUc7NRNorDY7pFbimYVT5EVyyUUpgw=; b=HYRF0Hl2JI9Sw9 Fxu8ytYXjEN/rNE3HfVZ1AWS69QJ0cy6epLZrBl1ddyY2ByBYGANb0e89fOch5KTJKozj9aU16E51 8KgStp5hY0U/d3Z1OwIhFLVsRbllKNXT+MxGhtqImgDFA+mXnKMpkwuh/PSFVeGJ+cQKkQxTq55tb EV7AzcvYclcC6MNd4Vr0vhUVZDODCqzrpcRoWliBljRWGI0nOLW/J5m9BzlbfIj6LpzM+iZ4cLgcJ it+0LosWVADweX4LalLVKRYUsfvCcZrqc6s+dAxmDLZceZ3I3cyt1a7xXXpQTnvPpUiQQj6gBQhDl 2+JCmIVIxef4h+meCQsQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3Ib9-0007PC-NB; Fri, 21 Sep 2018 10:23:43 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3IaC-0006xF-Cq for linux-arm-kernel@lists.infradead.org; Fri, 21 Sep 2018 10:22:46 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id w8LAMKMK030282; Fri, 21 Sep 2018 05:22:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1537525340; bh=IrJAtwRCt30w4PmzwQJ2ADd8n81WHgGBoHehyP3FbSM=; h=From:To:CC:Subject:Date; b=UJCT09uVfEjc+vKlWhMa253gf45caAw6Jmc54gq5rGa/DNk05NQ1pN+WtqzRY7oqN P4ZtSwRXoAu5+vGnOaEh3/pkQLPvrmArb9xtNupLXhxCeQ+Rz0zDfWakk4WTv1auXC 5mdKSIhlNhdmHjkvUFiRD8l6MaJXB7HSGkion4GE= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8LAMKG8028732; Fri, 21 Sep 2018 05:22:20 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 21 Sep 2018 05:22:19 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 21 Sep 2018 05:22:20 -0500 Received: from a0393678ub.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8LAMEt4032280; Fri, 21 Sep 2018 05:22:15 -0500 From: Kishon Vijay Abraham I To: Jingoo Han , Joao Pinto , Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Murali Karicheri , Kishon Vijay Abraham I , Subject: [RFC PATCH 00/40] Cleanup pci-keystone.c and Add AM654 PCIe Support Date: Fri, 21 Sep 2018 15:51:15 +0530 Message-ID: <20180921102155.22839-1-kishon@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180921_032244_537961_20422834 X-CRM114-Status: GOOD ( 19.35 ) X-Spam-Score: -3.1 (---) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-3.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [198.47.19.141 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.7 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Nishanth Menon , devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Tero Kristo , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Add PCIe RC support for TI's AM654 SoC. The PCIe controller in AM654 uses Synopsys core revision 4.90a and uses the same TI wrapper as used in keystone2 with certain modification. Hence AM654 will use the same pci wrapper driver pci-keystone.c The initial support for AM654 was merged recently [1] [1] -> https://lore.kernel.org/lkml/20180626162615.19194-1-nm@ti.com/ Patch series includes the following *) Merge pci-keystone-dw.c into pci-keystone.c so that we have single file for PCIe keystone driver. *) Cleanup the pci-keystone driver. In certain cases the DT binding is also modified since PCIe in keystone has never worked in mainline due to lack of PHY support. *) Included the PHY driver here for completeness (though the driver might go via linux-phy tree) *) Included the device tree patches here. Once this series is reviewed it'll be sent to be merged via Tony's tree. *) Patch to fix ATU identification for designware version >= 4.80 in designware core is also included here. TODO: *) Add Endpoint Support for AM654 *) Send a patch to fix the MRRS after the correct value is identified. Once this series is reviewed I'll split the series and send to corresponding subsytem Maintainers after removing RFC in subject. Thanks Kishon Benoit Parrot (1): arm64: dts: k3-am6: Add Main System Control Module node Kishon Vijay Abraham I (39): PCI: keystone: Use quirk to limit MRRS for K2G PCI: keystone: Use quirk to set MRRS for PCI host bridge PCI: keystone: Move dw_pcie_setup_rc out of ks_pcie_establish_link() PCI: keystone: Do not initiate link training multiple times PCI: keystone: Remove unused argument from ks_dw_pcie_host_init() PCI: keystone: Add start_link/stop_link dw_pcie_ops PCI: keystone: Merge pci-keystone-dw.c and pci-keystone.c PCI: keystone: Cleanup MSI/legacy interrupt configuration and handling PCI: keystone: Remove redundant platform_set_drvdata PCI: keystone: Use uniform function naming convention dt-bindings: PCI: keystone: Add bindings to get device control module PCI: keystone: Use syscon APIs to get device id from control module dt-bindings: PCI: keystone: Add "reg-names" binding information PCI: keystone: Use platform_get_resource_byname to get memory resources PCI: keystone: Cleanup PHY handling PCI: keystone: Invoke pm_runtime APIs to enable clock PCI: keystone: Cleanup configuration space access PCI: keystone: Get number of OB windows from DT and cleanup MEM space configuration PCI: keystone: Cleanup set_dbi_mode and get_dbi_mode PCI: keystone: Cleanup ks_pcie_link_up() PCI: keystone: Add debug error message for all errors PCI: keystone: Reorder header file in alphabetical order PCI: keystone: Cleanup macros defined in pci-keystone.c PCI: keystone: Move initializations to appropriate places dt-bindings: PCI: Add dt-binding to configure PCIe mode PCI: keystone: Explicitly set the PCIe mode dt-bindings: PCI: Document "atu" reg-names PCI: dwc: Fix ATU identification for designware version >= 4.80 PCI: keystone: Prevent ARM32 specific code to be compiled for ARM64 dt-bindings: PCI: Add PCI RC dt binding documentation for AM654 PCI: keystone: Add support for PCIe in AM654x Platforms phy: core: Invoke pm_runtime_get_*/pm_runtime_put_* before invoking reset callback dt-bindings: phy: ti: Add dt binding documentation for SERDES in AM654x SoC phy: ti: Add a new SERDES driver for TI's AM654x SoC ARM: dts: keystone-k2e: Use the updated binding to describe PCIe in k2e arm64: dts: k3-am6: Add "socionext,synquacer-pre-its" property to gic_its arm64: dts: k3-am6: Add mux-controller dt node required for muxing SERDES arm64: dts: k3-am6: Add SERDES DT node arm64: dts: k3-am6: Add Root Complex PCIe dt node .../bindings/pci/designware-pcie.txt | 7 +- .../devicetree/bindings/pci/pci-keystone.txt | 17 +- .../devicetree/bindings/phy/ti-phy.txt | 77 ++ MAINTAINERS | 2 +- arch/arm/boot/dts/keystone-k2e.dtsi | 15 +- arch/arm/boot/dts/keystone.dtsi | 18 +- arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 142 +++ arch/arm64/boot/dts/ti/k3-am65.dtsi | 1 + drivers/pci/controller/dwc/Kconfig | 2 +- drivers/pci/controller/dwc/Makefile | 2 +- drivers/pci/controller/dwc/pci-keystone-dw.c | 484 -------- drivers/pci/controller/dwc/pci-keystone.c | 1059 +++++++++++++---- drivers/pci/controller/dwc/pci-keystone.h | 57 - .../pci/controller/dwc/pcie-designware-host.c | 16 - drivers/pci/controller/dwc/pcie-designware.c | 50 +- drivers/pci/controller/dwc/pcie-designware.h | 13 +- drivers/phy/phy-core.c | 6 + drivers/phy/ti/Kconfig | 11 + drivers/phy/ti/Makefile | 1 + drivers/phy/ti/phy-am654-serdes.c | 513 ++++++++ include/dt-bindings/phy/phy-am654-serdes.h | 13 + 21 files changed, 1690 insertions(+), 816 deletions(-) delete mode 100644 drivers/pci/controller/dwc/pci-keystone-dw.c delete mode 100644 drivers/pci/controller/dwc/pci-keystone.h create mode 100644 drivers/phy/ti/phy-am654-serdes.c create mode 100644 include/dt-bindings/phy/phy-am654-serdes.h Reviewed-by: Rob Herring