From patchwork Fri Feb 9 18:17:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1058760dyd; Fri, 9 Feb 2024 10:50:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IH18L65M8qd3ibUi9FdJSYBQ/J8/WaZ55sWaI+URHpD9s6EZ2yJ6vAR9PNWyeO/zheD2CMQ X-Received: by 2002:a05:6358:b11e:b0:175:76ec:89e3 with SMTP id a30-20020a056358b11e00b0017576ec89e3mr272696rwo.27.1707504623695; Fri, 09 Feb 2024 10:50:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707504623; cv=pass; d=google.com; s=arc-20160816; b=Jh4yXRn/Cs/d5QXAvdaq7k1G7OFGFY+aVGVwm4vukvqeNd4bcjiX51Vs+u3VC21xEy YMDxHK5EgxpLLlBGwYcqE8xa5vqM21BODdSOJ5CVIUtNwZH8BL97pUlmHwpeEzHQvjKk b1a3bi8BRfaA+OI8J8Ckql4fVMvjt+wD5Annqx3sBHbBzfEtTZR86FuwY0p65bekrtaL Zdktomes5g3JOAVVkjmICCSJrF7cMDpRWLKtrR032m4Sg6OE6/Svhqj5eSd9uwutdPkN 6JgNmoNJzPfYsK1tBSP74oGf+byew7au2zASVZZtqk4jrnnuQVxI2KXroeLpH6ddOoKj QidQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qNlMQmwSE98T4yCPWQWMK6fAJhqmgCyt9lYFZQI22KA=; fh=YLXF8NM17zrVzBPzpyk0pNyb23q2ekNt4Ld8txk2lIc=; b=BvB6H4LCmpp1JLLmA4bwLy0G0BynGhqoLmtDFykSRyXHlo5BvgizBxhHCKwX14N9MK AnhOm+cWJJ0kduTzrhrPwvvHc8+otXKF/0DX/aIZ8H8FQ42z5wXkK+tBsY8W2DYQRt2d mefyzVVLsJ0MT58w6WX8gOkEkb4PIP/1minDG0nZoSkW1EDGlAmxJyMIe8vrUdyFgT6X oK1BOGPmnTNNxE54DjFOFRraGxWCyCs9Bju6irPU4NfnCARaZwpsAPA4XJWCK1gsbW2/ dBguhB+Cb9ynz7VJFudPSWmyCXw9cpbZRaNzReOGOSuo5VJ/gvIUTzBJvy/1hCWyOdsK o5EQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SUBofVAJ; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59782-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59782-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCXPiyldsYuEy3PmCgLU/bxJx2Kv1iCHZ0QMy+cbYllJnPbWekE/6sEyHJFro7vSZyBvzoIXhgV6nohFc9hm6rSQgeOL/Q== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p22-20020a637416000000b005cfd72d0bc7si2089267pgc.246.2024.02.09.10.50.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:50:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59782-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SUBofVAJ; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59782-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59782-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2FFEBB298BB for ; Fri, 9 Feb 2024 18:19:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BFB784A5D; Fri, 9 Feb 2024 18:18:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="SUBofVAJ" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCD9676030; Fri, 9 Feb 2024 18:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502716; cv=none; b=oX/1U8jFqT+P5QbR7L9RBlJJ+gAm0YFNKkacm+wkuW/380UG1QcRb/ygVm40bgNhJPdWtSB4VV5p/x2hrmsmlbEp4eGi/FSWGcUPRRsHklI914xMWSkYe2bvGh7F0x3UFXHvc1im8uSP5q6LgnoDrfWKO7PRE4iaPq4GublY9LA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502716; c=relaxed/simple; bh=QanVdLZGJsZiEBFc9AV6ugIOyYSeeb2yQCO75yW587Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=klp7R1u6Le1LeJhwXcGqArDOs8XTKSY5QY7US8P47MQXY10KsCUM64EkkirThvMNFpHv3WzB83CleRzu3tIOR6Kj3BWK4sFu2LuONfFI73AsTVr4HxwxSY2Vdqst5f1rfR7Iqin4iM9cPsxtFCCE/Vwf/Ft176cP8KJrofUj8tw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=SUBofVAJ; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=QanVdLZGJsZiEBFc9AV6ugIOyYSeeb2yQCO75yW587Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SUBofVAJYhLIPTU4SWQQMESBw2uF9Wo+TwBi7QQULgFyvr2J0/R7SsYfupbPU7YWc xb+QlBUWXwy1E4xEll3JGh0z0FFe2gICJfPkPDXopEHVkAPSK/BRC2Qj4SfTgI3aNC iL7MRClT6b6LLv4HOzZFXzU5utyFGKy2XS0JuJHxJn42U0Ur8c85PTGyMHLmCgialG cYXPhiL6bUnKtyFhhOfnRqde1ef6wlwqv7Q2cw59ERcIgXootWZXTN0YKX2hwIXMM4 gGZeoxwrN6gjYrIDVOgpclvQClFy1t49DdLtyL0d+kEOnP6s4su/9qmMNsXKZSM6ip 1XsaEAkp4FjSA== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id E6AA03780F7F; Fri, 9 Feb 2024 18:18:32 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 8DD1A4800CD; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 01/10] dt-bindings: soc: rockchip: add clock to RK3588 VO grf Date: Fri, 9 Feb 2024 19:17:17 +0100 Message-ID: <20240209181831.104687-2-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790448368548069958 X-GMAIL-MSGID: 1790448368548069958 The RK3588 VO GRF needs a clock. This adds the clock to the allowed properties, makes it mandatory for the RK3588 VO grf and disallows it for any other Rockchip grf. Signed-off-by: Sebastian Reichel Acked-by: Conor Dooley --- .../devicetree/bindings/soc/rockchip/grf.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml index 9793ea6f0fe6..20bc1f46384c 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml @@ -66,6 +66,9 @@ properties: reg: maxItems: 1 + clocks: + maxItems: 1 + "#address-cells": const: 1 @@ -248,6 +251,22 @@ allOf: unevaluatedProperties: false + - if: + properties: + compatible: + contains: + enum: + - rockchip,rk3588-vo-grf + + then: + required: + - clocks + + else: + properties: + clocks: false + + examples: - | #include From patchwork Fri Feb 9 18:17:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1058826dyd; Fri, 9 Feb 2024 10:50:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUdTHA1wNxm6nkvyv4pPPODsf17DJY6q0+ayKOjEq+gAViH37HdRmNpueZ3u4uAqO49EVJxPMLNrqcMs7W5oq9B3oSlWg== X-Google-Smtp-Source: AGHT+IEvmaZtx0icmSaR+eq6RpUVjtvl0tvNg2rwmxcc9R1JyxpEMnHbBttHgU51UMukeaSq8Duf X-Received: by 2002:a17:903:244e:b0:1d9:907f:636d with SMTP id l14-20020a170903244e00b001d9907f636dmr2652370pls.10.1707504631150; Fri, 09 Feb 2024 10:50:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707504631; cv=pass; d=google.com; s=arc-20160816; b=t4HpWcPGPqbQEJ5QCEfEIgJclNOEmdKPzCQDIc10NM87oSPHsk95UNvyG4rQFWvu5e E76Z0OtenBQyZgkLBabR00mbsy8L/3YiWyQMHXBHN86OB1IVfHJGuWQK7GawqFhfyExW SCnQ1dHI5ZM/eLJERIUJmuiM241rEmndA6uN/hpuVQbCrc40P2Ilsq8ovc64L1xFKXpe TcgxwIYj/ziuQMiQJhTNLVw+y/TLE/5L55nWtvg6fev4qtl99yY6AsA3k7WKpmkxvGNc Pxgni1zgLUPpbtX3k8JebmatLWkSJ0+OdquBUPi54azEapK1OPrtodeyZ7RntwVZgX8m wl2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Hdqbau0n/+DGE2feIRj6WGq0sHqWUB1xd/hT1GhAL34=; fh=r2h0V2fRVdSGRT+73KuaLJXa4C4xv5Z4UZJ/IxRO2ks=; b=hwQa471llurEyPydbwKOO0I9PrbmAw8KJuRT9vAArtKSFE/6k4dsKujo/44TNbweaX V7txl85y1lULhnUB5cuMD9LLBhSBBC4c6WnGbeDX0GS+upAWP/k7MBmh+M87FqZtf4M5 X4N4mVfEk2Hwi4IOS9m5Dza2zU98MNLJRU+BiKWLy1pqVYG/sDPGXlF6OR9Wv9E1KU9o KoRlp5hbZHt+tLROrBd6zSd211bqvJKQdsGng7hiJuQtc6ZRaNFPnkaco6Va04GUVPQy eorIyJDEOmHhFVvuITdNJfoLjX4naCOax4fQ+3RL8Gp7wbkm9gtCWC3FmCRw7AzVuqsh 7I4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=HkFuhZL1; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59783-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59783-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCVAfLG8NW0PbydcxfftGN9v8eu0rAzvi4T48aJrey3uj117PqF18myXrAqcYbwK1CpOmIWzBVnScRWC0iJOaKSZh1pZRw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b26-20020a6567da000000b005dc4d8ef150si2071446pgs.512.2024.02.09.10.50.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:50:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59783-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=HkFuhZL1; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59783-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59783-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 14C79B29948 for ; Fri, 9 Feb 2024 18:19:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7967E85957; Fri, 9 Feb 2024 18:18:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="HkFuhZL1" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 023A57EF0E; Fri, 9 Feb 2024 18:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502716; cv=none; b=KvISTlNLYy1+p6Mt/c271qBk5oONXGSQ/PAZF2Z/8TwbMXdN/+xmsOwARKCSq8S8uJzKSInHcX99zo/F6hWvtuq01JTQIk7jWTPav4njZ+bSdDxzcSBZlPYTOf4mQUA6uNEyC9jCGD0JBQ65Q4QgUfTX/o3eaRZJhUAJxZyASrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502716; c=relaxed/simple; bh=MpboPBc+N4LaDq5m0T4vAFnpYG6z/CneePQ9zzqz5/o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Pd3TXg2EeI7752XOpGOmPl+i2q3loPY6JmjS9w+njLuBo4oSCLFShh7ERklNrRDb2Y2yY9o26Or+SYgHdV+ufPFHOgBhfEp0wQ5yG8BINHfpfb2qj+WIN54ayqRUKNI5t6mjAhQhXCWFWO2/AWmTSaOuqQk8FirPlqd9Tw3v2j8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=HkFuhZL1; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=MpboPBc+N4LaDq5m0T4vAFnpYG6z/CneePQ9zzqz5/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HkFuhZL1qFCQBpdaVTY/tAV4eh9SR49iN/g13SDf6IYoVfwscaqvPphx2VNMv6NTW dOAcaPW3XYnxTFT4fJMiALVv+hQOR+KokkBXI8ApCe/Ap2VCjsohJOMBlhPX1o6Ohf xUGlY+BLutLYQyCnJRr/ZdRPZYdchKn/52ZntDSVY9E5ZdGoiPBnaITi5aIlrRbBKS yV1H9x6oxygrX3H5JTueONSnURVILzxTsHZtYeU8t6YIyIEEwR2PsJPinwybxZfcpF GXlrbH4dByQTlNmJqNa54Qoal8NpuWOQYekry6B7+JJEzaA8yiYazAKKySLxfX9MtA I2ynmsgmBawoQ== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 0545E378208C; Fri, 9 Feb 2024 18:18:33 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 8FDF54800D0; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 02/10] dt-bindings: soc: rockchip: add rk3588 USB3 syscon Date: Fri, 9 Feb 2024 19:17:18 +0100 Message-ID: <20240209181831.104687-3-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790448375932984554 X-GMAIL-MSGID: 1790448375932984554 RK3588 USB3 support requires the GRF for USB and USBDP PHY. Signed-off-by: Sebastian Reichel Acked-by: Conor Dooley --- Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml index 20bc1f46384c..12e7a78f7f6b 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml @@ -28,6 +28,8 @@ properties: - rockchip,rk3588-sys-grf - rockchip,rk3588-pcie3-phy-grf - rockchip,rk3588-pcie3-pipe-grf + - rockchip,rk3588-usb-grf + - rockchip,rk3588-usbdpphy-grf - rockchip,rk3588-vo-grf - rockchip,rk3588-vop-grf - rockchip,rv1108-usbgrf From patchwork Fri Feb 9 18:17:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199045 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1042237dyd; Fri, 9 Feb 2024 10:20:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUrfU7agVAba9qYXFB2DR/JgQIrcTcQ7+qA+WUNTn2h9ojKGLDWae5K+iLE9yd9lx+h2NFu6OXd01bA0RV0CtG9s5HwJg== X-Google-Smtp-Source: AGHT+IGnkF8msWfyOIgGRVRsW2VK3M0945fmiPPhDcAfiZDVGW1Gf2ZOVJpf6Cs6hHI0c2ETLiXW X-Received: by 2002:a05:622a:1a9f:b0:42c:6067:4f43 with SMTP id s31-20020a05622a1a9f00b0042c60674f43mr65789qtc.3.1707502810043; Fri, 09 Feb 2024 10:20:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707502810; cv=pass; d=google.com; s=arc-20160816; b=Wn7Tkf8grcJxdyEy+c/NtpvgptUpsr+3RIo/v85cH+lDCyJYNCrPC6Z1VNLBGiUC4A pLu4XLwW1Cl004IrMxtqtWNLbz3MZNZq56LjkEzN3jZzuAYlspuW4EHdwzh/2doKYEbd eU5C7i/fzAFCzkAoFDOJKTkyC49DSZtJrJb0vmOAK4h5B9ywC6ap2LbxXZyrfPa++RUS QS8OhdkOYBmmL1DfrwJktfHQeDcGOWl4rTD9PMTjjFiBehKvAwFzAK8oFbxInTb8VzOx Tvm7A2ORYknX23FN+4/Fi7g5eKGQ3BmV37q3s33cPHClzszbKne45uK5mF6RspveDvVo +uZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eOZPS1sZU4ASKNrf2MR3Pe93JBcUkdUZuJAw9viuELQ=; fh=alCLw7BDIsq6U3mvHTQp1i+ZlKgDoRXDoRen4FeslGs=; b=ty2VEEsgGZDRT8pVMT8X2MWga7c4+cXwWnRrjEpnT4pVNFh5UWEVNwrGlZD5RhrZEM VlbTlePnVW6mV0k2SEcESlj5eVPg4uJ+so/lm6q549XD0g9GjZEJnq6RlMezR4mTJY2s ZJHI7ZSCv1aDNbBCxKthbFGZTTK1AsgUL40qBj8J3MumhxEp4mNeCKLNG+3GT6jAmqXD LIylGy7vSRiGxlb3djB7gaKS8vyzSCnczNPsA1WfZCWN4a5hjpCICYUoOYI/Y3vlhvN2 8vxGAY3BZgLZD730stR1VtjyGNxQaxRrQ4Ffagju1J0HNzBITi/nZ1kzR3W1Yknquaqd 7TXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="ZkHFi/Rn"; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59785-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59785-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCU3+D1G/Lq6SkZ4VvUGpV7kE7UoNGqMiyMLs31n2pJZWZAyDcp5Oxy9SbFd+WwDTIRfL7Y2V8t93EqhHYueE8uauimtmw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h13-20020ac846cd000000b0042c644c36a9si18729qto.52.2024.02.09.10.20.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:20:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59785-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="ZkHFi/Rn"; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59785-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59785-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 41E061C216D1 for ; Fri, 9 Feb 2024 18:20:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DA731272C2; Fri, 9 Feb 2024 18:18:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ZkHFi/Rn" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13B5D7EF1B; Fri, 9 Feb 2024 18:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502716; cv=none; b=YFezuN9XnalSz3BnQ2YrWHXKKR016QZvOkxsnd9g6UAc9elPvYVQoEBVz1RUSsIKRwBkEshh/NRt1se68bN1DrZP8Fbqzw2TEHXJipbouPH51TRQlxFLq+qzeEQ/CsuS/rKdr3JRuoxT6gGhluLVw/HBCc4pU5qpIMxCs09LgjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502716; c=relaxed/simple; bh=xZcm+orw00B6Nq4H2S1rryWFpOh727WR5BMjfMSxMew=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D/sDS18w5UG74QqNyrflfdi6i4LWxClWxzB+k9Zpt1cDda92ZDGq60wgLgwDnpfCkr+u3M6oWXnz0ULi1SwTns1VBXir2D8csq0eGePnP1qE40tgQBKp/ucftlzyMqTex9IVyXdwjDjvIL8a5eabF8oxBlWabb3+kxOUA2Ef5dM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ZkHFi/Rn; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=xZcm+orw00B6Nq4H2S1rryWFpOh727WR5BMjfMSxMew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZkHFi/RnV1PYk4lpnI59yDDYJ/BooxzDGd0zHXCBNrPTb5ujilZPNJ5phoTFHRLbO DBDZHdmImQwVLljhWQCwXlGFOuz5unduh6X59QJFLvDUznAyi/BLep3rhnFAiCZOFb ZWrjyJ4C/8jrbkp7V+ynRAwvApyy4hlnhXNPo28ZQuYscoUCMS4vMMcRK+kR2LJBIr 9rGbx4u2bjQmX/Yj7cLJSt/xaZkjX+BgtXDqQihNiAPYv4NkL+KFbOY2Os7AsulOyd xGJHHbwPJxEIMnqIsjvvk5JK1z4osf3uqD3d9a+XQeNq+cyIns04jREZvQNOgtlxsA Q/5Wl6+nFMTjg== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 0A4E5378209E; Fri, 9 Feb 2024 18:18:33 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 91DC84800D1; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 03/10] dt-bindings: phy: add rockchip usbdp combo phy document Date: Fri, 9 Feb 2024 19:17:19 +0100 Message-ID: <20240209181831.104687-4-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790446466226619220 X-GMAIL-MSGID: 1790446466226619220 Add device tree binding document for Rockchip USBDP Combo PHY with Samsung IP block. Co-developed-by: Frank Wang Signed-off-by: Frank Wang Signed-off-by: Sebastian Reichel --- .../bindings/phy/phy-rockchip-usbdp.yaml | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/phy-rockchip-usbdp.yaml diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-usbdp.yaml b/Documentation/devicetree/bindings/phy/phy-rockchip-usbdp.yaml new file mode 100644 index 000000000000..3375a3099038 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-usbdp.yaml @@ -0,0 +1,166 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/phy-rockchip-usbdp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip USBDP Combo PHY with Samsung IP block + +maintainers: + - Frank Wang + - Zhang Yubing + +properties: + compatible: + enum: + - rockchip,rk3588-usbdp-phy + + reg: + maxItems: 1 + + clocks: + maxItems: 4 + + clock-names: + items: + - const: refclk + - const: immortal + - const: pclk + - const: utmi + + resets: + maxItems: 5 + + reset-names: + items: + - const: init + - const: cmn + - const: lane + - const: pcs_apb + - const: pma_apb + + rockchip,dp-lane-mux: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 2 + maxItems: 4 + description: + An array of physical Tyep-C lanes indexes. Position of an entry determines + the dp lane index, while the value of an entry indicater physical Type-C lane. + The support dp lanes number are 2 or 4. e.g. for 2 lanes dp lanes map, we could + have "rockchip,dp-lane-mux = <2, 3>;", assuming dp lane0 on Type-C phy lane2, + dp lane1 on Type-C phy lane3. For 4 lanes dp lanes map, we could have + "rockchip,dp-lane-mux = <0, 1, 2, 3>;", assuming dp lane0 on Type-C phy lane0, + dp lane1 on Type-C phy lane1, dp lane2 on Type-C phy lane2, dp lane3 on Type-C + phy lane3. If dp lane map by DisplayPort Alt mode, this property is not need. + + rockchip,u2phy-grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the syscon managing the 'usb2 phy general register files'. + + rockchip,usb-grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the syscon managing the 'usb general register files'. + + rockchip,usbdpphy-grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the syscon managing the 'usbdp phy general register files'. + + rockchip,vo-grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the syscon managing the 'video output general register files'. + When select the dp lane mapping will request its phandle. + + sbu1-dc-gpios: + description: + GPIO connected to the SBU1 line of the USB-C connector via a big resistor + (~100K) to apply a DC offset for signalling the connector orientation. + + sbu2-dc-gpios: + description: + GPIO connected to the SBU2 line of the USB-C connector via a big resistor + (~100K) to apply a DC offset for signalling the connector orientation. + + orientation-switch: + description: Flag the port as possible handler of orientation switching + type: boolean + + mode-switch: + description: Flag the port as possible handle of altmode switching + type: boolean + + dp-port: + type: object + additionalProperties: false + + properties: + "#phy-cells": + const: 0 + + required: + - "#phy-cells" + + usb3-port: + type: object + additionalProperties: false + + properties: + "#phy-cells": + const: 0 + + required: + - "#phy-cells" + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + A port node to link the PHY to a TypeC controller for the purpose of + handling orientation switching. + +required: + - compatible + - reg + - clocks + - clock-names + - resets + - reset-names + - dp-port + - usb3-port + +additionalProperties: false + +examples: + - | + #include + #include + + usbdp_phy0: phy@fed80000 { + compatible = "rockchip,rk3588-usbdp-phy"; + reg = <0xfed80000 0x10000>; + rockchip,u2phy-grf = <&usb2phy0_grf>; + rockchip,usb-grf = <&usb_grf>; + rockchip,usbdpphy-grf = <&usbdpphy0_grf>; + rockchip,vo-grf = <&vo0_grf>; + clocks = <&cru CLK_USBDPPHY_MIPIDCPPHY_REF>, + <&cru CLK_USBDP_PHY0_IMMORTAL>, + <&cru PCLK_USBDPPHY0>, + <&u2phy0>; + clock-names = "refclk", "immortal", "pclk", "utmi"; + resets = <&cru SRST_USBDP_COMBO_PHY0_INIT>, + <&cru SRST_USBDP_COMBO_PHY0_CMN>, + <&cru SRST_USBDP_COMBO_PHY0_LANE>, + <&cru SRST_USBDP_COMBO_PHY0_PCS>, + <&cru SRST_P_USBDPPHY0>; + reset-names = "init", "cmn", "lane", "pcs_apb", "pma_apb"; + + usbdp_phy0_dp: dp-port { + #phy-cells = <0>; + }; + + usbdp_phy0_u3: usb3-port { + #phy-cells = <0>; + }; + }; From patchwork Fri Feb 9 18:17:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1043529dyd; Fri, 9 Feb 2024 10:22:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXOWI9omZjrqhT75DoUByLsypMQ0GXGidGpBiECuAHuaRJLy5Gz/F3xe6+SuI3HK+9cPcjP6ZjLA7266v4Goa9GpisJMw== X-Google-Smtp-Source: AGHT+IES8eOzhqtOkWBfvEP5T4hqdwNLfAfB6T16YjyDb74BMQ52xDaBApQFPKzANpsXfG7UuuNk X-Received: by 2002:a05:6a21:9217:b0:19e:488f:692d with SMTP id tl23-20020a056a21921700b0019e488f692dmr3505044pzb.7.1707502926225; Fri, 09 Feb 2024 10:22:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707502926; cv=pass; d=google.com; s=arc-20160816; b=CLHwOsweQQm99R1VXwt6izOjL66EOT3jy2Lhr58AP+M4LEeiFxGcubSfkmJF+yB+NH NDJMJIUz0HH5YNT7Gu2AImEDj/Rb2K+FD4mvNQ17jNyKgQQXivr6OLMP8TCx1c+5FdeY iGIMgFl2zXPzeIoFTnd8Nm3jx2n3vH23GqOkWD+6OULIjmfJfWl4U3ezX4b5o8756nu0 eQgu2xFU4TOy+uZTyZtIXMVx0Jy8QWkwccPjWEkA30kesh3TY2WGjXhCHjgnUtjh2gGv TvTlPNlO7iJmiHNeejNkoCU4zPykHkZeQA4igSmg8eTSt7yQER9/iLgVZr5C8u08hWv3 Qalg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wRFUrSdggmVsmpz0xzjQMQRyUL+jQy0Ccu91UKGZRZw=; fh=+TNg9jiICbWT5MARsVQoh4qGLm1R8TvwUgrBPxBKhF0=; b=h4dN50NEhSSD5eCSzDsHyYa6vr/TAvM/8hvunErqNVlqEJtBBdcemqszvInZQZotUK 1RhLB2pF08GuMc3TCHFUuVDPltekEApgttdKhh3LbTU8+JQRI5gB7lUTlV7EhMvfDvim RHVXCzomFJz/qRzExENc3oMyBAPy1ba7K1yZvFTua24i+9mMyjrmc6XjpJwj33KT1nS5 ghB2GgQFsQ4svd89ybhpQUxHz8Zj4N7naM/gJpUlYWW1quIuZwDqPJHyrMuQi+yvWoOE 1Wf6GYtuixeX7u9C9QFFDsQC75NEjBrqBPbH15OryPJePq2p14bCrYxaDHbrqglRg9c7 uQUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=0I6rVqh1; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59786-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59786-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCX4WoFQ7y2GCnqRH4AFHTYE/A84oT7PnyG3UR453+rHjmJR7Vpnwaqwj69bg4JX66Qr/5uqnvxlnrMPv81jDXjPdcKRJQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s15-20020a63af4f000000b005db38f3524bsi2113145pgo.52.2024.02.09.10.22.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:22:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59786-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=0I6rVqh1; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59786-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59786-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CBB8B283CA4 for ; Fri, 9 Feb 2024 18:22:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2D997BAF6; Fri, 9 Feb 2024 18:18:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="0I6rVqh1" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39C087F491; Fri, 9 Feb 2024 18:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502718; cv=none; b=WLkQ8Wcc7ZEXe6h39N04Rjg7kcqDieL8h3cnZySnzFN4fRHEcXId/XJ02tagWZyPrWG+GqYZWXGPY09qWDgae36/1sqlWljQ6lQzIAC8+n66O5A2TUVxxtZOZJCykA7CQJaiNriKKPRr5NaaDQs0S8Omt+0x3725xE1wzZpHXVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502718; c=relaxed/simple; bh=gj1qboP0B/IODbvOpmdQxmIw8WI5CoW/gDOK27Sa04A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mFtfab/WKQ4SvEx+TKA/a8TfRw8wAKhRhraGXeGHgouCdBRdx+cdYVJGrbrmop5/3Pv73RoVTgT5zgWAsJlsu/9Fmfrq6icFa17m1euimA/SBX7V+7IYTozdag+Vsowm3Jwy6JRbleav1JlsT/E2I/EyOAVSo+qJzydklUZ/uC0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=0I6rVqh1; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=gj1qboP0B/IODbvOpmdQxmIw8WI5CoW/gDOK27Sa04A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0I6rVqh1kvhZGSzyF9CE/rN1FmTNvtJ406YlmaotObx1FpWDD2jgHiEQ4RwIxIA2l OxaIZ2kP1EMPeizdaeA3vhtlOViDewz2jbFa4xf+2nNcC6RB7qjGbqE+2cMNol5zRo LJj1F7EIU9rN7aUgV2fa5OuVWSho6iWkP2BHN97v4r6ShE+j6p22DUBu5KRhYz4XTw EDNinoZCXybIhqNIz02tsaS0XkL4vrZxRFN4BRoyzFGrNHbRw2fvGPx4TZEnXZUrnf Sy5TzzhMLZJFSVQeTFqbjNPAokLaS0CxaZ0NhQ+Gft8SLcW9cjvvG6MlVCA/Gig0Dh SDSXwDWIZM3xw== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 17D1B37820AB; Fri, 9 Feb 2024 18:18:33 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 944624800D2; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com, Zhang Yubing Subject: [PATCH v1 04/10] phy: rockchip: add usbdp combo phy driver Date: Fri, 9 Feb 2024 19:17:20 +0100 Message-ID: <20240209181831.104687-5-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790446588349490673 X-GMAIL-MSGID: 1790446588349490673 This adds a new USBDP combo PHY with Samsung IP block driver. The driver get lane mux and mapping info in 2 ways, supporting DisplayPort alternate mode or parsing from DT. When parsing from DT, the property "rockchip,dp-lane-mux" provide the DP mux and mapping info. This is needed when the PHY is not used with TypeC Alt-Mode. For example if the USB3 interface of the PHY is connected to a USB Type A connector and the DP interface is connected to a DisplayPort connector. When do DP link training, need to set lane number, link rate, swing, and pre-emphasis via PHY configure interface. Co-developed-by: Heiko Stuebner Signed-off-by: Heiko Stuebner Co-developed-by: Zhang Yubing Signed-off-by: Zhang Yubing Co-developed-by: Frank Wang Signed-off-by: Frank Wang Signed-off-by: Sebastian Reichel --- drivers/phy/rockchip/Kconfig | 12 + drivers/phy/rockchip/Makefile | 1 + drivers/phy/rockchip/phy-rockchip-usbdp.c | 1641 +++++++++++++++++++++ 3 files changed, 1654 insertions(+) create mode 100644 drivers/phy/rockchip/phy-rockchip-usbdp.c diff --git a/drivers/phy/rockchip/Kconfig b/drivers/phy/rockchip/Kconfig index 94360fc96a6f..d21b458c1d18 100644 --- a/drivers/phy/rockchip/Kconfig +++ b/drivers/phy/rockchip/Kconfig @@ -107,3 +107,15 @@ config PHY_ROCKCHIP_USB select GENERIC_PHY help Enable this to support the Rockchip USB 2.0 PHY. + +config PHY_ROCKCHIP_USBDP + tristate "Rockchip USBDP COMBO PHY Driver" + depends on ARCH_ROCKCHIP && OF + select GENERIC_PHY + select TYPEC + help + Enable this to support the Rockchip USB3.0/DP combo PHY with + Samsung IP block. This is required for USB3 support on RK3588. + + To compile this driver as a module, choose M here: the module + will be called phy-rockchip-usbdp diff --git a/drivers/phy/rockchip/Makefile b/drivers/phy/rockchip/Makefile index 7eab129230d1..25d2e1355db7 100644 --- a/drivers/phy/rockchip/Makefile +++ b/drivers/phy/rockchip/Makefile @@ -11,3 +11,4 @@ obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o obj-$(CONFIG_PHY_ROCKCHIP_SNPS_PCIE3) += phy-rockchip-snps-pcie3.o obj-$(CONFIG_PHY_ROCKCHIP_TYPEC) += phy-rockchip-typec.o obj-$(CONFIG_PHY_ROCKCHIP_USB) += phy-rockchip-usb.o +obj-$(CONFIG_PHY_ROCKCHIP_USBDP) += phy-rockchip-usbdp.o diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c new file mode 100644 index 000000000000..c7ed0fd10197 --- /dev/null +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c @@ -0,0 +1,1641 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Rockchip USBDP Combo PHY with Samsung IP block driver + * + * Copyright (C) 2021 Rockchip Electronics Co., Ltd + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* USBDP PHY Register Definitions */ +#define UDPHY_PCS 0x4000 +#define UDPHY_PMA 0x8000 + +/* VO0 GRF Registers */ +#define DP_SINK_HPD_CFG BIT(11) +#define DP_SINK_HPD_SEL BIT(10) +#define DP_AUX_DIN_SEL BIT(9) +#define DP_AUX_DOUT_SEL BIT(8) +#define DP_LANE_SEL_N(n) GENMASK(2 * (n) + 1, 2 * (n)) +#define DP_LANE_SEL_ALL GENMASK(7, 0) + +/* PMA CMN Registers */ +#define CMN_LANE_MUX_AND_EN_OFFSET 0x0288 /* cmn_reg00A2 */ +#define CMN_DP_LANE_MUX_N(n) BIT((n) + 4) +#define CMN_DP_LANE_EN_N(n) BIT(n) +#define CMN_DP_LANE_MUX_ALL GENMASK(7, 4) +#define CMN_DP_LANE_EN_ALL GENMASK(3, 0) + +#define CMN_DP_LINK_OFFSET 0x28c /* cmn_reg00A3 */ +#define CMN_DP_TX_LINK_BW GENMASK(6, 5) +#define CMN_DP_TX_LANE_SWAP_EN BIT(2) + +#define CMN_SSC_EN_OFFSET 0x2d0 /* cmn_reg00B4 */ +#define CMN_ROPLL_SSC_EN BIT(1) +#define CMN_LCPLL_SSC_EN BIT(0) + +#define CMN_ANA_LCPLL_DONE_OFFSET 0x0350 /* cmn_reg00D4 */ +#define CMN_ANA_LCPLL_LOCK_DONE BIT(7) +#define CMN_ANA_LCPLL_AFC_DONE BIT(6) + +#define CMN_ANA_ROPLL_DONE_OFFSET 0x0354 /* cmn_reg00D5 */ +#define CMN_ANA_ROPLL_LOCK_DONE BIT(1) +#define CMN_ANA_ROPLL_AFC_DONE BIT(0) + +#define CMN_DP_RSTN_OFFSET 0x038c /* cmn_reg00E3 */ +#define CMN_DP_INIT_RSTN BIT(3) +#define CMN_DP_CMN_RSTN BIT(2) +#define CMN_CDR_WTCHDG_EN BIT(1) +#define CMN_CDR_WTCHDG_MSK_CDR_EN BIT(0) + +#define TRSV_ANA_TX_CLK_OFFSET_N(n) (0x854 + (n) * 0x800) /* trsv_reg0215 */ +#define LN_ANA_TX_SER_TXCLK_INV BIT(1) + +#define TRSV_LN0_MON_RX_CDR_DONE_OFFSET 0x0b84 /* trsv_reg02E1 */ +#define TRSV_LN0_MON_RX_CDR_LOCK_DONE BIT(0) + +#define TRSV_LN2_MON_RX_CDR_DONE_OFFSET 0x1b84 /* trsv_reg06E1 */ +#define TRSV_LN2_MON_RX_CDR_LOCK_DONE BIT(0) + +#define BIT_WRITEABLE_SHIFT 16 +#define PHY_AUX_DP_DATA_POL_NORMAL 0 +#define PHY_AUX_DP_DATA_POL_INVERT 1 +#define PHY_LANE_MUX_USB 0 +#define PHY_LANE_MUX_DP 1 + +enum { + DP_BW_RBR, + DP_BW_HBR, + DP_BW_HBR2, + DP_BW_HBR3, +}; + +enum { + UDPHY_MODE_NONE = 0, + UDPHY_MODE_USB = BIT(0), + UDPHY_MODE_DP = BIT(1), + UDPHY_MODE_DP_USB = BIT(1) | BIT(0), +}; + +struct udphy_grf_reg { + unsigned int offset; + unsigned int bitend; + unsigned int bitstart; + unsigned int disable; + unsigned int enable; +}; + +struct udphy_grf_cfg { + /* u2phy-grf */ + struct udphy_grf_reg bvalid_phy_con; + struct udphy_grf_reg bvalid_grf_con; + + /* usb-grf */ + struct udphy_grf_reg usb3otg0_cfg; + struct udphy_grf_reg usb3otg1_cfg; + + /* usbdpphy-grf */ + struct udphy_grf_reg low_pwrn; + struct udphy_grf_reg rx_lfps; +}; + +struct udphy_vogrf_cfg { + /* vo-grf */ + struct udphy_grf_reg hpd_trigger; + u32 dp_lane_reg; +}; + +struct dp_tx_drv_ctrl { + u32 trsv_reg0204; + u32 trsv_reg0205; + u32 trsv_reg0206; + u32 trsv_reg0207; +}; + +struct rockchip_udphy; + +struct rockchip_udphy_cfg { + unsigned int num_phys; + unsigned int phy_ids[2]; + /* resets to be requested */ + const char * const *rst_list; + int num_rsts; + + struct udphy_grf_cfg grfcfg; + struct udphy_vogrf_cfg vogrfcfg[2]; + const struct dp_tx_drv_ctrl (*dp_tx_ctrl_cfg[4])[4]; + const struct dp_tx_drv_ctrl (*dp_tx_ctrl_cfg_typec[4])[4]; +}; + +struct rockchip_udphy { + struct device *dev; + struct regmap *pma_regmap; + struct regmap *u2phygrf; + struct regmap *udphygrf; + struct regmap *usbgrf; + struct regmap *vogrf; + struct typec_switch_dev *sw; + struct typec_mux_dev *mux; + struct mutex mutex; /* mutex to protect access to individual PHYs */ + + /* clocks and rests */ + int num_clks; + struct clk_bulk_data *clks; + struct clk *refclk; + int num_rsts; + struct reset_control_bulk_data *rsts; + + /* PHY status management */ + bool flip; + bool mode_change; + u8 mode; + u8 status; + + /* utilized for USB */ + bool hs; /* flag for high-speed */ + + /* utilized for DP */ + struct gpio_desc *sbu1_dc_gpio; + struct gpio_desc *sbu2_dc_gpio; + u32 lane_mux_sel[4]; + u32 dp_lane_sel[4]; + u32 dp_aux_dout_sel; + u32 dp_aux_din_sel; + bool dp_sink_hpd_sel; + bool dp_sink_hpd_cfg; + u8 bw; + int id; + + bool dp_in_use; + + /* PHY const config */ + const struct rockchip_udphy_cfg *cfgs; +}; + +static const struct dp_tx_drv_ctrl rk3588_dp_tx_drv_ctrl_rbr_hbr[4][4] = { + /* voltage swing 0, pre-emphasis 0->3 */ + { + { 0x20, 0x10, 0x42, 0xe5 }, + { 0x26, 0x14, 0x42, 0xe5 }, + { 0x29, 0x18, 0x42, 0xe5 }, + { 0x2b, 0x1c, 0x43, 0xe7 }, + }, + + /* voltage swing 1, pre-emphasis 0->2 */ + { + { 0x23, 0x10, 0x42, 0xe7 }, + { 0x2a, 0x17, 0x43, 0xe7 }, + { 0x2b, 0x1a, 0x43, 0xe7 }, + }, + + /* voltage swing 2, pre-emphasis 0->1 */ + { + { 0x27, 0x10, 0x42, 0xe7 }, + { 0x2b, 0x17, 0x43, 0xe7 }, + }, + + /* voltage swing 3, pre-emphasis 0 */ + { + { 0x29, 0x10, 0x43, 0xe7 }, + }, +}; + +static const struct dp_tx_drv_ctrl rk3588_dp_tx_drv_ctrl_rbr_hbr_typec[4][4] = { + /* voltage swing 0, pre-emphasis 0->3 */ + { + { 0x20, 0x10, 0x42, 0xe5 }, + { 0x26, 0x14, 0x42, 0xe5 }, + { 0x29, 0x18, 0x42, 0xe5 }, + { 0x2b, 0x1c, 0x43, 0xe7 }, + }, + + /* voltage swing 1, pre-emphasis 0->2 */ + { + { 0x23, 0x10, 0x42, 0xe7 }, + { 0x2a, 0x17, 0x43, 0xe7 }, + { 0x2b, 0x1a, 0x43, 0xe7 }, + }, + + /* voltage swing 2, pre-emphasis 0->1 */ + { + { 0x27, 0x10, 0x43, 0x67 }, + { 0x2b, 0x17, 0x43, 0xe7 }, + }, + + /* voltage swing 3, pre-emphasis 0 */ + { + { 0x29, 0x10, 0x43, 0xe7 }, + }, +}; + +static const struct dp_tx_drv_ctrl rk3588_dp_tx_drv_ctrl_hbr2[4][4] = { + /* voltage swing 0, pre-emphasis 0->3 */ + { + { 0x21, 0x10, 0x42, 0xe5 }, + { 0x26, 0x14, 0x42, 0xe5 }, + { 0x26, 0x16, 0x43, 0xe5 }, + { 0x2a, 0x19, 0x43, 0xe7 }, + }, + + /* voltage swing 1, pre-emphasis 0->2 */ + { + { 0x24, 0x10, 0x42, 0xe7 }, + { 0x2a, 0x17, 0x43, 0xe7 }, + { 0x2b, 0x1a, 0x43, 0xe7 }, + }, + + /* voltage swing 2, pre-emphasis 0->1 */ + { + { 0x28, 0x10, 0x42, 0xe7 }, + { 0x2b, 0x17, 0x43, 0xe7 }, + }, + + /* voltage swing 3, pre-emphasis 0 */ + { + { 0x28, 0x10, 0x43, 0xe7 }, + }, +}; + +static const struct dp_tx_drv_ctrl rk3588_dp_tx_drv_ctrl_hbr3[4][4] = { + /* voltage swing 0, pre-emphasis 0->3 */ + { + { 0x21, 0x10, 0x42, 0xe5 }, + { 0x26, 0x14, 0x42, 0xe5 }, + { 0x26, 0x16, 0x43, 0xe5 }, + { 0x29, 0x18, 0x43, 0xe7 }, + }, + + /* voltage swing 1, pre-emphasis 0->2 */ + { + { 0x24, 0x10, 0x42, 0xe7 }, + { 0x2a, 0x18, 0x43, 0xe7 }, + { 0x2b, 0x1b, 0x43, 0xe7 } + }, + + /* voltage swing 2, pre-emphasis 0->1 */ + { + { 0x27, 0x10, 0x42, 0xe7 }, + { 0x2b, 0x18, 0x43, 0xe7 } + }, + + /* voltage swing 3, pre-emphasis 0 */ + { + { 0x28, 0x10, 0x43, 0xe7 }, + }, +}; + +static const struct reg_sequence udphy_24m_refclk_cfg[] = { + {0x0090, 0x68}, {0x0094, 0x68}, + {0x0128, 0x24}, {0x012c, 0x44}, + {0x0130, 0x3f}, {0x0134, 0x44}, + {0x015c, 0xa9}, {0x0160, 0x71}, + {0x0164, 0x71}, {0x0168, 0xa9}, + {0x0174, 0xa9}, {0x0178, 0x71}, + {0x017c, 0x71}, {0x0180, 0xa9}, + {0x018c, 0x41}, {0x0190, 0x00}, + {0x0194, 0x05}, {0x01ac, 0x2a}, + {0x01b0, 0x17}, {0x01b4, 0x17}, + {0x01b8, 0x2a}, {0x01c8, 0x04}, + {0x01cc, 0x08}, {0x01d0, 0x08}, + {0x01d4, 0x04}, {0x01d8, 0x20}, + {0x01dc, 0x01}, {0x01e0, 0x09}, + {0x01e4, 0x03}, {0x01f0, 0x29}, + {0x01f4, 0x02}, {0x01f8, 0x02}, + {0x01fc, 0x29}, {0x0208, 0x2a}, + {0x020c, 0x17}, {0x0210, 0x17}, + {0x0214, 0x2a}, {0x0224, 0x20}, + {0x03f0, 0x0a}, {0x03f4, 0x07}, + {0x03f8, 0x07}, {0x03fc, 0x0c}, + {0x0404, 0x12}, {0x0408, 0x1a}, + {0x040c, 0x1a}, {0x0410, 0x3f}, + {0x0ce0, 0x68}, {0x0ce8, 0xd0}, + {0x0cf0, 0x87}, {0x0cf8, 0x70}, + {0x0d00, 0x70}, {0x0d08, 0xa9}, + {0x1ce0, 0x68}, {0x1ce8, 0xd0}, + {0x1cf0, 0x87}, {0x1cf8, 0x70}, + {0x1d00, 0x70}, {0x1d08, 0xa9}, + {0x0a3c, 0xd0}, {0x0a44, 0xd0}, + {0x0a48, 0x01}, {0x0a4c, 0x0d}, + {0x0a54, 0xe0}, {0x0a5c, 0xe0}, + {0x0a64, 0xa8}, {0x1a3c, 0xd0}, + {0x1a44, 0xd0}, {0x1a48, 0x01}, + {0x1a4c, 0x0d}, {0x1a54, 0xe0}, + {0x1a5c, 0xe0}, {0x1a64, 0xa8} +}; + +static const struct reg_sequence udphy_26m_refclk_cfg[] = { + {0x0830, 0x07}, {0x085c, 0x80}, + {0x1030, 0x07}, {0x105c, 0x80}, + {0x1830, 0x07}, {0x185c, 0x80}, + {0x2030, 0x07}, {0x205c, 0x80}, + {0x0228, 0x38}, {0x0104, 0x44}, + {0x0248, 0x44}, {0x038c, 0x02}, + {0x0878, 0x04}, {0x1878, 0x04}, + {0x0898, 0x77}, {0x1898, 0x77}, + {0x0054, 0x01}, {0x00e0, 0x38}, + {0x0060, 0x24}, {0x0064, 0x77}, + {0x0070, 0x76}, {0x0234, 0xe8}, + {0x0af4, 0x15}, {0x1af4, 0x15}, + {0x081c, 0xe5}, {0x181c, 0xe5}, + {0x099c, 0x48}, {0x199c, 0x48}, + {0x09a4, 0x07}, {0x09a8, 0x22}, + {0x19a4, 0x07}, {0x19a8, 0x22}, + {0x09b8, 0x3e}, {0x19b8, 0x3e}, + {0x09e4, 0x02}, {0x19e4, 0x02}, + {0x0a34, 0x1e}, {0x1a34, 0x1e}, + {0x0a98, 0x2f}, {0x1a98, 0x2f}, + {0x0c30, 0x0e}, {0x0c48, 0x06}, + {0x1c30, 0x0e}, {0x1c48, 0x06}, + {0x028c, 0x18}, {0x0af0, 0x00}, + {0x1af0, 0x00} +}; + +static const struct reg_sequence udphy_init_sequence[] = { + {0x0104, 0x44}, {0x0234, 0xe8}, + {0x0248, 0x44}, {0x028c, 0x18}, + {0x081c, 0xe5}, {0x0878, 0x00}, + {0x0994, 0x1c}, {0x0af0, 0x00}, + {0x181c, 0xe5}, {0x1878, 0x00}, + {0x1994, 0x1c}, {0x1af0, 0x00}, + {0x0428, 0x60}, {0x0d58, 0x33}, + {0x1d58, 0x33}, {0x0990, 0x74}, + {0x0d64, 0x17}, {0x08c8, 0x13}, + {0x1990, 0x74}, {0x1d64, 0x17}, + {0x18c8, 0x13}, {0x0d90, 0x40}, + {0x0da8, 0x40}, {0x0dc0, 0x40}, + {0x0dd8, 0x40}, {0x1d90, 0x40}, + {0x1da8, 0x40}, {0x1dc0, 0x40}, + {0x1dd8, 0x40}, {0x03c0, 0x30}, + {0x03c4, 0x06}, {0x0e10, 0x00}, + {0x1e10, 0x00}, {0x043c, 0x0f}, + {0x0d2c, 0xff}, {0x1d2c, 0xff}, + {0x0d34, 0x0f}, {0x1d34, 0x0f}, + {0x08fc, 0x2a}, {0x0914, 0x28}, + {0x0a30, 0x03}, {0x0e38, 0x03}, + {0x0ecc, 0x27}, {0x0ed0, 0x22}, + {0x0ed4, 0x26}, {0x18fc, 0x2a}, + {0x1914, 0x28}, {0x1a30, 0x03}, + {0x1e38, 0x03}, {0x1ecc, 0x27}, + {0x1ed0, 0x22}, {0x1ed4, 0x26}, + {0x0048, 0x0f}, {0x0060, 0x3c}, + {0x0064, 0xf7}, {0x006c, 0x20}, + {0x0070, 0x7d}, {0x0074, 0x68}, + {0x0af4, 0x1a}, {0x1af4, 0x1a}, + {0x0440, 0x3f}, {0x10d4, 0x08}, + {0x20d4, 0x08}, {0x00d4, 0x30}, + {0x0024, 0x6e}, +}; + +static inline int grfreg_write(struct regmap *base, + const struct udphy_grf_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 int udphy_clk_init(struct rockchip_udphy *udphy, struct device *dev) +{ + int i; + + udphy->num_clks = devm_clk_bulk_get_all(dev, &udphy->clks); + if (udphy->num_clks < 1) + return -ENODEV; + + /* used for configure phy reference clock frequency */ + for (i = 0; i < udphy->num_clks; i++) { + if (!strncmp(udphy->clks[i].id, "refclk", 6)) { + udphy->refclk = udphy->clks[i].clk; + break; + } + } + + if (!udphy->refclk) + return dev_err_probe(udphy->dev, -EINVAL, "no refclk found\n"); + + return 0; +} + +static int udphy_reset_assert_all(struct rockchip_udphy *udphy) +{ + return reset_control_bulk_assert(udphy->num_rsts, udphy->rsts); +} + +static int udphy_reset_deassert_all(struct rockchip_udphy *udphy) +{ + return reset_control_bulk_deassert(udphy->num_rsts, udphy->rsts); +} + +static int udphy_reset_deassert(struct rockchip_udphy *udphy, char *name) +{ + struct reset_control_bulk_data *list = udphy->rsts; + int idx; + + for (idx = 0; idx < udphy->num_rsts; idx++) { + if (!strcmp(list[idx].id, name)) + return reset_control_deassert(list[idx].rstc); + } + + return -EINVAL; +} + +static int udphy_reset_init(struct rockchip_udphy *udphy, struct device *dev) +{ + const struct rockchip_udphy_cfg *cfg = udphy->cfgs; + int idx; + + udphy->num_rsts = cfg->num_rsts; + udphy->rsts = devm_kcalloc(dev, udphy->num_rsts, + sizeof(*udphy->rsts), GFP_KERNEL); + if (!udphy->rsts) + return -ENOMEM; + + for (idx = 0; idx < cfg->num_rsts; idx++) + udphy->rsts[idx].id = cfg->rst_list[idx]; + + return devm_reset_control_bulk_get_exclusive(dev, cfg->num_rsts, + udphy->rsts); +} + +static void udphy_u3_port_disable(struct rockchip_udphy *udphy, u8 disable) +{ + const struct rockchip_udphy_cfg *cfg = udphy->cfgs; + const struct udphy_grf_reg *preg; + + preg = udphy->id ? &cfg->grfcfg.usb3otg1_cfg : &cfg->grfcfg.usb3otg0_cfg; + grfreg_write(udphy->usbgrf, preg, disable); +} + +static void udphy_usb_bvalid_enable(struct rockchip_udphy *udphy, u8 enable) +{ + const struct rockchip_udphy_cfg *cfg = udphy->cfgs; + + grfreg_write(udphy->u2phygrf, &cfg->grfcfg.bvalid_phy_con, enable); + grfreg_write(udphy->u2phygrf, &cfg->grfcfg.bvalid_grf_con, enable); +} + +/* + * In usb/dp combo phy driver, here are 2 ways to mapping lanes. + * + * 1 Type-C Mapping table (DP_Alt_Mode V1.0b remove ABF pin mapping) + * --------------------------------------------------------------------------- + * Type-C Pin B11-B10 A2-A3 A11-A10 B2-B3 + * PHY Pad ln0(tx/rx) ln1(tx) ln2(tx/rx) ln3(tx) + * C/E(Normal) dpln3 dpln2 dpln0 dpln1 + * C/E(Flip ) dpln0 dpln1 dpln3 dpln2 + * D/F(Normal) usbrx usbtx dpln0 dpln1 + * D/F(Flip ) dpln0 dpln1 usbrx usbtx + * A(Normal ) dpln3 dpln1 dpln2 dpln0 + * A(Flip ) dpln2 dpln0 dpln3 dpln1 + * B(Normal ) usbrx usbtx dpln1 dpln0 + * B(Flip ) dpln1 dpln0 usbrx usbtx + * --------------------------------------------------------------------------- + * + * 2 Mapping the lanes in dtsi + * if all 4 lane assignment for dp function, define rockchip,dp-lane-mux = ; + * sample as follow: + * --------------------------------------------------------------------------- + * B11-B10 A2-A3 A11-A10 B2-B3 + * rockchip,dp-lane-mux ln0(tx/rx) ln1(tx) ln2(tx/rx) ln3(tx) + * <0 1 2 3> dpln0 dpln1 dpln2 dpln3 + * <2 3 0 1> dpln2 dpln3 dpln0 dpln1 + * --------------------------------------------------------------------------- + * if 2 lane for dp function, 2 lane for usb function, define rockchip,dp-lane-mux = ; + * sample as follow: + * --------------------------------------------------------------------------- + * B11-B10 A2-A3 A11-A10 B2-B3 + * rockchip,dp-lane-mux ln0(tx/rx) ln1(tx) ln2(tx/rx) ln3(tx) + * <0 1> dpln0 dpln1 usbrx usbtx + * <2 3> usbrx usbtx dpln0 dpln1 + * --------------------------------------------------------------------------- + */ + +static int udphy_dplane_select(struct rockchip_udphy *udphy) +{ + const struct rockchip_udphy_cfg *cfg = udphy->cfgs; + u32 value = 0; + + switch (udphy->mode) { + case UDPHY_MODE_DP: + value |= 2 << udphy->dp_lane_sel[2] * 2; + value |= 3 << udphy->dp_lane_sel[3] * 2; + fallthrough; + case UDPHY_MODE_DP_USB: + value |= 0 << udphy->dp_lane_sel[0] * 2; + value |= 1 << udphy->dp_lane_sel[1] * 2; + break; + case UDPHY_MODE_USB: + break; + default: + break; + } + + regmap_write(udphy->vogrf, cfg->vogrfcfg[udphy->id].dp_lane_reg, + ((DP_AUX_DIN_SEL | DP_AUX_DOUT_SEL | DP_LANE_SEL_ALL) << 16) | + FIELD_PREP(DP_AUX_DIN_SEL, udphy->dp_aux_din_sel) | + FIELD_PREP(DP_AUX_DOUT_SEL, udphy->dp_aux_dout_sel) | value); + + return 0; +} + +static int udphy_dplane_get(struct rockchip_udphy *udphy) +{ + int dp_lanes; + + switch (udphy->mode) { + case UDPHY_MODE_DP: + dp_lanes = 4; + break; + case UDPHY_MODE_DP_USB: + dp_lanes = 2; + break; + case UDPHY_MODE_USB: + fallthrough; + default: + dp_lanes = 0; + break; + } + + return dp_lanes; +} + +static int udphy_dplane_enable(struct rockchip_udphy *udphy, int dp_lanes) +{ + u32 val = 0; + int i; + + for (i = 0; i < dp_lanes; i++) + val |= BIT(udphy->dp_lane_sel[i]); + + regmap_update_bits(udphy->pma_regmap, CMN_LANE_MUX_AND_EN_OFFSET, CMN_DP_LANE_EN_ALL, + FIELD_PREP(CMN_DP_LANE_EN_ALL, val)); + + if (!dp_lanes) + regmap_update_bits(udphy->pma_regmap, CMN_DP_RSTN_OFFSET, + CMN_DP_CMN_RSTN, FIELD_PREP(CMN_DP_CMN_RSTN, 0x0)); + + return 0; +} + +static int udphy_dp_hpd_event_trigger(struct rockchip_udphy *udphy, bool hpd) +{ + const struct rockchip_udphy_cfg *cfg = udphy->cfgs; + + udphy->dp_sink_hpd_sel = true; + udphy->dp_sink_hpd_cfg = hpd; + + if (!udphy->dp_in_use) + return 0; + + grfreg_write(udphy->vogrf, &cfg->vogrfcfg[udphy->id].hpd_trigger, hpd); + + return 0; +} + +static int udphy_set_typec_default_mapping(struct rockchip_udphy *udphy) +{ + if (udphy->flip) { + udphy->dp_lane_sel[0] = 0; + udphy->dp_lane_sel[1] = 1; + udphy->dp_lane_sel[2] = 3; + udphy->dp_lane_sel[3] = 2; + udphy->lane_mux_sel[0] = PHY_LANE_MUX_DP; + udphy->lane_mux_sel[1] = PHY_LANE_MUX_DP; + udphy->lane_mux_sel[2] = PHY_LANE_MUX_USB; + udphy->lane_mux_sel[3] = PHY_LANE_MUX_USB; + udphy->dp_aux_dout_sel = PHY_AUX_DP_DATA_POL_INVERT; + udphy->dp_aux_din_sel = PHY_AUX_DP_DATA_POL_INVERT; + gpiod_set_value_cansleep(udphy->sbu1_dc_gpio, 1); + gpiod_set_value_cansleep(udphy->sbu2_dc_gpio, 0); + } else { + udphy->dp_lane_sel[0] = 2; + udphy->dp_lane_sel[1] = 3; + udphy->dp_lane_sel[2] = 1; + udphy->dp_lane_sel[3] = 0; + udphy->lane_mux_sel[0] = PHY_LANE_MUX_USB; + udphy->lane_mux_sel[1] = PHY_LANE_MUX_USB; + udphy->lane_mux_sel[2] = PHY_LANE_MUX_DP; + udphy->lane_mux_sel[3] = PHY_LANE_MUX_DP; + udphy->dp_aux_dout_sel = PHY_AUX_DP_DATA_POL_NORMAL; + udphy->dp_aux_din_sel = PHY_AUX_DP_DATA_POL_NORMAL; + gpiod_set_value_cansleep(udphy->sbu1_dc_gpio, 0); + gpiod_set_value_cansleep(udphy->sbu2_dc_gpio, 1); + } + + udphy->mode = UDPHY_MODE_DP_USB; + + return 0; +} + +static int udphy_orien_sw_set(struct typec_switch_dev *sw, + enum typec_orientation orien) +{ + struct rockchip_udphy *udphy = typec_switch_get_drvdata(sw); + + mutex_lock(&udphy->mutex); + + if (orien == TYPEC_ORIENTATION_NONE) { + gpiod_set_value_cansleep(udphy->sbu1_dc_gpio, 0); + gpiod_set_value_cansleep(udphy->sbu2_dc_gpio, 0); + /* unattached */ + udphy_usb_bvalid_enable(udphy, false); + goto unlock_ret; + } + + udphy->flip = (orien == TYPEC_ORIENTATION_REVERSE) ? true : false; + udphy_set_typec_default_mapping(udphy); + udphy_usb_bvalid_enable(udphy, true); + +unlock_ret: + mutex_unlock(&udphy->mutex); + return 0; +} + +static void udphy_orien_switch_unregister(void *data) +{ + struct rockchip_udphy *udphy = data; + + typec_switch_unregister(udphy->sw); +} + +static int udphy_setup_orien_switch(struct rockchip_udphy *udphy) +{ + struct typec_switch_desc sw_desc = { }; + + sw_desc.drvdata = udphy; + sw_desc.fwnode = dev_fwnode(udphy->dev); + sw_desc.set = udphy_orien_sw_set; + + udphy->sw = typec_switch_register(udphy->dev, &sw_desc); + if (IS_ERR(udphy->sw)) { + dev_err(udphy->dev, "Error register typec orientation switch: %ld\n", + PTR_ERR(udphy->sw)); + return PTR_ERR(udphy->sw); + } + + return devm_add_action_or_reset(udphy->dev, + udphy_orien_switch_unregister, udphy); +} + +static int udphy_refclk_set(struct rockchip_udphy *udphy) +{ + unsigned long rate; + int ret; + + /* configure phy reference clock */ + rate = clk_get_rate(udphy->refclk); + dev_dbg(udphy->dev, "refclk freq %ld\n", rate); + + switch (rate) { + case 24000000: + ret = regmap_multi_reg_write(udphy->pma_regmap, udphy_24m_refclk_cfg, + ARRAY_SIZE(udphy_24m_refclk_cfg)); + if (ret) + return ret; + break; + case 26000000: + /* register default is 26MHz */ + ret = regmap_multi_reg_write(udphy->pma_regmap, udphy_26m_refclk_cfg, + ARRAY_SIZE(udphy_26m_refclk_cfg)); + if (ret) + return ret; + break; + default: + dev_err(udphy->dev, "unsupported refclk freq %ld\n", rate); + return -EINVAL; + } + + return 0; +} + +static int udphy_status_check(struct rockchip_udphy *udphy) +{ + unsigned int val; + int ret; + + /* LCPLL check */ + if (udphy->mode & UDPHY_MODE_USB) { + ret = regmap_read_poll_timeout(udphy->pma_regmap, CMN_ANA_LCPLL_DONE_OFFSET, + val, (val & CMN_ANA_LCPLL_AFC_DONE) && + (val & CMN_ANA_LCPLL_LOCK_DONE), 200, 100000); + if (ret) { + dev_err(udphy->dev, "cmn ana lcpll lock timeout\n"); + /* + * If earlier software (U-Boot) enabled USB once already + * the PLL may have problems locking on the first try. + * It will be successful on the second try, so for the + * time being a -EPROBE_DEFER will solve the issue. + * + * This requires further investigation to understand the + * root cause, especially considering that the driver is + * asserting all reset lines at probe time. + */ + return -EPROBE_DEFER; + } + + if (!udphy->flip) { + ret = regmap_read_poll_timeout(udphy->pma_regmap, + TRSV_LN0_MON_RX_CDR_DONE_OFFSET, val, + val & TRSV_LN0_MON_RX_CDR_LOCK_DONE, + 200, 100000); + if (ret) + dev_err(udphy->dev, "trsv ln0 mon rx cdr lock timeout\n"); + } else { + ret = regmap_read_poll_timeout(udphy->pma_regmap, + TRSV_LN2_MON_RX_CDR_DONE_OFFSET, val, + val & TRSV_LN2_MON_RX_CDR_LOCK_DONE, + 200, 100000); + if (ret) + dev_err(udphy->dev, "trsv ln2 mon rx cdr lock timeout\n"); + } + } + + return 0; +} + +static int udphy_init(struct rockchip_udphy *udphy) +{ + const struct rockchip_udphy_cfg *cfg = udphy->cfgs; + int ret; + + udphy_reset_assert_all(udphy); + usleep_range(10000, 11000); + + /* enable rx lfps for usb */ + if (udphy->mode & UDPHY_MODE_USB) + grfreg_write(udphy->udphygrf, &cfg->grfcfg.rx_lfps, true); + + /* Step 1: power on pma and deassert apb rstn */ + grfreg_write(udphy->udphygrf, &cfg->grfcfg.low_pwrn, true); + + udphy_reset_deassert(udphy, "pma_apb"); + udphy_reset_deassert(udphy, "pcs_apb"); + + /* Step 2: set init sequence and phy refclk */ + ret = regmap_multi_reg_write(udphy->pma_regmap, udphy_init_sequence, + ARRAY_SIZE(udphy_init_sequence)); + if (ret) { + dev_err(udphy->dev, "init sequence set error %d\n", ret); + goto assert_resets; + } + + ret = udphy_refclk_set(udphy); + if (ret) { + dev_err(udphy->dev, "refclk set error %d\n", ret); + goto assert_resets; + } + + /* Step 3: configure lane mux */ + regmap_update_bits(udphy->pma_regmap, CMN_LANE_MUX_AND_EN_OFFSET, + CMN_DP_LANE_MUX_ALL | CMN_DP_LANE_EN_ALL, + FIELD_PREP(CMN_DP_LANE_MUX_N(3), udphy->lane_mux_sel[3]) | + FIELD_PREP(CMN_DP_LANE_MUX_N(2), udphy->lane_mux_sel[2]) | + FIELD_PREP(CMN_DP_LANE_MUX_N(1), udphy->lane_mux_sel[1]) | + FIELD_PREP(CMN_DP_LANE_MUX_N(0), udphy->lane_mux_sel[0]) | + FIELD_PREP(CMN_DP_LANE_EN_ALL, 0)); + + /* Step 4: deassert init rstn and wait for 200ns from datasheet */ + if (udphy->mode & UDPHY_MODE_USB) + udphy_reset_deassert(udphy, "init"); + + if (udphy->mode & UDPHY_MODE_DP) { + regmap_update_bits(udphy->pma_regmap, CMN_DP_RSTN_OFFSET, + CMN_DP_INIT_RSTN, + FIELD_PREP(CMN_DP_INIT_RSTN, 0x1)); + } + + udelay(1); + + /* Step 5: deassert cmn/lane rstn */ + if (udphy->mode & UDPHY_MODE_USB) { + udphy_reset_deassert(udphy, "cmn"); + udphy_reset_deassert(udphy, "lane"); + } + + /* Step 6: wait for lock done of pll */ + ret = udphy_status_check(udphy); + if (ret) + goto assert_resets; + + return 0; + +assert_resets: + udphy_reset_assert_all(udphy); + return ret; +} + +static int udphy_setup(struct rockchip_udphy *udphy) +{ + int ret = 0; + + ret = clk_bulk_prepare_enable(udphy->num_clks, udphy->clks); + if (ret) { + dev_err(udphy->dev, "failed to enable clk\n"); + return ret; + } + + ret = udphy_init(udphy); + if (ret) { + dev_err(udphy->dev, "failed to init combophy\n"); + clk_bulk_disable_unprepare(udphy->num_clks, udphy->clks); + return ret; + } + + return 0; +} + +static int udphy_disable(struct rockchip_udphy *udphy) +{ + clk_bulk_disable_unprepare(udphy->num_clks, udphy->clks); + udphy_reset_assert_all(udphy); + + return 0; +} + +static int udphy_parse_lane_mux_data(struct rockchip_udphy *udphy) +{ + int ret, i, num_lanes; + + num_lanes = device_property_count_u32(udphy->dev, "rockchip,dp-lane-mux"); + if (num_lanes < 0) { + dev_dbg(udphy->dev, "no dp-lane-mux, following dp alt mode\n"); + udphy->mode = UDPHY_MODE_USB; + return 0; + } + + if (num_lanes != 2 && num_lanes != 4) + return dev_err_probe(udphy->dev, -EINVAL, + "invalid number of lane mux\n"); + + ret = device_property_read_u32_array(udphy->dev, "rockchip,dp-lane-mux", + udphy->dp_lane_sel, num_lanes); + if (ret) + return dev_err_probe(udphy->dev, ret, "get dp lane mux failed\n"); + + for (i = 0; i < num_lanes; i++) { + int j; + + if (udphy->dp_lane_sel[i] > 3) + return dev_err_probe(udphy->dev, -EINVAL, + "lane mux between 0 and 3, exceeding the range\n"); + + udphy->lane_mux_sel[udphy->dp_lane_sel[i]] = PHY_LANE_MUX_DP; + + for (j = i + 1; j < num_lanes; j++) { + if (udphy->dp_lane_sel[i] == udphy->dp_lane_sel[j]) + return dev_err_probe(udphy->dev, -EINVAL, + "set repeat lane mux value\n"); + } + } + + udphy->mode = UDPHY_MODE_DP; + if (num_lanes == 2) { + udphy->mode |= UDPHY_MODE_USB; + udphy->flip = (udphy->lane_mux_sel[0] == PHY_LANE_MUX_DP); + } + + return 0; +} + +static int udphy_get_initial_status(struct rockchip_udphy *udphy) +{ + int ret; + u32 value; + + ret = clk_bulk_prepare_enable(udphy->num_clks, udphy->clks); + if (ret) { + dev_err(udphy->dev, "failed to enable clk\n"); + return ret; + } + + udphy_reset_deassert_all(udphy); + + regmap_read(udphy->pma_regmap, CMN_LANE_MUX_AND_EN_OFFSET, &value); + if (FIELD_GET(CMN_DP_LANE_MUX_ALL, value) && FIELD_GET(CMN_DP_LANE_EN_ALL, value)) + udphy->status = UDPHY_MODE_DP; + else + udphy_disable(udphy); + + return 0; +} + +static int udphy_parse_dt(struct rockchip_udphy *udphy) +{ + struct device *dev = udphy->dev; + struct device_node *np = dev_of_node(dev); + enum usb_device_speed maximum_speed; + int ret; + + udphy->u2phygrf = syscon_regmap_lookup_by_phandle(np, "rockchip,u2phy-grf"); + if (IS_ERR(udphy->u2phygrf)) + return dev_err_probe(dev, PTR_ERR(udphy->u2phygrf), "failed to get u2phy-grf\n"); + + udphy->udphygrf = syscon_regmap_lookup_by_phandle(np, "rockchip,usbdpphy-grf"); + if (IS_ERR(udphy->udphygrf)) + return dev_err_probe(dev, PTR_ERR(udphy->udphygrf), "failed to get usbdpphy-grf\n"); + + udphy->usbgrf = syscon_regmap_lookup_by_phandle(np, "rockchip,usb-grf"); + if (IS_ERR(udphy->usbgrf)) + return dev_err_probe(dev, PTR_ERR(udphy->usbgrf), "failed to get usb-grf\n"); + + udphy->vogrf = syscon_regmap_lookup_by_phandle(np, "rockchip,vo-grf"); + if (IS_ERR(udphy->vogrf)) + return dev_err_probe(dev, PTR_ERR(udphy->vogrf), "failed to get vo-grf\n"); + + ret = udphy_parse_lane_mux_data(udphy); + if (ret) + return ret; + + udphy->sbu1_dc_gpio = devm_gpiod_get_optional(dev, "sbu1-dc", GPIOD_OUT_LOW); + if (IS_ERR(udphy->sbu1_dc_gpio)) + return PTR_ERR(udphy->sbu1_dc_gpio); + + udphy->sbu2_dc_gpio = devm_gpiod_get_optional(dev, "sbu2-dc", GPIOD_OUT_LOW); + if (IS_ERR(udphy->sbu2_dc_gpio)) + return PTR_ERR(udphy->sbu2_dc_gpio); + + if (device_property_present(dev, "maximum-speed")) { + maximum_speed = usb_get_maximum_speed(dev); + udphy->hs = maximum_speed <= USB_SPEED_HIGH ? true : false; + } + + ret = udphy_clk_init(udphy, dev); + if (ret) + return ret; + + ret = udphy_reset_init(udphy, dev); + if (ret) + return ret; + + return 0; +} + +static int udphy_power_on(struct rockchip_udphy *udphy, u8 mode) +{ + int ret; + + if (!(udphy->mode & mode)) { + dev_info(udphy->dev, "mode 0x%02x is not support\n", mode); + return 0; + } + + if (udphy->status == UDPHY_MODE_NONE) { + udphy->mode_change = false; + ret = udphy_setup(udphy); + if (ret) + return ret; + + if (udphy->mode & UDPHY_MODE_USB) + udphy_u3_port_disable(udphy, false); + } else if (udphy->mode_change) { + udphy->mode_change = false; + udphy->status = UDPHY_MODE_NONE; + if (udphy->mode == UDPHY_MODE_DP) + udphy_u3_port_disable(udphy, true); + + ret = udphy_disable(udphy); + if (ret) + return ret; + ret = udphy_setup(udphy); + if (ret) + return ret; + } + + udphy->status |= mode; + + return 0; +} + +static int udphy_power_off(struct rockchip_udphy *udphy, u8 mode) +{ + int ret; + + if (!(udphy->mode & mode)) { + dev_info(udphy->dev, "mode 0x%02x is not support\n", mode); + return 0; + } + + if (!udphy->status) + return 0; + + udphy->status &= ~mode; + + if (udphy->status == UDPHY_MODE_NONE) { + ret = udphy_disable(udphy); + if (ret) + return ret; + } + + return 0; +} + +static int rockchip_dp_phy_init(struct phy *phy) +{ + struct rockchip_udphy *udphy = phy_get_drvdata(phy); + + mutex_lock(&udphy->mutex); + + udphy->dp_in_use = true; + udphy_dp_hpd_event_trigger(udphy, udphy->dp_sink_hpd_cfg); + + mutex_unlock(&udphy->mutex); + + return 0; +} + +static int rockchip_dp_phy_exit(struct phy *phy) +{ + struct rockchip_udphy *udphy = phy_get_drvdata(phy); + + mutex_lock(&udphy->mutex); + udphy->dp_in_use = false; + mutex_unlock(&udphy->mutex); + return 0; +} + +static int rockchip_dp_phy_power_on(struct phy *phy) +{ + struct rockchip_udphy *udphy = phy_get_drvdata(phy); + int ret, dp_lanes; + + mutex_lock(&udphy->mutex); + + dp_lanes = udphy_dplane_get(udphy); + phy_set_bus_width(phy, dp_lanes); + + ret = udphy_power_on(udphy, UDPHY_MODE_DP); + if (ret) + goto unlock; + + ret = udphy_dplane_enable(udphy, dp_lanes); + if (ret) + goto unlock; + + ret = udphy_dplane_select(udphy); + +unlock: + mutex_unlock(&udphy->mutex); + /* + * If data send by aux channel too fast after phy power on, + * the aux may be not ready which will cause aux error. Adding + * delay to avoid this issue. + */ + usleep_range(10000, 11000); + return ret; +} + +static int rockchip_dp_phy_power_off(struct phy *phy) +{ + struct rockchip_udphy *udphy = phy_get_drvdata(phy); + int ret; + + mutex_lock(&udphy->mutex); + ret = udphy_dplane_enable(udphy, 0); + if (ret) + goto unlock; + + ret = udphy_power_off(udphy, UDPHY_MODE_DP); + +unlock: + mutex_unlock(&udphy->mutex); + return ret; +} + +static int rockchip_dp_phy_verify_link_rate(unsigned int link_rate) +{ + switch (link_rate) { + case 1620: + case 2700: + case 5400: + case 8100: + break; + default: + return -EINVAL; + } + + return 0; +} + +static int rockchip_dp_phy_verify_config(struct rockchip_udphy *udphy, + struct phy_configure_opts_dp *dp) +{ + int i, ret; + + /* If changing link rate was required, verify it's supported. */ + ret = rockchip_dp_phy_verify_link_rate(dp->link_rate); + if (ret) + return ret; + + /* Verify lane count. */ + switch (dp->lanes) { + case 1: + case 2: + case 4: + /* valid lane count. */ + break; + default: + return -EINVAL; + } + + /* + * If changing voltages is required, check swing and pre-emphasis + * levels, per-lane. + */ + if (dp->set_voltages) { + /* Lane count verified previously. */ + for (i = 0; i < dp->lanes; i++) { + if (dp->voltage[i] > 3 || dp->pre[i] > 3) + return -EINVAL; + + /* + * Sum of voltage swing and pre-emphasis levels cannot + * exceed 3. + */ + if (dp->voltage[i] + dp->pre[i] > 3) + return -EINVAL; + } + } + + return 0; +} + +static void udphy_dp_set_voltage(struct rockchip_udphy *udphy, u8 bw, + u32 voltage, u32 pre, u32 lane) +{ + const struct rockchip_udphy_cfg *cfg = udphy->cfgs; + const struct dp_tx_drv_ctrl (*dp_ctrl)[4]; + u32 offset = 0x800 * lane; + u32 val; + + if (udphy->mux) + dp_ctrl = cfg->dp_tx_ctrl_cfg_typec[bw]; + else + dp_ctrl = cfg->dp_tx_ctrl_cfg[bw]; + + val = dp_ctrl[voltage][pre].trsv_reg0204; + regmap_write(udphy->pma_regmap, 0x0810 + offset, val); + + val = dp_ctrl[voltage][pre].trsv_reg0205; + regmap_write(udphy->pma_regmap, 0x0814 + offset, val); + + val = dp_ctrl[voltage][pre].trsv_reg0206; + regmap_write(udphy->pma_regmap, 0x0818 + offset, val); + + val = dp_ctrl[voltage][pre].trsv_reg0207; + regmap_write(udphy->pma_regmap, 0x081c + offset, val); +} + +static int rockchip_dp_phy_configure(struct phy *phy, + union phy_configure_opts *opts) +{ + struct rockchip_udphy *udphy = phy_get_drvdata(phy); + struct phy_configure_opts_dp *dp = &opts->dp; + u32 i, val, lane; + int ret; + + ret = rockchip_dp_phy_verify_config(udphy, dp); + if (ret) + return ret; + + if (dp->set_rate) { + regmap_update_bits(udphy->pma_regmap, CMN_DP_RSTN_OFFSET, + CMN_DP_CMN_RSTN, FIELD_PREP(CMN_DP_CMN_RSTN, 0x0)); + + switch (dp->link_rate) { + case 1620: + udphy->bw = DP_BW_RBR; + break; + case 2700: + udphy->bw = DP_BW_HBR; + break; + case 5400: + udphy->bw = DP_BW_HBR2; + break; + case 8100: + udphy->bw = DP_BW_HBR3; + break; + default: + return -EINVAL; + } + + regmap_update_bits(udphy->pma_regmap, CMN_DP_LINK_OFFSET, CMN_DP_TX_LINK_BW, + FIELD_PREP(CMN_DP_TX_LINK_BW, udphy->bw)); + regmap_update_bits(udphy->pma_regmap, CMN_SSC_EN_OFFSET, CMN_ROPLL_SSC_EN, + FIELD_PREP(CMN_ROPLL_SSC_EN, dp->ssc)); + regmap_update_bits(udphy->pma_regmap, CMN_DP_RSTN_OFFSET, CMN_DP_CMN_RSTN, + FIELD_PREP(CMN_DP_CMN_RSTN, 0x1)); + + ret = regmap_read_poll_timeout(udphy->pma_regmap, CMN_ANA_ROPLL_DONE_OFFSET, val, + FIELD_GET(CMN_ANA_ROPLL_LOCK_DONE, val) && + FIELD_GET(CMN_ANA_ROPLL_AFC_DONE, val), + 0, 1000); + if (ret) { + dev_err(udphy->dev, "ROPLL is not lock, set_rate failed\n"); + return ret; + } + } + + if (dp->set_voltages) { + for (i = 0; i < dp->lanes; i++) { + lane = udphy->dp_lane_sel[i]; + switch (dp->link_rate) { + case 1620: + case 2700: + regmap_update_bits(udphy->pma_regmap, + TRSV_ANA_TX_CLK_OFFSET_N(lane), + LN_ANA_TX_SER_TXCLK_INV, + FIELD_PREP(LN_ANA_TX_SER_TXCLK_INV, + udphy->lane_mux_sel[lane])); + break; + case 5400: + case 8100: + regmap_update_bits(udphy->pma_regmap, + TRSV_ANA_TX_CLK_OFFSET_N(lane), + LN_ANA_TX_SER_TXCLK_INV, + FIELD_PREP(LN_ANA_TX_SER_TXCLK_INV, 0x0)); + break; + } + + udphy_dp_set_voltage(udphy, udphy->bw, dp->voltage[i], dp->pre[i], lane); + } + } + + return 0; +} + +static const struct phy_ops rockchip_dp_phy_ops = { + .init = rockchip_dp_phy_init, + .exit = rockchip_dp_phy_exit, + .power_on = rockchip_dp_phy_power_on, + .power_off = rockchip_dp_phy_power_off, + .configure = rockchip_dp_phy_configure, + .owner = THIS_MODULE, +}; + +static int rockchip_u3phy_init(struct phy *phy) +{ + struct rockchip_udphy *udphy = phy_get_drvdata(phy); + int ret = 0; + + mutex_lock(&udphy->mutex); + /* DP only or high-speed, disable U3 port */ + if (!(udphy->mode & UDPHY_MODE_USB) || udphy->hs) { + udphy_u3_port_disable(udphy, true); + goto unlock; + } + + ret = udphy_power_on(udphy, UDPHY_MODE_USB); + +unlock: + mutex_unlock(&udphy->mutex); + return ret; +} + +static int rockchip_u3phy_exit(struct phy *phy) +{ + struct rockchip_udphy *udphy = phy_get_drvdata(phy); + int ret = 0; + + mutex_lock(&udphy->mutex); + /* DP only or high-speed */ + if (!(udphy->mode & UDPHY_MODE_USB) || udphy->hs) + goto unlock; + + ret = udphy_power_off(udphy, UDPHY_MODE_USB); + +unlock: + mutex_unlock(&udphy->mutex); + return ret; +} + +static const struct phy_ops rockchip_u3phy_ops = { + .init = rockchip_u3phy_init, + .exit = rockchip_u3phy_exit, + .owner = THIS_MODULE, +}; + +static int usbdp_typec_mux_set(struct typec_mux_dev *mux, + struct typec_mux_state *state) +{ + struct rockchip_udphy *udphy = typec_mux_get_drvdata(mux); + u8 mode; + + mutex_lock(&udphy->mutex); + + switch (state->mode) { + case TYPEC_DP_STATE_C: + fallthrough; + case TYPEC_DP_STATE_E: + udphy->lane_mux_sel[0] = PHY_LANE_MUX_DP; + udphy->lane_mux_sel[1] = PHY_LANE_MUX_DP; + udphy->lane_mux_sel[2] = PHY_LANE_MUX_DP; + udphy->lane_mux_sel[3] = PHY_LANE_MUX_DP; + mode = UDPHY_MODE_DP; + break; + case TYPEC_DP_STATE_D: + fallthrough; + default: + if (udphy->flip) { + udphy->lane_mux_sel[0] = PHY_LANE_MUX_DP; + udphy->lane_mux_sel[1] = PHY_LANE_MUX_DP; + udphy->lane_mux_sel[2] = PHY_LANE_MUX_USB; + udphy->lane_mux_sel[3] = PHY_LANE_MUX_USB; + } else { + udphy->lane_mux_sel[0] = PHY_LANE_MUX_USB; + udphy->lane_mux_sel[1] = PHY_LANE_MUX_USB; + udphy->lane_mux_sel[2] = PHY_LANE_MUX_DP; + udphy->lane_mux_sel[3] = PHY_LANE_MUX_DP; + } + mode = UDPHY_MODE_DP_USB; + break; + } + + if (state->alt && state->alt->svid == USB_TYPEC_DP_SID) { + struct typec_displayport_data *data = state->data; + + if (!data) { + udphy_dp_hpd_event_trigger(udphy, false); + } else if (data->status & DP_STATUS_IRQ_HPD) { + udphy_dp_hpd_event_trigger(udphy, false); + usleep_range(750, 800); + udphy_dp_hpd_event_trigger(udphy, true); + } else if (data->status & DP_STATUS_HPD_STATE) { + if (udphy->mode != mode) { + udphy->mode = mode; + udphy->mode_change = true; + } + udphy_dp_hpd_event_trigger(udphy, true); + } else { + udphy_dp_hpd_event_trigger(udphy, false); + } + } + + mutex_unlock(&udphy->mutex); + return 0; +} + +static void udphy_typec_mux_unregister(void *data) +{ + struct rockchip_udphy *udphy = data; + + typec_mux_unregister(udphy->mux); +} + +static int udphy_setup_typec_mux(struct rockchip_udphy *udphy) +{ + struct typec_mux_desc mux_desc = {}; + + mux_desc.drvdata = udphy; + mux_desc.fwnode = dev_fwnode(udphy->dev); + mux_desc.set = usbdp_typec_mux_set; + + udphy->mux = typec_mux_register(udphy->dev, &mux_desc); + if (IS_ERR(udphy->mux)) { + dev_err(udphy->dev, "Error register typec mux: %ld\n", + PTR_ERR(udphy->mux)); + return PTR_ERR(udphy->mux); + } + + return devm_add_action_or_reset(udphy->dev, udphy_typec_mux_unregister, + udphy); +} + +static u32 udphy_dp_get_max_link_rate(struct rockchip_udphy *udphy, struct fwnode_handle *np) +{ + u32 max_link_rate; + int ret; + + ret = fwnode_property_read_u32(np, "max-link-rate", &max_link_rate); + if (ret) + return 8100; + + ret = rockchip_dp_phy_verify_link_rate(max_link_rate); + if (ret) { + dev_warn(udphy->dev, "invalid max-link-rate: %d\n", max_link_rate); + max_link_rate = 8100; + } + + return max_link_rate; +} + +static const struct regmap_config rockchip_udphy_pma_regmap_cfg = { + .reg_bits = 32, + .reg_stride = 4, + .val_bits = 32, + .fast_io = true, + .max_register = 0x20dc, +}; + +static int rockchip_udphy_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct fwnode_handle *child; + struct phy_provider *phy_provider; + struct resource *res; + struct rockchip_udphy *udphy; + void __iomem *base; + int id, ret; + + udphy = devm_kzalloc(dev, sizeof(*udphy), GFP_KERNEL); + if (!udphy) + return -ENOMEM; + + udphy->cfgs = device_get_match_data(dev); + if (!udphy->cfgs) + return dev_err_probe(dev, -EINVAL, "missing match data\n"); + + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); + if (IS_ERR(base)) + return PTR_ERR(base); + + /* find the phy-id from the io address */ + udphy->id = -ENODEV; + for (id = 0; id < udphy->cfgs->num_phys; id++) { + if (res->start == udphy->cfgs->phy_ids[id]) { + udphy->id = id; + break; + } + } + + if (udphy->id < 0) + return dev_err_probe(dev, -ENODEV, "no matching device found\n"); + + udphy->pma_regmap = devm_regmap_init_mmio(dev, base + UDPHY_PMA, + &rockchip_udphy_pma_regmap_cfg); + if (IS_ERR(udphy->pma_regmap)) + return PTR_ERR(udphy->pma_regmap); + + udphy->dev = dev; + ret = udphy_parse_dt(udphy); + if (ret) + return ret; + + ret = udphy_get_initial_status(udphy); + if (ret) + return ret; + + mutex_init(&udphy->mutex); + platform_set_drvdata(pdev, udphy); + + if (device_property_present(dev, "orientation-switch")) { + ret = udphy_setup_orien_switch(udphy); + if (ret) + return ret; + } + + if (device_property_present(dev, "mode-switch")) { + ret = udphy_setup_typec_mux(udphy); + if (ret) + return ret; + } + + fwnode_for_each_available_child_node(dev_fwnode(dev), child) { + const char *name = fwnode_get_name(child); + const struct phy_ops *ops; + struct phy *phy; + + if (!strcmp(name, "dp-port")) { + ops = &rockchip_dp_phy_ops; + } else if (!strcmp(name, "usb3-port")) { + ops = &rockchip_u3phy_ops; + } else { + /* e.g. ports node used by orientation switch */ + continue; + } + + phy = devm_phy_create(dev, to_of_node(child), ops); + if (IS_ERR(phy)) { + fwnode_handle_put(child); + ret = PTR_ERR(phy); + return dev_err_probe(dev, ret, "failed to create phy: %pfwP\n", child); + } + + if (ops == &rockchip_dp_phy_ops) { + phy_set_bus_width(phy, udphy_dplane_get(udphy)); + phy->attrs.max_link_rate = udphy_dp_get_max_link_rate(udphy, child); + } + + phy_set_drvdata(phy, udphy); + } + + phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + if (IS_ERR(phy_provider)) { + ret = PTR_ERR(phy_provider); + return dev_err_probe(dev, ret, "failed to register phy provider\n"); + } + + return 0; +} + +static int __maybe_unused udphy_resume(struct device *dev) +{ + struct rockchip_udphy *udphy = dev_get_drvdata(dev); + + if (udphy->dp_sink_hpd_sel) + udphy_dp_hpd_event_trigger(udphy, udphy->dp_sink_hpd_cfg); + + return 0; +} + +static const struct dev_pm_ops udphy_pm_ops = { + SET_LATE_SYSTEM_SLEEP_PM_OPS(NULL, udphy_resume) +}; + +static const char * const udphy_rst_list[] = { + "init", "cmn", "lane", "pcs_apb", "pma_apb" +}; + +static const struct rockchip_udphy_cfg rk3588_udphy_cfgs = { + .num_phys = 2, + .phy_ids = { + 0xfed80000, + 0xfed90000, + }, + .num_rsts = ARRAY_SIZE(udphy_rst_list), + .rst_list = udphy_rst_list, + .grfcfg = { + /* u2phy-grf */ + .bvalid_phy_con = { 0x0008, 1, 0, 0x2, 0x3 }, + .bvalid_grf_con = { 0x0010, 3, 2, 0x2, 0x3 }, + + /* usb-grf */ + .usb3otg0_cfg = { 0x001c, 15, 0, 0x1100, 0x0188 }, + .usb3otg1_cfg = { 0x0034, 15, 0, 0x1100, 0x0188 }, + + /* usbdpphy-grf */ + .low_pwrn = { 0x0004, 13, 13, 0, 1 }, + .rx_lfps = { 0x0004, 14, 14, 0, 1 }, + }, + .vogrfcfg = { + { + .hpd_trigger = { 0x0000, 11, 10, 1, 3 }, + .dp_lane_reg = 0x0000, + }, + { + .hpd_trigger = { 0x0008, 11, 10, 1, 3 }, + .dp_lane_reg = 0x0008, + }, + }, + .dp_tx_ctrl_cfg = { + rk3588_dp_tx_drv_ctrl_rbr_hbr, + rk3588_dp_tx_drv_ctrl_rbr_hbr, + rk3588_dp_tx_drv_ctrl_hbr2, + rk3588_dp_tx_drv_ctrl_hbr3, + }, + .dp_tx_ctrl_cfg_typec = { + rk3588_dp_tx_drv_ctrl_rbr_hbr_typec, + rk3588_dp_tx_drv_ctrl_rbr_hbr_typec, + rk3588_dp_tx_drv_ctrl_hbr2, + rk3588_dp_tx_drv_ctrl_hbr3, + }, +}; + +static const struct of_device_id rockchip_udphy_dt_match[] = { + { + .compatible = "rockchip,rk3588-usbdp-phy", + .data = &rk3588_udphy_cfgs + }, + { /* sentinel */ } +}; + +MODULE_DEVICE_TABLE(of, rockchip_udphy_dt_match); + +static struct platform_driver rockchip_udphy_driver = { + .probe = rockchip_udphy_probe, + .driver = { + .name = "rockchip-usbdp-phy", + .of_match_table = rockchip_udphy_dt_match, + .pm = &udphy_pm_ops, + }, +}; + +module_platform_driver(rockchip_udphy_driver); + +MODULE_AUTHOR("Frank Wang "); +MODULE_AUTHOR("Zhang Yubing "); +MODULE_DESCRIPTION("Rockchip USBDP Combo PHY driver"); +MODULE_LICENSE("GPL"); From patchwork Fri Feb 9 18:17:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1060087dyd; Fri, 9 Feb 2024 10:53:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjEgncuchRQwPcMbQX7No/T4tA/kQ/oDVrYS2cf54MxJZJTBvKCcdoKtaulzi6MHo4uoiQ X-Received: by 2002:a05:6a00:a01:b0:6e0:71bd:331c with SMTP id p1-20020a056a000a0100b006e071bd331cmr121326pfh.24.1707504801240; Fri, 09 Feb 2024 10:53:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707504801; cv=pass; d=google.com; s=arc-20160816; b=THoaRbYqZlScquAwnO46LJI3465Yiv/2n5Hd0YUyOH29jnKC+6AplITsAnAgIlaERm cBLYDfKVTbgCc3bhOQBb3pHXv1/ODko9G5feJ0CBpPAuaU5W9GYqlM79c0Kj/pBzZLiE eZE1Yuj17CKctGGqYmdWx0uEVe9LRL+b3YAS1qxeTQyiztl2TaiSxjg0S2WSyhCK2bvD cp7jRDxJYTLzQuchrAvygpL+4zMhzJ9rYqGF0cxUnYDV1AJuT7tNUrucJdQwCmo8gUOY uhcBAP9zQwezaqF3M8GhgPfyrwMSJthzN7zryAmyqDtKRFGu8Ss/sSKRlW3tL3Q/9h72 d9vA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zq2dqTZIzHiV1BXpAKLaTgm2DyLXQpYkQLNTBTeRTHE=; fh=cOLVrSI6llGjzGwOkp4if1SK/5r13ATA4Cl+yOXqzKQ=; b=K4nPRIRZ/e0U0nqlKVj6wa472KQoccYMD57NSS3eFN+fRX2JTMS2NXNyWmNExIzcY5 H56tajHkU2s3+QInxL4nT/d0z1ci7Lw+vKgtB0nvyAFxFlUxTC5OoAyuMQ9dY2WcbKyi lPHGzlkxaZIuZjp5/hZD7rkHi77auJGNqVxwCAgfilJ0321qSgpb0oCSRdk5hlNeH+h6 Ti6rxKbqrr0N29KTzXa9glosNhLQNfuTAsWW/NxEcpGTx//AuI2BG+2Xh3nE83G7CYfb mDS22srMWxwAJVTIBKqAbQRKFSeBHkviy5TbxR2m+PNR+pLogHUAhZhW8mwqZPDYRZV5 4zyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JEeiZgE3; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59787-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59787-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCUroWaG7mk63DPfADKimHqmquBr+xpIDXjIpQdBRfGwfQ4A3VwoyTsYLXWtQrah3OHeW5KMxMXzWeIHxTcIamYW0bl4NA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e19-20020a633713000000b005dc52dfebe5si1719778pga.794.2024.02.09.10.53.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:53:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59787-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JEeiZgE3; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59787-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59787-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2D9DBB2AABA for ; Fri, 9 Feb 2024 18:21:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E7291292E8; Fri, 9 Feb 2024 18:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="JEeiZgE3" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D50B68288C; Fri, 9 Feb 2024 18:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502719; cv=none; b=oO1FIxfO/PTC2toFpFjWt4tzVxGdSDaLDiKwLYciSZuu+yZlg7gTSwizdgoI0rKxIFM+7MuznGVCOyTpVb8h8ZoiYuUYahRe1WkWOi6gZsQeQfZfOoLusgbv/EGGTPzXVr2UvsQDwTFAI4kwMnm4zjF5koA26llGqUMpZaaiqM8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502719; c=relaxed/simple; bh=6OwzIeJWiBUu4hW9YyYAqgUG6qN2do9w9jwQ6wXw8TA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iyOcqSwGeP4/XjA0bJgtO6CNPN1VFnBgWTZ6QwWe1RgTwRuoEBgYsBvxJqzxCn9WVlgX6WKHDYNGHbCXgnhuXAZ9WNGe27iA3x8+I4SCa1bTQwnSooX9qm0BQ2/rkfj/C5f2XISCtS0IpUIjrMtLnbHLlQyP966YA3R9LrbxCDE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=JEeiZgE3; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=6OwzIeJWiBUu4hW9YyYAqgUG6qN2do9w9jwQ6wXw8TA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JEeiZgE382f2j2abYb/3odr14jV34IV7w6NVaITe523YnSmVPXJ8t8DQCg1N5EFLa vOZ6iDTe/5FnWBq+j6cxmR/sgsuTz4qyayfSAuBhzcFr92hslhfwB1ZKcDMipk5eto 15rIhGFymx4xV8IgkPuz5+jcU7QkmhH7YJBZEnKN9DcjQv7jZ1VT+T6nSMjhQp/hx+ ACmNMZThyuAe9/RqYCiHewNd33L5XhP0yMpto4bci/gBPtdZSPJbhO+eLjslaJWHbv 9GPAugVh1NRvmVkDsFD8YygL2T9wVL6e4n40aRUA3ivCTIFgZKfYKWSVJtY4xwjC/r 3QoERHNdW0eUQ== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 7400037820B1; Fri, 9 Feb 2024 18:18:33 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 962184800D3; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 05/10] arm64: defconfig: enable Rockchip Samsung USBDP PHY Date: Fri, 9 Feb 2024 19:17:21 +0100 Message-ID: <20240209181831.104687-6-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790448554209841711 X-GMAIL-MSGID: 1790448554209841711 The USBDP Phy is used by RK3588 to handle the Dual-Role USB3 controllers. The Phy also supports Displayport Alt-Mode, but the necessary DRM driver has not yet been merged. Signed-off-by: Sebastian Reichel --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index e6cf3e5d63c3..07890b86777e 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1492,6 +1492,7 @@ CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=m CONFIG_PHY_ROCKCHIP_PCIE=m CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y CONFIG_PHY_ROCKCHIP_TYPEC=y +CONFIG_PHY_ROCKCHIP_USBDP=m CONFIG_PHY_SAMSUNG_UFS=y CONFIG_PHY_UNIPHIER_USB2=y CONFIG_PHY_UNIPHIER_USB3=y From patchwork Fri Feb 9 18:17:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199049 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1044145dyd; Fri, 9 Feb 2024 10:23:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqt2cJZVf/Q5U85VNND3q2syQF4Xa7vm/mI7heQbtStIBF7JZ92f/puKK5ohYhpYgpuIoA X-Received: by 2002:a17:906:40cc:b0:a3b:ebb3:29fc with SMTP id a12-20020a17090640cc00b00a3bebb329fcmr1635708ejk.21.1707502980857; Fri, 09 Feb 2024 10:23:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707502980; cv=pass; d=google.com; s=arc-20160816; b=lWIjo26uKUB/P4Xe36L1pW36JkCk4SjRD1KBl/DKBqD8ZOmMM2ECMW1jFKE+hQzbqB 4MjMfo1/6ZWCREFVo03b6PJo08/E2G6AJvhG9/AM7FnGTYgAeAd8GYBdtTlUS4xNu8lU T8+1hcXpHsVPmnrZu2V1IYaqKQHGG0tNLuvfkUMti1B7jU0LXV2i3T+5ekGknGdNodp+ /XQ+XWThAVeCk05t6GSg8oX549FN98JgZMcbdFjXYA9J/GWMSyADfvnzD1DFvs0wlb6q 00GGfOcsW88cb3Jk7rKBEPXs1nyBu0Lv6pelGStziS1ofPMmA0iAKHAv/zuLRbU40Xby 9zhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=aPscnxrgE1XdryL30YjKddP4EkOq7j0VP0WCG/EIq8o=; fh=DazsDegcwOJZ5mjUKvf4os8dnZ4jB9qtczbc7e2BxMo=; b=AkjbY5n+FobH8WiseMXV3miHBodvzSh1k2lkZ+Ftm+Y9fSDiMcEw8UcDidiXDp8dMO SioTJUjSm4W1Xayo0lLkChRBOCCJ73LuXgmARA7V+8tO7mwqOAKApgTttmlVdiPrBt73 wnubN3qYij2CtQ7OBuTndELixhBEmkYfsQ/xguxdWBE0fFUS+8XM02hWdFg8zc52RE1K Xh26tz9nUq/qK5SGj5QeLN9Nt3vBeYuHeC6iCp6W17EB0u3LJ0BtVrQ2axsRzCbhZQig Bvo98ctuC4HZSk660TMktyH+LRpmLGqUpqaJJOCfyOnufN4Kqxe+wIo1dtJuKAkDkt7l DbAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ZOF8EMNs; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59789-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59789-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCXpLDe28NO0joY8ZuKRpjHh2k5x04ejO/1xEvYSe4il34uYct0VYcSZYmuqhM1GkrDdWL4wPIY420q/PMLBH5zW2douLw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gv10-20020a170906f10a00b00a374cf5cf83si1087159ejb.86.2024.02.09.10.23.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:23:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59789-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ZOF8EMNs; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59789-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59789-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DC3441F28052 for ; Fri, 9 Feb 2024 18:21:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F0D8129A7F; Fri, 9 Feb 2024 18:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ZOF8EMNs" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D51A58288F; Fri, 9 Feb 2024 18:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502719; cv=none; b=pH8MWyx/pqd1rNwaYeO/8jL6g7PjMnSVOFi+8R9G/7USeKsCTZBvTF25YaiEwjO9+LVLD4aRIYN8yAwOivj6rva5t+Zl8KUue/fZWdON4pF2JoNRwKaKm+Van2VRo88sWzjylS33dAPBfz965g2vCyX2Fq9eBRw8r5mjQF/9Sys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502719; c=relaxed/simple; bh=NhEJU4fPbw7evyuXsafxiqtsg7ouIz0AOGaTUJeDeEY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BnYWdNDo5w5sTdOh3fLvBOzhNqXKj3t+QMQq+CHQQmZXDflnhkhfpu41bm9lsTj46koXE2uwKv382lWoieHXECjoL8N+r/MIEcae07JRYI/GN67TU5eTBTFNfLGbR4bZ8B/tHsvJAGv2zo1R97kGwwv7eOjGiQtKAky71kh9pko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ZOF8EMNs; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=NhEJU4fPbw7evyuXsafxiqtsg7ouIz0AOGaTUJeDeEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZOF8EMNsCyA0ZeBtf5aRGjnmINmWWoe7johz+TNkiVCvCRJgQurna/b1Ym8Iygfs7 LAtr+q/xp3D7SvQt0ndjs//PsUHeYa05JDO4jMN8QxW1+9qv2XPvnerxClKVudL8C8 6rIz/TYPOhi12x0MRLlIxct8I5wk7J9qCTTf5ziCBzyONDrjnlVeKjIA6BJQiL3M4B 9DmWrVf3qyQHG/Fxy4Ba1izowcg6CvPPGgvFgVJ5hcxRbfKbNeSXfnxyPRtZChlx0q TViIuhRYRY02EB1cd9gcmLUCyNIEN/hHMM8Mo820qguA9tNddVeSURgkpZJTZc0rzE FILCrd3tAmwFQ== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 7A65437820B6; Fri, 9 Feb 2024 18:18:33 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 97F554800D4; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 06/10] arm64: dts: rockchip: add USBDP phys on rk3588 Date: Fri, 9 Feb 2024 19:17:22 +0100 Message-ID: <20240209181831.104687-7-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790446645890112754 X-GMAIL-MSGID: 1790446645890112754 Add both USB3-Displayport PHYs to RK3588 SoC DT. Signed-off-by: Sebastian Reichel --- arch/arm64/boot/dts/rockchip/rk3588.dtsi | 62 +++++++++++++++++++ arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 73 +++++++++++++++++++++++ 2 files changed, 135 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588.dtsi b/arch/arm64/boot/dts/rockchip/rk3588.dtsi index 5519c1430cb7..c26288ec75ce 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588.dtsi @@ -17,6 +17,37 @@ pipe_phy1_grf: syscon@fd5c0000 { reg = <0x0 0xfd5c0000 0x0 0x100>; }; + usbdpphy1_grf: syscon@fd5cc000 { + compatible = "rockchip,rk3588-usbdpphy-grf", "syscon"; + reg = <0x0 0xfd5cc000 0x0 0x4000>; + }; + + usb2phy1_grf: syscon@fd5d4000 { + compatible = "rockchip,rk3588-usb2phy-grf", "syscon", + "simple-mfd"; + reg = <0x0 0xfd5d4000 0x0 0x4000>; + #address-cells = <1>; + #size-cells = <1>; + + u2phy1: usb2-phy@4000 { + compatible = "rockchip,rk3588-usb2phy"; + reg = <0x4000 0x10>; + interrupts = ; + resets = <&cru SRST_OTGPHY_U3_1>, <&cru SRST_P_USB2PHY_U3_1_GRF0>; + reset-names = "phy", "apb"; + clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>; + clock-names = "phyclk"; + clock-output-names = "usb480m_phy1"; + #clock-cells = <0>; + status = "disabled"; + + u2phy1_otg: otg-port { + #phy-cells = <0>; + status = "disabled"; + }; + }; + }; + i2s8_8ch: i2s@fddc8000 { compatible = "rockchip,rk3588-i2s-tdm"; reg = <0x0 0xfddc8000 0x0 0x1000>; @@ -310,6 +341,37 @@ sata-port@0 { }; }; + usbdp_phy1: phy@fed90000 { + compatible = "rockchip,rk3588-usbdp-phy"; + reg = <0x0 0xfed90000 0x0 0x10000>; + rockchip,u2phy-grf = <&usb2phy1_grf>; + rockchip,usb-grf = <&usb_grf>; + rockchip,usbdpphy-grf = <&usbdpphy1_grf>; + rockchip,vo-grf = <&vo0_grf>; + clocks = <&cru CLK_USBDPPHY_MIPIDCPPHY_REF>, + <&cru CLK_USBDP_PHY1_IMMORTAL>, + <&cru PCLK_USBDPPHY1>, + <&u2phy1>; + clock-names = "refclk", "immortal", "pclk", "utmi"; + resets = <&cru SRST_USBDP_COMBO_PHY1_INIT>, + <&cru SRST_USBDP_COMBO_PHY1_CMN>, + <&cru SRST_USBDP_COMBO_PHY1_LANE>, + <&cru SRST_USBDP_COMBO_PHY1_PCS>, + <&cru SRST_P_USBDPPHY1>; + reset-names = "init", "cmn", "lane", "pcs_apb", "pma_apb"; + status = "disabled"; + + usbdp_phy1_dp: dp-port { + #phy-cells = <0>; + status = "disabled"; + }; + + usbdp_phy1_u3: usb3-port { + #phy-cells = <0>; + status = "disabled"; + }; + }; + combphy1_ps: phy@fee10000 { compatible = "rockchip,rk3588-naneng-combphy"; reg = <0x0 0xfee10000 0x0 0x100>; diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 36b1b7acfe6a..553e1883cfe4 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -536,6 +536,37 @@ pipe_phy2_grf: syscon@fd5c4000 { reg = <0x0 0xfd5c4000 0x0 0x100>; }; + usbdpphy0_grf: syscon@fd5c8000 { + compatible = "rockchip,rk3588-usbdpphy-grf", "syscon"; + reg = <0x0 0xfd5c8000 0x0 0x4000>; + }; + + usb2phy0_grf: syscon@fd5d0000 { + compatible = "rockchip,rk3588-usb2phy-grf", "syscon", + "simple-mfd"; + reg = <0x0 0xfd5d0000 0x0 0x4000>; + #address-cells = <1>; + #size-cells = <1>; + + u2phy0: usb2-phy@0 { + compatible = "rockchip,rk3588-usb2phy"; + reg = <0x0 0x10>; + interrupts = ; + resets = <&cru SRST_OTGPHY_U3_0>, <&cru SRST_P_USB2PHY_U3_0_GRF0>; + reset-names = "phy", "apb"; + clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>; + clock-names = "phyclk"; + clock-output-names = "usb480m_phy0"; + #clock-cells = <0>; + status = "disabled"; + + u2phy0_otg: otg-port { + #phy-cells = <0>; + status = "disabled"; + }; + }; + }; + usb2phy2_grf: syscon@fd5d8000 { compatible = "rockchip,rk3588-usb2phy-grf", "syscon", "simple-mfd"; reg = <0x0 0xfd5d8000 0x0 0x4000>; @@ -561,6 +592,17 @@ u2phy2_host: host-port { }; }; + vo0_grf: syscon@fd5a6000 { + compatible = "rockchip,rk3588-vo-grf", "syscon"; + reg = <0x0 0xfd5a6000 0x0 0x2000>; + clocks = <&cru PCLK_VO0GRF>; + }; + + usb_grf: syscon@fd5ac000 { + compatible = "rockchip,rk3588-usb-grf", "syscon"; + reg = <0x0 0xfd5ac000 0x0 0x4000>; + }; + usb2phy3_grf: syscon@fd5dc000 { compatible = "rockchip,rk3588-usb2phy-grf", "syscon", "simple-mfd"; reg = <0x0 0xfd5dc000 0x0 0x4000>; @@ -2360,6 +2402,37 @@ dmac2: dma-controller@fed10000 { #dma-cells = <1>; }; + usbdp_phy0: phy@fed80000 { + compatible = "rockchip,rk3588-usbdp-phy"; + reg = <0x0 0xfed80000 0x0 0x10000>; + rockchip,u2phy-grf = <&usb2phy0_grf>; + rockchip,usb-grf = <&usb_grf>; + rockchip,usbdpphy-grf = <&usbdpphy0_grf>; + rockchip,vo-grf = <&vo0_grf>; + clocks = <&cru CLK_USBDPPHY_MIPIDCPPHY_REF>, + <&cru CLK_USBDP_PHY0_IMMORTAL>, + <&cru PCLK_USBDPPHY0>, + <&u2phy0>; + clock-names = "refclk", "immortal", "pclk", "utmi"; + resets = <&cru SRST_USBDP_COMBO_PHY0_INIT>, + <&cru SRST_USBDP_COMBO_PHY0_CMN>, + <&cru SRST_USBDP_COMBO_PHY0_LANE>, + <&cru SRST_USBDP_COMBO_PHY0_PCS>, + <&cru SRST_P_USBDPPHY0>; + reset-names = "init", "cmn", "lane", "pcs_apb", "pma_apb"; + status = "disabled"; + + usbdp_phy0_dp: dp-port { + #phy-cells = <0>; + status = "disabled"; + }; + + usbdp_phy0_u3: usb3-port { + #phy-cells = <0>; + status = "disabled"; + }; + }; + combphy0_ps: phy@fee00000 { compatible = "rockchip,rk3588-naneng-combphy"; reg = <0x0 0xfee00000 0x0 0x100>; From patchwork Fri Feb 9 18:17:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1060107dyd; Fri, 9 Feb 2024 10:53:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHvEQ22fKI7MEncijZVCNLk4GjHxsPEjOekY5qXtju6HZgHDZi/xTPhI2OHrlEuVNHt8cF X-Received: by 2002:a17:902:e983:b0:1d9:c367:203e with SMTP id f3-20020a170902e98300b001d9c367203emr137743plb.5.1707504802890; Fri, 09 Feb 2024 10:53:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707504802; cv=pass; d=google.com; s=arc-20160816; b=xhVX1T0JtYJbpUoxFu5AMozwsXzBE+nVGr4P88tP9UKYYYiJH+pylLd/MFfOhnxjm/ S34NrupAwAAaTpCJyn0OvrzDvOt8oM62Hd95QoKDu/ZPrDsObNMdSZCZCqeIEEUF64Mq rAiW5fRJJ2+oe9YnrgYYiMmYY4LCpRRRCpd79TXe/+iCw/KSrh4a9Edo4t9s8604RkFl MSzKfn8d8aYKEK8SZ97Z2yAV63fj37KaSfhQhwtTT6llyo73EvCOgeIKiOZWyOFVwctY C+nt5iNhk4IC4llIGKXWG64+/eakmbpCHonoLtzNqwc7zDy0tsKkSknSd3zsx/yTlrfC Ch4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=AvRuZhFQU8khmZnUkKtVsdeNt5Fq+0ySx0yWPZbOb7w=; fh=Yl49PKv9y3r/bdczl7OBy9Z2NscO583S+1h3ZHDH5Ws=; b=xVIfRnWuiNtW8cvsAnqGEMUMa//93e1Ac0tsyE+fOr6nYCPqdDZ1W1UpT01xugXNw0 R/psqgBPTZn5g09dGsoJHOE1ar9u0f0d2oWQtRoJCQAYp4JICxw2Q5GtSsHnRkNrcg16 mK//u6bGkp6EsoEtPq6uVGw/k961QWMi7tukAvIowUS7Xu99MfgZZH4sJu0oe784zgFD 4jh84ZVqNEpTZxwtyq3s9ataR2vZ932dsyuF17YTGYuNuQuCxl3pXrqXKE1ap8NmIP9k u0NKgJIZ46KobICzfhMnd/RGTfGzFol9stga/Y6moejV8VKLmcNpYUOshJUMmrjSCiHg Pmdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VtOBVG1u; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59788-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59788-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCVmjH3gHnHMkkavNOigM3cqPfmUsXCz3BhQABg7eKgqbjlNwuT9oxeJiff0+mtxaMdatfNJle0gUePSqA8OC/Zgc9KnZQ== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s9-20020a170902b18900b001d8f4b57bf7si2026817plr.107.2024.02.09.10.53.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59788-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VtOBVG1u; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59788-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59788-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 925D3B2AAF4 for ; Fri, 9 Feb 2024 18:21:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA69B80BE9; Fri, 9 Feb 2024 18:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="VtOBVG1u" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA68883CA2; Fri, 9 Feb 2024 18:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502719; cv=none; b=nvOD8QWCnrXPak9vcMgVLgY8/mUU2j8F4XvBixf44jUgNFJTNzepCr04bJjAhTrqj/Yczhshskz1SpchgN9t46W1pwx5ghQ201RZXccp8RyUY2UEFKQb7sQYZNk2WOhKcCmE/0gWOr/JDZkIMM6pXKrMrj46MdbkqI1WbRJmSn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502719; c=relaxed/simple; bh=W78wJAlvixNiHCrlDx7Yf34X8zTmj0Mc93LVC6YUGHk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OC3GfFevB+Eakk4RbZDef7p9081WC1RSAGqBKaOVCAr6AByhM0z7vmXZBo+4V7rw34IZWkbPOwTIV2GbT5gx+9m3z7+NeCm81wc4Cqf1PYS68GnN0xBaAx3EtVMxN9oAW9cILKK6mn4XCuDn5baiLo8pyG9oa0YZqjidcWxSNTw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=VtOBVG1u; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=W78wJAlvixNiHCrlDx7Yf34X8zTmj0Mc93LVC6YUGHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VtOBVG1u257+IaxbL4kCb1BZvnebVBjMBRdk0bovXc7lTsHVRvyrKKb35oidH+Eoe itPO+GWc9iKODx/G/DKDktLKcSucCwDSwEdoqqfZwu3Hl2Z4JK9Q+WEo5qdvweAsmT PH793MjuHdk+yMFRVcUtiUm7lVhXmZgi4YK0RkW8ZrerPQYor2c59yAsInzOJMeA4N TTdnbA1t5CroXZxEl8Qxy5YkeF+uZIyQ/b420cPCSoEl8eWC3L+Pe+q5bZElLfkxzW vOS8BR8C2Dp99bskFvyuc389Qkd9Dq9yhxuI/trNzi+Ta85gR/P9kfYyyZ5xRue6aB 6V60As5VEZVYg== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 8BBB037820B7; Fri, 9 Feb 2024 18:18:33 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 9990F4800D5; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 07/10] arm64: dts: rockchip: add USB3 DRD controllers on rk3588 Date: Fri, 9 Feb 2024 19:17:23 +0100 Message-ID: <20240209181831.104687-8-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790448556460051862 X-GMAIL-MSGID: 1790448556460051862 Add both USB3 dual-role controllers to the RK3588 devicetree. Signed-off-by: Sebastian Reichel --- arch/arm64/boot/dts/rockchip/rk3588.dtsi | 20 ++++++++++++++++++++ arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 22 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588.dtsi b/arch/arm64/boot/dts/rockchip/rk3588.dtsi index c26288ec75ce..8b991da9db4f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588.dtsi @@ -7,6 +7,26 @@ #include "rk3588-pinctrl.dtsi" / { + usb_host1_xhci: usb@fc400000 { + compatible = "rockchip,rk3588-dwc3", "snps,dwc3"; + reg = <0x0 0xfc400000 0x0 0x400000>; + interrupts = ; + clocks = <&cru REF_CLK_USB3OTG1>, <&cru SUSPEND_CLK_USB3OTG1>, + <&cru ACLK_USB3OTG1>; + clock-names = "ref_clk", "suspend_clk", "bus_clk"; + dr_mode = "otg"; + phys = <&u2phy1_otg>, <&usbdp_phy1_u3>; + phy-names = "usb2-phy", "usb3-phy"; + phy_type = "utmi_wide"; + power-domains = <&power RK3588_PD_USB>; + resets = <&cru SRST_A_USB3OTG1>; + snps,dis_enblslpm_quirk; + snps,dis-u2-freeclk-exists-quirk; + snps,dis-del-phy-power-chg-quirk; + snps,dis-tx-ipgap-linecheck-quirk; + status = "disabled"; + }; + pcie30_phy_grf: syscon@fd5b8000 { compatible = "rockchip,rk3588-pcie3-phy-grf", "syscon"; reg = <0x0 0xfd5b8000 0x0 0x10000>; diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 553e1883cfe4..6ded159d6dc9 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -436,6 +436,28 @@ scmi_shmem: sram@0 { }; }; + usb_host0_xhci: usb@fc000000 { + compatible = "rockchip,rk3588-dwc3", "snps,dwc3"; + reg = <0x0 0xfc000000 0x0 0x400000>; + interrupts = ; + clocks = <&cru REF_CLK_USB3OTG0>, <&cru SUSPEND_CLK_USB3OTG0>, + <&cru ACLK_USB3OTG0>; + clock-names = "ref_clk", "suspend_clk", "bus_clk"; + dr_mode = "otg"; + phys = <&u2phy0_otg>, <&usbdp_phy0_u3>; + phy-names = "usb2-phy", "usb3-phy"; + phy_type = "utmi_wide"; + power-domains = <&power RK3588_PD_USB>; + resets = <&cru SRST_A_USB3OTG0>; + snps,dis_enblslpm_quirk; + snps,dis-u1-entry-quirk; + snps,dis-u2-entry-quirk; + snps,dis-u2-freeclk-exists-quirk; + snps,dis-del-phy-power-chg-quirk; + snps,dis-tx-ipgap-linecheck-quirk; + status = "disabled"; + }; + usb_host0_ehci: usb@fc800000 { compatible = "rockchip,rk3588-ehci", "generic-ehci"; reg = <0x0 0xfc800000 0x0 0x40000>; From patchwork Fri Feb 9 18:17:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1044133dyd; Fri, 9 Feb 2024 10:23:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1OzRv/gaZ4ox/WzFBHIXEq36KQNt9fbL9dx68ULzElwnZmmctUE/uVm6gegeaZJsfb5KV X-Received: by 2002:a2e:9950:0:b0:2d0:d3ec:a545 with SMTP id r16-20020a2e9950000000b002d0d3eca545mr2032633ljj.50.1707502979941; Fri, 09 Feb 2024 10:22:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707502979; cv=pass; d=google.com; s=arc-20160816; b=NY1Ux9NoEE2ypdPG6dnvr+yC4s0dJnv+JTRVNfQgdHF8i7amxBEBz3/6h6C2wnTrwC 5GNKlk6KdhTBtmxXpOVpW17jhIRMHSruTm/F/ZtEZ2uQdaSeXEBnLEttiBimKleg20eB G/zd5Gqnf8KBS2hNxAN80yzuloeHDgMPyB4DbeCWpZndxdAFOJo75t7DSsXgnXynYJl3 JbPgQsXT5h48MnlQVmYBks1+T0geYucD53o0NdceLopY7dmk7ZSbDIve4xVXDlHgc9BT h8W8/9nC/hLLTA3sp9tMCs4eYA24KzYL6j/wJlem6tvPQBXGqXg9KTtqESI6bmzK13xg xdNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LRW9Tk8JZWrRkRGBiY1nUgdy5mpV7oovSv+mRV+jFOU=; fh=+Uu0Io1Jq77nrwTB6PZ83tt/kNAYnFDUTyISupguZmk=; b=dp/OrsG+dJQkB6IEs6UOAQ7XK+GETEDIgsYCIHaonQNE5Y/UDwiyY93rb2emRP2g2N MyESFkQRLMRsVktUepYgae/Ve9ykKZpxCCgaag6qArjylxVrch4ZNqn8ewAAHHbzwJcy XFHAnn+aYDRNUXFt6UxzXdXRlulPrYkKTPXetWt4clY7NFH6oJFeTqlaJ5IJofCG9o3v YQcyL6xzJ3UoLzwWMB5UK8s+GXOwmlSrikZjCXAE7/RQVBRgVQ8dbwabrCVEp4ArMxh1 VgHQJDcPBWCbvjHTBhA9jzSKH1GiRlffropaLz+msJ6xjTc0fhDp2TjymPgQpv0wK3rj GKPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=pjOZO6rx; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59791-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59791-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCUoKEu/VxqeHvIjxmm3xIMs4u4XZmginYisvfqPEDvsLNoRR18ViHXHaV1nh/X17oJyxs+oO5MO+W9R87eLkMimk4QIBQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k20-20020a05640212d400b0055fe442b1b6si1105086edx.49.2024.02.09.10.22.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:22:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59791-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=pjOZO6rx; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59791-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59791-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DB3581F278F1 for ; Fri, 9 Feb 2024 18:21:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88D8A83CB5; Fri, 9 Feb 2024 18:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="pjOZO6rx" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38F3183CBF; Fri, 9 Feb 2024 18:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502720; cv=none; b=Jf/e0Kd+Xh5YMo3oIqQRnmB5sbVrywomPAjidMAxikDmgbqFl6XkyCNi4ij3nIltgDi7WdnYnWzmzNXPKp0xe9A8yBmjU3YiXBV8JEB/i2IYOtdKCNszlN8GBkCvU+Y0eEli61ROkuEXQglK3uIqtvJfNd5TyrjJFLnlu20PAL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502720; c=relaxed/simple; bh=+bnYk1BYj3u3N4iOBFsXjnHlC1pJe00wOp5nI388mvs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AoH8KT/jkfUe0FEA8B8YlZen45Ctmy5Sy2fcggh5iUq4bGJ9hXsriad7Ky2w8FZmdgSASQdEuUMKTjsDrpqJKcsuAqV74EuL10BsnUeVpHrVg1cr5lREkTlvpDpYwFZTmw2yU+nxSn5IpMIqbra2P5i1lRDcf2Sy+b/oqYurA8Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=pjOZO6rx; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=+bnYk1BYj3u3N4iOBFsXjnHlC1pJe00wOp5nI388mvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjOZO6rxSLu/ROG0VFzDJ+dpaTg1u18L5IiQJJ6PPQw1RPjNZDRchOw8FkIPs9vk/ m5+MiLpM4uisZAhpnKeTFf7iRGkNAxymblpYLquA+cq56ZLYHiveXv1a4/Pl6lLsyJ OXHhSOTKV3Jh/rnVlVJWYR4VWr4LRXNazfZmbqqkZ39ON71hD4AIi3jTebxAAnZcV7 XxGoaDn1iVtKqiNHn0PDzmc12qMQokMXSTNGkrEz+SOrfdm2ua4GLS5kRwGOWxb3ZW XaHTIrVVu0OkC+nFhxFbVMmXDJdz+eGUlTRM4vZVs22a5VoGFNoEhvTJH72t7fBixI lY2vpWxteIrVg== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 905F237820B9; Fri, 9 Feb 2024 18:18:33 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 9B33C4800D6; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 08/10] arm64: dts: rockchip: add USB3 to rk3588-evb1 Date: Fri, 9 Feb 2024 19:17:24 +0100 Message-ID: <20240209181831.104687-9-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790446644855933057 X-GMAIL-MSGID: 1790446644855933057 Add support for the board's USB3 connectors. It has 1x USB Type-A and 1x USB Type-C. Signed-off-by: Sebastian Reichel --- .../boot/dts/rockchip/rk3588-evb1-v10.dts | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts index ac7c677b0fb9..6b7d54455ca1 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts @@ -9,6 +9,7 @@ #include #include #include +#include #include "rk3588.dtsi" / { @@ -224,6 +225,18 @@ vcc5v0_usb: vcc5v0-usb-regulator { regulator-max-microvolt = <5000000>; vin-supply = <&vcc5v0_usbdcin>; }; + + vbus5v0_typec: vbus5v0-typec { + compatible = "regulator-fixed"; + regulator-name = "vbus5v0_typec"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&gpio4 RK_PD0 GPIO_ACTIVE_HIGH>; + vin-supply = <&vcc5v0_usb>; + pinctrl-names = "default"; + pinctrl-0 = <&typec5v_pwren>; + }; }; &combphy0_ps { @@ -284,6 +297,56 @@ &gmac0_rgmii_clk &i2c2 { status = "okay"; + usbc0: usb-typec@22 { + compatible = "fcs,fusb302"; + reg = <0x22>; + interrupt-parent = <&gpio3>; + interrupts = ; + pinctrl-names = "default"; + pinctrl-0 = <&usbc0_int>; + vbus-supply = <&vbus5v0_typec>; + status = "okay"; + + usb_con: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + data-role = "dual"; + power-role = "dual"; + try-power-role = "source"; + op-sink-microwatt = <1000000>; + sink-pdos = + ; + source-pdos = + ; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + usbc0_orien_sw: endpoint { + remote-endpoint = <&usbdp_phy0_orientation_switch>; + }; + }; + + port@1 { + reg = <1>; + usbc0_role_sw: endpoint { + remote-endpoint = <&dwc3_0_role_switch>; + }; + }; + + port@2 { + reg = <2>; + dp_altmode_mux: endpoint { + remote-endpoint = <&usbdp_phy0_dp_altmode_mux>; + }; + }; + }; + }; + }; + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; @@ -410,6 +473,16 @@ vcc5v0_host_en: vcc5v0-host-en { rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; }; }; + + usb-typec { + usbc0_int: usbc0-int { + rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + typec5v_pwren: typec5v-pwren { + rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; }; &pwm2 { @@ -1040,6 +1113,22 @@ &sata0 { status = "okay"; }; +&u2phy0 { + status = "okay"; +}; + +&u2phy0_otg { + status = "okay"; +}; + +&u2phy1 { + status = "okay"; +}; + +&u2phy1_otg { + status = "okay"; +}; + &u2phy2 { status = "okay"; }; @@ -1078,3 +1167,65 @@ &usb_host1_ehci { &usb_host1_ohci { status = "okay"; }; + +&usbdp_phy0 { + orientation-switch; + mode-switch; + sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>; + sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + usbdp_phy0_orientation_switch: endpoint@0 { + reg = <0>; + remote-endpoint = <&usbc0_orien_sw>; + }; + + usbdp_phy0_dp_altmode_mux: endpoint@1 { + reg = <1>; + remote-endpoint = <&dp_altmode_mux>; + }; + }; +}; + +&usbdp_phy0_u3 { + status = "okay"; +}; + +&usbdp_phy1 { + /* + * USBDP PHY1 is wired to a female USB3 Type-A connector. Additionally + * the differential pairs 2+3 and the aux channel are wired to a RTD2166, + * which converts the DP signal into VGA. This is exposed on the + * board via a female VGA connector. + */ + rockchip,dp-lane-mux = <2 3>; + status = "okay"; +}; + +&usbdp_phy1_u3 { + status = "okay"; +}; + +&usb_host0_xhci { + dr_mode = "otg"; + usb-role-switch; + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + dwc3_0_role_switch: endpoint@0 { + reg = <0>; + remote-endpoint = <&usbc0_role_sw>; + }; + }; +}; + +&usb_host1_xhci { + dr_mode = "host"; + status = "okay"; +}; From patchwork Fri Feb 9 18:17:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1044051dyd; Fri, 9 Feb 2024 10:22:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiYrI7QP0Bkb4T6lmQQD1KJk1/I+u2Sd/EogOO1mwo20GwTqQTYqFPjjcTQNpim90hqHfZ X-Received: by 2002:a17:906:c798:b0:a3b:d939:ee95 with SMTP id cw24-20020a170906c79800b00a3bd939ee95mr1848762ejb.35.1707502972867; Fri, 09 Feb 2024 10:22:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707502972; cv=pass; d=google.com; s=arc-20160816; b=rsv5wQbap23GQAzj8E20o/CDSa0PLjK5dpZfa8qrBMNA7Ab+4Z770uvW9VkqTDyJUM 6zIgfWly0ELMSb07HOQEJV7h1VTbTOVlKzOOnAcqCKeoqDbsBYO/kgB9YYZpjui1AiLW slkraIEA4l3efZwBuqyX6aKcZ9kbCxplVyd9mwywBS5mlDskZ+s57BTdz8kYjM+So76w hSJ2bUETd8Rl4CgkxrT6TenuSAfn2Dq818M9zLoNFjRGbVfAPWkVeiP2sRnhJDDOE8SM M/EkL3SWUmVdt91+vSp7Zpx8fDE2sAT1KCIRQe0dYSWE6+zLBQq0i8HbRY3DN/2ryfn8 H4ow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Stgxqrq/rWRBOYNThaofOcruJwWVqYXPADlBfGErmmk=; fh=0Lk3CHUtEtUz48kvthozvl0fijKfM6iDwbJnKyGlZWc=; b=AheLoSMM/+Cj05KcqrpSiVyssPQmhHliDQIqL8Tkbr+qp2N+P6SNKjj4lk+CHPGgtf ewWrS7ORDRmrcu624R8KDsVdbAwiARDQ4sgLTzB9kd9ptcOgz21GK79HIuUFGwabp88q LuxrZaPoB4+/b6jV2uSwcK1oR8eESZ/kmAVeRXKwBNiBQkRsbxsPuepf1IcE+zNMLBYB u3/1yOwH8gyaIAOguJ3Amiwb/F60zbxePdNSiTF2XPdYwRyUqmfmc8AE8UWgS11H3As+ yDm8zJRL089k3NkYTNMQ7OD9I+pF0Vic9wpcH4PanwqSLOK0AbRU0RFqV/LgnyM7QCfU hIUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Z5LRajx6; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59790-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59790-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCVv48HBkuVNrFYkcNGQCrTmdjCtaaxbAbaG/5SIM0ryz67NCdXIfJtGVZqirQnyL7JfzYcDvMjk5ky3auKg+bo4Lffk4Q== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id jt19-20020a170906dfd300b00a3c0a753bd9si360680ejc.638.2024.02.09.10.22.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:22:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59790-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Z5LRajx6; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59790-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59790-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6ED931F250D8 for ; Fri, 9 Feb 2024 18:21:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C7A7F1292F5; Fri, 9 Feb 2024 18:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Z5LRajx6" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2859683CB5; Fri, 9 Feb 2024 18:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502719; cv=none; b=jZTcGxY+5fhe26U8WHEjkfDRvBtO4jOlT6xS64Mh3X40PsuRFbyw59rRSTws4qnkSOVaU56eUapHnyJe6Ypxw5dx1Yz4A9EJqo5uAJ+/pGpxF0MuXoyZy5Nn4XCVfYbNsJ52lSd46thUqpo93nkloHDNFJr8emU0LsVxkn8zSc8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502719; c=relaxed/simple; bh=irXRQ4YZgGtGFtaBzqS7r1OEFusEH88K+e92por6DDs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eJhntsYMTxbjYkaFAhQt1Kx4ozwB1utZf76a2dmOmYm9aUyTTXCTXt4oF/AuasPaT6j8njivxtVOYEsx3EL3CycRrgZAN8OZbjTklWDEXmHGtysyUcTlZcqkBr0d+sEnp7ZsvtrE7RtUeeP22vMXlKYQAJhBSuT5QgTK2qlV7L8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Z5LRajx6; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=irXRQ4YZgGtGFtaBzqS7r1OEFusEH88K+e92por6DDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z5LRajx6Dfr3ecG9xMCfxi6QpOw++W22ZkovyotZkMbzmbXc+Zmk7Iahwcu+zLVn/ cZMGw5y0Bm+0YN6M3b4VmyyDXfiEOQR3DlnFNkxCUMloji51dErFfyny4s2iRVHqdV ylSssROUX2jdbTsvGwROEaBc/99AqzNX9afx/c1/uIm0sonf6eVJ7o1pNGZ4VEoXvL TTt5pDb3A65kb6ryvL/d0YpUZPalA/y1of5YGCw9wAK2cONOx54EtkTx2H2LhrchBm +hprAqc256MEz2s80YbP89q9IcfB+utpIRQa/g9Qrv5YUmr6gXDClJPWQPZVoUsvIr Y/Qs6x0EtyIxg== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A470137820BC; Fri, 9 Feb 2024 18:18:33 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 9CF0A4800DC; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 09/10] arm64: dts: rockchip: add upper USB3 port to rock-5a Date: Fri, 9 Feb 2024 19:17:25 +0100 Message-ID: <20240209181831.104687-10-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790446636893549984 X-GMAIL-MSGID: 1790446636893549984 Enable full support (XHCI, EHCI, OHCI) for the upper USB3 port from Radxa Rock 5 Model A. The lower one is already supported. Signed-off-by: Sebastian Reichel --- .../boot/dts/rockchip/rk3588s-rock-5a.dts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts index 2002fd0221fa..f78d131a8ca8 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts @@ -698,6 +698,14 @@ regulator-state-mem { }; }; +&u2phy0 { + status = "okay"; +}; + +&u2phy0_otg { + status = "okay"; +}; + &u2phy2 { status = "okay"; }; @@ -721,6 +729,15 @@ &uart2 { status = "okay"; }; +&usbdp_phy0 { + status = "okay"; + rockchip,dp-lane-mux = <2 3>; +}; + +&usbdp_phy0_u3 { + status = "okay"; +}; + &usb_host0_ehci { status = "okay"; pinctrl-names = "default"; @@ -731,6 +748,11 @@ &usb_host0_ohci { status = "okay"; }; +&usb_host0_xhci { + dr_mode = "host"; + status = "okay"; +}; + &usb_host1_ehci { status = "okay"; }; From patchwork Fri Feb 9 18:17:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 199066 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1060374dyd; Fri, 9 Feb 2024 10:54:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVryXXd+LQkeBawdWHzjmONx7LOmUG5OAxdHuxNwManZKZHca7MgAjgvS9phGCvJOg8VVidEqgKGhRztXg4IBnhqlOtFQ== X-Google-Smtp-Source: AGHT+IEoDsZKJlwGuRu8BR0A4gHWX+0DKmerXty0nVneASdd3T+aIcp9cBb1LcBvNBc12DHZhjWS X-Received: by 2002:a17:902:6e10:b0:1d8:e4b8:95e5 with SMTP id u16-20020a1709026e1000b001d8e4b895e5mr106657plk.32.1707504840351; Fri, 09 Feb 2024 10:54:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707504840; cv=pass; d=google.com; s=arc-20160816; b=VNKb3Zt7t/+AvysIZ2gLQq8sJToDzufbmE09jZoLhrkICbumbomDeFnXZjpeCL0VBn haH21ftWmGco809m7WZrwRdPjHQNN9VwX/8tQPD88IGrv2WgPikGrIexiPkvwwX4VeSs b/trJYr96MGGJJrys6ZoibejmhgGDRo5B33agGy0/9KILni/TixMm4AHPfj63kquYXAn Rrm0ANjMCMNlKM8MiFoWlAruGbAy5Wp215eymr4adeLkbjLVNNbQlRaBSOI73qDgQcVS N3kn/t8eaRZydaJtlbmGr5UgGgEVYcrTKc+MCbcduaNSy/v/a0KCK2a/IGi/VCSPv5IO K5gg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vi0Xh6/de/VdBmvgW2JXsUqrGjPjTAm+5sqkcNvU0u4=; fh=8DXXLgOtqZx6e7aNlBYKo18ItPOTprBr52SW4fKxoJM=; b=SXeutLo6QzcauvUclM15e6hMdmk4LkQc4PM3cLmmmmgbJ0uvVPn3/11nQ5zioiX+nZ ZiRtLnSrYBYdfnaj7pzbzBaMVJRf8CiVlINeNRf/bL1pkGaz5zfr3jQM+li2oxJFVxSP U3Cluziorf5Sf8r0H6g5t7etKcryaKjqnjh86QZrS80maZZmH4S+xykiDmq+lTyJPPIY cz+Nc2EirdL/c3R9MP1qFxtL/PkGpFMIezJUBJPqm/cVNlHbM9chHgoJDYqms9jlaK3I /rvnIH79w/AgZpBMAUDfpoWcll3o5jVC3MwEGemJZkFltu4HJLKikdxplosv6UYm98ni VzeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=XWY9HYO4; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59792-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59792-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCVjV0DzM9ARuECVjQec33srkejIV2Sgl0/cvS29I4W5dUeQ4GgctLYhIUDEb+V9KbZisXypEwZhvlA3kZfLQdXaDvmWnA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k1-20020a170902c40100b001d955aef796si2089276plk.478.2024.02.09.10.53.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:54:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59792-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=XWY9HYO4; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-59792-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59792-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9765BB2AFF9 for ; Fri, 9 Feb 2024 18:21:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CD42129A7D; Fri, 9 Feb 2024 18:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="XWY9HYO4" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5499F84A2A; Fri, 9 Feb 2024 18:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502720; cv=none; b=OiFUxFnJ8JGuiB8zIcTRnBZRcVjIvM8H9ZkfKFdXYlJXvo4XqgeVlvITf/SxHQB1ExNtIBf4VoxpOlZ28o93E1QK1AKaVpd9hgT15ObKLDTtmyDz3HqfAfJwpPsd6cidIzVCopMtoLNeY0Y9Xy9qPTMyUezEdIfRHGv28rJpBz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707502720; c=relaxed/simple; bh=WeIVl1zwKI+IWUXLWKWVFzcLpHB4iw+lJXds4NyJ6UY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G++G1hBLec2igg8b5EfC2RogphsQLgKkNsN9v/50Xy8pyU1rqpPazkhe3QQ1BpQ6iIUK1Ry3jJyZpk9GiCiRXvDdCzSpvdfqSiHxFwCVu8scn9oYgrQvpfqXKsWHZSW4MZu3RAyJ/6BoF+ZOnsXZDm8s8hjZA/+6myk0bV3TbQ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=XWY9HYO4; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707502713; bh=WeIVl1zwKI+IWUXLWKWVFzcLpHB4iw+lJXds4NyJ6UY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XWY9HYO4btgqiR9IRipS2lfv4IjIZtUPD3yRwcavdOewzEc/uu4PV3siERB156nqw CXrrlYH1HK8pbMo3eHCGCAvYMrTgH4Z0ZlhU6Q9ScPqMxh7WlWXqQvyVHlEa8LJzJu c/7y2ZjRB5VmejTRAjdJp8SHFvLqs5hjyvIjWNhy2jpHMQDmWPydsCSA79vTk4b1BB RyX2SxxebKvzwMDpBdcoP2gwfvvpWFH2QG9vb7vQYT+Iu8MVE93weh8vcL2ehVFtNo ndWbuc9uWepwdye/yy0FnGjVp+QfHgt+GGW180Vq/jVTuU5XCWftc0Y+Ey8fzpfkjL FoP1iELJV6J+Q== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A0BCD37820BB; Fri, 9 Feb 2024 18:18:33 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 9EB3B4800DD; Fri, 9 Feb 2024 19:18:32 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 10/10] arm64: dts: rockchip: add lower USB3 port to rock-5b Date: Fri, 9 Feb 2024 19:17:26 +0100 Message-ID: <20240209181831.104687-11-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209181831.104687-1-sebastian.reichel@collabora.com> References: <20240209181831.104687-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790448595314699817 X-GMAIL-MSGID: 1790448595314699817 Enable full support (XHCI, EHCI, OHCI) for the lower USB3 port from Radxa Rock 5 Model B. The upper one is already supported. Signed-off-by: Sebastian Reichel --- .../boot/dts/rockchip/rk3588-rock-5b.dts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts index a0e303c3a1dc..db6f0e91f62d 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -736,6 +736,14 @@ &uart2 { status = "okay"; }; +&u2phy1 { + status = "okay"; +}; + +&u2phy1_otg { + status = "okay"; +}; + &u2phy2 { status = "okay"; }; @@ -755,6 +763,14 @@ &u2phy3_host { status = "okay"; }; +&usbdp_phy1 { + status = "okay"; +}; + +&usbdp_phy1_u3 { + status = "okay"; +}; + &usb_host0_ehci { status = "okay"; }; @@ -771,6 +787,11 @@ &usb_host1_ohci { status = "okay"; }; +&usb_host1_xhci { + dr_mode = "host"; + status = "okay"; +}; + &usb_host2_xhci { status = "okay"; };