dt-bindings: net: Convert hisilicon,hns-nic to DT schema
Rob Herring (Arm)
maintainerPATCH 1/1 dt-bindings: net: Convert hisilicon,hns-nic to DT schema
Convert the hisilicon,hns-nic binding to DT schema format. It's a straight forward conversion.
--- .../bindings/net/hisilicon,hns-nic.yaml | 107 ++++++++++++++++++ .../bindings/net/hisilicon-hns-nic.txt | 76 ------------- 2 files changed, 107 insertions(+), 76 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml delete mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml new file +107 -0
@@ -0,0 +1,107 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/hisilicon,hns-nic.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon Network Subsystem NIC controller + +maintainers: + - Jian Shen <[email protected]> + - Jijie Shao <[email protected]> + +allOf: + - $ref: ethernet-controller.yaml# + +properties: + compatible: + enum: + - hisilicon,hns-nic-v1 + - hisilicon,hns-nic-v2 + + ae-handle: + description: + accelerator engine handle for hns, specifies a reference to the + associating hardware driver node. + $ref: /schemas/types.yaml#/definitions/phandle + + port-id: + description: | + is the index of port provided by DSAF (the accelerator). DSAF can connect to 8 PHYs. + Port 0 to 1 are both used for administration purpose. + They are called debug ports. + + The remaining 6 PHYs are taken according to the mode of DSAF. + + In NIC mode of DSAF, all 6 PHYs are taken as ethernet ports to the CPU. + The port-id can be 2 to 7. Here is the diagram: + +-----+---------------+ + | CPU | + +-+-+-+---+-+-+-+-+-+-+ + | | | | | | | | + debug service + port port + (0,1) (2-7) + + In Switch mode of DSAF, all 6 PHYs are taken as physical ports connect to a LAN Switch, + while the CPU side assume itself have one single NIC connect to this switch. + In this case, the port-id will be 2 only. + +-----+---------------+ + | CPU | + +-+-+-+---+-+-+-+-+-+-+ + | | service| port(2) + debug +------------+ + port | switch | + (0,1) +-+-+-+-+-+-++ + | | | | | | + external port + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 7 + + port-idx-in-ae: + description: | + is the index of port provided by AE. + In NIC mode of DSAF, all 6 PHYs of service DSAF are taken as ethernet ports to the CPU. + The port-idx-in-ae can be 0 to 5. Here is the diagram: + +-----+---------------+ + | CPU | + +-+-+-+---+-+-+-+-+-+-+ + | | | | | | | | + debug debug service + port port port + (0) (0) (0-5) + + In Switch mode of DSAF, all 6 PHYs of service DSAF are taken as physical ports connected to + a LAN Switch, + while the CPU side assume itself have one single NIC connected to this switch. + In this case, the port-idx-in-ae will be 0 only. + +-----+-----+------+------+ + | CPU | + +-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | service| port(0) + debug debug +------------+ + port port | switch | + (0) (0) +-+-+-+-+-+-++ + | | | | | | + external port + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 5 + + dma-coherent: true + +required: + - compatible + - ae-handle + - port-idx-in-ae + - local-mac-address + +unevaluatedProperties: false + +examples: + - | + ethernet { + compatible = "hisilicon,hns-nic-v1"; + ae-handle = <&dsaf0>; + port-idx-in-ae = <0>; + local-mac-address = [a2 14 e4 4b 56 76]; + };
Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt deleted +0 -76
76 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] dt-bindings: incomplete port-id deprecation and validation constraint --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dt-bindings: incomplete port-id deprecation and validation constraint --
commit fa2141e31377c486f984e5588eb02ffe70ed8443
Author: Rob Herring (Arm) <[email protected]>
dt-bindings: net: Convert hisilicon,hns-nic to DT schema
Convert the hisilicon,hns-nic binding to DT schema format. It's a straight forward conversion.
Quoted 4 lines
Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml new file +0
-0
[ ... ]
Quoted 6 lines
Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml new file +6
-0+properties: + compatible: + enum: + - hisilicon,hns-nic-v1 + - hisilicon,hns-nic-v2 +
Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml line 31
Quoted 10 lines
Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml new file +10
-0+ ae-handle: + description: + accelerator engine handle for hns, specifies a reference to the + associating hardware driver node. + $ref: /schemas/types.yaml#/definitions/phandle + + port-id: + description: | + is the index of port provided by DSAF (the accelerator). DSAF can connect to 8 PHYs. + Port 0 to 1 are both used for administration purpose.
[Severity: Low]
The original text file mentioned the port-id attribute remains for compatibility purposes and is not recommended for new code. Should properties.port-id in Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml include a deprecated: true annotation here to preserve that constraint?
[ ... ]
Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml line 96
Quoted 7 lines
Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml new file +7
-0+ dma-coherent: true + +required: + - compatible + - ae-handle + - port-idx-in-ae + - local-mac-address
[Severity: Low]
Does unconditionally requiring port-idx-in-ae in the required list break dtbs_check schema validation for older device trees in Documentation/devicetree/bindings/net/hisilicon,hns-nic.yaml?
If legacy device trees rely on the port-id fallback without providing port-idx-in-ae, this strict requirement might cause validation errors when running schema checks on older configurations. Should this be conditionally required instead?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1