dt-bindings: net: Convert HiSilicon GMAC v1/2 to DT schema
Subsystems (5)
Rob Herring (Arm)
maintainerPATCH 1/1 dt-bindings: net: Convert HiSilicon GMAC v1/2 to DT schema
Convert the HiSilicon GMAC v1/2 binding to DT schema format.
As this binding also contains the MDIO bus directly rather than in an 'mdio' child node, the MDIO node name schema needs to be relaxed.
--- .../bindings/net/hisilicon,hisi-gmac-v1.yaml | 96 +++++++++++++++++++ .../bindings/net/hisilicon-hix5hd2-gmac.txt | 60 ------------ .../devicetree/bindings/net/mdio.yaml | 7 +- 3 files changed, 102 insertions(+), 61 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/hisilicon,hisi-gmac-v1.yaml delete mode 100644 Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt
Documentation/devicetree/bindings/net/hisilicon,hisi-gmac-v1.yaml new file +96 -0
@@ -0,0 +1,96 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/hisilicon,hisi-gmac-v1.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon GMAC controller + +maintainers: + - Jian Shen <[email protected]> + - Jijie Shao <[email protected]> + +allOf: + - $ref: /schemas/net/ethernet-controller.yaml# + - $ref: /schemas/net/mdio.yaml# + +properties: + compatible: + oneOf: + - items: + - const: hisilicon,hix5hd2-gmac + - const: hisilicon,hisi-gmac-v1 + - items: + - const: hisilicon,hi3798cv200-gmac + - const: hisilicon,hisi-gmac-v2 + + reg: + items: + - description: MAC registers + - description: External interface control register + + interrupts: + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 2 + + clock-names: + minItems: 1 + items: + - const: mac_core + - const: mac_ifc + + resets: + minItems: 1 + maxItems: 3 + + reset-names: + minItems: 1 + items: + - const: mac_core + - const: mac_ifc + - const: phy + + hisilicon,phy-reset-delays-us: + description: Triplet of PHY reset delays in microseconds. + items: + - description: Pre-reset delay. + - description: Reset pulse duration. + - description: Post-reset delay. + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - phy-mode + - phy-handle + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/histb-clock.h> + + ethernet@f9840000 { + compatible = "hisilicon,hi3798cv200-gmac", "hisilicon,hisi-gmac-v2"; + reg = <0xf9840000 0x1000>, <0xf984300c 0x4>; + interrupts = <0 71 4>; + #address-cells = <1>; + #size-cells = <0>; + phy-mode = "rgmii"; + phy-handle = <&phy2>; + mac-address = [00 00 00 00 00 00]; + clocks = <&crg HISTB_ETH0_MAC_CLK>, <&crg HISTB_ETH0_MACIF_CLK>; + clock-names = "mac_core", "mac_ifc"; + resets = <&crg 0xcc 8>, <&crg 0xcc 10>, <&crg 0xcc 12>; + reset-names = "mac_core", "mac_ifc", "phy"; + hisilicon,phy-reset-delays-us = <10000 10000 30000>; + + phy2: ethernet-phy@2 { + reg = <2>; + }; + };
Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt deleted +0 -60
60 lines not on this page · raw message
Documentation/devicetree/bindings/net/mdio.yaml +6 -1
@@ -17,9 +17,14 @@ description: bus. These should follow the generic ethernet-phy.yaml document, or a device specific binding document. +select: + properties: + $nodename: + pattern: '^mdio(-(bus|external))?(@.+|-([0-9]+))?$' + properties: $nodename: - pattern: '^mdio(-(bus|external))?(@.+|-([0-9]+))?$' + pattern: '^(ethernet|mdio(-(bus|external))?)(@.+|-([0-9]+))?$' "#address-cells": const: 1
Signature · 1 line
2.53.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] dt-bindings: net: hisilicon,hisi-gmac-v1.yaml omits hisilicon,hi3516a-gmac --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] dt-bindings: net: hisilicon,hisi-gmac-v1.yaml omits hisilicon,hi3516a-gmac
--
commit ab6f211d13f9c7a3f51fb6e0f45f7089669c73d4
Author: Rob Herring (Arm) <[email protected]>
dt-bindings: net: Convert HiSilicon GMAC v1/2 to DT schema
This commit converts the HiSilicon GMAC v1/2 binding from text to DT schema format and relaxes the node name pattern in mdio.yaml to allow ethernet controller nodes that directly contain an MDIO bus.
Quoted 6 lines
Documentation/devicetree/bindings/net/hisilicon,hisi-gmac-v1.yaml new file +0
-0@@ -0,0 +1,96 @@
[ ... ]
Documentation/devicetree/bindings/net/hisilicon,hisi-gmac-v1.yaml line 25
Quoted 9 lines
Documentation/devicetree/bindings/net/hisilicon,hisi-gmac-v1.yaml new file +9
-0+properties: + compatible: + oneOf: + - items: + - const: hisilicon,hix5hd2-gmac + - const: hisilicon,hisi-gmac-v1 + - items: + - const: hisilicon,hi3798cv200-gmac + - const: hisilicon,hisi-gmac-v2
[Severity: Low]
Should the v2 compatible entry also allow "hisilicon,hi3516a-gmac" via an enum alongside "hisilicon,hi3798cv200-gmac"?
The removed text binding documented "hisilicon,hi3516a-gmac" as a v2 SoC compatible string, and hix5hd2_of_match[] in drivers/net/ethernet/hisilicon/hix5hd2_gmac.c still matches it, so omitting it leaves that compatible string undocumented for dt_compatible_check and breaks schema validation for hi3516a GMAC nodes.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Rob Herring
maintainerQuoted 38 lines · On Tue, Nov 10, 2026 at 07:17:28PM +0000, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] dt-bindings: net: hisilicon,hisi-gmac-v1.yaml omits hisilicon,hi3516a-gmac
--commit
ab6f211d13f9c7a3f51fb6e0f45f7089669c73d4
Author: Rob Herring (Arm) <[email protected]>dt-bindings: net: Convert HiSilicon GMAC v1/2 to DT schema
This commit converts the HiSilicon GMAC v1/2 binding from text to DT schema format and relaxes the node name pattern in
mdio.yamlto allow ethernet controller nodes that directly contain an MDIO bus.Quoted 6 lines
Documentation/devicetree/bindings/net/hisilicon,hisi-gmac-v1.yaml new file +0
-0@@ -0,0 +1,96 @@[ ... ]
Documentation/devicetree/bindings/net/hisilicon,hisi-gmac-v1.yaml line 25
Quoted 9 lines
Documentation/devicetree/bindings/net/hisilicon,hisi-gmac-v1.yaml new file +9
-0+properties: + compatible: + oneOf: + - items: + - const: hisilicon,hix5hd2-gmac + - const: hisilicon,hisi-gmac-v1 + - items: + - const: hisilicon,hi3798cv200-gmac + - const: hisilicon,hisi-gmac-v2[Severity: Low]
Should the v2 compatible entry also allow "hisilicon,hi3516a-gmac" via an enum alongside "hisilicon,hi3798cv200-gmac"?
Quoted 5 lines
The removed text binding documented "hisilicon,hi3516a-gmac" as a v2 SoC compatible string, and hix5hd2_of_match[] in
drivers/net/ethernet/hisilicon/hix5hd2_gmac.cstill matches it, so omitting it leaves that compatible string undocumented fordt_compatible_checkand breaks schema validation for hi3516a GMAC nodes.
No, the above matches actual users and the .txt binding was not precise.
Rob
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Mon, 9 Nov 2026 13:16:41 -0600 you wrote:
Convert the HiSilicon GMAC v1/2 binding to DT schema format.
As this binding also contains the MDIO bus directly rather than in an 'mdio' child node, the MDIO node name schema needs to be relaxed.
Signed-off-by Rob Herring (Arm) <[email protected]>[...]
Here is the summary with links:
- [net-next] dt-bindings: net: Convert HiSilicon GMAC v1/2 to DT schema
https://git.kernel.org/netdev/net-next/c/556e0ac6a771
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html