From patchwork Wed Dec 22 21:30:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 12697325 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 A1390C433EF for ; Wed, 22 Dec 2021 21:32:13 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=JCK2wI8tN+KzvY56aLtEabtNTXaYeOOJFQ6s7LG3nJE=; b=Oyl6580gdXWE3D OwDZO35aqCe6UkDRCA9Qz/P0wQZCo0sOJj5INjD20H62ic2thOhE8fQv611AOf+1gC6RLmDw4jfKY gMvijCrwMpqDAHwVyOBbti0TqLF/Pz1n3kKkzKuw6rlCWV7mE1cbSLlGW+hiqnfC+uu89wk+EWfnn Prllng15UxmSJ9d2p9KZeBl62VB7ita27gBEDof7svDcJiVs+HhZEoBqyLnHm5n8m5ZSubXVifFEK hJzIVbYhgvEjpCG2pKjiPRAWL03EuG3ppjrXtXY41g6WHTHshH0gePYtdq0KMOYIAWqkDdsQPQVZp +GIIOL15uoDdZRHbzvjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n09CN-00BLUh-9T; Wed, 22 Dec 2021 21:30:59 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n09C9-00BLN6-L5; Wed, 22 Dec 2021 21:30:46 +0000 Received: by mail-ed1-x533.google.com with SMTP id j6so13490803edw.12; Wed, 22 Dec 2021 13:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qQXUaN0G/M7AuMBSJmA3Q8Ph5u2SiY7RJ4xRri99ZLE=; b=AumMTRNWoZx/L5fXOyl3GJKgA4sfsO4D5ZIKm+9We5Y/AvzVLyE2MwEvvYCChW3CIb 8eHNz3bxYNg52d2Wy2uFHkY0Pr1HbLd5y6c2ir8Hqyx09+z+ns1nHf+MF6MXS9JMjBjY Y7dKi1+vEZCDDfmcb6z2wIADqnY6UtiYCB69ca8xWN/WLwpzUj1dcRepWBS/tXPqmg9I XsSHNYUTy0Wn0HbRaqOq6fjVwc9mzAjH+oGFR+QW5tmMjswoSkC64Pe5nATUs94H8z0j iVL6HIOTOFW4VboFn7aPXJB0dcgWYRODeS0Gt/U45dzgLCplRT1ApdwPXyZDZiTBxeGv nuVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qQXUaN0G/M7AuMBSJmA3Q8Ph5u2SiY7RJ4xRri99ZLE=; b=GmU9A33OJIowrTqI/Lj6804eufSsk4Z23d7GJp9NSkcTAEeC1D6WTyVnvlrN4CSwiU 8Nq9X9Q+4tOQ+G2o35Cr2P/ytoQriAgWbe1l4RXTAoExhSlbHLkXes7ERK5UaqljvSBL pTk/fF2hHTaH9VX9338gXm0WdQjmtTUn4pHRn/v5fYEmRga4udaN8p6IwzZwxTJbALU+ KEksmYikKxiIzaqV7Hgq3mQwQb4qKVd6VEM48HaqVYE0170mEwQ3Z1ikH41RyoTwGC4O WHvJpJYqD4zsCQ4A1QVQoBKy3vUuq6PxoFrPoKF/06ywAZKjuBgKHuf1PfBARUOtPEYj Bt/w== X-Gm-Message-State: AOAM533V2a/gPdPItsbL5oW6z7Z3ARsDgiDMO3QtPa36uWCw7ZhpE4e7 JfYuWveSoJ6l6Hmc7hRbcpM= X-Google-Smtp-Source: ABdhPJz6Fpffv+KYXV7xi5AzTzY21/iPgukLA+zAUVKyJuepnnsc0k2qSeJgVh35yHAEQAghE25M/A== X-Received: by 2002:a17:907:1c9c:: with SMTP id nb28mr4053483ejc.452.1640208640675; Wed, 22 Dec 2021 13:30:40 -0800 (PST) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id ne2sm1087776ejc.108.2021.12.22.13.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 13:30:40 -0800 (PST) From: Johan Jonker To: heiko@sntech.de Cc: robh+dt@kernel.org, kishon@ti.com, vkoul@kernel.org, p.zabel@pengutronix.de, lee.jones@linaro.org, yifeng.zhao@rock-chips.com, kever.yang@rock-chips.com, cl@rock-chips.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v6 1/4] dt-bindings: mfd: syscon: add naneng multi phy register compatible Date: Wed, 22 Dec 2021 22:30:29 +0100 Message-Id: <20211222213032.7678-2-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211222213032.7678-1-jbx6244@gmail.com> References: <20211222213032.7678-1-jbx6244@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_133045_718145_FF686BE8 X-CRM114-Status: UNSURE ( 8.27 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add Naneng multi phy register compatible. Signed-off-by: Johan Jonker Signed-off-by: Yifeng Zhao Acked-by: Rob Herring --- Documentation/devicetree/bindings/mfd/syscon.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml index 5de16388a..9f0c8aa81 100644 --- a/Documentation/devicetree/bindings/mfd/syscon.yaml +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml @@ -52,6 +52,8 @@ properties: - rockchip,rk3288-qos - rockchip,rk3368-qos - rockchip,rk3399-qos + - rockchip,rk3568-pipe-grf + - rockchip,rk3568-pipe-phy-grf - rockchip,rk3568-qos - samsung,exynos3-sysreg - samsung,exynos4-sysreg From patchwork Wed Dec 22 21:30:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 12697327 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 20383C433F5 for ; Wed, 22 Dec 2021 21:32:48 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=AChAbLPMlXxKu8vulWlq+djnH/tnWqDU6MZ8XzBFciA=; b=VsJA2ZQdoQJYbF Xcb5vlOT/VOrhJIIvUi5QONWc/ZQhpckBX0X7CDB8ZouIjnf6Ws1WJuiupiZiDIWfyNFDvYO4vtsf u9Y1egs0yeVmzUg1whUNtQKnmclhwJcUqUg9My4xn9UMaz4ryUplnVVUwvaEiHHDp/w+XWk3ogy2f r/UkICkagZU09j8RPMH+ZwhbV5D94l83YSa4nG6ADxYSbYGBO2Lok8DIvqrIq0bVWZrIJ9DLEiXVt iRcA6UfKK9lhhxPNNMGvu2p+VvEav/Y2gOZjtSi1O2HE/R4nZioHryx/DH1rD0Gvzk1v6ZLo4+MML zEtlzxdZIJjnbQvvhzwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n09Cs-00BLhe-2M; Wed, 22 Dec 2021 21:31:30 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n09C9-00BLNF-P1; Wed, 22 Dec 2021 21:30:48 +0000 Received: by mail-ed1-x532.google.com with SMTP id x15so13717521edv.1; Wed, 22 Dec 2021 13:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q9xBnp+DcnB6XC5obBOXShIXNIp0uQFFeRvqFbdve3w=; b=BOyE9hxYPdMU2y5WUQnnm+p4QwH8QQt6K/e+4iD6zZ/oQWSYfvd+ETgFHHAD2wkEqb FuEPHeB0WLKhN8pguiTPR2VzuQJxeF4QOnJtG9iUiY6Vjx+axAFS9FaaWGoBsEJCkYJR N4d+KpiAmge/Spiza0Vtc1ryWD73w8TLQHiZp4qSpNzWKL0EnGErK+HrAbzqAMmy8VrN G7rvEByUqTdqyVxiVRVvFmH2j2iweJKwY+lqBpcZdtO++o3Kb1u8ml2g1fYEM6EMAFmH 0xgSNRnoMdxW0XbmTN8a89UEr/z3gZx5pLMmctzmZ3LmVKqyMlRJooowfoMWy3JM+Yf1 rGlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q9xBnp+DcnB6XC5obBOXShIXNIp0uQFFeRvqFbdve3w=; b=D9YuTzi2sSMUtZ0Zgt9YZjhdAkyaoJmXtSA+6e3t32m6qgAbkqjZhv0H7kXgNTAM7o yYqbdmu787Z6nDuiGgxn5lzaiP01YRqtcC2a+SCxNoNlmO7ua5KhaD4whW05+sWI2Ks7 UAL7GQsx27gYIvCYJbNq3kH8+SotRUm0UNw7ooZjnRB+8sEg5NjDyDCXYBL8/V6ETPMM 9XkZ7yBlYHqy44nIC+NeMO7iVriB7UHcvpTbStAf1LjNsDoSz7CXCZtpbRy4KJCi3IdJ QkWBYYjlGP/bR5EUkmXh3r8YcitNrIHIlZ/pxH4Y/wF32RCD6GOnUQ/GvXCbq1JLGME4 Yocg== X-Gm-Message-State: AOAM531f0+ojfOR56oVPFef1t2JHR7oqLe/SD53fv1oToCvU0UI/IJCU K3lsH8GRnN1Xmnj4y2d4rjs= X-Google-Smtp-Source: ABdhPJyXgoXKOqrBn8mrW2mn2gHaC6E5k8NmTCsecC/cPmhf+k3OxerK4SD9CswDtgpfmM16W5coig== X-Received: by 2002:a05:6402:440a:: with SMTP id y10mr4257267eda.371.1640208641640; Wed, 22 Dec 2021 13:30:41 -0800 (PST) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id ne2sm1087776ejc.108.2021.12.22.13.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 13:30:41 -0800 (PST) From: Johan Jonker To: heiko@sntech.de Cc: robh+dt@kernel.org, kishon@ti.com, vkoul@kernel.org, p.zabel@pengutronix.de, lee.jones@linaro.org, yifeng.zhao@rock-chips.com, kever.yang@rock-chips.com, cl@rock-chips.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v6 2/4] dt-bindings: phy: rockchip: add naneng multi phy bindings Date: Wed, 22 Dec 2021 22:30:30 +0100 Message-Id: <20211222213032.7678-3-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211222213032.7678-1-jbx6244@gmail.com> References: <20211222213032.7678-1-jbx6244@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_133045_874998_99885B77 X-CRM114-Status: GOOD ( 15.97 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Yifeng Zhao Add the compatible strings for the Naneng multi phy found on Rockchip SoCs. Signed-off-by: Yifeng Zhao Signed-off-by: Johan Jonker --- Changes in v6: - change from comb to multi phy - add parent node - change compatible strings - remove rockchip,sgmii-mac-sel - remove rockchip,dis-u3otg0-port - remove rockchip,dis-u3otg1-port Changes in v5: - modify description for ssc and ext-refclk - remove apb reset Changes in v4: - restyle - remove some minItems - add more properties - remove reset-names - move #phy-cells - add rockchip,rk3568-pipe-grf - add rockchip,rk3568-pipe-phy-grf Changes in v3: None Changes in v2: - Fix dtschema/dtc warnings/errors --- .../phy/phy-rockchip-naneng-multiphy.yaml | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/phy-rockchip-naneng-multiphy.yaml diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-naneng-multiphy.yaml b/Documentation/devicetree/bindings/phy/phy-rockchip-naneng-multiphy.yaml new file mode 100644 index 000000000..40ec1b240 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-naneng-multiphy.yaml @@ -0,0 +1,167 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/phy-rockchip-naneng-multiphy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip SoC Naneng Multi Phy Device Tree Bindings + +maintainers: + - Heiko Stuebner + +properties: + compatible: + enum: + - rockchip,rk3566-naneng-multiphy + - rockchip,rk3568-naneng-multiphy + + rockchip,pipe-grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Some additional phy settings are accessed through GRF regs. + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + +required: + - compatible + - "#address-cells" + - "#size-cells" + +additionalProperties: false + +patternProperties: + "multi-phy@[0-9a-f]+$": + type: object + + properties: + reg: + maxItems: 1 + + clocks: + items: + - description: reference clock + - description: apb clock + - description: pipe clock + + clock-names: + items: + - const: ref + - const: apb + - const: pipe + + resets: + items: + - description: exclusive PHY reset line + + rockchip,enable-ssc: + type: boolean + description: + The option SSC can be enabled for U3, SATA and PCIE. + Most commercially available platforms use SSC to reduce EMI. + + rockchip,ext-refclk: + type: boolean + description: + Many PCIe connections, especially backplane connections, + require a synchronous reference clock between the two link partners. + To achieve this a common clock source, referred to as REFCLK in + the PCI Express Card Electromechanical Specification, + should be used by both ends of the PCIe link. + In PCIe mode one can choose to use an internal + or an external reference clock. + By default the internal clock is selected. The PCIe PHY provides a 100MHz + differential clock output(optional with SSC) for system applications. + When selecting this option an externally 100MHz differential + reference clock needs to be provided to the PCIe PHY. + + rockchip,pipe-phy-grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Some additional pipe settings are accessed through GRF regs. + + "#phy-cells": + const: 1 + + required: + - reg + - clocks + - clock-names + - resets + - rockchip,pipe-phy-grf + - "#phy-cells" + + additionalProperties: false + +examples: + - | + #include + + pipegrf: syscon@fdc50000 { + compatible = "rockchip,rk3568-pipe-grf", "syscon"; + reg = <0xfdc50000 0x1000>; + }; + + pipe_phy_grf0: syscon@fdc70000 { + compatible = "rockchip,rk3568-pipe-phy-grf", "syscon"; + reg = <0xfdc70000 0x1000>; + }; + + pipe_phy_grf1: syscon@fdc80000 { + compatible = "rockchip,rk3568-pipe-phy-grf", "syscon"; + reg = <0xfdc80000 0x1000>; + }; + + pipe_phy_grf2: syscon@fdc90000 { + compatible = "rockchip,rk3568-pipe-phy-grf", "syscon"; + reg = <0xfdc90000 0x1000>; + }; + + multiphy: multiphy { + compatible = "rockchip,rk3568-naneng-multiphy"; + rockchip,pipe-grf = <&pipegrf>; + #address-cells = <2>; + #size-cells = <2>; + + multiphy0: multi-phy@fe820000 { + reg = <0x0 0xfe820000 0x0 0x100>; + clocks = <&pmucru CLK_PCIEPHY0_REF>, + <&cru PCLK_PIPEPHY0>, + <&cru PCLK_PIPE>; + clock-names = "ref", "apb", "pipe"; + assigned-clocks = <&pmucru CLK_PCIEPHY0_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY0>; + rockchip,pipe-phy-grf = <&pipe_phy_grf0>; + #phy-cells = <1>; + }; + + multiphy1: multi-phy@fe830000 { + reg = <0x0 0xfe830000 0x0 0x100>; + clocks = <&pmucru CLK_PCIEPHY1_REF>, + <&cru PCLK_PIPEPHY1>, + <&cru PCLK_PIPE>; + clock-names = "ref", "apb", "pipe"; + assigned-clocks = <&pmucru CLK_PCIEPHY1_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY1>; + rockchip,pipe-phy-grf = <&pipe_phy_grf1>; + #phy-cells = <1>; + }; + + multiphy2: multi-phy@fe840000 { + reg = <0x0 0xfe840000 0x0 0x100>; + clocks = <&pmucru CLK_PCIEPHY2_REF>, + <&cru PCLK_PIPEPHY2>, + <&cru PCLK_PIPE>; + clock-names = "ref", "apb", "pipe"; + assigned-clocks = <&pmucru CLK_PCIEPHY2_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY2>; + rockchip,pipe-phy-grf = <&pipe_phy_grf2>; + #phy-cells = <1>; + }; + }; From patchwork Wed Dec 22 21:30:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 12697326 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 E6A15C433EF for ; Wed, 22 Dec 2021 21:32:38 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=ydx3kzQ+g4hpTThDnYsca77t7QoZKjqxqwpEtFeBidE=; b=DCYSufZrE8L4I9 M+8W3xAXvDBZFDm2VfVR5v+LP2R5aGJAjef81RbnOjssEQMko5dpJBjTf8vcIp4rfeMs4+n49wSeW U0hOn1LqRG0MWRP42To41K022WkTlC88gRaz5tPlenx6SvrvBjBOczuS11ILLJ+zPcNizAfz88ImI eugdAkvGPUWwAW9UNV41NN9HRHIMSSkdcmbJgPWwcE0o2P5IPiNw2zYLFhtoZVePIUyzEJp/dOlFn xjUilUJKWzkP61hEsMHkalvKpQXcvFxyFHa5V29/61Wx8YbqnCwYcCq+CxHrvSgr/8oK8qwH50gzc jxDH8Dmv9VVZxxmb93PA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n09CZ-00BLYi-EG; Wed, 22 Dec 2021 21:31:11 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n09C8-00BLNe-DN; Wed, 22 Dec 2021 21:30:47 +0000 Received: by mail-ed1-x529.google.com with SMTP id b13so13566765edd.8; Wed, 22 Dec 2021 13:30:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m20m85gDAiOlVcpKPCRTeS3RtyxvXkd97QbTkmzrC9c=; b=p0ABiDZ74n3EHl5wYlaXNYvpvaLC0GS22vJL8kYepswK5CYfRB7ROQBrWr49B7lAWN 5gcxwkiVYSdUCd0Bj/lJTcrEH91GMydyN2SC01YVKaoLSKEZ+PxpjNhkMNQx6U5pBeV7 kcdJcoYDfHCLCF09WVF5RD6ztJbvK4dBzEr5ut7H9Xr0JwoSEZ7PaiTPjUK7L9dWyPcj pbL+82LNeMJw0gYgJjVpR70i0YtZYC5UBrFqBAw7QrpFqE+XH95jhbNGSM8E2mnf1Svl OG5yHM+i5fLXw62Z4hpfQV6tcro5ECQS99/nXQTZT7TyCxx1mtPy7bXzFtBIf4islIWe tMrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m20m85gDAiOlVcpKPCRTeS3RtyxvXkd97QbTkmzrC9c=; b=rL53def96ZGgN3OWsJJVyZywkj3SISnsfPyebVBAxVhOYFDZGPrdQJ5Wtur9vt9nbm NT5uIHXquZyVr0OQOUFKLxg1C8EzKIyaRj51BCNjHBThGM9bBLNxfFJNIhaf/UzR2twK iI2+3maDYtZUug3L5Qdti2wMl9m7OX9B1DZ3KmHyQE1RLPjqMt+Qpp4yepYr1lmz+1pR G8GiGYUbvbdGmfB58RSyPgq34VsIDAZQxian56O/zr0ADLizlO0cml3OsFjnOZ61xyo+ P8CtWd9a7AqzAQ/ybZ106mWRxor53DMpVbDUv1Q9xdCOYbF+LIqO7tVVcGoB9QgJ8pxB g5wA== X-Gm-Message-State: AOAM532GoZ4idlC6yPGfw5Pq5M1grGWPHxMqahEmeEouho/OQbxjQ1jj R1RepqQsjUgrv+lqOJ9fzpk= X-Google-Smtp-Source: ABdhPJzxDIbYyk9ia5wC4V2QjyzjgjMs/EEQHN+wPThnCz5qZsUeZKUXsZQqsRh2Cenrp/cASHj5dg== X-Received: by 2002:a17:907:1c92:: with SMTP id nb18mr3924413ejc.256.1640208642955; Wed, 22 Dec 2021 13:30:42 -0800 (PST) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id ne2sm1087776ejc.108.2021.12.22.13.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 13:30:42 -0800 (PST) From: Johan Jonker To: heiko@sntech.de Cc: robh+dt@kernel.org, kishon@ti.com, vkoul@kernel.org, p.zabel@pengutronix.de, lee.jones@linaro.org, yifeng.zhao@rock-chips.com, kever.yang@rock-chips.com, cl@rock-chips.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v6 3/4] phy: rockchip: add naneng multi phy for rk3568 Date: Wed, 22 Dec 2021 22:30:31 +0100 Message-Id: <20211222213032.7678-4-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211222213032.7678-1-jbx6244@gmail.com> References: <20211222213032.7678-1-jbx6244@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_133044_594226_878EF061 X-CRM114-Status: GOOD ( 24.38 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Yifeng Zhao This patch implements a multi phy driver for Rockchip SoCs with NaNeng IP block. This phy can be used as pcie-phy, usb3-phy, sata-phy or sgmii-phy. Signed-off-by: Yifeng Zhao Signed-off-by: Johan Jonker --- TEST COMPILED ONLY! Driver not verified with hardware! --- Changes in v6: - restyle - rename defines - change from comb to multi phy - clean up includes - add parent node - change compatible strings - remove rockchip,sgmii-mac-sel support - remove rockchip,dis-u3otg0-port support - remove rockchip,dis-u3otg1-port support Changes in v5: - add rockchip_combphy_updatel() - restyle Changes in v4: - restyle - add devm_reset_control_array_get() - remove clk structure - change refclk DT parse - change dev_err message - add dot to phrase - add ext_refclk variable - add enable_ssc variable - rename rockchip_combphy_param_write - remove param_read - replace rockchip-naneng-combphy driver name Changes in v3: - Using api devm_reset_control_get_optional_exclusive and dev_err_probe. - Remove apb_rst. - Redefine registers address. Changes in v2: - Using api devm_platform_get_and_ioremap_resource. - Modify rockchip_combphy_set_Mode. - Add some PHY registers definition. --- drivers/phy/rockchip/Kconfig | 8 + drivers/phy/rockchip/Makefile | 1 + .../rockchip/phy-rockchip-naneng-multiphy.c | 661 ++++++++++++++++++ 3 files changed, 670 insertions(+) create mode 100644 drivers/phy/rockchip/phy-rockchip-naneng-multiphy.c diff --git a/drivers/phy/rockchip/Kconfig b/drivers/phy/rockchip/Kconfig index e812adad7..a14e32b6f 100644 --- a/drivers/phy/rockchip/Kconfig +++ b/drivers/phy/rockchip/Kconfig @@ -66,6 +66,14 @@ config PHY_ROCKCHIP_INNO_DSIDPHY Enable this to support the Rockchip MIPI/LVDS/TTL PHY with Innosilicon IP block. +config PHY_ROCKCHIP_NANENG_MULTI_PHY + tristate "Rockchip NANENG MULTI PHY Driver" + depends on ARCH_ROCKCHIP && OF + select GENERIC_PHY + help + Enable this to support the Rockchip PCIe/USB3.0/SATA/QSGMII + multi PHY with NaNeng IP block. + config PHY_ROCKCHIP_PCIE tristate "Rockchip PCIe PHY Driver" depends on (ARCH_ROCKCHIP && OF) || COMPILE_TEST diff --git a/drivers/phy/rockchip/Makefile b/drivers/phy/rockchip/Makefile index f0eec212b..d5570452f 100644 --- a/drivers/phy/rockchip/Makefile +++ b/drivers/phy/rockchip/Makefile @@ -6,6 +6,7 @@ obj-$(CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY) += phy-rockchip-inno-csidphy.o obj-$(CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY) += phy-rockchip-inno-dsidphy.o obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o +obj-$(CONFIG_PHY_ROCKCHIP_NANENG_MULTI_PHY) += phy-rockchip-naneng-multiphy.o obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o obj-$(CONFIG_PHY_ROCKCHIP_TYPEC) += phy-rockchip-typec.o obj-$(CONFIG_PHY_ROCKCHIP_USB) += phy-rockchip-usb.o diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-multiphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-multiphy.c new file mode 100644 index 000000000..765ede440 --- /dev/null +++ b/drivers/phy/rockchip/phy-rockchip-naneng-multiphy.c @@ -0,0 +1,661 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Rockchip PIPE USB3.0 PCIE SATA Multi Phy driver + * + * Copyright (C) 2021 Rockchip Electronics Co., Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BIT_WRITEABLE_SHIFT 16 +#define REF_CLOCK_24MHz (24 * HZ_PER_MHZ) +#define REF_CLOCK_25MHz (25 * HZ_PER_MHZ) +#define REF_CLOCK_100MHz (100 * HZ_PER_MHZ) + +/* RK3568 MULTI PHY REG */ +#define RK3568_PHYREG6 0x14 +#define PHYREG6_PLL_DIV_MASK GENMASK(7, 6) +#define PHYREG6_PLL_DIV_SHIFT 6 +#define PHYREG6_PLL_DIV_2 1 + +#define RK3568_PHYREG7 0x18 +#define PHYREG7_TX_RTERM_MASK GENMASK(7, 4) +#define PHYREG7_TX_RTERM_SHIFT 4 +#define PHYREG7_TX_RTERM_50OHM 8 +#define PHYREG7_RX_RTERM_MASK GENMASK(3, 0) +#define PHYREG7_RX_RTERM_SHIFT 0 +#define PHYREG7_RX_RTERM_44OHM 15 + +#define RK3568_PHYREG8 0x1C +#define PHYREG8_SSC_EN BIT(4) + +#define RK3568_PHYREG11 0x28 +#define PHYREG11_SU_TRIM_0_7 0xF0 + +#define RK3568_PHYREG12 0x2C +#define PHYREG12_PLL_LPF_ADJ_VALUE 4 + +#define RK3568_PHYREG13 0x30 +#define PHYREG13_RESISTER_MASK GENMASK(5, 4) +#define PHYREG13_RESISTER_SHIFT 0x4 +#define PHYREG13_RESISTER_HIGH_Z 3 +#define PHYREG13_CKRCV_AMP0 BIT(7) + +#define RK3568_PHYREG14 0x34 +#define PHYREG14_CKRCV_AMP1 BIT(0) + +#define RK3568_PHYREG15 0x38 +#define PHYREG15_CTLE_EN BIT(0) +#define PHYREG15_SSC_CNT_MASK GENMASK(7, 6) +#define PHYREG15_SSC_CNT_SHIFT 6 +#define PHYREG15_SSC_CNT_VALUE 1 + +#define RK3568_PHYREG16 0x3C +#define PHYREG16_SSC_CNT_VALUE 0x5f + +#define RK3568_PHYREG18 0x44 +#define PHYREG18_PLL_LOOP 0x32 + +#define RK3568_PHYREG32 0x7C +#define PHYREG32_SSC_MASK GENMASK(7, 4) +#define PHYREG32_SSC_DIR_SHIFT 4 +#define PHYREG32_SSC_UPWARD 0 +#define PHYREG32_SSC_DOWNWARD 1 +#define PHYREG32_SSC_OFFSET_SHIFT 6 +#define PHYREG32_SSC_OFFSET_500PPM 1 + +#define RK3568_PHYREG33 0x80 +#define PHYREG33_PLL_KVCO_MASK GENMASK(4, 2) +#define PHYREG33_PLL_KVCO_SHIFT 2 +#define PHYREG33_PLL_KVCO_VALUE 2 + +struct rockchip_multiphy_priv; + +struct multiphy_reg { + u16 offset; + u16 bitend; + u16 bitstart; + u16 disable; + u16 enable; +}; + +struct rockchip_multiphy_grfcfg { + struct multiphy_reg pcie_mode_set; + struct multiphy_reg usb_mode_set; + struct multiphy_reg sgmii_mode_set; + struct multiphy_reg qsgmii_mode_set; + struct multiphy_reg pipe_rxterm_set; + struct multiphy_reg pipe_txelec_set; + struct multiphy_reg pipe_txcomp_set; + struct multiphy_reg pipe_clk_25m; + struct multiphy_reg pipe_clk_100m; + struct multiphy_reg pipe_phymode_sel; + struct multiphy_reg pipe_rate_sel; + struct multiphy_reg pipe_rxterm_sel; + struct multiphy_reg pipe_txelec_sel; + struct multiphy_reg pipe_txcomp_sel; + struct multiphy_reg pipe_clk_ext; + struct multiphy_reg pipe_sel_usb; + struct multiphy_reg pipe_sel_qsgmii; + struct multiphy_reg pipe_phy_status; + struct multiphy_reg con0_for_pcie; + struct multiphy_reg con1_for_pcie; + struct multiphy_reg con2_for_pcie; + struct multiphy_reg con3_for_pcie; + struct multiphy_reg con0_for_sata; + struct multiphy_reg con1_for_sata; + struct multiphy_reg con2_for_sata; + struct multiphy_reg con3_for_sata; + struct multiphy_reg pipe_con0_for_sata; + struct multiphy_reg pipe_sgmii_mac_sel; + struct multiphy_reg pipe_xpcs_phy_ready; + struct multiphy_reg u3otg0_port_en; + struct multiphy_reg u3otg1_port_en; +}; + +struct rockchip_multiphy_cfg { + const struct rockchip_multiphy_grfcfg *grfcfg; + int (*multiphy_cfg)(struct phy *phy); +}; + +struct rockchip_multiphy_node_priv { + int id; + u8 mode; + void __iomem *mmio; + int num_clks; + struct clk_bulk_data *clks; + struct regmap *phy_grf; + struct phy *phy; + struct reset_control *phy_rst; + struct clk *refclk; + bool enable_ssc; + bool ext_refclk; +}; + +struct rockchip_multiphy_priv { + struct device *dev; + int num_phy; + struct regmap *pipe_grf; + const struct rockchip_multiphy_cfg *cfg; + struct rockchip_multiphy_node_priv **node; +}; + +static void rockchip_multiphy_updatel(struct phy *phy, int mask, int val, int reg) +{ + struct rockchip_multiphy_node_priv *node_priv = phy_get_drvdata(phy); + unsigned int temp; + + temp = readl(node_priv->mmio + reg); + temp = (temp & ~(mask)) | val; + writel(temp, node_priv->mmio + reg); +} + +static int rockchip_multiphy_param_write(struct regmap *base, + const struct multiphy_reg *reg, bool en) +{ + u32 val, mask, tmp; + + tmp = en ? reg->enable : reg->disable; + mask = GENMASK(reg->bitend, reg->bitstart); + val = (tmp << reg->bitstart) | (mask << BIT_WRITEABLE_SHIFT); + + return regmap_write(base, reg->offset, val); +} + +static u32 rockchip_multiphy_is_ready(struct phy *phy) +{ + struct rockchip_multiphy_priv *priv = dev_get_drvdata(phy->dev.parent); + struct rockchip_multiphy_node_priv *node_priv = phy_get_drvdata(phy); + const struct rockchip_multiphy_grfcfg *cfg = priv->cfg->grfcfg; + u32 mask, val; + + mask = GENMASK(cfg->pipe_phy_status.bitend, + cfg->pipe_phy_status.bitstart); + + regmap_read(node_priv->phy_grf, cfg->pipe_phy_status.offset, &val); + val = (val & mask) >> cfg->pipe_phy_status.bitstart; + + return val; +} + +static int rockchip_multiphy_set_mode(struct phy *phy) +{ + struct rockchip_multiphy_priv *priv = dev_get_drvdata(phy->dev.parent); + struct rockchip_multiphy_node_priv *node_priv = phy_get_drvdata(phy); + int ret = 0; + + switch (node_priv->mode) { + case PHY_TYPE_PCIE: + case PHY_TYPE_USB3: + case PHY_TYPE_SATA: + case PHY_TYPE_SGMII: + case PHY_TYPE_QSGMII: + if (priv->cfg->multiphy_cfg) + ret = priv->cfg->multiphy_cfg(phy); + break; + default: + dev_err(priv->dev, "incompatible PHY type\n"); + return -EINVAL; + } + + if (ret) + dev_err(priv->dev, "failed to init phy for phy mode %x\n", node_priv->mode); + + return ret; +} + +static int rockchip_multiphy_init(struct phy *phy) +{ + struct rockchip_multiphy_priv *priv = dev_get_drvdata(phy->dev.parent); + struct rockchip_multiphy_node_priv *node_priv = phy_get_drvdata(phy); + const struct rockchip_multiphy_grfcfg *cfg = priv->cfg->grfcfg; + u32 val; + int ret; + + ret = clk_bulk_prepare_enable(node_priv->num_clks, node_priv->clks); + if (ret) { + dev_err(priv->dev, "failed to enable clks\n"); + return ret; + } + + ret = rockchip_multiphy_set_mode(phy); + if (ret) + goto err_clk; + + ret = reset_control_deassert(node_priv->phy_rst); + if (ret) + goto err_clk; + + if (node_priv->mode == PHY_TYPE_USB3) { + ret = readx_poll_timeout_atomic(rockchip_multiphy_is_ready, + phy, val, + val == cfg->pipe_phy_status.enable, + 10, 1000); + if (ret) + dev_warn(priv->dev, "wait phy status ready timeout\n"); + } + + return 0; + +err_clk: + clk_bulk_disable_unprepare(node_priv->num_clks, node_priv->clks); + + return ret; +} + +static int rockchip_multiphy_exit(struct phy *phy) +{ + struct rockchip_multiphy_node_priv *node_priv = phy_get_drvdata(phy); + + clk_bulk_disable_unprepare(node_priv->num_clks, node_priv->clks); + reset_control_assert(node_priv->phy_rst); + + return 0; +} + +static const struct phy_ops rochchip_multiphy_ops = { + .init = rockchip_multiphy_init, + .exit = rockchip_multiphy_exit, + .owner = THIS_MODULE, +}; + +static struct phy *rockchip_multiphy_xlate(struct device *dev, struct of_phandle_args *args) +{ + struct rockchip_multiphy_priv *priv = dev_get_drvdata(dev); + struct rockchip_multiphy_node_priv *node_priv = NULL; + struct device_node *phy_np = args->np; + int index; + + if (args->args_count != 1) { + dev_err(dev, "invalid number of arguments\n"); + return ERR_PTR(-EINVAL); + } + + for (index = 0; index < priv->num_phy; index++) + if (phy_np == priv->node[index]->phy->dev.of_node) { + node_priv = priv->node[index]; + break; + } + + if (!node_priv) { + dev_err(dev, "failed to find appropriate phy\n"); + return ERR_PTR(-EINVAL); + } + + if (node_priv->mode != PHY_NONE && node_priv->mode != args->args[0]) + dev_warn(dev, "phy type select %d overwriting type %d\n", + args->args[0], node_priv->mode); + + node_priv->mode = args->args[0]; + + return node_priv->phy; +} + +static int rockchip_multiphy_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct device_node *child_np; + struct phy_provider *phy_provider; + struct resource res; + struct rockchip_multiphy_priv *priv; + int retval; + int id; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->cfg = of_device_get_match_data(dev); + if (!priv->cfg) { + dev_err(dev, "no OF match data provided\n"); + return -EINVAL; + } + + priv->num_phy = of_get_child_count(np); + priv->node = devm_kcalloc(dev, priv->num_phy, sizeof(*priv->node), GFP_KERNEL); + if (!priv->node) + return -ENOMEM; + + priv->dev = dev; + dev_set_drvdata(dev, priv); + + priv->pipe_grf = syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,pipe-grf"); + if (IS_ERR(priv->pipe_grf)) { + dev_err(dev, "failed to find peri_ctrl pipe-grf regmap\n"); + return PTR_ERR(priv->pipe_grf); + } + + id = 0; + for_each_child_of_node(np, child_np) { + struct rockchip_multiphy_node_priv *node_priv; + struct device *subdev; + struct phy *phy; + int i; + + node_priv = devm_kzalloc(dev, sizeof(*node_priv), GFP_KERNEL); + if (!node_priv) { + retval = -ENOMEM; + goto put_child; + } + + priv->node[id] = node_priv; + + phy = devm_phy_create(dev, child_np, &rochchip_multiphy_ops); + if (IS_ERR(phy)) { + dev_err(dev, "failed to create phy\n"); + retval = PTR_ERR(phy); + goto put_child; + } + + subdev = &phy->dev; + retval = of_address_to_resource(child_np, 0, &res); + if (retval) { + dev_err(subdev, "failed to get address resource(id-%d)\n", + id); + goto put_child; + } + + node_priv->mmio = devm_ioremap_resource(subdev, &res); + if (IS_ERR(node_priv->mmio)) { + retval = PTR_ERR(node_priv->mmio); + goto put_child; + } + + node_priv->phy = phy; + node_priv->id = id; + node_priv->mode = PHY_NONE; + id++; + + phy_set_drvdata(phy, node_priv); + + node_priv->num_clks = devm_clk_bulk_get_all(dev, &node_priv->clks); + if (node_priv->num_clks < 1) { + retval = -EINVAL; + goto put_child; + } + + node_priv->refclk = NULL; + for (i = 0; i < node_priv->num_clks; i++) { + if (!strncmp(node_priv->clks[i].id, "ref", 3)) { + node_priv->refclk = node_priv->clks[i].clk; + break; + } + } + + if (!node_priv->refclk) { + dev_err(dev, "no refclk found\n"); + retval = -EINVAL; + goto put_child; + } + + node_priv->phy_grf = syscon_regmap_lookup_by_phandle(dev->of_node, + "rockchip,pipe-phy-grf"); + if (IS_ERR(node_priv->phy_grf)) { + retval = PTR_ERR(node_priv->phy_grf); + dev_err(dev, "failed to find pipe-phy-grf regmap\n"); + goto put_child; + } + + node_priv->enable_ssc = device_property_present(dev, "rockchip,enable-ssc"); + + node_priv->ext_refclk = device_property_present(dev, "rockchip,ext-refclk"); + + node_priv->phy_rst = devm_reset_control_array_get(dev, false, false); + if (IS_ERR(node_priv->phy_rst)) { + retval = PTR_ERR(node_priv->phy_rst); + dev_err(dev, "failed to get phy reset\n"); + goto put_child; + } + + retval = reset_control_assert(node_priv->phy_rst); + if (retval) { + dev_err(dev, "failed to reset phy\n"); + goto put_child; + } + } + + phy_provider = devm_of_phy_provider_register(dev, rockchip_multiphy_xlate); + + return PTR_ERR_OR_ZERO(phy_provider); +put_child: + of_node_put(child_np); + return retval; +} + +static int rk3568_multiphy_cfg(struct phy *phy) +{ + struct rockchip_multiphy_node_priv *node_priv = phy_get_drvdata(phy); + struct rockchip_multiphy_priv *priv = dev_get_drvdata(phy->dev.parent); + const struct rockchip_multiphy_grfcfg *cfg = priv->cfg->grfcfg; + unsigned long rate; + u32 val; + + switch (node_priv->mode) { + case PHY_TYPE_PCIE: + /* Set SSC downward spread spectrum. */ + rockchip_multiphy_updatel(phy, PHYREG32_SSC_MASK, + PHYREG32_SSC_DOWNWARD << PHYREG32_SSC_DIR_SHIFT, + RK3568_PHYREG32); + + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->con0_for_pcie, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->con1_for_pcie, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->con2_for_pcie, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->con3_for_pcie, true); + break; + + case PHY_TYPE_USB3: + /* Set SSC downward spread spectrum. */ + rockchip_multiphy_updatel(phy, PHYREG32_SSC_MASK, + PHYREG32_SSC_DOWNWARD << PHYREG32_SSC_DIR_SHIFT, + RK3568_PHYREG32); + + /* Enable adaptive CTLE for USB3.0 Rx. */ + val = readl(node_priv->mmio + RK3568_PHYREG15); + val |= PHYREG15_CTLE_EN; + writel(val, node_priv->mmio + RK3568_PHYREG15); + + /* Set PLL KVCO fine tuning signals. */ + rockchip_multiphy_updatel(phy, PHYREG33_PLL_KVCO_MASK, + PHYREG33_PLL_KVCO_VALUE << PHYREG33_PLL_KVCO_SHIFT, + RK3568_PHYREG33); + + /* Enable controlling random jitter. */ + writel(PHYREG12_PLL_LPF_ADJ_VALUE, node_priv->mmio + RK3568_PHYREG12); + + /* Set PLL input clock divider 1/2. */ + rockchip_multiphy_updatel(phy, PHYREG6_PLL_DIV_MASK, + PHYREG6_PLL_DIV_2 << PHYREG6_PLL_DIV_SHIFT, + RK3568_PHYREG6); + + writel(PHYREG18_PLL_LOOP, node_priv->mmio + RK3568_PHYREG18); + writel(PHYREG11_SU_TRIM_0_7, node_priv->mmio + RK3568_PHYREG11); + + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_sel_usb, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_txcomp_sel, false); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_txelec_sel, false); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->usb_mode_set, true); + break; + + case PHY_TYPE_SATA: + /* Enable adaptive CTLE for SATA Rx. */ + val = readl(node_priv->mmio + RK3568_PHYREG15); + val |= PHYREG15_CTLE_EN; + writel(val, node_priv->mmio + RK3568_PHYREG15); + /* + * Set tx_rterm=50ohm and rx_rterm=44ohm for SATA. + * 0: 60ohm, 8: 50ohm 15: 44ohm (by step abort 1ohm) + */ + val = PHYREG7_TX_RTERM_50OHM << PHYREG7_TX_RTERM_SHIFT; + val |= PHYREG7_RX_RTERM_44OHM << PHYREG7_RX_RTERM_SHIFT; + writel(val, node_priv->mmio + RK3568_PHYREG7); + + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->con0_for_sata, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->con1_for_sata, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->con2_for_sata, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->con3_for_sata, true); + rockchip_multiphy_param_write(priv->pipe_grf, &cfg->pipe_con0_for_sata, true); + break; + + case PHY_TYPE_SGMII: + rockchip_multiphy_param_write(priv->pipe_grf, &cfg->pipe_xpcs_phy_ready, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_phymode_sel, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_sel_qsgmii, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->sgmii_mode_set, true); + break; + + case PHY_TYPE_QSGMII: + rockchip_multiphy_param_write(priv->pipe_grf, &cfg->pipe_xpcs_phy_ready, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_phymode_sel, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_rate_sel, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_sel_qsgmii, true); + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->qsgmii_mode_set, true); + break; + + default: + dev_err(priv->dev, "incompatible PHY type\n"); + return -EINVAL; + } + + rate = clk_get_rate(node_priv->refclk); + + switch (rate) { + case REF_CLOCK_24MHz: + if (node_priv->mode == PHY_TYPE_USB3 || node_priv->mode == PHY_TYPE_SATA) { + /* Set ssc_cnt[9:0]=0101111101 & 31.5KHz. */ + val = PHYREG15_SSC_CNT_VALUE << PHYREG15_SSC_CNT_SHIFT; + rockchip_multiphy_updatel(phy, PHYREG15_SSC_CNT_MASK, + val, RK3568_PHYREG15); + + writel(PHYREG16_SSC_CNT_VALUE, node_priv->mmio + RK3568_PHYREG16); + } + break; + + case REF_CLOCK_25MHz: + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_clk_25m, true); + break; + + case REF_CLOCK_100MHz: + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_clk_100m, true); + if (node_priv->mode == PHY_TYPE_PCIE) { + /* PLL KVCO fine tuning. */ + val = PHYREG33_PLL_KVCO_VALUE << PHYREG33_PLL_KVCO_SHIFT; + rockchip_multiphy_updatel(phy, PHYREG33_PLL_KVCO_MASK, + val, RK3568_PHYREG33); + + /* Enable controlling random jitter. */ + writel(PHYREG12_PLL_LPF_ADJ_VALUE, node_priv->mmio + RK3568_PHYREG12); + + val = PHYREG6_PLL_DIV_2 << PHYREG6_PLL_DIV_SHIFT; + rockchip_multiphy_updatel(phy, PHYREG6_PLL_DIV_MASK, + val, RK3568_PHYREG6); + + writel(PHYREG18_PLL_LOOP, node_priv->mmio + RK3568_PHYREG18); + writel(PHYREG11_SU_TRIM_0_7, node_priv->mmio + RK3568_PHYREG11); + } else if (node_priv->mode == PHY_TYPE_SATA) { + /* downward spread spectrum +500ppm */ + val = PHYREG32_SSC_DOWNWARD << PHYREG32_SSC_DIR_SHIFT; + val |= PHYREG32_SSC_OFFSET_500PPM << PHYREG32_SSC_OFFSET_SHIFT; + rockchip_multiphy_updatel(phy, PHYREG32_SSC_MASK, + val, RK3568_PHYREG32); + writel(val, node_priv->mmio + RK3568_PHYREG32); + } + break; + + default: + dev_err(priv->dev, "unsupported rate: %lu\n", rate); + return -EINVAL; + } + + if (node_priv->ext_refclk) { + rockchip_multiphy_param_write(node_priv->phy_grf, &cfg->pipe_clk_ext, true); + if (node_priv->mode == PHY_TYPE_PCIE && rate == REF_CLOCK_100MHz) { + val = PHYREG13_RESISTER_HIGH_Z << PHYREG13_RESISTER_SHIFT; + val |= PHYREG13_CKRCV_AMP0; + rockchip_multiphy_updatel(phy, PHYREG13_RESISTER_MASK, + val, RK3568_PHYREG13); + + val = readl(node_priv->mmio + RK3568_PHYREG14); + val |= PHYREG14_CKRCV_AMP1; + writel(val, node_priv->mmio + RK3568_PHYREG14); + } + } + + if (node_priv->enable_ssc) { + val = readl(node_priv->mmio + RK3568_PHYREG8); + val |= PHYREG8_SSC_EN; + writel(val, node_priv->mmio + RK3568_PHYREG8); + } + + return 0; +} + +static const struct rockchip_multiphy_grfcfg rk3568_multiphy_grfcfgs = { + /* pipe-phy-grf */ + .pcie_mode_set = { 0x0000, 5, 0, 0x00, 0x11 }, + .usb_mode_set = { 0x0000, 5, 0, 0x00, 0x04 }, + .sgmii_mode_set = { 0x0000, 5, 0, 0x00, 0x01 }, + .qsgmii_mode_set = { 0x0000, 5, 0, 0x00, 0x21 }, + .pipe_rxterm_set = { 0x0000, 12, 12, 0x00, 0x01 }, + .pipe_txelec_set = { 0x0004, 1, 1, 0x00, 0x01 }, + .pipe_txcomp_set = { 0x0004, 4, 4, 0x00, 0x01 }, + .pipe_clk_25m = { 0x0004, 14, 13, 0x00, 0x01 }, + .pipe_clk_100m = { 0x0004, 14, 13, 0x00, 0x02 }, + .pipe_phymode_sel = { 0x0008, 1, 1, 0x00, 0x01 }, + .pipe_rate_sel = { 0x0008, 2, 2, 0x00, 0x01 }, + .pipe_rxterm_sel = { 0x0008, 8, 8, 0x00, 0x01 }, + .pipe_txelec_sel = { 0x0008, 12, 12, 0x00, 0x01 }, + .pipe_txcomp_sel = { 0x0008, 15, 15, 0x00, 0x01 }, + .pipe_clk_ext = { 0x000c, 9, 8, 0x02, 0x01 }, + .pipe_sel_usb = { 0x000c, 14, 13, 0x00, 0x01 }, + .pipe_sel_qsgmii = { 0x000c, 15, 13, 0x00, 0x07 }, + .pipe_phy_status = { 0x0034, 6, 6, 0x01, 0x00 }, + .con0_for_pcie = { 0x0000, 15, 0, 0x00, 0x1000 }, + .con1_for_pcie = { 0x0004, 15, 0, 0x00, 0x0000 }, + .con2_for_pcie = { 0x0008, 15, 0, 0x00, 0x0101 }, + .con3_for_pcie = { 0x000c, 15, 0, 0x00, 0x0200 }, + .con0_for_sata = { 0x0000, 15, 0, 0x00, 0x0119 }, + .con1_for_sata = { 0x0004, 15, 0, 0x00, 0x0040 }, + .con2_for_sata = { 0x0008, 15, 0, 0x00, 0x80c3 }, + .con3_for_sata = { 0x000c, 15, 0, 0x00, 0x4407 }, + /* pipe-grf */ + .pipe_con0_for_sata = { 0x0000, 15, 0, 0x00, 0x2220 }, + .pipe_sgmii_mac_sel = { 0x0040, 1, 1, 0x00, 0x01 }, + .pipe_xpcs_phy_ready = { 0x0040, 2, 2, 0x00, 0x01 }, + .u3otg0_port_en = { 0x0104, 15, 0, 0x0181, 0x1100 }, + .u3otg1_port_en = { 0x0144, 15, 0, 0x0181, 0x1100 }, +}; + +static const struct rockchip_multiphy_cfg rk3568_multiphy_cfgs = { + .grfcfg = &rk3568_multiphy_grfcfgs, + .multiphy_cfg = rk3568_multiphy_cfg, +}; + +static const struct of_device_id rockchip_multiphy_of_match[] = { + { .compatible = "rockchip,rk3566-naneng-multiphy", + .data = &rk3568_multiphy_cfgs, }, + { .compatible = "rockchip,rk3568-naneng-multiphy", + .data = &rk3568_multiphy_cfgs, }, + { }, +}; +MODULE_DEVICE_TABLE(of, rockchip_multiphy_of_match); + +static struct platform_driver rockchip_multiphy_driver = { + .probe = rockchip_multiphy_probe, + .driver = { + .name = "rockchip-naneng-multiphy", + .of_match_table = rockchip_multiphy_of_match, + }, +}; +module_platform_driver(rockchip_multiphy_driver); + +MODULE_DESCRIPTION("Rockchip NANENG MULTIPHY driver"); +MODULE_LICENSE("GPL v2"); From patchwork Wed Dec 22 21:30:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 12697339 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 AEDA9C433F5 for ; Wed, 22 Dec 2021 21:33:05 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=XraBFimDSK92cvmfS5BvC8E+zSY/bWhgPkzwUOFBUjo=; b=xjU7qw5mm0GciP sjzDCc9/Qq3PihZy5zxGXBTGhdB9nIy7fysZ8u8ce+eWPQYVBw2OVuKSYov6Sj+EH6JeMwJ5rvlms nusd7l9G+0L4vOmO8KGZUSGp4P8THpMdOcLIJCC9q2rb+e/Mf2Bse+pmRDnEmC3kWocvALhSQXjqu l4XyOpftVMNrjoAk4oRfVE6Lf2X2+UewOcmdswt1ZE2weNa+hRffZ0Gth9CFge6pvhkYnp6JbLV2V Mp1yN2xoVQ6WsIQzOpcbGvxoQIYmojY02cIZQQlwIW5/vpbo3wvSfdi4nbn+Z/xEiqCchkCkbO7C5 IYIuE+JIDbtSYRtIsZRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n09D7-00BLq9-62; Wed, 22 Dec 2021 21:31:45 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n09CD-00BLO7-JX; Wed, 22 Dec 2021 21:30:51 +0000 Received: by mail-ed1-x52d.google.com with SMTP id m21so14893889edc.0; Wed, 22 Dec 2021 13:30:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iplbSwiVf6b64+flx7Li4BU1W4Eid44TyGxCKnCRca4=; b=Sb6/nc3z8/Y4H0lGOPRClAe7BhwXGvn6Ac6pu54EEmRw4dXWm5WEIVyVm2EKnBFDfl B8fP1CVL1tV5vDrE1UtcqoLspqnD5R8JugCWEGSiK3SGydqJQVQ5cZlpxsZmq3WPbPYp kZ3f0eZB0IJBh/6jCrDlVlRxdmc+nd0RtQgWlEdZ1t7GfvlR3Ik8nQbFcGnzaHbsWoso dTt3wJrVrR7rMoHP1d8eEpqxh9EhPt+OW7TI04iYkd5lPDr07bz8wjiPBxFhS2p1WNHA wgJlYv4QZEWhmQT/0z241jHx6dAwC/uIU6N/kH2OA/aGSPP6T8xcUCg8m7rAm4U1FFn5 rvCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iplbSwiVf6b64+flx7Li4BU1W4Eid44TyGxCKnCRca4=; b=HW6AVxaWk6AymMieE4NfPNWqFpR/90L/Re2x+F1Ct2kpnxYfeyV1n+m2UaE1WcFSZG gyYiCH4ajLwjVQgljcRy1aUF2g3mqIUKZ4j0ErJvQr0hACrYPREu0chqlBDfKBFgTTxp ZWOBvsTkD3QjWLZxowaeIBhqL2JAdIBsVc3R9UyY+mO4JWohIxyUugV1BBgvK/54QgpD s4PEJvcGKZ/LmC9a8JO4dupR1+b+m+/rLyad/pV53/dkFoXpDQMUWwEp9wnwabP6eZec slfQryC6WACN2tWrVViAt636r8Mytini9Sa81EsATi28NuVPQRcqM0DNmEUiMHM0Qr9T 05yw== X-Gm-Message-State: AOAM531zaPhjQ1m75wH/kJf9JnEwOILRok/fkbOZu6gfeT79yR2JMq8/ HIXA+wEbyoU5muWz6uZT5y8= X-Google-Smtp-Source: ABdhPJzmZ5/2Yy7zLaDSt7vWQIxgFmATyGaI1BP/pB8RJvno6F+3Daj8qabccEhxciiJ2QmlfJai2g== X-Received: by 2002:a17:907:2d10:: with SMTP id gs16mr3800028ejc.489.1640208643891; Wed, 22 Dec 2021 13:30:43 -0800 (PST) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id ne2sm1087776ejc.108.2021.12.22.13.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 13:30:43 -0800 (PST) From: Johan Jonker To: heiko@sntech.de Cc: robh+dt@kernel.org, kishon@ti.com, vkoul@kernel.org, p.zabel@pengutronix.de, lee.jones@linaro.org, yifeng.zhao@rock-chips.com, kever.yang@rock-chips.com, cl@rock-chips.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v6 4/4] arm64: dts: rockchip: add naneng multi phy nodes for rk3568 Date: Wed, 22 Dec 2021 22:30:32 +0100 Message-Id: <20211222213032.7678-5-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211222213032.7678-1-jbx6244@gmail.com> References: <20211222213032.7678-1-jbx6244@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_133049_693187_E0CAD83A X-CRM114-Status: GOOD ( 10.11 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Yifeng Zhao Add the core DT nodes for the rk3568 Naneng multi phys. Signed-off-by: Yifeng Zhao Signed-off-by: Johan Jonker --- arch/arm64/boot/dts/rockchip/rk3566.dtsi | 4 ++ arch/arm64/boot/dts/rockchip/rk3568.dtsi | 23 +++++++++++ arch/arm64/boot/dts/rockchip/rk356x.dtsi | 50 ++++++++++++++++++++++++ 3 files changed, 77 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3566.dtsi b/arch/arm64/boot/dts/rockchip/rk3566.dtsi index 3839eef5e..af442e83b 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566.dtsi @@ -6,6 +6,10 @@ compatible = "rockchip,rk3566"; }; +&multiphy { + compatible = "rockchip,rk3566-naneng-multiphy"; +}; + &power { power-domain@RK3568_PD_PIPE { reg = ; diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi index 2fd313a29..22bc0e85b 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi @@ -8,6 +8,11 @@ / { compatible = "rockchip,rk3568"; + pipe_phy_grf0: syscon@fdc70000 { + compatible = "rockchip,rk3568-pipe-phy-grf", "syscon"; + reg = <0x0 0xfdc70000 0x0 0x1000>; + }; + qos_pcie3x1: qos@fe190080 { compatible = "rockchip,rk3568-qos", "syscon"; reg = <0x0 0xfe190080 0x0 0x20>; @@ -80,6 +85,24 @@ }; }; +&multiphy { + compatible = "rockchip,rk3568-naneng-multiphy"; + + multiphy0: multi-phy@fe820000 { + reg = <0x0 0xfe820000 0x0 0x100>; + clocks = <&pmucru CLK_PCIEPHY0_REF>, + <&cru PCLK_PIPEPHY0>, + <&cru PCLK_PIPE>; + clock-names = "ref", "apb", "pipe"; + assigned-clocks = <&pmucru CLK_PCIEPHY0_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY0>; + rockchip,pipe-phy-grf = <&pipe_phy_grf0>; + #phy-cells = <1>; + status = "disabled"; + }; +}; + &power { power-domain@RK3568_PD_PIPE { reg = ; diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index 46d9552f6..32e5c8026 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -214,11 +214,26 @@ }; }; + pipegrf: syscon@fdc50000 { + compatible = "rockchip,rk3568-pipe-grf", "syscon"; + reg = <0x0 0xfdc50000 0x0 0x1000>; + }; + grf: syscon@fdc60000 { compatible = "rockchip,rk3568-grf", "syscon", "simple-mfd"; reg = <0x0 0xfdc60000 0x0 0x10000>; }; + pipe_phy_grf1: syscon@fdc80000 { + compatible = "rockchip,rk3568-pipe-phy-grf", "syscon"; + reg = <0x0 0xfdc80000 0x0 0x1000>; + }; + + pipe_phy_grf2: syscon@fdc90000 { + compatible = "rockchip,rk3568-pipe-phy-grf", "syscon"; + reg = <0x0 0xfdc90000 0x0 0x1000>; + }; + pmucru: clock-controller@fdd00000 { compatible = "rockchip,rk3568-pmucru"; reg = <0x0 0xfdd00000 0x0 0x1000>; @@ -1077,6 +1092,41 @@ status = "disabled"; }; + multiphy: multiphy { + rockchip,pipe-grf = <&pipegrf>; + #address-cells = <2>; + #size-cells = <2>; + status = "disabled"; + + multiphy1: multi-phy@fe830000 { + reg = <0x0 0xfe830000 0x0 0x100>; + clocks = <&pmucru CLK_PCIEPHY1_REF>, + <&cru PCLK_PIPEPHY1>, + <&cru PCLK_PIPE>; + clock-names = "ref", "apb", "pipe"; + assigned-clocks = <&pmucru CLK_PCIEPHY1_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY1>; + rockchip,pipe-phy-grf = <&pipe_phy_grf1>; + #phy-cells = <1>; + status = "disabled"; + }; + + multiphy2: multi-phy@fe840000 { + reg = <0x0 0xfe840000 0x0 0x100>; + clocks = <&pmucru CLK_PCIEPHY2_REF>, + <&cru PCLK_PIPEPHY2>, + <&cru PCLK_PIPE>; + clock-names = "ref", "apb", "pipe"; + assigned-clocks = <&pmucru CLK_PCIEPHY2_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY2>; + rockchip,pipe-phy-grf = <&pipe_phy_grf2>; + #phy-cells = <1>; + status = "disabled"; + }; + }; + pinctrl: pinctrl { compatible = "rockchip,rk3568-pinctrl"; rockchip,grf = <&grf>;