Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp260411rdg; Tue, 10 Oct 2023 09:27:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH14NumSu0hG3P9uGHUU5PL27EypKTrPYxMjO8R5LBQ+kPEuRyMtcSmcnxhVHxSiSdHUirn X-Received: by 2002:a05:6a00:cc4:b0:68f:c081:3d5c with SMTP id b4-20020a056a000cc400b0068fc0813d5cmr19321647pfv.8.1696955258287; Tue, 10 Oct 2023 09:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696955258; cv=none; d=google.com; s=arc-20160816; b=S8tFVmptCQ+EFwwlnJC5/2bX9QPJ5CGu8JOIlWPxz/IjSyajV8LqLG5g5Fr7yHuD2Z pG8DAmppZK/fvpdls/JCPCKDVhH2+Kp6owTI1QVJI9s7UgSrRqf+DoJt6iFKwnYAmAaQ KXqymrzjl/jP82Tr7RnyxqoY5Oqo1EXF3yZa/As98IWopQTvVZAvprWgddfvk2Sb/EcB tN95Z21fVSlcxgLUCnUhB8CXOXllF0cSVFzemFIS7c4SAjFDsslJCvEjfc7AZ6rEinzD WfzUZxZ/1j4lamv+rJ3V1dow1dd2WpzwwhRpI6kh0D4YsDyYNYgeXG/bO2bGhYYetrIc uP4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k4YBlDBPJl5iPpzjMfW6fYzCKhuOaLn1C7FXgglGbwM=; fh=mqH2SSitTLsMaTa9ybyH6mx91Vkj0SB/+Y4XwT9ESJ0=; b=cRMiEEpLiUnm3Zr2viNQRwSiXucQv7i4qxGffBeat4rFcNqsq/6PEFXs5tSOpkCGDi T/X2hPnTgGp+vHzjIlxvKfjJqRsbus/Ms1ovCuI+w6+F9s44FhquBJrnZrNYMUPnUFPn wgrdoCBuF+8CyTbA+Mon4Zb2OlAq9AeSN2Sgl1h7uya3b9m/mD5Ep4VL7oRTczIzL22/ V9fymppnForUpB8dsL2KvbuDCP8Ux0tv64Lg7UKd9mTne3OoQWWkkgFs6sZkZCZ+9PXl Zlfy36LraoY0n0wB7zKUtZaHIm3V3Gg/d3TeOmC1gL7u74Thx+6nnwNKEM6fxGvUq63r dzgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rw30bMW6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id y71-20020a638a4a000000b005740b4723f9si12228145pgd.811.2023.10.10.09.27.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 09:27:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rw30bMW6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C94BE809B9DB; Tue, 10 Oct 2023 09:27:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231246AbjJJQ11 (ORCPT + 99 others); Tue, 10 Oct 2023 12:27:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbjJJQ10 (ORCPT ); Tue, 10 Oct 2023 12:27:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91ADC93 for ; Tue, 10 Oct 2023 09:27:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26365C433C7; Tue, 10 Oct 2023 16:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696955245; bh=t4PzobXZJtCe2x1U9eIGmA6015uE27joZNtgWmnO0IA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rw30bMW6+kCwj0bQ0XJCl02xwmXUjxDC3O97DswIyyA5f79Vz1CsAoyiwlnwI1u5D +E4uzeAwjpbuocOd1mekTSSqSmo/qW443P2zp4DFE/vurKgdny9URSly2jBIy2YwZN 2FBZcAHRRhuq8sYAlSSlXMxoMfoia7kDd7qdXt1x9THtFTpMFcCUwT5IAvA25RB7Hw dzjMC9ayTvTgtRq9oYdYq5GhIYCf/b7Q2a3nXRQYFhEIhfwxQ90pwuSUMh/SxuO2Gf cNpIMmJ9ZYcwHQqWIhJ0b3ZWZYMyTAYXqmkUOmjlCeul5j8qNGFunRkAqquAKw4inC ncO72LLPNRVSQ== Received: (nullmailer pid 1012386 invoked by uid 1000); Tue, 10 Oct 2023 16:27:22 -0000 Date: Tue, 10 Oct 2023 11:27:22 -0500 From: Rob Herring To: Sebastian Reichel Cc: Heiko Stuebner , Greg Kroah-Hartman , Thinh Nguyen , Krzysztof Kozlowski , Conor Dooley , linux-rockchip@lists.infradead.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com Subject: Re: [PATCH v3 1/3] dt-bindings: usb: add rk3588 compatible to rockchip,dwc3 Message-ID: <20231010162722.GA1006254-robh@kernel.org> References: <20231009172129.43568-1-sebastian.reichel@collabora.com> <20231009172129.43568-2-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231009172129.43568-2-sebastian.reichel@collabora.com> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 10 Oct 2023 09:27:36 -0700 (PDT) X-Spam-Level: ** On Mon, Oct 09, 2023 at 07:20:09PM +0200, Sebastian Reichel wrote: > RK3588 has three DWC3 controllers. Two of them are fully functional in > host, device and OTG mode including USB2 support. They are connected to > dedicated PHYs, that also support USB-C's DisplayPort alternate mode. > > The third controller is connected to one of the combphy's shared > with PCIe and SATA. It can only be used in host mode and does not > support USB2. Compared to the other controllers this one needs > some extra clocks. > > While adding the extra clocks required by RK3588, I noticed grf_clk > is not available on RK3568, so I disallowed it for that platform. > > Signed-off-by: Sebastian Reichel > --- > .../bindings/usb/rockchip,dwc3.yaml | 66 +++++++++++++++++-- > 1 file changed, 61 insertions(+), 5 deletions(-) > > diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml > index 291844c8f3e1..517879290099 100644 > --- a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml > +++ b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml > @@ -20,9 +20,6 @@ description: > Type-C PHY > Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > > -allOf: > - - $ref: snps,dwc3.yaml# > - > select: > properties: > compatible: > @@ -30,6 +27,7 @@ select: > enum: > - rockchip,rk3328-dwc3 > - rockchip,rk3568-dwc3 > + - rockchip,rk3588-dwc3 > required: > - compatible > > @@ -39,6 +37,7 @@ properties: > - enum: > - rockchip,rk3328-dwc3 > - rockchip,rk3568-dwc3 > + - rockchip,rk3588-dwc3 > - const: snps,dwc3 > > reg: > @@ -58,7 +57,9 @@ properties: > Master/Core clock, must to be >= 62.5 MHz for SS > operation and >= 30MHz for HS operation > - description: > - Controller grf clock > + Controller grf clock OR UTMI clock > + - description: > + PIPE clock > > clock-names: > minItems: 3 > @@ -66,7 +67,10 @@ properties: > - const: ref_clk > - const: suspend_clk > - const: bus_clk > - - const: grf_clk > + - enum: > + - grf_clk > + - utmi > + - const: pipe > > power-domains: > maxItems: 1 > @@ -86,6 +90,58 @@ required: > - clocks > - clock-names > > +allOf: > + - $ref: snps,dwc3.yaml# > + - if: > + properties: > + compatible: > + contains: > + const: rockchip,rk3328-dwc3 > + then: > + properties: > + clocks: > + minItems: 3 > + maxItems: 4 > + clock-names: > + minItems: 3 > + items: > + - const: ref_clk > + - const: suspend_clk > + - const: bus_clk > + - const: grf_clk No need to list everything again. Just: contains: const: grf_clk > + - if: > + properties: > + compatible: > + contains: > + const: rockchip,rk3568-dwc3 > + then: > + properties: > + clocks: > + maxItems: 3 > + clock-names: > + items: > + - const: ref_clk > + - const: suspend_clk > + - const: bus_clk Just 'maxItems: 3' is sufficient here. > + - if: > + properties: > + compatible: > + contains: > + const: rockchip,rk3588-dwc3 > + then: > + properties: > + clocks: > + minItems: 3 3 is already the min. > + maxItems: 5 And 5 is already the max. > + clock-names: > + minItems: 3 > + items: > + - const: ref_clk > + - const: suspend_clk > + - const: bus_clk > + - const: utmi > + - const: pipe Again, can use 'contains' here. Where 'utmi' is in the list is already defined by the top-level schema. Rob