devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern
@ 2023-08-14  9:39 Eugen Hristev
  2023-08-14  9:39 ` [PATCH v2 2/2] arm64: dts: mediatek: fix t-phy unit name Eugen Hristev
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Eugen Hristev @ 2023-08-14  9:39 UTC (permalink / raw)
  To: linux-mediatek
  Cc: chunfeng.yun, vkoul, kishon, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, matthias.bgg, angelogioacchino.delregno, sam.shih,
	jieyy.yang, frank-w, linux-arm-kernel, linux-phy, devicetree,
	linux-kernel, chris.obbard, kernel, Eugen Hristev

The pattern for the nodename only allows t-phy@... , however, for the case
when the t-phy has no `reg` and only `ranges` (basically when the t-phy
is just a parent node), dtc will throw this warning:

Warning (unit_address_vs_reg): /t-phy@1a243000: node has a unit name, but no reg or ranges property

For a node like this:

	sata_phy: t-phy@1a243000 {
		ranges;

		sata_port: sata-phy@1a243000 {
			reg = <0 0x1a243000 0 0x0100>;
		};
	};

it is normal that the parent node 't-phy' would be without any address, as in:

	sata_phy: t-phy {
		ranges;

		sata_port: sata-phy@1a243000 {
			reg = <0 0x1a243000 0 0x0100>;
		};
	};

because being just a holder it does not have its own reg.

However the binding does not allow such a name for the t-phy, so with this
patch, making the `@[0-9a-f]+` part optional, such node is possible.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
---
Changes in v2:
- none
 Documentation/devicetree/bindings/phy/mediatek,tphy.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
index 230a17f24966..2bb91542e984 100644
--- a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
+++ b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
@@ -64,7 +64,7 @@ description: |
 
 properties:
   $nodename:
-    pattern: "^t-phy@[0-9a-f]+$"
+    pattern: "^t-phy(@[0-9a-f]+)?$"
 
   compatible:
     oneOf:
-- 
2.34.1


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

* [PATCH v2 2/2] arm64: dts: mediatek: fix t-phy unit name
  2023-08-14  9:39 [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern Eugen Hristev
@ 2023-08-14  9:39 ` Eugen Hristev
  2023-10-03  9:19   ` AngeloGioacchino Del Regno
  2023-08-14 16:19 ` [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern Conor Dooley
  2023-08-17  9:55 ` (subset) " Vinod Koul
  2 siblings, 1 reply; 5+ messages in thread
From: Eugen Hristev @ 2023-08-14  9:39 UTC (permalink / raw)
  To: linux-mediatek
  Cc: chunfeng.yun, vkoul, kishon, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, matthias.bgg, angelogioacchino.delregno, sam.shih,
	jieyy.yang, frank-w, linux-arm-kernel, linux-phy, devicetree,
	linux-kernel, chris.obbard, kernel, Eugen Hristev

dtbs_check throws a warning at t-phy nodes:
Warning (unit_address_vs_reg): /t-phy@1a243000: node has a unit name, but no reg or ranges property
Warning (unit_address_vs_reg): /soc/t-phy@11c00000: node has a unit name, but no reg or ranges property

The ranges is empty thus removing the `@1a243000`, `@11c00000` from
the node name.

Fixes: 6029cae696c8 ("arm64: dts: mediatek: mt7622: harmonize node names and compatibles")
Fixes: 918aed7abd2d ("arm64: dts: mt7986: add pcie related device nodes")
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
---
Changes in v2:
- mention dtbs_check in the commit message and blame some commits

 arch/arm64/boot/dts/mediatek/mt7622.dtsi  | 2 +-
 arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
index 36ef2dbe8add..3ee9266fa8e9 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -905,7 +905,7 @@ sata: sata@1a200000 {
 		status = "disabled";
 	};
 
-	sata_phy: t-phy@1a243000 {
+	sata_phy: t-phy {
 		compatible = "mediatek,mt7622-tphy",
 			     "mediatek,generic-tphy-v1";
 		#address-cells = <2>;
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
index 68539ea788df..24eda00e320d 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -434,7 +434,7 @@ pcie_intc: interrupt-controller {
 			};
 		};
 
-		pcie_phy: t-phy@11c00000 {
+		pcie_phy: t-phy {
 			compatible = "mediatek,mt7986-tphy",
 				     "mediatek,generic-tphy-v2";
 			#address-cells = <2>;
-- 
2.34.1


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

* Re: [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern
  2023-08-14  9:39 [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern Eugen Hristev
  2023-08-14  9:39 ` [PATCH v2 2/2] arm64: dts: mediatek: fix t-phy unit name Eugen Hristev
@ 2023-08-14 16:19 ` Conor Dooley
  2023-08-17  9:55 ` (subset) " Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Conor Dooley @ 2023-08-14 16:19 UTC (permalink / raw)
  To: Eugen Hristev
  Cc: linux-mediatek, chunfeng.yun, vkoul, kishon, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno, sam.shih, jieyy.yang, frank-w,
	linux-arm-kernel, linux-phy, devicetree, linux-kernel,
	chris.obbard, kernel

[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]

On Mon, Aug 14, 2023 at 12:39:30PM +0300, Eugen Hristev wrote:
> The pattern for the nodename only allows t-phy@... , however, for the case
> when the t-phy has no `reg` and only `ranges` (basically when the t-phy
> is just a parent node), dtc will throw this warning:
> 
> Warning (unit_address_vs_reg): /t-phy@1a243000: node has a unit name, but no reg or ranges property
> 
> For a node like this:
> 
> 	sata_phy: t-phy@1a243000 {
> 		ranges;
> 
> 		sata_port: sata-phy@1a243000 {
> 			reg = <0 0x1a243000 0 0x0100>;
> 		};
> 	};
> 
> it is normal that the parent node 't-phy' would be without any address, as in:
> 
> 	sata_phy: t-phy {
> 		ranges;
> 
> 		sata_port: sata-phy@1a243000 {
> 			reg = <0 0x1a243000 0 0x0100>;
> 		};
> 	};
> 
> because being just a holder it does not have its own reg.
> 
> However the binding does not allow such a name for the t-phy, so with this
> patch, making the `@[0-9a-f]+` part optional, such node is possible.
> 
> Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>

This seems reasonable to me, perhaps the lads will scream.
Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
> Changes in v2:
> - none
>  Documentation/devicetree/bindings/phy/mediatek,tphy.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
> index 230a17f24966..2bb91542e984 100644
> --- a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
> +++ b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
> @@ -64,7 +64,7 @@ description: |
>  
>  properties:
>    $nodename:
> -    pattern: "^t-phy@[0-9a-f]+$"
> +    pattern: "^t-phy(@[0-9a-f]+)?$"
>  
>    compatible:
>      oneOf:
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: (subset) [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern
  2023-08-14  9:39 [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern Eugen Hristev
  2023-08-14  9:39 ` [PATCH v2 2/2] arm64: dts: mediatek: fix t-phy unit name Eugen Hristev
  2023-08-14 16:19 ` [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern Conor Dooley
@ 2023-08-17  9:55 ` Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2023-08-17  9:55 UTC (permalink / raw)
  To: linux-mediatek, Eugen Hristev
  Cc: chunfeng.yun, kishon, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, angelogioacchino.delregno, sam.shih, jieyy.yang,
	frank-w, linux-arm-kernel, linux-phy, devicetree, linux-kernel,
	chris.obbard, kernel


On Mon, 14 Aug 2023 12:39:30 +0300, Eugen Hristev wrote:
> The pattern for the nodename only allows t-phy@... , however, for the case
> when the t-phy has no `reg` and only `ranges` (basically when the t-phy
> is just a parent node), dtc will throw this warning:
> 
> Warning (unit_address_vs_reg): /t-phy@1a243000: node has a unit name, but no reg or ranges property
> 
> For a node like this:
> 
> [...]

Applied, thanks!

[1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern
      commit: e4077ca4ebdefa1b4616e4dafcb67b621253b233

Best regards,
-- 
~Vinod



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

* Re: [PATCH v2 2/2] arm64: dts: mediatek: fix t-phy unit name
  2023-08-14  9:39 ` [PATCH v2 2/2] arm64: dts: mediatek: fix t-phy unit name Eugen Hristev
@ 2023-10-03  9:19   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-10-03  9:19 UTC (permalink / raw)
  To: Eugen Hristev, linux-mediatek
  Cc: chunfeng.yun, vkoul, kishon, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, matthias.bgg, sam.shih, jieyy.yang, frank-w,
	linux-arm-kernel, linux-phy, devicetree, linux-kernel,
	chris.obbard, kernel

Il 14/08/23 11:39, Eugen Hristev ha scritto:
> dtbs_check throws a warning at t-phy nodes:
> Warning (unit_address_vs_reg): /t-phy@1a243000: node has a unit name, but no reg or ranges property
> Warning (unit_address_vs_reg): /soc/t-phy@11c00000: node has a unit name, but no reg or ranges property
> 
> The ranges is empty thus removing the `@1a243000`, `@11c00000` from
> the node name.
> 
> Fixes: 6029cae696c8 ("arm64: dts: mediatek: mt7622: harmonize node names and compatibles")
> Fixes: 918aed7abd2d ("arm64: dts: mt7986: add pcie related device nodes")
> Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



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

end of thread, other threads:[~2023-10-03  9:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14  9:39 [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern Eugen Hristev
2023-08-14  9:39 ` [PATCH v2 2/2] arm64: dts: mediatek: fix t-phy unit name Eugen Hristev
2023-10-03  9:19   ` AngeloGioacchino Del Regno
2023-08-14 16:19 ` [PATCH v2 1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern Conor Dooley
2023-08-17  9:55 ` (subset) " Vinod Koul

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).