diff mbox series

[net-next,v3,2/6] dt-bindings: net: hisilicon-femac-mdio: convert to YAML

Message ID 20240220-net-v3-2-b68e5b75e765@outlook.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: hisi-femac: add support for Hi3798MV200, remove unmaintained compatibles | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: forbidden405@formail.com
netdev/build_clang success Errors and warnings before: 958 this patch: 958
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch warning WARNING: DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.rst WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-20--06-00 (tests: 1358)

Commit Message

Yang Xiwen via B4 Relay Feb. 19, 2024, 7:57 p.m. UTC
From: Yang Xiwen <forbidden405@outlook.com>

Also mark the clock optional

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
---
 .../bindings/net/hisilicon,hisi-femac-mdio.yaml    | 48 ++++++++++++++++++++++
 .../bindings/net/hisilicon-femac-mdio.txt          | 22 ----------
 2 files changed, 48 insertions(+), 22 deletions(-)

Comments

Krzysztof Kozlowski Feb. 21, 2024, 8:11 a.m. UTC | #1
On 19/02/2024 20:57, Yang Xiwen via B4 Relay wrote:
> From: Yang Xiwen <forbidden405@outlook.com>
> 
> Also mark the clock optional
> 

> +allOf:
> +  - $ref: mdio.yaml#
> +
> +properties:
> +  "#address-cells":
> +    const: 1

Drop property.

> +
> +  "#size-cells":
> +    const: 0

Drop property.


> +
> +  compatible:
> +    const: hisilicon,hisi-femac-mdio

Put compatible as the first.

> +
> +  reg:
> +    maxItems: 1

Reg the second.

> +
> +  clocks:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    mdio@10091100 {
> +        compatible = "hisilicon,hisi-femac-mdio";
> +        reg = <0x10091100 0x20>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;

Add clocks to the example.



Best regards,
Krzysztof
Krzysztof Kozlowski Feb. 21, 2024, 8:12 a.m. UTC | #2
On 19/02/2024 20:57, Yang Xiwen via B4 Relay wrote:
> From: Yang Xiwen <forbidden405@outlook.com>
> 
> Also mark the clock optional

Why? Your commit msg must provide rationale. Clocks are rarely optional
signals, so this looks wrong.

Best regards,
Krzysztof
Yang Xiwen Feb. 21, 2024, 11:24 a.m. UTC | #3
On 2/21/2024 4:12 PM, Krzysztof Kozlowski wrote:
> On 19/02/2024 20:57, Yang Xiwen via B4 Relay wrote:
>> From: Yang Xiwen <forbidden405@outlook.com>
>>
>> Also mark the clock optional
> Why? Your commit msg must provide rationale. Clocks are rarely optional
> signals, so this looks wrong.


Well. I don't know too much about the hardware either. I think the clock 
can be either shared with MAC controller or completely non-existent in 
hardware.


But from the driver side, the clock must be stripped from MDIO bus node. 
The clocks must be controlled entirely within MAC controller driver. Do 
I need to mention it in this commit too?


Actually I've never seen anything like "MDIO bus clock" in the 
datasheet. The MDIO bus and MAC controller are activated simultaneously. 
So I think removing this clock entirely is also acceptable.


>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Feb. 22, 2024, 6:15 p.m. UTC | #4
On 21/02/2024 12:24, Yang Xiwen wrote:
> On 2/21/2024 4:12 PM, Krzysztof Kozlowski wrote:
>> On 19/02/2024 20:57, Yang Xiwen via B4 Relay wrote:
>>> From: Yang Xiwen <forbidden405@outlook.com>
>>>
>>> Also mark the clock optional
>> Why? Your commit msg must provide rationale. Clocks are rarely optional
>> signals, so this looks wrong.
> 
> 
> Well. I don't know too much about the hardware either. I think the clock 
> can be either shared with MAC controller or completely non-existent in 
> hardware.
> 
> 
> But from the driver side, the clock must be stripped from MDIO bus node. 
> The clocks must be controlled entirely within MAC controller driver. Do 
> I need to mention it in this commit too?
> 
> 
> Actually I've never seen anything like "MDIO bus clock" in the 
> datasheet. The MDIO bus and MAC controller are activated simultaneously. 
> So I think removing this clock entirely is also acceptable.

None of these are arguments to make the clock optional. The last one is
an argument to drop clock entirely.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/hisilicon,hisi-femac-mdio.yaml b/Documentation/devicetree/bindings/net/hisilicon,hisi-femac-mdio.yaml
new file mode 100644
index 000000000000..1c85e6e7f8f6
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/hisilicon,hisi-femac-mdio.yaml
@@ -0,0 +1,48 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/hisilicon,hisi-femac-mdio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: HiSilicon FEMAC MDIO bus
+
+maintainers:
+  - Yang Xiwen <forbidden405@formail.com>
+
+allOf:
+  - $ref: mdio.yaml#
+
+properties:
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  compatible:
+    const: hisilicon,hisi-femac-mdio
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    mdio@10091100 {
+        compatible = "hisilicon,hisi-femac-mdio";
+        reg = <0x10091100 0x20>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        phy@1 {
+            reg = <1>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/net/hisilicon-femac-mdio.txt b/Documentation/devicetree/bindings/net/hisilicon-femac-mdio.txt
deleted file mode 100644
index 23a39a309d17..000000000000
--- a/Documentation/devicetree/bindings/net/hisilicon-femac-mdio.txt
+++ /dev/null
@@ -1,22 +0,0 @@ 
-Hisilicon Fast Ethernet MDIO Controller interface
-
-Required properties:
-- compatible: should be "hisilicon,hisi-femac-mdio".
-- reg: address and length of the register set for the device.
-- clocks: A phandle to the reference clock for this device.
-
-- PHY subnode: inherits from phy binding [1]
-[1] Documentation/devicetree/bindings/net/phy.txt
-
-Example:
-mdio: mdio@10091100 {
-	compatible = "hisilicon,hisi-femac-mdio";
-	reg = <0x10091100 0x10>;
-	clocks = <&crg HI3516CV300_MDIO_CLK>;
-	#address-cells = <1>;
-	#size-cells = <0>;
-
-	phy0: phy@1 {
-		reg = <1>;
-	};
-};