From patchwork Thu Jun 29 07:51:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 11423 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9469716vqr; Thu, 29 Jun 2023 01:01:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/wrF+zHvhT0YYE62b2SUQpnjXmngB50TASe6wcOzkfMwgKq0W4qB/Anhfi6vfQ35pORzu X-Received: by 2002:a05:6a20:7fa0:b0:100:b92b:e8be with SMTP id d32-20020a056a207fa000b00100b92be8bemr51325558pzj.2.1688025707092; Thu, 29 Jun 2023 01:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688025707; cv=none; d=google.com; s=arc-20160816; b=sS5JQAjskMVG0XAq0Z7R7/SO8u/yh3Sjs0ZfM4koooFUvr90n2wYNX4YV4JH9VaA7F jBwVd/gpIxUgXkVoDf2g5iCj/M9fLbT+8dGXmGIsTZ/zjMsDN+oMWHHfixDi/0jyj4H8 VmRKAIuB0kN6MXOi6YHqZlXvpQL3TEcQA8lITbXsflGLzxDWVaw2lf2quMQ52XxXaEWc ymd5jflI5nneY0LhT47OfrBYgEh0djvLi3C9hiligv0joz3OLEHzBiRnIxxFeVADj0UL 3avqPoSc6Canpmd8mhuaboHKESaT1i3muF9K6ccvUKHJQSGT9VZa3VC3CRVWFLQ0pLuV 308w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=uG/GikTNcb3bo/viTuixENICJTZ2wH9CA4dQna5gmnA=; fh=eeODssFzCiLuj4Y2Poz4a1+JaBBLhhwnNU23JWsakRA=; b=fbU2RFJdDKCRIofpuFYVCqQdF2C5Mn9f/U8WLKpHBh01Itnvik62vVpvtjoop8K3nA h2fUNTLCSUwoQpTMQvC4Y0jplD2xILmcV3mnmvcYKn+ABT5W7NLhdtaMvfZUstyuCONa d/e4USufXPn372F7IA+ulMOG+zl4mXMUDvSYPo4uPBmxHZ1L1H6QD0vzfLdlqYI0Vw4B ADDpbFomsXkacnZCY7RpiVTg4WcxZBYBcz3PmySzmZGeRRv3AlLX3CyuzxDr7UaJfPhP U1s6cfAoedyk4KqhOsaVH8UVGYh/8AOyQa4Vz+PwXch9O/vUCgkYXAjUQeK6dvTnwd/l O93Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a6566c5000000b0055acfb661c0si8515317pgw.524.2023.06.29.01.01.16; Thu, 29 Jun 2023 01:01:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbjF2Hxu (ORCPT + 99 others); Thu, 29 Jun 2023 03:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231996AbjF2Hwo (ORCPT ); Thu, 29 Jun 2023 03:52:44 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F183610FE; Thu, 29 Jun 2023 00:51:26 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id AD5F624E2D2; Thu, 29 Jun 2023 15:51:17 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 29 Jun 2023 15:51:18 +0800 Received: from ubuntu.localdomain (183.27.97.206) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 29 Jun 2023 15:51:16 +0800 From: Minda Chen To: Emil Renner Berthing , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Roger Quadros CC: , , , , "Paul Walmsley" , Palmer Dabbelt , Albert Ou , Minda Chen , Mason Huo Subject: [PATCH v8 0/5] Add JH7110 USB PHY driver support Date: Thu, 29 Jun 2023 15:51:10 +0800 Message-ID: <20230629075115.11934-1-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [183.27.97.206] X-ClientProxiedBy: EXCAS063.cuchost.com (172.16.6.23) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770023244253570960?= X-GMAIL-MSGID: =?utf-8?q?1770023244253570960?= This patchset adds USB and PCIe PHY for the StarFive JH7110 SoC. The patch has been tested on the VisionFive 2 board. This patchset is base on v6.4-rc6 patch 1 is usb phy dt-binding document. patch 2 is Pcie PHY dt-binding document. patch 3 is USB 2.0 PHY driver. patch 4 is PCIe PHY driver. patch 5 is PCIe PHY dts Previous version are merged with USB controller patch. For USB controller patch is accepted. Now remove the USB controller patch. And remove the dependency. previous change can be seen list below. (start from old patch set v3) v3: https://patchwork.kernel.org/project/linux-phy/cover/20230315104411.73614-1-minda.chen@starfivetech.com/ v4: https://patchwork.kernel.org/project/linux-phy/cover/20230406015216.27034-1-minda.chen@starfivetech.com/ v5: https://patchwork.kernel.org/project/linux-phy/cover/20230420110052.3182-1-minda.chen@starfivetech.com/ v6: https://patchwork.kernel.org/project/linux-phy/cover/20230518112750.57924-1-minda.chen@starfivetech.com/ v7: https://patchwork.kernel.org/project/linux-phy/cover/20230619094759.21013-1-minda.chen@starfivetech.com/ changes: v8: (patch 3) remame jh7110_usb2_mode_set to usb2_set_ls_keeplive . make function more accurate. (patch 4) remove depend on USB_PHY and fix compile robot error. v7: (patch3 and patch 4) Add /driver/phy/starfive directory, Makefile and Kconfig. Remove the dependency. (patch 5) add PCIe PHY dts configuration. (USB 2.0 PHY clock reply on other patch, Dont add this first). v6: 1. (patch 3) remove the platform remove function. 2. (patch 4) - add switch to pcie mode function. - remove the redundant init/exit function. v5: 1. (patch 1) set correct model name and commit title. 2. (patch 2) change to '-item' in syscon property. change commit title. v4: 1. (patch 1) split PCIe PHY dt-binding doc to patch 2. 2. (patch 2) PCIe PHY add stg and sys con configuration to dt-binding doc. 3. (patch 3) - split PCIe PHY driver to patch 4. - replace dr_mode to phy mode in jh7110_usb2_phy. 4. (patch 4) - Makefile and Kconfig sorted by alphabet sequence. - Add PCIe PHY stg and syscon PHY connection configuration for USB 3.0. v3: 1. Add patch 1 - 4. Add USB PHY driver and dt-binding doc. USB PHY codes are moved to patch 3 and patch 4. Minda Chen (5): dt-bindings: phy: Add StarFive JH7110 USB PHY dt-bindings: phy: Add StarFive JH7110 PCIe PHY phy: starfive: Add JH7110 USB 2.0 PHY driver phy: starfive: Add JH7110 PCIE 2.0 PHY driver riscv: dts: starfive: Add PCIe PHY dts configuration for JH7110 .../phy/starfive,jh7110-pcie-phy.yaml | 58 +++++ .../bindings/phy/starfive,jh7110-usb-phy.yaml | 50 +++++ MAINTAINERS | 8 + arch/riscv/boot/dts/starfive/jh7110.dtsi | 12 ++ drivers/phy/Kconfig | 1 + drivers/phy/Makefile | 1 + drivers/phy/starfive/Kconfig | 24 +++ drivers/phy/starfive/Makefile | 3 + drivers/phy/starfive/phy-jh7110-pcie.c | 204 ++++++++++++++++++ drivers/phy/starfive/phy-jh7110-usb.c | 152 +++++++++++++ 10 files changed, 513 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/starfive,jh7110-pcie-phy.yaml create mode 100644 Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yaml create mode 100644 drivers/phy/starfive/Kconfig create mode 100644 drivers/phy/starfive/Makefile create mode 100644 drivers/phy/starfive/phy-jh7110-pcie.c create mode 100644 drivers/phy/starfive/phy-jh7110-usb.c base-commit: 858fd168a95c5b9669aac8db6c14a9aeab446375