devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] ARM: dts: stm32: remove typec port dtbs_check warning on stm32mp15xx-dkx
@ 2023-04-12 15:13 Fabrice Gasnier
  2023-05-16 16:27 ` Alexandre TORGUE
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Gasnier @ 2023-04-12 15:13 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

According to usb-connector.yaml, typec connector should always use:
- ports property
- with port@0 (required).
This is also true for a single HS port. This removes dtbs_check warning:
stusb1600@28: connector: Unevaluated properties are not allowed ('port'
was unexpected)

Downside is it introduces another warning when building with W=1:

Warning (graph_child_address): /soc/i2c@5c002000/stusb1600@28/connector/
ports: graph node has single child node 'port@0', #address-cells
/#size-cells are not necessary

By removing #address-cells/#size-cells as suggested, another couple of
W=1 warning shows up:
Warning (avoid_default_addr_size): /soc/i2c@5c002000/stusb1600@28/
connector/ports/port@0: Relying on default #address-cells value
Warning (avoid_default_addr_size): /soc/i2c@5c002000/stusb1600@28/
connector/ports/port@0: Relying on default #size-cells value

Is there a clean way or necessary change to reach a clean build and clean
dtbs_check ?
Maybe this kind of concern has already been addressed ?
As far as I understand, the OF graph allows a single port {} node (e.g.
code being reworked here). Could this be added in relevant dtschema, to
address the single HS port use case (usb-connector.yaml) ?

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32mp15xx-dkx.dtsi | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
index cefeeb00fc22..41e79c8cc752 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
@@ -259,9 +259,14 @@ connector {
 			power-role = "dual";
 			typec-power-opmode = "default";
 
-			port {
-				con_usbotg_hs_ep: endpoint {
-					remote-endpoint = <&usbotg_hs_ep>;
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				port@0 {
+					reg = <0>;
+					con_usbotg_hs_ep: endpoint {
+						remote-endpoint = <&usbotg_hs_ep>;
+					};
 				};
 			};
 		};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC PATCH] ARM: dts: stm32: remove typec port dtbs_check warning on stm32mp15xx-dkx
  2023-04-12 15:13 [RFC PATCH] ARM: dts: stm32: remove typec port dtbs_check warning on stm32mp15xx-dkx Fabrice Gasnier
@ 2023-05-16 16:27 ` Alexandre TORGUE
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre TORGUE @ 2023-05-16 16:27 UTC (permalink / raw)
  To: Fabrice Gasnier, robh+dt, krzysztof.kozlowski+dt
  Cc: amelie.delaunay, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32


On 4/12/23 17:13, Fabrice Gasnier wrote:
> According to usb-connector.yaml, typec connector should always use:
> - ports property
> - with port@0 (required).
> This is also true for a single HS port. This removes dtbs_check warning:
> stusb1600@28: connector: Unevaluated properties are not allowed ('port'
> was unexpected)
> 
> Downside is it introduces another warning when building with W=1:
> 
> Warning (graph_child_address): /soc/i2c@5c002000/stusb1600@28/connector/
> ports: graph node has single child node 'port@0', #address-cells
> /#size-cells are not necessary
> 
> By removing #address-cells/#size-cells as suggested, another couple of
> W=1 warning shows up:
> Warning (avoid_default_addr_size): /soc/i2c@5c002000/stusb1600@28/
> connector/ports/port@0: Relying on default #address-cells value
> Warning (avoid_default_addr_size): /soc/i2c@5c002000/stusb1600@28/
> connector/ports/port@0: Relying on default #size-cells value
> 
> Is there a clean way or necessary change to reach a clean build and clean
> dtbs_check ?
> Maybe this kind of concern has already been addressed ?
> As far as I understand, the OF graph allows a single port {} node (e.g.
> code being reworked here). Could this be added in relevant dtschema, to
> address the single HS port use case (usb-connector.yaml) ?
> 

Rob, Krzysztof, do you an idea to figure out this issue ?

Thanks in advance
Alex


> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
> ---
>   arch/arm/boot/dts/stm32mp15xx-dkx.dtsi | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
> index cefeeb00fc22..41e79c8cc752 100644
> --- a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
> +++ b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
> @@ -259,9 +259,14 @@ connector {
>   			power-role = "dual";
>   			typec-power-opmode = "default";
>   
> -			port {
> -				con_usbotg_hs_ep: endpoint {
> -					remote-endpoint = <&usbotg_hs_ep>;
> +			ports {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				port@0 {
> +					reg = <0>;
> +					con_usbotg_hs_ep: endpoint {
> +						remote-endpoint = <&usbotg_hs_ep>;
> +					};
>   				};
>   			};
>   		};


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-16 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-12 15:13 [RFC PATCH] ARM: dts: stm32: remove typec port dtbs_check warning on stm32mp15xx-dkx Fabrice Gasnier
2023-05-16 16:27 ` Alexandre TORGUE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).