Message ID | 20240216-inno-phy-v1-1-1ab912f0533f@outlook.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-68861-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp599704dyb; Fri, 16 Feb 2024 07:43:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVO/5uz1riUDLX1kJzHoRKtDgf/ZV9wsR5kTJoyNh4ksIdwfjSYwSkj83JWfMHA2ugDjlbGp1iOgwGUs2SVSnBEUVZNXw== X-Google-Smtp-Source: AGHT+IE/g38yN1BW+DJ+/7rnM8RehWz6p1nxBYQwA+hZkvG2IQwQZdsBhXSPiBQY3NTbN5xT9Rh0 X-Received: by 2002:a17:902:c946:b0:1db:28b4:4475 with SMTP id i6-20020a170902c94600b001db28b44475mr7137707pla.9.1708098234672; Fri, 16 Feb 2024 07:43:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708098234; cv=pass; d=google.com; s=arc-20160816; b=hKR7Va2nmsNIkx2ahgZKMEguSF0HLzgQZxLXfjeiC9gC6ah+7enCqqkffePf04JrOK I3gtbH6Cra+JTT6w6imL2OLcR14y+PAndyyAOFS4JsivGyEwmuzIzJu/Q08dPZc+KGSg 96GiumCljUsQWejxo9zhA4iAW+0za9AS3omlrMtXvTwdVnj4+Iy74lw+AiaqzQfDRCdM WhZYc86kRy8cHsakbewO3Uf4GF9Vz6s02r1gk84oV5t2m+Qvy4H7vQIA7QhIXxkCQYDI OVyeRjuKV2QeaqCWKCEYq2hRg9yci0C9zH1nwbbV/y8rJgH6h8mU86Xdt5W7tHQNtWXT kdhg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=FinT+vkQziuNeqTpkFgvATIzRKNd62D4ymBjq5/lwAg=; fh=/wRwIHgmVsrLW9sRFYxTGxZ4FeMBZ7dOboqO3KP8JJ0=; b=IA5LbAKyaLNSXGLeVOOczckmmirKD1+FNAWOSHUMF9GaEPB9Edq6znVsIO7Rgixjoi M8bSBm0XH+8OzSEy1I/FzehVkelaxa2J8VS1V1RrFM3fJY5Q/2LVFNpLYYgBu0g3a++N UTvJwPo73zv51VtlmOzYNgvZ8kRo4can9rx4aJC2YZA41vTVCX8Kh2quV7LbBGInbLKr YibtCDgxAe+gnRTCRRYki/JuoIQ8GbV1ZtR/3V+mOYsSXKrroZaTAYvLd4FVZp7aSNGV ZHOPCElbPrmVX03/4HWHaeN8EGYKL0xaGAqjkr807f/v1CcFRaZub89BYIC21FTePOJq 2h3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YBxiFFNi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68861-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68861-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u11-20020a170902b28b00b001d792c3bbd0si16672plr.641.2024.02.16.07.43.54 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:43:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68861-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=@kernel.org header.s=k20201202 header.b=YBxiFFNi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68861-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68861-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 0B676B2555A for <ouuuleilei@gmail.com>; Fri, 16 Feb 2024 15:32:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 627A0132C3B; Fri, 16 Feb 2024 15:21:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YBxiFFNi" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BCCCB12EBFB; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; cv=none; b=nZgfqsua1Qa+OPJPxMAIo4XgOXL0r76a+1AyAgOYxPXwbU79vBf0+ILY0pVt/yVCsGPGejaA1j3yLwnHQLeZ2zScZxZzFWxmsKwyB1PeFwJwIqFPXmthIFC5VK93oDW6hOtuwOhVRMAhtmelGjiHKSJrCXxB24LcYMjLltzhVfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; c=relaxed/simple; bh=TRmVZH+PZ59+C0TEtARg738Y2o6iYiZC8Ky45LjLJSY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PNiPZUm5XRPNQK3wSfmHSw7X9aErZW/oK3yYTzdILhT+IJZcTYBkkp1ybsH7c+92mD6RvK9898Fvm5mcNmCq3T8HYQJLqf5/2xnGe7WJ7WxE9L7sbPqBSduXMkHcAWUbhjGrt/7e9me566OEGPxQJM/wv104/4Ze2R8G26IViA4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YBxiFFNi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 4F17EC433F1; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708096887; bh=TRmVZH+PZ59+C0TEtARg738Y2o6iYiZC8Ky45LjLJSY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YBxiFFNiiyfTYhqoomzmP4UeXXGkxJuZ70x7AUZk/HagzZt57oafcUglg3Sl7nTcz Gg/f7/HUpv2faOooIdsFcKsJFgVSHxVqtTbya/w0/G/1ZEkW05WDzUTpG8cw3qVLjv btrcY90qgNuTJ5htK3OcayNa5WoB4C8HlGf8bLYVnup3EoktiWNZZ7b+wW9nUsiQTZ ecN1Hxj7TfOVFcgmRrF5zZoucWSWLH1oyEjsQcpjDKIPjMnI8c9cILFwQ6keC3G3YB PI0EzZVf0tXOXiYjpeX4m+Ra2pwGCNOSfRThJ/3YHiENQwLOA9+7VS+IpK8jxqRFDK r3sI2hhe/8Uyw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3944BC48BC4; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) From: Yang Xiwen via B4 Relay <devnull+forbidden405.outlook.com@kernel.org> Date: Fri, 16 Feb 2024 23:21:01 +0800 Subject: [PATCH RFC 1/4] dt-binding: phy: hisi-inno-usb2: convert to YAML Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240216-inno-phy-v1-1-1ab912f0533f@outlook.com> References: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> In-Reply-To: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> To: Vinod Koul <vkoul@kernel.org>, Kishon Vijay Abraham I <kishon@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Jiancheng Xue <xuejiancheng@hisilicon.com>, Pengcheng Li <lpc.li@hisilicon.com>, Shawn Guo <shawn.guo@linaro.org> Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I <kishon@ti.com>, David Yang <mmyangfl@gmail.com>, Yang Xiwen <forbidden405@outlook.com> X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708096886; l=5966; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=l2ypu5YlW9CWMPkZmrwjgcd2IjIfU7LZ/QhuKeoEs5U=; b=RZhPg7bOXtCnLnhOnPvU31l6XXB2L3mNOEDisGfSglBCTAd29oMaVQfbWq6MOoAXduRzISDbH NW0AULX6Bm2Al+ajA/8kB5/HGXGgfc95jw0ePqdl+PFsRhAFn8QQDTP X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen <forbidden405@outlook.com> Reply-To: <forbidden405@outlook.com> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791070814284694999 X-GMAIL-MSGID: 1791070814284694999 |
Series |
phy: hisi-inno-phy: add support for hi3798mv200-usb2-phy
|
|
Commit Message
Yang Xiwen via B4 Relay
Feb. 16, 2024, 3:21 p.m. UTC
From: Yang Xiwen <forbidden405@outlook.com> Also rename to hisilicon,inno-usb2-phy.yaml and add this name to compatible lists. Signed-off-by: Yang Xiwen <forbidden405@outlook.com> --- .../bindings/phy/hisilicon,inno-usb2-phy.yaml | 115 +++++++++++++++++++++ .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 71 ------------- 2 files changed, 115 insertions(+), 71 deletions(-)
Comments
On 16/02/2024 16:21, Yang Xiwen via B4 Relay wrote: > From: Yang Xiwen <forbidden405@outlook.com> > > Also rename to hisilicon,inno-usb2-phy.yaml and add this name to > compatible lists. Please use subject prefixes matching the subsystem. You can get them for example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory your patch is touching. > > Signed-off-by: Yang Xiwen <forbidden405@outlook.com> > --- > .../bindings/phy/hisilicon,inno-usb2-phy.yaml | 115 +++++++++++++++++++++ > .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 71 ------------- > 2 files changed, 115 insertions(+), 71 deletions(-) > > diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml > new file mode 100644 > index 000000000000..73256eee10f9 > --- /dev/null > +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml > @@ -0,0 +1,115 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/phy/hisilicon,inno-usb2-phy.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: HiSilicon HiSTB SoCs INNO USB2 PHY device > + > +maintainers: > + - Yang Xiwen <forbidden405@outlook.com> > + > +properties: > + compatible: > + minItems: 1 No, why? Compatibles must be fixed/constrained. > + items: > + - enum: > + - hisilicon,hi3798cv200-usb2-phy > + - hisilicon,hi3798mv100-usb2-phy This wasn't here before. Not explained in commit msg. > + - const: hisilicon,inno-usb2-phy > + > + reg: > + maxItems: 1 > + description: | Do not need '|' unless you need to preserve formatting. > + Should be the address space for PHY configuration register in peripheral > + controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC. > + Or direct MMIO address space. > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > + clocks: > + maxItems: 1 > + description: reference clock > + > + resets: > + maxItems: 1 > + > +patternProperties: > + 'phy@[0-9a-f]+': > + type: object > + additionalProperties: false > + description: individual ports provided by INNO PHY > + > + properties: > + reg: > + maxItems: 1 > + > + '#phy-cells': > + const: 0 > + > + resets: > + maxItems: 1 > + > + required: [reg, '#phy-cells', resets] One item per line. Look at other bindings or example-schema. > + > +required: > + - compatible > + - clocks > + - reg > + - '#address-cells' > + - '#size-cells' > + - resets > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/clock/histb-clock.h> > + > + peripheral-controller@8a20000 { > + compatible = "hisilicon,hi3798cv200-perictrl", "syscon", "simple-mfd"; > + reg = <0x8a20000 0x1000>; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges = <0x0 0x8a20000 0x1000>; Drop the node, not related to this binding. If this binding is supposed to be part of other device in case of MFD devices or some tightly coupled ones, then could be included in the example there. > + > + usb2-phy@120 { > + compatible = "hisilicon,hi3798cv200-usb2-phy"; > + reg = <0x120 0x4>; > + clocks = <&crg HISTB_USB2_PHY1_REF_CLK>; > + resets = <&crg 0xbc 4>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + phy@0 { > + reg = <0>; > + #phy-cells = <0>; > + resets = <&crg 0xbc 8>; > + }; > + > + phy@1 { > + reg = <1>; > + #phy-cells = <0>; > + resets = <&crg 0xbc 9>; > + }; > + }; > + > + usb2-phy@124 { > + compatible = "hisilicon,hi3798cv200-usb2-phy"; You can keep only one example, because they are basically the same. Best regards, Krzysztof
On 2/17/2024 6:14 PM, Krzysztof Kozlowski wrote: > On 16/02/2024 16:21, Yang Xiwen via B4 Relay wrote: >> From: Yang Xiwen <forbidden405@outlook.com> >> >> Also rename to hisilicon,inno-usb2-phy.yaml and add this name to >> compatible lists. > Please use subject prefixes matching the subsystem. You can get them for > example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory > your patch is touching. Will fix in next version > >> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >> --- >> .../bindings/phy/hisilicon,inno-usb2-phy.yaml | 115 +++++++++++++++++++++ >> .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 71 ------------- >> 2 files changed, 115 insertions(+), 71 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml >> new file mode 100644 >> index 000000000000..73256eee10f9 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml >> @@ -0,0 +1,115 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/phy/hisilicon,inno-usb2-phy.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: HiSilicon HiSTB SoCs INNO USB2 PHY device >> + >> +maintainers: >> + - Yang Xiwen <forbidden405@outlook.com> >> + >> +properties: >> + compatible: >> + minItems: 1 > No, why? Compatibles must be fixed/constrained. > >> + items: >> + - enum: >> + - hisilicon,hi3798cv200-usb2-phy >> + - hisilicon,hi3798mv100-usb2-phy > This wasn't here before. Not explained in commit msg. The commit 3940ffc65492 ("phy: hisilicon: Add inno-usb2-phy driver for Hi3798MV100") does not have dt-binding change commit along with. Will explain this in commit log. > >> + - const: hisilicon,inno-usb2-phy >> + >> + reg: >> + maxItems: 1 >> + description: | > Do not need '|' unless you need to preserve formatting. > >> + Should be the address space for PHY configuration register in peripheral >> + controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC. >> + Or direct MMIO address space. >> + >> + '#address-cells': >> + const: 1 >> + >> + '#size-cells': >> + const: 0 >> + >> + clocks: >> + maxItems: 1 >> + description: reference clock >> + >> + resets: >> + maxItems: 1 >> + >> +patternProperties: >> + 'phy@[0-9a-f]+': >> + type: object >> + additionalProperties: false >> + description: individual ports provided by INNO PHY >> + >> + properties: >> + reg: >> + maxItems: 1 >> + >> + '#phy-cells': >> + const: 0 >> + >> + resets: >> + maxItems: 1 >> + >> + required: [reg, '#phy-cells', resets] > One item per line. Look at other bindings or example-schema. > >> + >> +required: >> + - compatible >> + - clocks >> + - reg >> + - '#address-cells' >> + - '#size-cells' >> + - resets >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include <dt-bindings/clock/histb-clock.h> >> + >> + peripheral-controller@8a20000 { >> + compatible = "hisilicon,hi3798cv200-perictrl", "syscon", "simple-mfd"; >> + reg = <0x8a20000 0x1000>; >> + #address-cells = <1>; >> + #size-cells = <1>; >> + ranges = <0x0 0x8a20000 0x1000>; > Drop the node, not related to this binding. If this binding is supposed > to be part of other device in case of MFD devices or some tightly > coupled ones, then could be included in the example there. For CV200, this binding is supposed to be always inside the perictrl device. The PHY address space are accessed from a bus implemented by perictrl. > >> + >> + usb2-phy@120 { >> + compatible = "hisilicon,hi3798cv200-usb2-phy"; >> + reg = <0x120 0x4>; >> + clocks = <&crg HISTB_USB2_PHY1_REF_CLK>; >> + resets = <&crg 0xbc 4>; >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + phy@0 { >> + reg = <0>; >> + #phy-cells = <0>; >> + resets = <&crg 0xbc 8>; >> + }; >> + >> + phy@1 { >> + reg = <1>; >> + #phy-cells = <0>; >> + resets = <&crg 0xbc 9>; >> + }; >> + }; >> + >> + usb2-phy@124 { >> + compatible = "hisilicon,hi3798cv200-usb2-phy"; > You can keep only one example, because they are basically the same. Will remove > > > Best regards, > Krzysztof >
On 17/02/2024 11:24, Yang Xiwen wrote: >>> + >>> +examples: >>> + - | >>> + #include <dt-bindings/clock/histb-clock.h> >>> + >>> + peripheral-controller@8a20000 { >>> + compatible = "hisilicon,hi3798cv200-perictrl", "syscon", "simple-mfd"; >>> + reg = <0x8a20000 0x1000>; >>> + #address-cells = <1>; >>> + #size-cells = <1>; >>> + ranges = <0x0 0x8a20000 0x1000>; >> Drop the node, not related to this binding. If this binding is supposed >> to be part of other device in case of MFD devices or some tightly >> coupled ones, then could be included in the example there. > For CV200, this binding is supposed to be always inside the perictrl > device. The PHY address space are accessed from a bus implemented by > perictrl. Every node is supposes to be somewhere in something, so with this logic you would start from soc@. What's wrong in putting it in parent schema? Best regards, Krzysztof
On 2/17/2024 6:29 PM, Krzysztof Kozlowski wrote: > On 17/02/2024 11:24, Yang Xiwen wrote: > >>>> + >>>> +examples: >>>> + - | >>>> + #include <dt-bindings/clock/histb-clock.h> >>>> + >>>> + peripheral-controller@8a20000 { >>>> + compatible = "hisilicon,hi3798cv200-perictrl", "syscon", "simple-mfd"; >>>> + reg = <0x8a20000 0x1000>; >>>> + #address-cells = <1>; >>>> + #size-cells = <1>; >>>> + ranges = <0x0 0x8a20000 0x1000>; >>> Drop the node, not related to this binding. If this binding is supposed >>> to be part of other device in case of MFD devices or some tightly >>> coupled ones, then could be included in the example there. >> For CV200, this binding is supposed to be always inside the perictrl >> device. The PHY address space are accessed from a bus implemented by >> perictrl. > Every node is supposes to be somewhere in something, so with this logic > you would start from soc@. What's wrong in putting it in parent schema? When the ports reg property only has an dummy address (no size), it must be inside the perictrl node, accessed from the bus implemented by perictrl. But when the ports has its own MMIO address space (mv200), it should be located under a simple-bus node instead. So it's either: perictrl@8a20000 { usb2-phy@120: { reg = <0x120 0x4>; // this is the register that controls writes and reads to the phy, implemented by perictrl. (just like SPI/I2C) phy@0: { reg = <0>; // the reg is used as an index }; }; }; or: soc@0 { usb2-phy@f9865000 { // MMIO reg = <0xf9865000 0x1000> port0@0 { reg = <0x0 0x400>; // used as MMIO address space }; }; }; So here is why i include perictrl node in the example. If the ports are not mmio, the phy must be under a perictrl node. Or if the ports has its own address space, it should not be under a perictrl node, but rather an simple-bus node. > > Best regards, > Krzysztof >
On 2/17/2024 6:14 PM, Krzysztof Kozlowski wrote: > On 16/02/2024 16:21, Yang Xiwen via B4 Relay wrote: >> From: Yang Xiwen <forbidden405@outlook.com> >> >> Also rename to hisilicon,inno-usb2-phy.yaml and add this name to >> compatible lists. > Please use subject prefixes matching the subsystem. You can get them for > example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory > your patch is touching. > >> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >> --- >> .../bindings/phy/hisilicon,inno-usb2-phy.yaml | 115 +++++++++++++++++++++ >> .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 71 ------------- >> 2 files changed, 115 insertions(+), 71 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml >> new file mode 100644 >> index 000000000000..73256eee10f9 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml >> @@ -0,0 +1,115 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/phy/hisilicon,inno-usb2-phy.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: HiSilicon HiSTB SoCs INNO USB2 PHY device >> + >> +maintainers: >> + - Yang Xiwen <forbidden405@outlook.com> >> + >> +properties: >> + compatible: >> + minItems: 1 > No, why? Compatibles must be fixed/constrained. Hi3798CV200 has only the first compatible listed in its device tree. But you are right i can add it to hi3798mv200.dtsi so that `minItems` can be removed > >> + items: >> + - enum: >> + - hisilicon,hi3798cv200-usb2-phy >> + - hisilicon,hi3798mv100-usb2-phy > This wasn't here before. Not explained in commit msg. > >> + - const: hisilicon,inno-usb2-phy >> + >> + reg: >> + maxItems: 1 >> + description: | > Do not need '|' unless you need to preserve formatting. > >> + Should be the address space for PHY configuration register in peripheral >> + controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC. >> + Or direct MMIO address space. >> + >> + '#address-cells': >> + const: 1 >> + >> + '#size-cells': >> + const: 0 >> + >> + clocks: >> + maxItems: 1 >> + description: reference clock >> + >> + resets: >> + maxItems: 1 >> + >> +patternProperties: >> + 'phy@[0-9a-f]+': >> + type: object >> + additionalProperties: false >> + description: individual ports provided by INNO PHY >> + >> + properties: >> + reg: >> + maxItems: 1 >> + >> + '#phy-cells': >> + const: 0 >> + >> + resets: >> + maxItems: 1 >> + >> + required: [reg, '#phy-cells', resets] > One item per line. Look at other bindings or example-schema. > >> + >> +required: >> + - compatible >> + - clocks >> + - reg >> + - '#address-cells' >> + - '#size-cells' >> + - resets >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include <dt-bindings/clock/histb-clock.h> >> + >> + peripheral-controller@8a20000 { >> + compatible = "hisilicon,hi3798cv200-perictrl", "syscon", "simple-mfd"; >> + reg = <0x8a20000 0x1000>; >> + #address-cells = <1>; >> + #size-cells = <1>; >> + ranges = <0x0 0x8a20000 0x1000>; > Drop the node, not related to this binding. If this binding is supposed > to be part of other device in case of MFD devices or some tightly > coupled ones, then could be included in the example there. > >> + >> + usb2-phy@120 { >> + compatible = "hisilicon,hi3798cv200-usb2-phy"; >> + reg = <0x120 0x4>; >> + clocks = <&crg HISTB_USB2_PHY1_REF_CLK>; >> + resets = <&crg 0xbc 4>; >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + phy@0 { >> + reg = <0>; >> + #phy-cells = <0>; >> + resets = <&crg 0xbc 8>; >> + }; >> + >> + phy@1 { >> + reg = <1>; >> + #phy-cells = <0>; >> + resets = <&crg 0xbc 9>; >> + }; >> + }; >> + >> + usb2-phy@124 { >> + compatible = "hisilicon,hi3798cv200-usb2-phy"; > You can keep only one example, because they are basically the same. It is listed here just because cv200 (and the upcoming mv200) actually has two INNO phys in the SoC. And coincidently for both SoCs, one with two ports is wired to USB2 controller(EHCI &OHCI), while the other one with only one port is wired to DWC3 controller. The example here is borrowed directly from hi3798cv200.dtsi. > > Best regards, > Krzysztof >
On 17/02/2024 11:54, Yang Xiwen wrote: > On 2/17/2024 6:29 PM, Krzysztof Kozlowski wrote: >> On 17/02/2024 11:24, Yang Xiwen wrote: >> >>>>> + >>>>> +examples: >>>>> + - | >>>>> + #include <dt-bindings/clock/histb-clock.h> >>>>> + >>>>> + peripheral-controller@8a20000 { >>>>> + compatible = "hisilicon,hi3798cv200-perictrl", "syscon", "simple-mfd"; >>>>> + reg = <0x8a20000 0x1000>; >>>>> + #address-cells = <1>; >>>>> + #size-cells = <1>; >>>>> + ranges = <0x0 0x8a20000 0x1000>; >>>> Drop the node, not related to this binding. If this binding is supposed >>>> to be part of other device in case of MFD devices or some tightly >>>> coupled ones, then could be included in the example there. >>> For CV200, this binding is supposed to be always inside the perictrl >>> device. The PHY address space are accessed from a bus implemented by >>> perictrl. >> Every node is supposes to be somewhere in something, so with this logic >> you would start from soc@. What's wrong in putting it in parent schema? > > When the ports reg property only has an dummy address (no size), it must > be inside the perictrl node, accessed from the bus implemented by perictrl. > > But when the ports has its own MMIO address space (mv200), it should be > located under a simple-bus node instead. > > So it's either: > > perictrl@8a20000 { > > usb2-phy@120: { > > reg = <0x120 0x4>; // this is the register that controls writes > and reads to the phy, implemented by perictrl. (just like SPI/I2C) > > phy@0: { > > reg = <0>; // the reg is used as an index > > }; > > }; > > }; > > or: > > soc@0 { > > usb2-phy@f9865000 { // MMIO > > reg = <0xf9865000 0x1000> > > port0@0 { > > reg = <0x0 0x400>; // used as MMIO address space > > }; > > }; > > }; > > So here is why i include perictrl node in the example. If the ports are > not mmio, the phy must be under a perictrl node. Or if the ports has its > own address space, it should not be under a perictrl node, but rather an > simple-bus node. I don't understand why you keep insisting and discussing this. You are adding other compatibles to this schema example, which usually we try to avoid. You entirely ignored my comment above and pasted DTS which is no related to the topic we discuss here. I did not question whether this can be or cannot be in some node. Best regards, Krzysztof
On 17/02/2024 14:14, Yang Xiwen wrote: > On 2/17/2024 6:14 PM, Krzysztof Kozlowski wrote: >> On 16/02/2024 16:21, Yang Xiwen via B4 Relay wrote: >>> From: Yang Xiwen <forbidden405@outlook.com> >>> >>> Also rename to hisilicon,inno-usb2-phy.yaml and add this name to >>> compatible lists. >> Please use subject prefixes matching the subsystem. You can get them for >> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory >> your patch is touching. >> >>> Signed-off-by: Yang Xiwen <forbidden405@outlook.com> >>> --- >>> .../bindings/phy/hisilicon,inno-usb2-phy.yaml | 115 +++++++++++++++++++++ >>> .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 71 ------------- >>> 2 files changed, 115 insertions(+), 71 deletions(-) >>> >>> diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml >>> new file mode 100644 >>> index 000000000000..73256eee10f9 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml >>> @@ -0,0 +1,115 @@ >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/phy/hisilicon,inno-usb2-phy.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: HiSilicon HiSTB SoCs INNO USB2 PHY device >>> + >>> +maintainers: >>> + - Yang Xiwen <forbidden405@outlook.com> >>> + >>> +properties: >>> + compatible: >>> + minItems: 1 >> No, why? Compatibles must be fixed/constrained. > Hi3798CV200 has only the first compatible listed in its device tree. But > you are right i can add it to hi3798mv200.dtsi so that `minItems` can be > removed >> >>> + items: >>> + - enum: >>> + - hisilicon,hi3798cv200-usb2-phy >>> + - hisilicon,hi3798mv100-usb2-phy >> This wasn't here before. Not explained in commit msg. >> >>> + - const: hisilicon,inno-usb2-phy >>> + >>> + reg: >>> + maxItems: 1 >>> + description: | >> Do not need '|' unless you need to preserve formatting. >> >>> + Should be the address space for PHY configuration register in peripheral >>> + controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC. >>> + Or direct MMIO address space. >>> + >>> + '#address-cells': >>> + const: 1 >>> + >>> + '#size-cells': >>> + const: 0 >>> + >>> + clocks: >>> + maxItems: 1 >>> + description: reference clock >>> + >>> + resets: >>> + maxItems: 1 >>> + >>> +patternProperties: >>> + 'phy@[0-9a-f]+': >>> + type: object >>> + additionalProperties: false >>> + description: individual ports provided by INNO PHY >>> + >>> + properties: >>> + reg: >>> + maxItems: 1 >>> + >>> + '#phy-cells': >>> + const: 0 >>> + >>> + resets: >>> + maxItems: 1 >>> + >>> + required: [reg, '#phy-cells', resets] >> One item per line. Look at other bindings or example-schema. >> >>> + >>> +required: >>> + - compatible >>> + - clocks >>> + - reg >>> + - '#address-cells' >>> + - '#size-cells' >>> + - resets >>> + >>> +additionalProperties: false >>> + >>> +examples: >>> + - | >>> + #include <dt-bindings/clock/histb-clock.h> >>> + >>> + peripheral-controller@8a20000 { >>> + compatible = "hisilicon,hi3798cv200-perictrl", "syscon", "simple-mfd"; >>> + reg = <0x8a20000 0x1000>; >>> + #address-cells = <1>; >>> + #size-cells = <1>; >>> + ranges = <0x0 0x8a20000 0x1000>; >> Drop the node, not related to this binding. If this binding is supposed >> to be part of other device in case of MFD devices or some tightly >> coupled ones, then could be included in the example there. >> >>> + >>> + usb2-phy@120 { >>> + compatible = "hisilicon,hi3798cv200-usb2-phy"; >>> + reg = <0x120 0x4>; >>> + clocks = <&crg HISTB_USB2_PHY1_REF_CLK>; >>> + resets = <&crg 0xbc 4>; >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + >>> + phy@0 { >>> + reg = <0>; >>> + #phy-cells = <0>; >>> + resets = <&crg 0xbc 8>; >>> + }; >>> + >>> + phy@1 { >>> + reg = <1>; >>> + #phy-cells = <0>; >>> + resets = <&crg 0xbc 9>; >>> + }; >>> + }; >>> + >>> + usb2-phy@124 { >>> + compatible = "hisilicon,hi3798cv200-usb2-phy"; >> You can keep only one example, because they are basically the same. > > It is listed here just because cv200 (and the upcoming mv200) actually > has two INNO phys in the SoC. And coincidently for both SoCs, one with > two ports is wired to USB2 controller(EHCI &OHCI), while the other one > with only one port is wired to DWC3 controller. The example here is > borrowed directly from hi3798cv200.dtsi. > I see the differences and one difference means they are basically the same. Best regards, Krzysztof
On 2/17/2024 9:39 PM, Krzysztof Kozlowski wrote: > On 17/02/2024 11:54, Yang Xiwen wrote: >> On 2/17/2024 6:29 PM, Krzysztof Kozlowski wrote: >>> On 17/02/2024 11:24, Yang Xiwen wrote: >>> >>>>>> + >>>>>> +examples: >>>>>> + - | >>>>>> + #include <dt-bindings/clock/histb-clock.h> >>>>>> + >>>>>> + peripheral-controller@8a20000 { >>>>>> + compatible = "hisilicon,hi3798cv200-perictrl", "syscon", "simple-mfd"; >>>>>> + reg = <0x8a20000 0x1000>; >>>>>> + #address-cells = <1>; >>>>>> + #size-cells = <1>; >>>>>> + ranges = <0x0 0x8a20000 0x1000>; >>>>> Drop the node, not related to this binding. If this binding is supposed >>>>> to be part of other device in case of MFD devices or some tightly >>>>> coupled ones, then could be included in the example there. >>>> For CV200, this binding is supposed to be always inside the perictrl >>>> device. The PHY address space are accessed from a bus implemented by >>>> perictrl. >>> Every node is supposes to be somewhere in something, so with this logic >>> you would start from soc@. What's wrong in putting it in parent schema? >> When the ports reg property only has an dummy address (no size), it must >> be inside the perictrl node, accessed from the bus implemented by perictrl. >> >> But when the ports has its own MMIO address space (mv200), it should be >> located under a simple-bus node instead. >> >> So it's either: >> >> perictrl@8a20000 { >> >> usb2-phy@120: { >> >> reg = <0x120 0x4>; // this is the register that controls writes >> and reads to the phy, implemented by perictrl. (just like SPI/I2C) >> >> phy@0: { >> >> reg = <0>; // the reg is used as an index >> >> }; >> >> }; >> >> }; >> >> or: >> >> soc@0 { >> >> usb2-phy@f9865000 { // MMIO >> >> reg = <0xf9865000 0x1000> >> >> port0@0 { >> >> reg = <0x0 0x400>; // used as MMIO address space >> >> }; >> >> }; >> >> }; >> >> So here is why i include perictrl node in the example. If the ports are >> not mmio, the phy must be under a perictrl node. Or if the ports has its >> own address space, it should not be under a perictrl node, but rather an >> simple-bus node. > I don't understand why you keep insisting and discussing this. You are > adding other compatibles to this schema example, which usually we try to > avoid. You entirely ignored my comment above and pasted DTS which is no > related to the topic we discuss here. I did not question whether this > can be or cannot be in some node. okay, I can remove the parent node if it's preferred. This is simply the most usual example that exists in real dts. > > Best regards, > Krzysztof >
diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml new file mode 100644 index 000000000000..73256eee10f9 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml @@ -0,0 +1,115 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/hisilicon,inno-usb2-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon HiSTB SoCs INNO USB2 PHY device + +maintainers: + - Yang Xiwen <forbidden405@outlook.com> + +properties: + compatible: + minItems: 1 + items: + - enum: + - hisilicon,hi3798cv200-usb2-phy + - hisilicon,hi3798mv100-usb2-phy + - const: hisilicon,inno-usb2-phy + + reg: + maxItems: 1 + description: | + Should be the address space for PHY configuration register in peripheral + controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC. + Or direct MMIO address space. + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + clocks: + maxItems: 1 + description: reference clock + + resets: + maxItems: 1 + +patternProperties: + 'phy@[0-9a-f]+': + type: object + additionalProperties: false + description: individual ports provided by INNO PHY + + properties: + reg: + maxItems: 1 + + '#phy-cells': + const: 0 + + resets: + maxItems: 1 + + required: [reg, '#phy-cells', resets] + +required: + - compatible + - clocks + - reg + - '#address-cells' + - '#size-cells' + - resets + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/histb-clock.h> + + peripheral-controller@8a20000 { + compatible = "hisilicon,hi3798cv200-perictrl", "syscon", "simple-mfd"; + reg = <0x8a20000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x8a20000 0x1000>; + + usb2-phy@120 { + compatible = "hisilicon,hi3798cv200-usb2-phy"; + reg = <0x120 0x4>; + clocks = <&crg HISTB_USB2_PHY1_REF_CLK>; + resets = <&crg 0xbc 4>; + #address-cells = <1>; + #size-cells = <0>; + + phy@0 { + reg = <0>; + #phy-cells = <0>; + resets = <&crg 0xbc 8>; + }; + + phy@1 { + reg = <1>; + #phy-cells = <0>; + resets = <&crg 0xbc 9>; + }; + }; + + usb2-phy@124 { + compatible = "hisilicon,hi3798cv200-usb2-phy"; + reg = <0x124 0x4>; + clocks = <&crg HISTB_USB2_PHY2_REF_CLK>; + resets = <&crg 0xbc 6>; + #address-cells = <1>; + #size-cells = <0>; + + phy@0 { + reg = <0>; + #phy-cells = <0>; + resets = <&crg 0xbc 10>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt deleted file mode 100644 index 104953e849e7..000000000000 --- a/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt +++ /dev/null @@ -1,71 +0,0 @@ -Device tree bindings for HiSilicon INNO USB2 PHY - -Required properties: -- compatible: Should be one of the following strings: - "hisilicon,inno-usb2-phy", - "hisilicon,hi3798cv200-usb2-phy". -- reg: Should be the address space for PHY configuration register in peripheral - controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC. -- clocks: The phandle and clock specifier pair for INNO USB2 PHY device - reference clock. -- resets: The phandle and reset specifier pair for INNO USB2 PHY device reset - signal. -- #address-cells: Must be 1. -- #size-cells: Must be 0. - -The INNO USB2 PHY device should be a child node of peripheral controller that -contains the PHY configuration register, and each device supports up to 2 PHY -ports which are represented as child nodes of INNO USB2 PHY device. - -Required properties for PHY port node: -- reg: The PHY port instance number. -- #phy-cells: Defined by generic PHY bindings. Must be 0. -- resets: The phandle and reset specifier pair for PHY port reset signal. - -Refer to phy/phy-bindings.txt for the generic PHY binding properties - -Example: - -perictrl: peripheral-controller@8a20000 { - compatible = "hisilicon,hi3798cv200-perictrl", "simple-mfd"; - reg = <0x8a20000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x8a20000 0x1000>; - - usb2_phy1: usb2-phy@120 { - compatible = "hisilicon,hi3798cv200-usb2-phy"; - reg = <0x120 0x4>; - clocks = <&crg HISTB_USB2_PHY1_REF_CLK>; - resets = <&crg 0xbc 4>; - #address-cells = <1>; - #size-cells = <0>; - - usb2_phy1_port0: phy@0 { - reg = <0>; - #phy-cells = <0>; - resets = <&crg 0xbc 8>; - }; - - usb2_phy1_port1: phy@1 { - reg = <1>; - #phy-cells = <0>; - resets = <&crg 0xbc 9>; - }; - }; - - usb2_phy2: usb2-phy@124 { - compatible = "hisilicon,hi3798cv200-usb2-phy"; - reg = <0x124 0x4>; - clocks = <&crg HISTB_USB2_PHY2_REF_CLK>; - resets = <&crg 0xbc 6>; - #address-cells = <1>; - #size-cells = <0>; - - usb2_phy2_port0: phy@0 { - reg = <0>; - #phy-cells = <0>; - resets = <&crg 0xbc 10>; - }; - }; -};