From patchwork Tue Mar 5 02:19:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 13581554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9EDD1C48BF6 for ; Tue, 5 Mar 2024 02:20:31 +0000 (UTC) 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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5CqrOjn+r2NL3/5DXc98kummx46ciD+kgKSPPuXJWKk=; b=mJRz5ul0Ee5uZG QCUTT9hy5sKPcwYpyxO9QLiDHe0/0UgqUGuAoBAt6Pez/2XDhZrVgu1Xs4ujVTw9hMxY1/aYwLodk 6rJHzZz5SwPJE8rbpeiVEcG6pwnhIoWYoDoPZGfh92HD9Hpy8URllZT5tkoymwJenlZFU7OhAajQj EM21kXAGGrXx/wSUsc6JOcuoKGnjJT+kVF4lCCm2eQ0U0zkHtt1OMI2Yxoyw7IaDf/wR2zlNoY7Uc hRuuw9CAz+7QmudxowsViT9OBKFLRRYp52eUkW/D09OCiaB7OiR8zWdLJ0qqn8inemc2+lENH7v1M 7bmrYnZzGzU+xn2hzQ9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPv-0000000BXdL-0uZw; Tue, 05 Mar 2024 02:20:31 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPQ-0000000BXSb-33sk for linux-phy@lists.infradead.org; Tue, 05 Mar 2024 02:20:16 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 9A389CE182E; Tue, 5 Mar 2024 02:19:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 7B46BC43390; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709605196; bh=esSfqR/EN2uGgQJhZInB3gQ5IgggyIpQkCwvAPI4KIE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=B6jPmrlv0e63tN91R5wSQHmgw+HQjbhM+GG7rMi69/VzxSGNHYI8JsY92W73+sspe VPOmRDq6g583Pl66liY77KWE2eXAp1HBwgLQgZhjG3oDXK7UV5HapmzqTmWlimU9z5 kBkc+FjWH//O3zJYm4Q5EEpdBezCIuLukoNMpVAiTwQIFDa20xLXE629BYqJ47GgGb 9PIDySWaGiLn/jiF3UCLo7qFJ1WLrRpF1Pk9joaysLHoti93f2bmagGGt39g0Q3UEt 5KSBre2Ly+wCviatpTAMvOGk6Hpgbte9ZsGR8DA5u7GOjQVN6KO0PG7MNYCToZ71fi g2Oz2ymQPQj2A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 646D3C54E49; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Tue, 05 Mar 2024 10:19:46 +0800 Subject: [PATCH v4 1/5] phy: hisilicon: hisi-inno-phy: enable clocks for every ports MIME-Version: 1.0 Message-Id: <20240305-inno-phy-v4-1-a03204c9cf1c@outlook.com> References: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> In-Reply-To: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Shawn Guo , Philipp Zabel Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709605195; l=971; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=jGUbESXsyAvU27nkXjLoTOKtwqcjOT068eM8RNJCWfs=; b=mZkELQxdOeb+Ne66xgMMDdr9MMJtJvx7d4OtBV0cy5nnZX+tkpCKswo6gT9KRCqANjgeZjyPA wGNJRUlf08VDaB8fXHvmiAChKRXphX48gM5i0Dmi7bKCDr/iQX04WzJ X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_182001_052151_B4B6CC51 X-CRM114-Status: GOOD ( 11.23 ) 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: , Reply-To: forbidden405@outlook.com Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Yang Xiwen This is needed for port1 to work. Fixes: ba8b0ee81fbb ("phy: add inno-usb2-phy driver for hi3798cv200 SoC") Signed-off-by: Yang Xiwen --- drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c b/drivers/phy/hisilicon/phy-hisi-inno-usb2.c index c138cd4807d6..b7e740eb4752 100644 --- a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c +++ b/drivers/phy/hisilicon/phy-hisi-inno-usb2.c @@ -86,8 +86,10 @@ static void hisi_inno_phy_write_reg(struct hisi_inno_phy_priv *priv, static void hisi_inno_phy_setup(struct hisi_inno_phy_priv *priv) { + int i; /* The phy clk is controlled by the port0 register 0x06. */ - hisi_inno_phy_write_reg(priv, 0, 0x06, PHY_CLK_ENABLE); + for (i = 0; i < INNO_PHY_PORT_NUM; i++) + hisi_inno_phy_write_reg(priv, i, 0x06, PHY_CLK_ENABLE); msleep(PHY_CLK_STABLE_TIME); } From patchwork Tue Mar 5 02:19:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 13581553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 51C9BC54E49 for ; Tue, 5 Mar 2024 02:20:31 +0000 (UTC) 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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/2R38O80DicePnrR3j2kuGSdNnN6AYlOCZyQUC/s9ZM=; b=2zDJajhXYHUHaL kcGorLFkpHgRGDrNRIV0xBYdMGK5TSqwP3Y0+butPj7xM8nbI/l4WhfDxu3PcWDxEZbQNupkhSFfQ qnuqVFqTMDnUetIu+0W09mA3hT5Z/7Xe1wDj1j2HkAPcM8Tvn3REUOVzMkYURpazvD26iZCohdEod IgyDd6VxH9tAOHv09KA3S6b/NiV9dDrTQr2DdZZM780wK5V/4wWvlNxk5s4PCzRHAKm2enLiNQb80 5GsjVeUee2M8+4SdWwa2xy+FmaAPfDgyvVKs4SJWx4I8OkALfmS0jZ2AgHsM8b4ezXjOYX8OwOMzq xTpU9mjbxOGjr1ZHN9sQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPu-0000000BXcu-3kBI; Tue, 05 Mar 2024 02:20:30 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPV-0000000BXSK-22Ed for linux-phy@lists.infradead.org; Tue, 05 Mar 2024 02:20:16 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 966A06126D; Tue, 5 Mar 2024 02:19:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 85F71C433C7; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709605196; bh=lZYW9zvoMOxgkd/IKnhVJFOnDEZXnsI2aX54xtRQrrg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=eUwpuNejGcfQldHG7BsfpYP5Q8dymwd9ZmPlLHa9rZz+48FXrRR5xx9HAy710Lt+K lDI+m6YgxdK0EqgVq+tQcAy1XTUtLsmlT8MWj0j6ceYjSiGiHLTPmKKngVFB8oTaOZ udA0z+Zz0iHSt27PIFg4a0+TFtKVS0VT6doRi+x+H/g43Xe9UITM8YxtZM4pOE0itx bYTUEi/HQKDIt7O83TtZqUMivhJ7L7RJdWxknzSq6/2zGXFtSFSF+0BVsHCgm/x1n6 9G9qEBcu8ZyFXQ3RuZNvUtl2w5mv6dZpiz5qGVlotELjFTptnbTtMY2lDJafT1rGnw hpfKb5MdT/fzQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E62DC54E55; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Tue, 05 Mar 2024 10:19:47 +0800 Subject: [PATCH v4 2/5] dt-bindings: phy: hisi-inno-usb2: convert to YAML MIME-Version: 1.0 Message-Id: <20240305-inno-phy-v4-2-a03204c9cf1c@outlook.com> References: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> In-Reply-To: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Shawn Guo , Philipp Zabel Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709605195; l=5151; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=H42r50zesn+yJEXWkqPepxMjIK3D2+wjfxV9miK7Xtk=; b=k0iNB2GEjjV2MoB+qQL8hiiIzhEFsI0jMRhYK59W/cHEVK7VRtqMFqJIlj5Gdf0JhWP5kecXD i3KlT9pyHOUB+Cs4TrfynHzsS4AysHl7VWTDovmSfBs0RAaAJprcvjg X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_182005_999161_11DB6960 X-CRM114-Status: GOOD ( 13.22 ) 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: , Reply-To: forbidden405@outlook.com Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Yang Xiwen convert the legacy text binding to YAML. While at it, remove "hisilicon,inno-usb2-phy" fallback compatible. Signed-off-by: Yang Xiwen Reviewed-by: Rob Herring --- .../bindings/phy/hisilicon,inno-usb2-phy.yaml | 91 ++++++++++++++++++++++ .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 71 ----------------- 2 files changed, 91 insertions(+), 71 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml new file mode 100644 index 000000000000..ba82405ddf51 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml @@ -0,0 +1,91 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/hisilicon,inno-usb2-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon HiSTB SoCs INNO USB2 PHY device + +maintainers: + - Yang Xiwen + +properties: + compatible: + items: + - enum: + - hisilicon,hi3798cv200-usb2-phy + + reg: + maxItems: 1 + description: Should be the address space for PHY configuration register in + peripheral controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC, + or direct MMIO address space. + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + clocks: + maxItems: 1 + description: reference clock + + resets: + maxItems: 1 + +patternProperties: + 'phy@[0-9a-f]+': + type: object + additionalProperties: false + description: individual ports provided by INNO PHY + + properties: + reg: + maxItems: 1 + description: should be the port index (if under a perictrl node) + or port address space + + '#phy-cells': + const: 0 + + resets: + maxItems: 1 + + required: + - reg + - '#phy-cells' + - resets + +required: + - compatible + - clocks + - reg + - '#address-cells' + - '#size-cells' + - resets + +additionalProperties: false + +examples: + - | + usb2-phy@120 { + compatible = "hisilicon,hi3798cv200-usb2-phy"; + reg = <0x120 0x4>; + clocks = <&clk_ref>; + resets = <&crg 0xbc 4>; + #address-cells = <1>; + #size-cells = <0>; + + phy@0 { + reg = <0>; + #phy-cells = <0>; + resets = <&crg 0xbc 8>; + }; + + phy@1 { + reg = <1>; + #phy-cells = <0>; + resets = <&crg 0xbc 9>; + }; + }; diff --git a/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt deleted file mode 100644 index 104953e849e7..000000000000 --- a/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt +++ /dev/null @@ -1,71 +0,0 @@ -Device tree bindings for HiSilicon INNO USB2 PHY - -Required properties: -- compatible: Should be one of the following strings: - "hisilicon,inno-usb2-phy", - "hisilicon,hi3798cv200-usb2-phy". -- reg: Should be the address space for PHY configuration register in peripheral - controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC. -- clocks: The phandle and clock specifier pair for INNO USB2 PHY device - reference clock. -- resets: The phandle and reset specifier pair for INNO USB2 PHY device reset - signal. -- #address-cells: Must be 1. -- #size-cells: Must be 0. - -The INNO USB2 PHY device should be a child node of peripheral controller that -contains the PHY configuration register, and each device supports up to 2 PHY -ports which are represented as child nodes of INNO USB2 PHY device. - -Required properties for PHY port node: -- reg: The PHY port instance number. -- #phy-cells: Defined by generic PHY bindings. Must be 0. -- resets: The phandle and reset specifier pair for PHY port reset signal. - -Refer to phy/phy-bindings.txt for the generic PHY binding properties - -Example: - -perictrl: peripheral-controller@8a20000 { - compatible = "hisilicon,hi3798cv200-perictrl", "simple-mfd"; - reg = <0x8a20000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x8a20000 0x1000>; - - usb2_phy1: usb2-phy@120 { - compatible = "hisilicon,hi3798cv200-usb2-phy"; - reg = <0x120 0x4>; - clocks = <&crg HISTB_USB2_PHY1_REF_CLK>; - resets = <&crg 0xbc 4>; - #address-cells = <1>; - #size-cells = <0>; - - usb2_phy1_port0: phy@0 { - reg = <0>; - #phy-cells = <0>; - resets = <&crg 0xbc 8>; - }; - - usb2_phy1_port1: phy@1 { - reg = <1>; - #phy-cells = <0>; - resets = <&crg 0xbc 9>; - }; - }; - - usb2_phy2: usb2-phy@124 { - compatible = "hisilicon,hi3798cv200-usb2-phy"; - reg = <0x124 0x4>; - clocks = <&crg HISTB_USB2_PHY2_REF_CLK>; - resets = <&crg 0xbc 6>; - #address-cells = <1>; - #size-cells = <0>; - - usb2_phy2_port0: phy@0 { - reg = <0>; - #phy-cells = <0>; - resets = <&crg 0xbc 10>; - }; - }; -}; From patchwork Tue Mar 5 02:19:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 13581550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4EF18C48BF6 for ; Tue, 5 Mar 2024 02:20:10 +0000 (UTC) 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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=O93Fq0zULCP3+hRhSDuTsUXf08Tz2hCjJjAvA0iOsPI=; b=TAFTD8hjR9kTQU O+NyhbT5tgZCl/ryqDeVZ6aR+wXIldR5k7kl2z0EDiJfe3fD9I5EKm0lnM0jl3BcIFZfkNJ8y5f6D Y2KmKaTaF3EORa6ubczplS9qDnXv1KQhpcVppSoKv3BBN2PmAMyaU0Zk9njBTHvnAoB9koQ7nYz+s uupoBrBaJ0z5FruVQGmhDL+8waMH0oC08sT9jdk9kX9kEx3U2eYhmcyKkMhNlo+UZq2h+UbnB4Ow8 oTgE8+K1ftnmCrQln+FeNUMNGbkaqOcXr5KlhhPiEpxNXtRkcJcqsjs9ihcXYpTKsHEIc7SAgOlj9 5CH/hnKuFMpMFTK6+RTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPZ-0000000BXXF-3gsm; Tue, 05 Mar 2024 02:20:09 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPO-0000000BXRM-42gw for linux-phy@lists.infradead.org; Tue, 05 Mar 2024 02:20:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C70136123D; Tue, 5 Mar 2024 02:19:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 90637C43394; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709605196; bh=j2QxGDEhq99RHC8PPIr7+4POEgFQFJ0Y8qdfPyL6lA4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=vAwCX0T5XC55C8KD+4b8Yd+cjS3vfJRmE/JSXBEK+Y579w6DsWnsEQ+SeLG7tyv0c ummb7qt3utjLsbclCSpfdrK1ZMYCtxKHLH6J1W039wkMEIGkuNCbJb11tp+O6X6IEc 5TBmZGQadJPD7Ds1AG+dalB+FVJ+lWCeZ1uoj4S45emW9qSxpISoInobKnIXd1H9Y6 ySeWju+DOMvhNZ5okrxP1h1Mii2VarkHM2DSpzF3P57Om6kIJdNtLQ994RFv/osKcl QfWvtxvSMeDb3ErGe1RQJrxnq6tUmNHU51YYOrkzm1suZ4lprkL4nz2ke4ZR/BClTD PdakwTHcD0J2w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78CDAC54E4A; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Tue, 05 Mar 2024 10:19:48 +0800 Subject: [PATCH v4 3/5] dt-bindings: phy: hisilicon,inno-usb2-phy: add support for Hi3798MV100 INNO PHY MIME-Version: 1.0 Message-Id: <20240305-inno-phy-v4-3-a03204c9cf1c@outlook.com> References: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> In-Reply-To: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Shawn Guo , Philipp Zabel Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709605195; l=829; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=6dFyqSF2W3Rgkd9gq9kKKbV4XaRy0uRiH6eHrHgNDio=; b=rkQ0Luc5fivUDIuQxsUqDT1LMOA7aZ5/z3xiXyMpkOfiv2nAPIafLjZGeKrFJSTSJv06mOnDs dgIdv7UUNJ8A9eG0uKnq4B1shlgOHRQLUBJsDd5hc2Dg4YKUiqjTVmB X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_181959_110549_93BAB40D X-CRM114-Status: UNSURE ( 7.54 ) X-CRM114-Notice: Please train this message. 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: , Reply-To: forbidden405@outlook.com Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Yang Xiwen Hi3798MV100 also has a similar INNO USB2 PHY with slightly different register fields offsets. Document it in the binding. Signed-off-by: Yang Xiwen Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml index ba82405ddf51..7f0811a2dc2b 100644 --- a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml @@ -14,6 +14,7 @@ properties: items: - enum: - hisilicon,hi3798cv200-usb2-phy + - hisilicon,hi3798mv100-usb2-phy reg: maxItems: 1 From patchwork Tue Mar 5 02:19:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 13581551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C55BFC54E49 for ; Tue, 5 Mar 2024 02:20:14 +0000 (UTC) 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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/NMmSJktMieLa+CkoCqhkyxmt7rLH66rfejjBt5t/gQ=; b=xNQtMmolNi08uX 9EdDgwBQlp5HJQ6/ZHGkLDPL7Ejz0QW9QYaFjP/gU2bKXFtVxksAoYPj2Qxy8r9qx+8R5nOi/ZoI8 PP5Cp1g7AqUzNsrGmn1f5rCLVX89fWRhDIsinuqcuNWN/1zhl88wHgXVvumanwWgbgG146xY9R5RD Yr0/WOgJj72DHuW64iuhH9ZhkqYS0AgUb7/TorLQxG9bjJ8FlwhGXxcZEPKWY+di7niZeZbgXWXuL Ljs2oXKQraj1Yvdyi3o5pPvCvek7cTRV/VwhPRDID2u05PyRy5gZMhb3aKZmLFvZlQh8lkNIU5lTB 51lDcwxaeaWeA/jlmQEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPe-0000000BXYl-1N9H; Tue, 05 Mar 2024 02:20:14 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPO-0000000BXRL-3cuG for linux-phy@lists.infradead.org; Tue, 05 Mar 2024 02:20:12 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id AAF716132A; Tue, 5 Mar 2024 02:19:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 98281C43330; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709605196; bh=Nb/la9hCvIDGODkj1BLvn7upbkGoEP4jj+8C4O4Wx18=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=OVn4PUXfa7uCyZYEqJTCTmUczcuu64E/tJZpSIF0b4lyrJBiokBLs/tYoLgz3TTtl 6EUxRO5xmS72QSJIjDhvq4n9LdtxAaeHRLWaIvjsV8pcnF9g1MCv5qi4guD6KBJLn7 VPRuNJEYh8mZ59NEGM5ygjHhhA57/WkcI/ygpTgGtVWLTxN/sHw2MR/x471038g1In x7/d6z244O4AQUWo8zblNnU0+vzrM4KSXzsmaf9SEG45b6cxn/VYprM6AZwb4p64cK eRBDWmU7PJqUpEOitRiXTaUzsdYtwLzbMdoqmvRbzZY5gmz1gjfgcQ5a5cZIHFJuQE e9kW6H1HizXuQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81FCEC54E5C; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Tue, 05 Mar 2024 10:19:49 +0800 Subject: [PATCH v4 4/5] dt-bindings: phy: hisi-inno-usb2: add compatible of hisilicon,hi3798mv200-usb2-phy MIME-Version: 1.0 Message-Id: <20240305-inno-phy-v4-4-a03204c9cf1c@outlook.com> References: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> In-Reply-To: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Shawn Guo , Philipp Zabel Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709605195; l=1981; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=wZ19rp19Vxc5/c1Dz8YVfg/y4dYjOmfzasZL5uF3AuA=; b=Dnqcmj76wQuPc3ttKvuVarxC4G2id7/3Z9Wg2UUMDSlEc3KKyPFjdZSm7lgammo8QVZj5yIbZ 0Ijy5mV9iiqAX061Dn92Hh+Um0E2n1z/jJJMs3f8Y/VDhM3w3xKBfOK X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_181959_301528_790144DF X-CRM114-Status: UNSURE ( 7.88 ) X-CRM114-Notice: Please train this message. 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: , Reply-To: forbidden405@outlook.com Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Yang Xiwen Hi3798MV200 INNO USB2 PHY is attached directly to system bus. Add compatible "hisilicon,hi3798mv200-usb2-phy" for it. The ports of Hi3798MV200 INNO PHY has its own address space, so Signed-off-by: Yang Xiwen Reviewed-by: Rob Herring --- .../bindings/phy/hisilicon,inno-usb2-phy.yaml | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml index 7f0811a2dc2b..92559bdc4fef 100644 --- a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml @@ -15,6 +15,7 @@ properties: - enum: - hisilicon,hi3798cv200-usb2-phy - hisilicon,hi3798mv100-usb2-phy + - hisilicon,hi3798mv200-usb2-phy reg: maxItems: 1 @@ -22,18 +23,29 @@ properties: peripheral controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC, or direct MMIO address space. + ranges: + maxItems: 1 + '#address-cells': const: 1 '#size-cells': - const: 0 + enum: [0, 1] clocks: maxItems: 1 description: reference clock resets: - maxItems: 1 + minItems: 1 + items: + - description: port reset + - description: optional external test bus reset + + reset-names: + items: + - const: port + - const: test patternProperties: 'phy@[0-9a-f]+': @@ -66,6 +78,21 @@ required: - '#size-cells' - resets +allOf: + - if: + properties: + compatible: + contains: + const: hisilicon,hi3798mv200-usb2-phy + then: + required: + - ranges + - reset-names + else: + properties: + ranges: false + reset-names: false + additionalProperties: false examples: From patchwork Tue Mar 5 02:19:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 13581552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 26161C48BF6 for ; Tue, 5 Mar 2024 02:20:15 +0000 (UTC) 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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=46aW1Rg4S5OtYS3EYoWTGSytGtZjQhIhjY+uDHWYlTU=; b=0+J81mpOd7V3Ke FnGYUpuK54LnYL4N+mFuiWhphj0Wv5tHAP3lgRW4apGelNwCuIIMnkogGSLCd+cY2Kt055lFST6II L6UvQJldv8lPB7ZxnFntt+FH7THObvLPPVelKqDgZcJdkWIH/1njAu5CUEQL12DVXz3KCmm5hK7qH Nt4IDmz407OUwf9Jy61PcTxOnHD+heSxTJVrUyjrNNsaRVCzKCPDLPH6uO1tFdaIGkm8HuQPvSkUz kJCXtyNZHDhGAC5lB3wIgfD9I69ZzPUhw9GwAIs1/P0vebGvnpjS1tJC0far6b/mYNyMw7ygCgWgH +3Y/grbZXnGDKeON1lrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPe-0000000BXZN-3JFA; Tue, 05 Mar 2024 02:20:14 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhKPP-0000000BXRQ-3Syq for linux-phy@lists.infradead.org; Tue, 05 Mar 2024 02:20:13 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E219E6132F; Tue, 5 Mar 2024 02:19:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 9F512C43609; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709605196; bh=ZVz6nj4UbEpZbl6tYHxFuKq/qPSaAZ9MpnOjiva0PyY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=QMP7FoPsJ74ILNiOd7Tvaw9B9Mhf5P5Ddf0hJN8qCcLMJ6NnBlCCA3uB97pBw6Rj/ MJqrxQs4/2qL1hf/tPorVTigIca8M4XR7zpk9JXfBCrUCsOxry4zqBbb6wn0bbwwdA NFkW858bPpUYmLqJMxyxqapPE11ZP+jSi9as41EAxguFOw6xzjcQedOPpdXB557Jly WYXoonrhRAywoi7NCr/3ptmwlTGJhPtQryKiVL0sF9Xx7VIcQCgRWRnoy2+7X7F2aM 0ot3s1EsZsOLzDeB4cn6vpp/eXQWVg/edfWQnVhbtif1j5qkj70NpIYYuvvoBW0Uju be7YeTtB7m7tQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D7CBC54E58; Tue, 5 Mar 2024 02:19:56 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Tue, 05 Mar 2024 10:19:50 +0800 Subject: [PATCH v4 5/5] phy: hisilicon: hisi-inno-phy: add support for Hi3798MV200 INNO PHY MIME-Version: 1.0 Message-Id: <20240305-inno-phy-v4-5-a03204c9cf1c@outlook.com> References: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> In-Reply-To: <20240305-inno-phy-v4-0-a03204c9cf1c@outlook.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Shawn Guo , Philipp Zabel Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709605195; l=5083; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=hpWZOa3GUm+yktbgJ6FbaHA5gwAHZdlfsvDn+nR5IsE=; b=+qlj9H6AzcRViTrVE/rR0YLSUPKB4v0WqydB/LFfz2sNY2E2mZuHuEQ1tqHyI8EN570QJDPdr nJtS/tsHjFZBRuQVZ5fywvp+rsmUAyEGSPezBkDg1F1rYdeHjiOK5uP X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_182000_612083_72C6794B X-CRM114-Status: GOOD ( 16.95 ) 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: , Reply-To: forbidden405@outlook.com Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Yang Xiwen Direct MMIO resgiter access is used by Hi3798MV200. For other models, of_iomap() returns NULL due to insufficient length. So they are unaffected. Also Hi3798MV200 INNO PHY has an extra reset required to be deasserted, switch to reset_control_bulk_() APIs for that. Signed-off-by: Yang Xiwen --- drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 66 ++++++++++++++++++------------ 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c b/drivers/phy/hisilicon/phy-hisi-inno-usb2.c index b7e740eb4752..a759823b5b1e 100644 --- a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c +++ b/drivers/phy/hisilicon/phy-hisi-inno-usb2.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,7 @@ #define PHY_TYPE_0 0 #define PHY_TYPE_1 1 +#define PHY_TYPE_MMIO 2 #define PHY_TEST_DATA GENMASK(7, 0) #define PHY_TEST_ADDR_OFFSET 8 @@ -43,6 +45,7 @@ #define PHY_CLK_ENABLE BIT(2) struct hisi_inno_phy_port { + void __iomem *base; struct reset_control *utmi_rst; struct hisi_inno_phy_priv *priv; }; @@ -50,7 +53,7 @@ struct hisi_inno_phy_port { struct hisi_inno_phy_priv { void __iomem *mmio; struct clk *ref_clk; - struct reset_control *por_rst; + struct reset_control *rsts; unsigned int type; struct hisi_inno_phy_port ports[INNO_PHY_PORT_NUM]; }; @@ -62,26 +65,31 @@ static void hisi_inno_phy_write_reg(struct hisi_inno_phy_priv *priv, u32 val; u32 value; - if (priv->type == PHY_TYPE_0) - val = (data & PHY_TEST_DATA) | - ((addr << PHY_TEST_ADDR_OFFSET) & PHY0_TEST_ADDR) | - ((port << PHY0_TEST_PORT_OFFSET) & PHY0_TEST_PORT) | - PHY0_TEST_WREN | PHY0_TEST_RST; - else - val = (data & PHY_TEST_DATA) | - ((addr << PHY_TEST_ADDR_OFFSET) & PHY1_TEST_ADDR) | - ((port << PHY1_TEST_PORT_OFFSET) & PHY1_TEST_PORT) | - PHY1_TEST_WREN | PHY1_TEST_RST; - writel(val, reg); - - value = val; - if (priv->type == PHY_TYPE_0) - value |= PHY0_TEST_CLK; - else - value |= PHY1_TEST_CLK; - writel(value, reg); - - writel(val, reg); + if (priv->ports[port].base) + /* FIXME: fill stride in priv */ + writel(data, (u32 *)priv->ports[port].base + addr); + else { + if (priv->type == PHY_TYPE_0) + val = (data & PHY_TEST_DATA) | + ((addr << PHY_TEST_ADDR_OFFSET) & PHY0_TEST_ADDR) | + ((port << PHY0_TEST_PORT_OFFSET) & PHY0_TEST_PORT) | + PHY0_TEST_WREN | PHY0_TEST_RST; + else + val = (data & PHY_TEST_DATA) | + ((addr << PHY_TEST_ADDR_OFFSET) & PHY1_TEST_ADDR) | + ((port << PHY1_TEST_PORT_OFFSET) & PHY1_TEST_PORT) | + PHY1_TEST_WREN | PHY1_TEST_RST; + writel(val, reg); + + value = val; + if (priv->type == PHY_TYPE_0) + value |= PHY0_TEST_CLK; + else + value |= PHY1_TEST_CLK; + writel(value, reg); + + writel(val, reg); + } } static void hisi_inno_phy_setup(struct hisi_inno_phy_priv *priv) @@ -104,7 +112,7 @@ static int hisi_inno_phy_init(struct phy *phy) return ret; udelay(REF_CLK_STABLE_TIME); - reset_control_deassert(priv->por_rst); + reset_control_deassert(priv->rsts); udelay(POR_RST_COMPLETE_TIME); /* Set up phy registers */ @@ -122,7 +130,7 @@ static int hisi_inno_phy_exit(struct phy *phy) struct hisi_inno_phy_priv *priv = port->priv; reset_control_assert(port->utmi_rst); - reset_control_assert(priv->por_rst); + reset_control_assert(priv->rsts); clk_disable_unprepare(priv->ref_clk); return 0; @@ -158,15 +166,16 @@ static int hisi_inno_phy_probe(struct platform_device *pdev) if (IS_ERR(priv->ref_clk)) return PTR_ERR(priv->ref_clk); - priv->por_rst = devm_reset_control_get_exclusive(dev, NULL); - if (IS_ERR(priv->por_rst)) - return PTR_ERR(priv->por_rst); + priv->rsts = devm_reset_control_array_get(dev, false, false); + if (IS_ERR(priv->rsts)) + return PTR_ERR(priv->rsts); priv->type = (uintptr_t) of_device_get_match_data(dev); for_each_child_of_node(np, child) { struct reset_control *rst; struct phy *phy; + void __iomem *base; rst = of_reset_control_get_exclusive(child, NULL); if (IS_ERR(rst)) { @@ -174,7 +183,10 @@ static int hisi_inno_phy_probe(struct platform_device *pdev) return PTR_ERR(rst); } + base = of_iomap(child, 0); + priv->ports[i].utmi_rst = rst; + priv->ports[i].base = base; priv->ports[i].priv = priv; phy = devm_phy_create(dev, child, &hisi_inno_phy_ops); @@ -205,6 +217,8 @@ static const struct of_device_id hisi_inno_phy_of_match[] = { .data = (void *) PHY_TYPE_0 }, { .compatible = "hisilicon,hi3798mv100-usb2-phy", .data = (void *) PHY_TYPE_1 }, + { .compatible = "hisilicon,hi3798mv200-usb2-phy", + .data = (void *) PHY_TYPE_MMIO }, { }, }; MODULE_DEVICE_TABLE(of, hisi_inno_phy_of_match);