Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3630960pxv; Mon, 12 Jul 2021 23:32:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOlAI4TRXySwr9WW7JFaa6mQQy5ORf/fVg5neSL9pdTfM4TXJVUoPOrRACOJDmEY61Igzq X-Received: by 2002:a50:9b06:: with SMTP id o6mr3618554edi.284.1626157936475; Mon, 12 Jul 2021 23:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626157936; cv=none; d=google.com; s=arc-20160816; b=f+AqL+6h+8paQHzpvVr83pVgijBT8LCyeB5RI6ptsBkBc8Ccez6/CpsW421wk+4lFA GN9JwtMBXXLOb+OhJhDSCdChukri+hzYm6Z/0PA4+L6Ej+UAH0j0zgAt57ifwAynfuTj ieS4KI9sShbSM3RLRQVhWECX7hh++3qDcPxBIrALN1CP6WA8aKJNVaqCoJVrlGsfyAic fNo0s+SHyG3kvt9HoKeOp8XKt3JxB2X/ezwXPM5uoYGXINL87KjDtxZ3bWVPDsdix+12 9bEtDTM58S0HF0tIX13EtMIqnvFArNt5BHET60KUfx9JRrRpHzuBlHSwVE7cT9cIIWgE VdqA== 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=kd2vjlfYAhYm8yY4UTe+92OYcG1/nNAD9uCGmT8jH9I=; b=OsqS+I0zvZLn//T/ZYCV8Wpl7l40IFIngl7AIb4DdXF+RDbnSiv8GX5Bv3AmZ8wlJd PTa7Ge+gadRBII5OLjvm8E5YjfKAX4RKoIkN7x+oEoLn+Vp8TsvnoVCAuilxNEL2enM6 xAPK2w20Pz3js6QBKN5CwbZAp2KSbAuw4PCnMl+3Msub5+95RgJIsMuUC7sSEMGhuz6e HkeNTMElaSflPray2YaG19FvZIittxRokvuGtD/8qinu86/jwF7FCcfmA/wx8+TofGR7 4erzwh4JC2y2b3HDktJmOW1LjdESM4Mq5yrG/kstjv6jYGCAQDX5h3ufADqFDHGi/q8P SkWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nzR1lod7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si3735218edk.216.2021.07.12.23.31.54; Mon, 12 Jul 2021 23:32:16 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nzR1lod7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234175AbhGMGbi (ORCPT + 99 others); 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