From patchwork Sun Apr 13 08:58:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 14049218 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 3C981C369B4 for ; Sun, 13 Apr 2025 09:02:08 +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=LvAXPekwoCw36HRnCtg4TbI0QC2KihkdLfaJeXUu/Oc=; b=1kfNlrdVNflkWV C7RJzmaJKkjNRmfNCP9z06k3spYKsato065buzEk5U90GjbJXmITSQpmaxh/BsWm4E6P7Gr2E5pnY iQh9dWo6d2P8c1+Bfy5gvTXNp87vlgof9dABZN2O3H3NBIrr+eT6ONtJgck684dxVof1X/H0sZ9Zs sGH51mnzgcilluFtUT+yOll4R8CK29Idas+KGirW0ZUJq5ZciWoJ33l71cVjCC14V2xVFnQJehzUq WKIwKVeEZAtDju0hdsCPQzel7Rh4mYdimqSan7TANvnOYANDn7UfdCiWNPXMHCH2Q2YOEbMFBOGqI Y0bYkhWSJux7PUqlghAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tE7-0000000Gz77-3yeW; Sun, 13 Apr 2025 09:02:07 +0000 Received: from mxout1.routing.net ([2a03:2900:1:a::a]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tAM-0000000Gyl9-3VUK; Sun, 13 Apr 2025 08:58:16 +0000 Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout1.routing.net (Postfix) with ESMTP id CC4AD3FDF4; Sun, 13 Apr 2025 08:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1744534693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PKUZ1+4YVFc7xv72f1Tv2gQXBQdFJKtnqIffuvfuqJg=; b=nGFaGpEZr5p5AvddB7kdYZ+4ZXePpkmtqF3yJ0SJ2t5Rc+yB6CFVV+ZOGxyl0SRDRvdai/ mW/NNHGhXvIO76jk112wzjXh35RLhve+Y+TCU8kC+n0q8J4kY2jbc3RXOjH4KvQUh8qsmT I/87eKRiBMIQzgSG5KhcJtn5TBWDCCo= Received: from frank-u24.. (fttx-pool-194.15.86.153.bambit.de [194.15.86.153]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id EB87140089; Sun, 13 Apr 2025 08:58:11 +0000 (UTC) From: Frank Wunderlich To: Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: Frank Wunderlich , Daniel Golle , Sam Shih , MandyJH Liu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 1/5] dt-bindings: phy: mtk-xs-phy: Add mt7988 compatible Date: Sun, 13 Apr 2025 10:58:01 +0200 Message-ID: <20250413085806.8544-2-linux@fw-web.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250413085806.8544-1-linux@fw-web.de> References: <20250413085806.8544-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: ce383be7-dddc-4262-94ec-9650b3b27f4f X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250413_015815_017988_94FF3C07 X-CRM114-Status: UNSURE ( 6.53 ) 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: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Frank Wunderlich Add compatible for xs-phy on mt7988. Signed-off-by: Frank Wunderlich --- Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml index a9e3139fd421..3b5253659e6f 100644 --- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml @@ -49,6 +49,7 @@ properties: - enum: - mediatek,mt3611-xsphy - mediatek,mt3612-xsphy + - mediatek,mt7988-xsphy - const: mediatek,xsphy reg: From patchwork Sun Apr 13 08:58:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 14049220 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 9D4B5C369AE for ; Sun, 13 Apr 2025 09:04:01 +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=1f2YGh529+3zM8FUmDpXCyYZNL1H3z0dw2wsPkG27zs=; b=XT/o+hP8JLnq22 AD6Tz6WCDWkSrUSmYdj6e/UNireFs6a5eVip10LAk/E2ZtfBnuLQwrmRaZRWLjXmwZYhrelTJBDVj Ileyz9r212d9VGKWCU3srxJLuO488nhcEC+uapfG4B2eSHsrTIWWdTYLHEOBRIic6GEDi+EqVcdU9 /L9pIMobgdCU6enzlLnieSYkLVZpGc86NasDrcxeO926Frw0s7uGEDRba1zxB1xjg8AEFKjIsVYmu JtTclG/y1fUTdpg68Iy486dCGavEB0A3ElNIcb5K8Id7SwhiUtNeZRBgq8IENFe+QDrI6en/Nln1/ pcvoVmSz6Q09YVIPvCkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tFx-0000000GzHI-1Sp5; Sun, 13 Apr 2025 09:04:01 +0000 Received: from mxout4.routing.net ([2a03:2900:1:a::9]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tAN-0000000GylC-3c46; Sun, 13 Apr 2025 08:58:17 +0000 Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout4.routing.net (Postfix) with ESMTP id 9D2E11000DE; Sun, 13 Apr 2025 08:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1744534693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W28WfcAJpST8Dtovpq8Ep5E0UnnAP29jza5E8k0zwUc=; b=g8PR66PEcKXygMIAAD/6t9416lGPgK0YiQiT1lftZJct9EmT40dbwrcbJxVpa0O2wSvmYx rjtkJpbfqdLE2Qz+VbwWR6E34ycKsz4stgR3uWXnA3fTRgn4pjQFokikcQWx3QaxtAPUa1 u6iefurH9/HxO56PMPeGvkyT/R8lcbE= Received: from frank-u24.. (fttx-pool-194.15.86.153.bambit.de [194.15.86.153]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id B7EE84006C; Sun, 13 Apr 2025 08:58:12 +0000 (UTC) From: Frank Wunderlich To: Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: Frank Wunderlich , Daniel Golle , Sam Shih , MandyJH Liu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 2/5] dt-bindings: phy: mtk-xs-phy: support type switch by pericfg Date: Sun, 13 Apr 2025 10:58:02 +0200 Message-ID: <20250413085806.8544-3-linux@fw-web.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250413085806.8544-1-linux@fw-web.de> References: <20250413085806.8544-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 79785311-ffeb-47ff-b83e-a442f86500dc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250413_015816_043136_269746F8 X-CRM114-Status: UNSURE ( 7.39 ) 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: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Frank Wunderlich Add support for type switch by pericfg register between USB3, PCIe, ... Signed-off-by: Frank Wunderlich --- .../devicetree/bindings/phy/mediatek,xsphy.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml index 3b5253659e6f..5033d77c1239 100644 --- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml @@ -151,6 +151,22 @@ patternProperties: minimum: 1 maximum: 31 + mediatek,syscon-type: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + description: + A phandle to syscon used to access the register of type switch, + the field should always be 3 cells long. + items: + items: + - description: + The first cell represents a phandle to syscon + - description: + The second cell represents the register offset + - description: + The third cell represents the index of config segment + enum: [0, 1, 2, 3] + required: - reg - clocks From patchwork Sun Apr 13 08:58:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 14049227 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 DF9CDC3601E for ; Sun, 13 Apr 2025 09:05:54 +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=az1i6diI6ZErQYytIVqligmDLEygk+h73RgNPbtQm/8=; b=LoJJ+jwN47pIKq aFuurGRz49A+a8J1N0JMVB+7+HRpupHd8y2BjIrO5bW3DsleFfTOMj7xJm9K6+NjCcFOseAd1HxK1 /52plCehAsueUDVUS9nMadNxWer5Gnc85pX6qc9Ujbpq5PqOOwrf8nE5JSrL2PHHlFmP5b2qL2kkq WvryV8cTfyc/hYgNI+WJz09Q4TesXG2U5gXMIELCj1JYHbeq6Zg9eYKQMNfU9be6AGI1mmOvV4voN dyenKYAHFhwZNrgfx4lLWOd3XtD1jP4CsWUBbbS0xCMl0ZxSI9d9wLTmBJBRLXf8YkXOE6aRI47fS XlwMDhEKhARMYGWst9qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tHm-0000000GzUA-2i6l; Sun, 13 Apr 2025 09:05:54 +0000 Received: from mxout3.routing.net ([2a03:2900:1:a::8]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tAP-0000000Gylh-09Wh; Sun, 13 Apr 2025 08:58:18 +0000 Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout3.routing.net (Postfix) with ESMTP id 7FD6460533; Sun, 13 Apr 2025 08:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1744534694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bfhYzFpGn1B5RnzNyN51+I0POHsgnSqYypq5zUupqA=; b=pCzmcJ1BcwSaDmCCw1UdgyY2Tn8jvDcYynkIZRXOv3KEw2hvW1Jvz42jNDdlX/zuTTcI8F 6LEXt/pxULn95Qzr2TZpIN9xnRsb6wYmOY/6Bcu1H14wO/bOSM4B4fT53vF5PTpPmWWZOC T87WS5vWaPzwJRijvKHymcZtqUMkaWc= Received: from frank-u24.. (fttx-pool-194.15.86.153.bambit.de [194.15.86.153]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id 7FE4E40089; Sun, 13 Apr 2025 08:58:13 +0000 (UTC) From: Frank Wunderlich To: Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: Frank Wunderlich , Daniel Golle , Sam Shih , MandyJH Liu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 3/5] dt-bindings: power: Add binding for MediaTek MT7988 topmisc power controller Date: Sun, 13 Apr 2025 10:58:03 +0200 Message-ID: <20250413085806.8544-4-linux@fw-web.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250413085806.8544-1-linux@fw-web.de> References: <20250413085806.8544-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 9abf532c-77b9-424f-a697-dc702d13d513 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250413_015817_229940_C311A0E5 X-CRM114-Status: UNSURE ( 7.42 ) 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: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Frank Wunderlich Topmisc is a systemcontroller used for xs-phy and ethernet on mt7988. Add binding for it. Signed-off-by: Frank Wunderlich --- .../power/mediatek,power-controller.yaml | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/power/mediatek,power-controller.yaml b/Documentation/devicetree/bindings/power/mediatek,power-controller.yaml index 591a080ca3ff..60d2fc7963e5 100644 --- a/Documentation/devicetree/bindings/power/mediatek,power-controller.yaml +++ b/Documentation/devicetree/bindings/power/mediatek,power-controller.yaml @@ -22,17 +22,27 @@ properties: pattern: '^power-controller(@[0-9a-f]+)?$' compatible: - enum: - - mediatek,mt6735-power-controller - - mediatek,mt6795-power-controller - - mediatek,mt8167-power-controller - - mediatek,mt8173-power-controller - - mediatek,mt8183-power-controller - - mediatek,mt8186-power-controller - - mediatek,mt8188-power-controller - - mediatek,mt8192-power-controller - - mediatek,mt8195-power-controller - - mediatek,mt8365-power-controller + oneOf: + - items: + - enum: + - mediatek,mt6735-power-controller + - mediatek,mt6795-power-controller + - mediatek,mt8167-power-controller + - mediatek,mt8173-power-controller + - mediatek,mt8183-power-controller + - mediatek,mt8186-power-controller + - mediatek,mt8188-power-controller + - mediatek,mt8192-power-controller + - mediatek,mt8195-power-controller + - mediatek,mt8365-power-controller + - items: + - enum: + - mediatek,mt7988-topmisc + - const: syscon + - const: mediatek,mt7988-power-controller + + reg: + maxItems: 1 '#power-domain-cells': const: 1 @@ -43,6 +53,9 @@ properties: '#size-cells': const: 0 + '#clock-cells': + const: 1 + patternProperties: "^power-domain@[0-9a-f]+$": $ref: "#/$defs/power-domain-node" From patchwork Sun Apr 13 08:58:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 14049228 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 A18F0C3601E for ; Sun, 13 Apr 2025 09:07:51 +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=NvcA8YE6pEo4CCH8Ji5iIPCQ6ySsqMBMnTZFiu6gnm0=; b=QkLATcnwarBOGC qOPI/1k8bkqj6NtuQFzaB9jiS2TJWnwGTP9TIxEmwpF5iEjsKhudOsTvobuteF57dGRiqLK1gjBwq FnX9xdcLUN817wYcDhlHHvEkE7nzPLcylZ6/yKC7ip8tZTLFOOYhVzibZ+zCQZtNbOPf7+jWCqc1B Fzsjs/KL/OBrsrlIWM42D/LgqHtmHrGb2G02sKne+VJxdp9QjOscT4/B4RwFqkq9BkhzoI2hhzLf5 8sWb76sp7unFbg4uzcinQ1MeMtfakmqN9NJF9tOYvvbCZAPWQnVaT7SWLYjJXUA6aoCfQSDp8RiXt RUam1Unq1kKJLKYcA2/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tJf-0000000GzfC-1gSN; Sun, 13 Apr 2025 09:07:51 +0000 Received: from mxout4.routing.net ([2a03:2900:1:a::9]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tAO-0000000Gyli-3Xsm; Sun, 13 Apr 2025 08:58:18 +0000 Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout4.routing.net (Postfix) with ESMTP id 48A2B1004D0; Sun, 13 Apr 2025 08:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1744534695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ib+KhWCrUSc+adJVmrX0XIz7ASiUmHJbOHL7A4bL+YA=; b=UmZtL6jgI0cyBG7f71Ee/uZxE5PK2Aj4cICeBnSmw2bChWLWVpZqIVq7lh+k7mYtdNgDuJ Cs+2MIvkgE/TKpaEW3DWkcPs1i9oU//GkVuNQtl8ROCEsDK+F9B22o+t3skCy+HyOyQv4N WIkYjWr//pftCpbYr1pa6U2DQSgG9vM= Received: from frank-u24.. (fttx-pool-194.15.86.153.bambit.de [194.15.86.153]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id 67BC94006C; Sun, 13 Apr 2025 08:58:14 +0000 (UTC) From: Frank Wunderlich To: Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: Frank Wunderlich , Daniel Golle , Sam Shih , MandyJH Liu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 4/5] phy: mediatek: xsphy: support type switch by pericfg Date: Sun, 13 Apr 2025 10:58:04 +0200 Message-ID: <20250413085806.8544-5-linux@fw-web.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250413085806.8544-1-linux@fw-web.de> References: <20250413085806.8544-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 69e800a6-6e8a-4e39-b54f-7c2364b9dec1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250413_015817_178699_CB97AB5E X-CRM114-Status: GOOD ( 16.81 ) 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: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Daniel Golle Patch from Sam Shih found in MediaTek SDK released under GPL. Get syscon and use it to set the PHY type. Extend support to PCIe and SGMII mode in addition to USB2 and USB3. Signed-off-by: Daniel Golle --- drivers/phy/mediatek/phy-mtk-xsphy.c | 85 +++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/drivers/phy/mediatek/phy-mtk-xsphy.c b/drivers/phy/mediatek/phy-mtk-xsphy.c index 7c248f5cfca5..c0ddb9273cc3 100644 --- a/drivers/phy/mediatek/phy-mtk-xsphy.c +++ b/drivers/phy/mediatek/phy-mtk-xsphy.c @@ -11,10 +11,12 @@ #include #include #include +#include #include #include #include #include +#include #include "phy-mtk-io.h" @@ -81,12 +83,22 @@ #define XSP_SR_COEF_DIVISOR 1000 #define XSP_FM_DET_CYCLE_CNT 1024 +/* PHY switch between pcie/usb3/sgmii */ +#define USB_PHY_SWITCH_CTRL 0x0 +#define RG_PHY_SW_TYPE GENMASK(3, 0) +#define RG_PHY_SW_PCIE 0x0 +#define RG_PHY_SW_USB3 0x1 +#define RG_PHY_SW_SGMII 0x2 + struct xsphy_instance { struct phy *phy; void __iomem *port_base; struct clk *ref_clk; /* reference clock of anolog phy */ u32 index; u32 type; + struct regmap *type_sw; + u32 type_sw_reg; + u32 type_sw_index; /* only for HQA test */ int efuse_intr; int efuse_tx_imp; @@ -259,6 +271,10 @@ static void phy_parse_property(struct mtk_xsphy *xsphy, inst->efuse_intr, inst->efuse_tx_imp, inst->efuse_rx_imp); break; + case PHY_TYPE_PCIE: + case PHY_TYPE_SGMII: + /* nothing to do */ + break; default: dev_err(xsphy->dev, "incompatible phy type\n"); return; @@ -305,6 +321,62 @@ static void u3_phy_props_set(struct mtk_xsphy *xsphy, RG_XTP_LN0_RX_IMPSEL, inst->efuse_rx_imp); } +/* type switch for usb3/pcie/sgmii */ +static int phy_type_syscon_get(struct xsphy_instance *instance, + struct device_node *dn) +{ + struct of_phandle_args args; + int ret; + + /* type switch function is optional */ + if (!of_property_present(dn, "mediatek,syscon-type")) + return 0; + + ret = of_parse_phandle_with_fixed_args(dn, "mediatek,syscon-type", + 2, 0, &args); + if (ret) + return ret; + + instance->type_sw_reg = args.args[0]; + instance->type_sw_index = args.args[1] & 0x3; /* <=3 */ + instance->type_sw = syscon_node_to_regmap(args.np); + of_node_put(args.np); + dev_info(&instance->phy->dev, "type_sw - reg %#x, index %d\n", + instance->type_sw_reg, instance->type_sw_index); + + return PTR_ERR_OR_ZERO(instance->type_sw); +} + +static int phy_type_set(struct xsphy_instance *instance) +{ + int type; + u32 offset; + + if (!instance->type_sw) + return 0; + + switch (instance->type) { + case PHY_TYPE_USB3: + type = RG_PHY_SW_USB3; + break; + case PHY_TYPE_PCIE: + type = RG_PHY_SW_PCIE; + break; + case PHY_TYPE_SGMII: + type = RG_PHY_SW_SGMII; + break; + case PHY_TYPE_USB2: + default: + return 0; + } + + offset = instance->type_sw_index * BITS_PER_BYTE; + regmap_update_bits(instance->type_sw, instance->type_sw_reg, + RG_PHY_SW_TYPE << offset, type << offset); + + return 0; +} + static int mtk_phy_init(struct phy *phy) { struct xsphy_instance *inst = phy_get_drvdata(phy); @@ -325,6 +397,10 @@ static int mtk_phy_init(struct phy *phy) case PHY_TYPE_USB3: u3_phy_props_set(xsphy, inst); break; + case PHY_TYPE_PCIE: + case PHY_TYPE_SGMII: + /* nothing to do, only used to set type */ + break; default: dev_err(xsphy->dev, "incompatible phy type\n"); clk_disable_unprepare(inst->ref_clk); @@ -403,12 +479,15 @@ static struct phy *mtk_phy_xlate(struct device *dev, inst->type = args->args[0]; if (!(inst->type == PHY_TYPE_USB2 || - inst->type == PHY_TYPE_USB3)) { + inst->type == PHY_TYPE_USB3 || + inst->type == PHY_TYPE_PCIE || + inst->type == PHY_TYPE_SGMII)) { dev_err(dev, "unsupported phy type: %d\n", inst->type); return ERR_PTR(-EINVAL); } phy_parse_property(xsphy, inst); + phy_type_set(inst); return inst->phy; } @@ -510,6 +589,10 @@ static int mtk_xsphy_probe(struct platform_device *pdev) dev_err(dev, "failed to get ref_clk(id-%d)\n", port); return PTR_ERR(inst->ref_clk); } + + retval = phy_type_syscon_get(inst, child_np); + if (retval) + return retval; } provider = devm_of_phy_provider_register(dev, mtk_phy_xlate); From patchwork Sun Apr 13 08:58:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 14049233 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 75C0AC3601E for ; Sun, 13 Apr 2025 09:09:43 +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=rsllP2f7pm4xR9VUVLOkPB359MOx1a01wGE6uZ7tN6c=; b=jOpqr5yRyYXtt6 u+rFO83cQpP+dc89UCihdr1nSwo4+agliVo0AxZDh5oDfKyoKWEJSIFt0hf1E3Ni0feuib7RQbjZ0 KVD5tDIPXz9TGBT/enBbJdsNAGi2moSuquUE+I8eBrY6To202nJ6yEPuZclB/Wm7xbhL3hQICzR37 0px9SLGPNyAGkwnoCKQ5ZtSt8HxKkvYj28e4n30KelOMg3rRWs7fkfuN3tHgYD1haMsGB+aNOMN5E aaggfhFUkqfmJa4aECAExJJU5L/Pkv57zzAY9AHmkD2RzaffP42D6KXyquMl41/YuIr/rcw5yaWeH 9DW17XSJ+O+FowLCtUYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tLT-0000000GzuZ-0uRT; Sun, 13 Apr 2025 09:09:43 +0000 Received: from mxout3.routing.net ([2a03:2900:1:a::8]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3tAP-0000000GymF-245V; Sun, 13 Apr 2025 08:58:19 +0000 Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout3.routing.net (Postfix) with ESMTP id 155CE60536; Sun, 13 Apr 2025 08:58:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1744534696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fUg/DncS2AhYG89VBxFJm1aq8shzU0lzttlOs1DPzvU=; b=ZjnUgL6ARihXC/nQO4jManNDUvZw6u+ojM0IQH9iESkQE8HMOY166SZ/i4TH41Yccj0yk9 0tpOCkWLhxjn8fCV5/kpZCig7MQx8AWMZhZz7GfhgS4SYZVu7fAlIPV9Ybokzwu1ChNSD1 MY0azaWWbG1pUBbOyk4ybi8mTNQFC0A= Received: from frank-u24.. (fttx-pool-194.15.86.153.bambit.de [194.15.86.153]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id 2D57940089; Sun, 13 Apr 2025 08:58:15 +0000 (UTC) From: Frank Wunderlich To: Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: Frank Wunderlich , Daniel Golle , Sam Shih , MandyJH Liu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 5/5] arm64: dts: mediatek: mt7988: Add xsphy for ssusb0/pcie2 Date: Sun, 13 Apr 2025 10:58:05 +0200 Message-ID: <20250413085806.8544-6-linux@fw-web.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250413085806.8544-1-linux@fw-web.de> References: <20250413085806.8544-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: bf08c37c-044c-4f9f-90b3-b87e6ed8eae5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250413_015817_676327_FDB30BA6 X-CRM114-Status: UNSURE ( 7.67 ) 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: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Frank Wunderlich First usb and third pcie controller on mt7988 need a xs-phy to work properly. Signed-off-by: Frank Wunderlich --- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi index 88b56a24efca..10525d977007 100644 --- a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi @@ -334,6 +334,8 @@ usb@11190000 { <&infracfg CLK_INFRA_133M_USB_HCK>, <&infracfg CLK_INFRA_USB_XHCI>; clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck"; + phys = <&xphyu2port0 PHY_TYPE_USB2>, + <&xphyu3port0 PHY_TYPE_USB3>; status = "disabled"; }; @@ -398,6 +400,9 @@ pcie2: pcie@11280000 { pinctrl-0 = <&pcie2_pins>; status = "disabled"; + phys = <&xphyu3port0 PHY_TYPE_PCIE>; + phy-names = "pcie-phy"; + #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0x7>; interrupt-map = <0 0 0 1 &pcie_intc2 0>, @@ -548,6 +553,40 @@ tphyu3port0: usb-phy@11c50700 { }; }; + topmisc: power-controller@11d10000 { + compatible = "mediatek,mt7988-topmisc", "syscon", + "mediatek,mt7988-power-controller"; + reg = <0 0x11d10000 0 0x10000>; + #clock-cells = <1>; + #power-domain-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + xs-phy@11e10000 { + compatible = "mediatek,mt7988-xsphy", + "mediatek,xsphy"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + status = "disabled"; + + xphyu2port0: usb-phy@11e10000 { + reg = <0 0x11e10000 0 0x400>; + clocks = <&infracfg CLK_INFRA_USB_UTMI>; + clock-names = "ref"; + #phy-cells = <1>; + }; + + xphyu3port0: usb-phy@11e13000 { + reg = <0 0x11e13400 0 0x500>; + clocks = <&infracfg CLK_INFRA_USB_PIPE>; + clock-names = "ref"; + #phy-cells = <1>; + mediatek,syscon-type = <&topmisc 0x218 0>; + }; + }; + clock-controller@11f40000 { compatible = "mediatek,mt7988-xfi-pll"; reg = <0 0x11f40000 0 0x1000>;