From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14F3EC11F73 for ; Tue, 13 Jul 2021 06:28:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02A256128E for ; Tue, 13 Jul 2021 06:28:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234199AbhGMGbi (ORCPT ); Tue, 13 Jul 2021 02:31:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:51002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233638AbhGMGbe (ORCPT ); Tue, 13 Jul 2021 02:31:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 28D9361283; Tue, 13 Jul 2021 06:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626157725; bh=PEvDrwtE2bMG2PczNSuL9uDCvMHHowXcV5u6IAjX46w=; h=From:To:Cc:Subject:Date:From; b=nzR1lod7qK3qD1h91+LXHZfHDOmr09o67FANoX2f945kRzxW7YVw5ryLhmpjzPRT0 dg5X5Ib+GN17behzFF1jEoKiodoQXaTea+OTRHkz0YeRujajnE3wtSLPa95KnOmqZv 0zSx7bFZPr4S/R4W6DuyC2f7xed92vJ0wmBNrmBMFMfhAR+hNtUST7dMSyKEmhX+18 Yvt3T83wZFiJaYGz2JDj5XbUFEKytST75Q701vh0UQ91G+tUeSEAa8w8xnVW5Cv42w u2e5w+duPsL5HnC/YAzrwJrEsl3EVnJMvA2H41wmEKEePaq0l2pF7fduR/5fWcmGqz 1ZH0zWoAcZ/SA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1m3BuM-005yPU-OH; Tue, 13 Jul 2021 08:28:42 +0200 From: Mauro Carvalho Chehab To: Bjorn Helgaas Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Manivannan Sadhasivam , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Binghui Wang , Rob Herring , Xiaowei Song , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-phy@lists.infradead.org Subject: [PATCH v5 0/8] Add support for Hikey 970 PCIe Date: Tue, 13 Jul 2021 08:28:33 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As requested by Rob Herring, this series split the PHY part into a separate driver. Then, it adds support for Kirin 970 on a single patch. With this change, the PHY-specific device tree bindings for Kirin 960 moved to its own PHY properties. Tested on Hikey970: $ lspci 00:00.0 PCI bridge: Huawei Technologies Co., Ltd. Device 3670 (rev 01) 01:00.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:01.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:04.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:05.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:07.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:09.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 07) $ ethtool enp6s0 Settings for enp6s0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised pause frame use: Symmetric Receive-only Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Link partner advertised pause frame use: Symmetric Receive-only Link partner advertised auto-negotiation: Yes Link partner advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Auto-negotiation: on master-slave cfg: preferred slave master-slave status: slave Port: Twisted Pair PHYAD: 0 Transceiver: external MDI-X: Unknown netlink error: Operation not permitted Link detected: yes Partially tested on Hikey 960[1]: $ lspci 00:00.0 PCI bridge: Huawei Technologies Co., Ltd. Device 3660 (rev 01) [1] The Hikey 960 doesn't come with any internal PCIe device. Its hardware supports just an external device via a M.2 slot that doesn't support SATA. I ordered a NVMe device to test, but the vendor is currently out of supply. It should take 3-4 weeks to arrive here. I'll run an extra test on it once it arrives. --- v5: - added "static" to hi3670_pcie_get_eyeparam() declaration on patch 6/8 v4: - dropped the DTS patch, as it depends on a PMIC-related patch series; - minor changes at the patch description; - HiKey and HiSilicon are now using the preferred CamelCase format. Mauro Carvalho Chehab (8): dt-bindings: phy: Add bindings for HiKey 960 PCIe PHY dt-bindings: phy: Add bindings for HiKey 970 PCIe PHY dt-bindings: PCI: kirin: Fix compatible string dt-bindings: PCI: kirin: Drop PHY properties phy: HiSilicon: Add driver for Kirin 960 PCIe PHY phy: HiSilicon: add driver for Kirin 970 PCIe PHY PCI: kirin: Drop the PHY logic from the driver PCI: kirin: Use regmap for APB registers .../devicetree/bindings/pci/kirin-pcie.txt | 21 +- .../phy/hisilicon,phy-hi3660-pcie.yaml | 82 ++ .../phy/hisilicon,phy-hi3670-pcie.yaml | 101 ++ arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 29 +- drivers/pci/controller/dwc/pcie-kirin.c | 298 ++---- drivers/phy/hisilicon/Kconfig | 20 + drivers/phy/hisilicon/Makefile | 2 + drivers/phy/hisilicon/phy-hi3660-pcie.c | 325 +++++++ drivers/phy/hisilicon/phy-hi3670-pcie.c | 892 ++++++++++++++++++ 9 files changed, 1500 insertions(+), 270 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/hisilicon,phy-hi3660-pcie.yaml create mode 100644 Documentation/devicetree/bindings/phy/hisilicon,phy-hi3670-pcie.yaml create mode 100644 drivers/phy/hisilicon/phy-hi3660-pcie.c create mode 100644 drivers/phy/hisilicon/phy-hi3670-pcie.c -- 2.31.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0F21C07E95 for ; Tue, 13 Jul 2021 06:30:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 604EF61042 for ; Tue, 13 Jul 2021 06:30:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 604EF61042 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=kTmT+OiJdssuELTCeA5Qs+fL0IpbLn3RnqJcDRQrrFo=; b=F83DZJScR1HqOI jiB0haZt9b93RQH1CvkD8F41ryX7O1evxidWHkrk7WOhOOyVdGCGdhVedH1EOOcuhhIz9Xei3DRNz +8LVo4dqXudE9fVLjx1LAaeY5MnIbTnpgQAoT7ALNbxymauLKHIX5wvv6Pk4kVNYtvfcdBHHqRTX1 ChvCwxvo2SfI6CHcCDUv0+3TknLI9sXbOD3/hqbnJECPtDbPhLVWdTr0I6XlRMtws8tHsbMcFI7Iy Z4NlSbnhI7epQJs7VNbtHKlilKWSNFYkGjGrTfh4DWuZlNDaeuzEQC2qwLKyI43vOWKgW/FqRDbsD 1cu6kqJ4Kojexyqv+Edg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3BuV-009Goc-PX; Tue, 13 Jul 2021 06:28:52 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3BuP-009GjL-N0; Tue, 13 Jul 2021 06:28:48 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 28D9361283; Tue, 13 Jul 2021 06:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626157725; bh=PEvDrwtE2bMG2PczNSuL9uDCvMHHowXcV5u6IAjX46w=; h=From:To:Cc:Subject:Date:From; b=nzR1lod7qK3qD1h91+LXHZfHDOmr09o67FANoX2f945kRzxW7YVw5ryLhmpjzPRT0 dg5X5Ib+GN17behzFF1jEoKiodoQXaTea+OTRHkz0YeRujajnE3wtSLPa95KnOmqZv 0zSx7bFZPr4S/R4W6DuyC2f7xed92vJ0wmBNrmBMFMfhAR+hNtUST7dMSyKEmhX+18 Yvt3T83wZFiJaYGz2JDj5XbUFEKytST75Q701vh0UQ91G+tUeSEAa8w8xnVW5Cv42w u2e5w+duPsL5HnC/YAzrwJrEsl3EVnJMvA2H41wmEKEePaq0l2pF7fduR/5fWcmGqz 1ZH0zWoAcZ/SA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1m3BuM-005yPU-OH; Tue, 13 Jul 2021 08:28:42 +0200 From: Mauro Carvalho Chehab To: Bjorn Helgaas Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Manivannan Sadhasivam , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Binghui Wang , Rob Herring , Xiaowei Song , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-phy@lists.infradead.org Subject: [PATCH v5 0/8] Add support for Hikey 970 PCIe Date: Tue, 13 Jul 2021 08:28:33 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210712_232845_832420_19FAC351 X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As requested by Rob Herring, this series split the PHY part into a separate driver. Then, it adds support for Kirin 970 on a single patch. With this change, the PHY-specific device tree bindings for Kirin 960 moved to its own PHY properties. Tested on Hikey970: $ lspci 00:00.0 PCI bridge: Huawei Technologies Co., Ltd. Device 3670 (rev 01) 01:00.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:01.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:04.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:05.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:07.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:09.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 07) $ ethtool enp6s0 Settings for enp6s0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised pause frame use: Symmetric Receive-only Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Link partner advertised pause frame use: Symmetric Receive-only Link partner advertised auto-negotiation: Yes Link partner advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Auto-negotiation: on master-slave cfg: preferred slave master-slave status: slave Port: Twisted Pair PHYAD: 0 Transceiver: external MDI-X: Unknown netlink error: Operation not permitted Link detected: yes Partially tested on Hikey 960[1]: $ lspci 00:00.0 PCI bridge: Huawei Technologies Co., Ltd. Device 3660 (rev 01) [1] The Hikey 960 doesn't come with any internal PCIe device. Its hardware supports just an external device via a M.2 slot that doesn't support SATA. I ordered a NVMe device to test, but the vendor is currently out of supply. It should take 3-4 weeks to arrive here. I'll run an extra test on it once it arrives. --- v5: - added "static" to hi3670_pcie_get_eyeparam() declaration on patch 6/8 v4: - dropped the DTS patch, as it depends on a PMIC-related patch series; - minor changes at the patch description; - HiKey and HiSilicon are now using the preferred CamelCase format. Mauro Carvalho Chehab (8): dt-bindings: phy: Add bindings for HiKey 960 PCIe PHY dt-bindings: phy: Add bindings for HiKey 970 PCIe PHY dt-bindings: PCI: kirin: Fix compatible string dt-bindings: PCI: kirin: Drop PHY properties phy: HiSilicon: Add driver for Kirin 960 PCIe PHY phy: HiSilicon: add driver for Kirin 970 PCIe PHY PCI: kirin: Drop the PHY logic from the driver PCI: kirin: Use regmap for APB registers .../devicetree/bindings/pci/kirin-pcie.txt | 21 +- .../phy/hisilicon,phy-hi3660-pcie.yaml | 82 ++ .../phy/hisilicon,phy-hi3670-pcie.yaml | 101 ++ arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 29 +- drivers/pci/controller/dwc/pcie-kirin.c | 298 ++---- drivers/phy/hisilicon/Kconfig | 20 + drivers/phy/hisilicon/Makefile | 2 + drivers/phy/hisilicon/phy-hi3660-pcie.c | 325 +++++++ drivers/phy/hisilicon/phy-hi3670-pcie.c | 892 ++++++++++++++++++ 9 files changed, 1500 insertions(+), 270 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/hisilicon,phy-hi3660-pcie.yaml create mode 100644 Documentation/devicetree/bindings/phy/hisilicon,phy-hi3670-pcie.yaml create mode 100644 drivers/phy/hisilicon/phy-hi3660-pcie.c create mode 100644 drivers/phy/hisilicon/phy-hi3670-pcie.c -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CD54C07E96 for ; Tue, 13 Jul 2021 06:29:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 363CE61260 for ; Tue, 13 Jul 2021 06:29:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 363CE61260 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=qsqW/u8gTFiZToSlrHdL+ohlByn13B0Di2adf9v046Q=; b=Op8QkWtq0s/qPL DLMeJ5s1ALu7+U/Cel2K5n9c8MQkz9Hp2zZXOFBgrqPGNGTUWnKTac5rPO8SgRr6xftgdPI8l6vTA 4+OVUY66dxMwJMCdAhyd/rp98aXl5XAfXr0/8pu5MktMWhOqchjSrZIpC3V7/Iw/xgTv4x7YYcn6L /ChDyeioj7oaNiX7QEsh8AmbWWNM3ENhJ8bZalfTmmMXqcBqH7SKEtCodaJYOtifb9BV9Cmnn9dL9 xJ39gw+IoE5ZcpN6mKrx1pApjScjbNG+7LYS2bFx871xuenfVazQmlLUslqNz220uREo7nYhigZMK l/sX5DJ4EPKj804aS1hA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3Buf-009GrG-OS; Tue, 13 Jul 2021 06:29:01 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3BuP-009GjL-N0; Tue, 13 Jul 2021 06:28:48 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 28D9361283; Tue, 13 Jul 2021 06:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626157725; bh=PEvDrwtE2bMG2PczNSuL9uDCvMHHowXcV5u6IAjX46w=; h=From:To:Cc:Subject:Date:From; b=nzR1lod7qK3qD1h91+LXHZfHDOmr09o67FANoX2f945kRzxW7YVw5ryLhmpjzPRT0 dg5X5Ib+GN17behzFF1jEoKiodoQXaTea+OTRHkz0YeRujajnE3wtSLPa95KnOmqZv 0zSx7bFZPr4S/R4W6DuyC2f7xed92vJ0wmBNrmBMFMfhAR+hNtUST7dMSyKEmhX+18 Yvt3T83wZFiJaYGz2JDj5XbUFEKytST75Q701vh0UQ91G+tUeSEAa8w8xnVW5Cv42w u2e5w+duPsL5HnC/YAzrwJrEsl3EVnJMvA2H41wmEKEePaq0l2pF7fduR/5fWcmGqz 1ZH0zWoAcZ/SA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1m3BuM-005yPU-OH; Tue, 13 Jul 2021 08:28:42 +0200 From: Mauro Carvalho Chehab To: Bjorn Helgaas Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Manivannan Sadhasivam , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Binghui Wang , Rob Herring , Xiaowei Song , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-phy@lists.infradead.org Subject: [PATCH v5 0/8] Add support for Hikey 970 PCIe Date: Tue, 13 Jul 2021 08:28:33 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210712_232845_832420_19FAC351 X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org As requested by Rob Herring, this series split the PHY part into a separate driver. Then, it adds support for Kirin 970 on a single patch. With this change, the PHY-specific device tree bindings for Kirin 960 moved to its own PHY properties. Tested on Hikey970: $ lspci 00:00.0 PCI bridge: Huawei Technologies Co., Ltd. Device 3670 (rev 01) 01:00.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:01.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:04.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:05.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:07.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 02:09.0 PCI bridge: PLX Technology, Inc. PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) 06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 07) $ ethtool enp6s0 Settings for enp6s0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised pause frame use: Symmetric Receive-only Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Link partner advertised pause frame use: Symmetric Receive-only Link partner advertised auto-negotiation: Yes Link partner advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Auto-negotiation: on master-slave cfg: preferred slave master-slave status: slave Port: Twisted Pair PHYAD: 0 Transceiver: external MDI-X: Unknown netlink error: Operation not permitted Link detected: yes Partially tested on Hikey 960[1]: $ lspci 00:00.0 PCI bridge: Huawei Technologies Co., Ltd. Device 3660 (rev 01) [1] The Hikey 960 doesn't come with any internal PCIe device. Its hardware supports just an external device via a M.2 slot that doesn't support SATA. I ordered a NVMe device to test, but the vendor is currently out of supply. It should take 3-4 weeks to arrive here. I'll run an extra test on it once it arrives. --- v5: - added "static" to hi3670_pcie_get_eyeparam() declaration on patch 6/8 v4: - dropped the DTS patch, as it depends on a PMIC-related patch series; - minor changes at the patch description; - HiKey and HiSilicon are now using the preferred CamelCase format. Mauro Carvalho Chehab (8): dt-bindings: phy: Add bindings for HiKey 960 PCIe PHY dt-bindings: phy: Add bindings for HiKey 970 PCIe PHY dt-bindings: PCI: kirin: Fix compatible string dt-bindings: PCI: kirin: Drop PHY properties phy: HiSilicon: Add driver for Kirin 960 PCIe PHY phy: HiSilicon: add driver for Kirin 970 PCIe PHY PCI: kirin: Drop the PHY logic from the driver PCI: kirin: Use regmap for APB registers .../devicetree/bindings/pci/kirin-pcie.txt | 21 +- .../phy/hisilicon,phy-hi3660-pcie.yaml | 82 ++ .../phy/hisilicon,phy-hi3670-pcie.yaml | 101 ++ arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 29 +- drivers/pci/controller/dwc/pcie-kirin.c | 298 ++---- drivers/phy/hisilicon/Kconfig | 20 + drivers/phy/hisilicon/Makefile | 2 + drivers/phy/hisilicon/phy-hi3660-pcie.c | 325 +++++++ drivers/phy/hisilicon/phy-hi3670-pcie.c | 892 ++++++++++++++++++ 9 files changed, 1500 insertions(+), 270 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/hisilicon,phy-hi3660-pcie.yaml create mode 100644 Documentation/devicetree/bindings/phy/hisilicon,phy-hi3670-pcie.yaml create mode 100644 drivers/phy/hisilicon/phy-hi3660-pcie.c create mode 100644 drivers/phy/hisilicon/phy-hi3670-pcie.c -- 2.31.1 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy