From patchwork Fri Apr 12 07:22:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13627028 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 AB736C00A94 for ; Fri, 12 Apr 2024 07:22:36 +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=zfctx22gUuPGBbRWoIZoZwhiJdJqo73npibfXbUmq48=; b=sHrNXZ/RyIumkz bFoPxjxyExoGSDmN9mfFg+MyeUBpHPUysp1mai7rgGLwNm0EthMGyevexcnpDFYnWWTEvxv1QUsTO k6Gpe0EORsL9PtNq5MUNjk10rc5n1+rZhRYxDLado4IP3Dnd+f/AgZ9QO3DjrNsyPJzMdM9dNRrDh prNamR0s/VQP6rrR+HC3zRAXcS3ONWwNkQrAOGbgNuF2OytHJIoICis04I16dc5PXV0d9F3OppE4k ls6Ad1c01ORpYO4NOfTF8S0Os5WngIK76Uy+2yQLouIbrHdRv9U6bxtRaDBEwE/+d/FLi37GINsiy NF0niQZt2LOmuJEeWfDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvBF0-0000000FolG-221A; Fri, 12 Apr 2024 07:22:30 +0000 Received: from mail-mw2nam10olkn20801.outbound.protection.outlook.com ([2a01:111:f403:2c12::801] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvBEx-0000000FohE-0Dtm; Fri, 12 Apr 2024 07:22:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YMzSeHnOfVGsvjFCLKGQVhLttbrLiO8ZH94DzEa0rMH5AMMi1wlz7c/O8Fr0ZjkVbCP5KqF9sYz7JXTfnlAhmyuqZ515dCYU+0he++Zx1GJVJhZZo06SMhpLFCRLhx625MFZRYzEkZpGE/W059SN1dMliuMBp7ftTpYucp8xtT6y82MejwDGD2Mvp7jLu2MPrqo02mgEb6e4GdNvw2qMqyHYEmvBCTcI9//Z11/NWRkw03OxtahtLHIqnYaiScYtg3QL193SkBlivw2562SsNY9C02ZcuaO8Lp53URVqEJ1c3QhbjQaufYkHuoDsjT0pZcBOVXlx9xRNairTLzH/Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9orR8NrFwt5ihPrhce3Ei6vQWvU8oXwr9Lg5EYAoQys=; b=WrDkVskU/8+BElA2NtmUTGmWsnfTJ9LWkLkqmxiZTHWdttyTvVigwiaZhCvP4ghucJlsfMUm0uutm0oj1f4z6i88PXvdFdOmkkDjcCNzLfOuyTEpT9E251yjOVB/NhqmwEegGzqP47jtjsg2QqX+VPI3Rkleq5l/Tq12oKwboUGJxl2ZsbRUpjaLUgZOvc7pFEcfkvaIxQVJoD0r7Z1uTV4RBJrYofa723O1JBoTf/XrTv8Da18q+gU7jjZP02yq/ZxN/xp5Gv2LKJiwpxS+ZaIRWS+efvehVswTnHheA9VNAkIb4wikXZ1z61EqaaVzVX7zkyaSzvqcX3G4y58/3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9orR8NrFwt5ihPrhce3Ei6vQWvU8oXwr9Lg5EYAoQys=; b=P1AWM6b6TxTAhqyPBi7TnyM7yogcS5uDPKts5cK6hriUHBGe+sUM/CVmPxcfk3luYDf9kHC0yHLeIGWNEi1adzaI3vkeKNAgaCs29HqNzsQXcXJ54TGl6tjilJc6PH+U5TELPq5fAR6dknxN3FodA15CvXkWiik3JvJUQ+aUKuCPwFPWDr4/nfL1Y3kB/iST8tDywzNXImKw0Zk8UQqwG5z0xaq6QGCOzXh6N+rISKC0T+3+AyCqA2VjWuYMRInZ2RK6/Q+45Lp0r7HRI10YeYKSBpE53nNieqjeG69ClN3RyFHDxePPLHTxvsD6rwWLJ3wnE04Adkh+9wUuKv9qTg== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by SN7PR20MB5795.namprd20.prod.outlook.com (2603:10b6:806:32b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.33; Fri, 12 Apr 2024 07:22:12 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::182f:841b:6e76:b819]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::182f:841b:6e76:b819%2]) with mapi id 15.20.7409.042; Fri, 12 Apr 2024 07:22:11 +0000 From: Inochi Amaoto To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Jisheng Zhang , Liu Gui , Jingbao Qiu , dlan@gentoo.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH 1/2] dt-bindings: phy: Add Sophgo CV1800 USB phy Date: Fri, 12 Apr 2024 15:22:24 +0800 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: X-TMN: [cKHdt+g8ePVIAyxeOaBKpFAuortgQ4ByqzIMygT0oU0=] X-ClientProxiedBy: SI2PR06CA0015.apcprd06.prod.outlook.com (2603:1096:4:186::7) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240412072226.121769-1-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|SN7PR20MB5795:EE_ X-MS-Office365-Filtering-Correlation-Id: 5941c22b-5411-47df-13b7-08dc5ac14524 X-MS-Exchange-SLBlob-MailProps: iS5pQZgsAQDmFN0yKEpvbPDpAvl+/SbOPR3B5EqMNpdvaFjcuntyOEwE3y8XB9AvtEJxpjkfn0VgABu0Lq2RbDavDUvzmSQVh8Aqb0/NB5HTUnNXQOdfmeXlPGzzz9HC+qBSUNMUO29Qp5vuhrGcMJ+u/DKx4c8xdAuSmQ/8x4nCQ6U7NA6Ensb3QnrGPB0VQ2UATb/gBBqfBJw0clOF4NpFE0p3g4w+CpIe4RALtihY4Hk4kN3vwrzMpz31iLMhBEueYtjX56aR4zQKpdA5TarKjK/6S8leNF84skql7v1MAkesY5zzxfKpf5ZafSzvC0y2dj5j3UaWdnd4Q9QrUfohoEGRSQ1viQdD2yMDyTPLrX3/69UQI/ok2rajS2bRiInw/kbN+8Z5YslnRuYPj7MR/Y4ZO49Tk7rL7/cwW3Sxkt4qZ+5CrcOXBUCA0qzHhstI6yYfUUtUPchINocXtxU4r+NBo2I1cnUKg1AzX0kjtD9u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J66XtZg49/Mts0pqTF1jUFYUNPPn/rFxEX6gkwaJMuv99Hjcvuif0ipUdcXjoQk7O9nuPhxpu+7XipDts12InXLqP0sa1aJN/dRW1Ps0NAHW/ArVvtJjnpfijeVVMMDJZB2YQmlKMl4DFTt9JX2aKMeHR8w2rusArblbvhSJsI4+XpNb1CwNzpuauJwEVl8r7s+5eHg0M1UEFMXUnz1P6ceMZPjhhDkgTj0NKEa9NG/DqmgRRpzyK3al599YEuvOe3fix5 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5941c22b-5411-47df-13b7-08dc5ac14524 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 07:22:11.6444 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR20MB5795 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240412_002227_105129_15FC5BC9 X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The USB phy of Sophgo CV18XX series SoC needs to sense a pin called "VBUS_DET" to get the right operation mode. If this pin is not connected, it only supports setting the mode manually. Add USB phy bindings for Sophgo CV18XX/SG200X series SoC. Signed-off-by: Inochi Amaoto --- .../bindings/phy/sophgo,cv1800-usb-phy.yaml | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/sophgo,cv1800-usb-phy.yaml -- 2.44.0 diff --git a/Documentation/devicetree/bindings/phy/sophgo,cv1800-usb-phy.yaml b/Documentation/devicetree/bindings/phy/sophgo,cv1800-usb-phy.yaml new file mode 100644 index 000000000000..cb394ac5d8c4 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/sophgo,cv1800-usb-phy.yaml @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/sophgo,cv1800-usb-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sophgo CV18XX/SG200X USB 2.0 PHY + +maintainers: + - Inochi Amaoto + +properties: + compatible: + const: sophgo,cv1800-usb-phy + + reg: + maxItems: 1 + + "#phy-cells": + const: 0 + + clocks: + items: + - description: PHY clock + - description: PHY app clock + - description: PHY stb clock + - description: PHY lpm clock + + clock-names: + items: + - const: phy + - const: app + - const: stb + - const: lpm + + dr_mode: + description: PHY device mode when initing. + enum: [host, peripheral, otg] + + vbus_det-gpios: + description: GPIO to the USB OTG VBUS detect pin. This should not be + defined if vbus_det gpio and switch gpio are connected. + maxItems: 1 + + sophgo,switch-gpios: + description: GPIO for the phy to control connected switch. + maxItems: 2 + +required: + - compatible + - "#phy-cells" + - clocks + - clock-names + - dr_mode + +allOf: + - if: + properties: + dr_mode: + const: otg + then: + required: + - vbus_det-gpios + +additionalProperties: false + +examples: + - | + phy@48 { + compatible = "sophgo,cv1800-usb-phy"; + reg = <0x48 0x4>; + #phy-cells = <0>; + clocks = <&clk 92>, <&clk 93>, + <&clk 94>, <&clk 95>; + clock-names = "phy", "app", "stb", "lpm"; + dr_mode = "host"; + }; + - | + #include + + phy@54 { + compatible = "sophgo,cv1800-usb-phy"; + reg = <0x54 0x4>; + #phy-cells = <0>; + clocks = <&clk 92>, <&clk 93>, + <&clk 94>, <&clk 95>; + clock-names = "phy", "app", "stb", "lpm"; + dr_mode = "otg"; + vbus_det-gpios = <&portb 6 GPIO_ACTIVE_HIGH>; + };