Skip to contentSkip to conversation

dt-bindings: net: Convert HiSilicon hns-dsaf to DT schema

PATCH Applied Rob Herring (Arm) 3 participants 4 messages Oct 5 – Oct 8

Subsystems (4)
lore
Share & tools
lore

Rob Herring (Arm)

author maintainer
#0 lore raw

PATCH v3 1/1 dt-bindings: net: Convert HiSilicon hns-dsaf to DT schema

Convert the HiSilicon hns-dsaf binding to DT schema format.

Drop 'phy-handle' at top level as there are no users. Add undocumented 'media-type' property.

Support for 4 'reg' regions is dropped as that has long been deprecated and there are no known users of it.

Assisted-by LLM

---
v3:
- Make subctrl-syscon, buf-size and desc-num required

v2:
- Add constraints for buf-size and desc-num
- Drop erroneous 1st 2 'reg' entries
- Fix example 'reg' cell sizes
- Add 'backplane' to 'media-type' property

---
 .../bindings/net/hisilicon,hns-dsaf-v1.yaml   | 170 ++++++++++++++++++
 .../bindings/net/hisilicon-hns-dsaf.txt       |  90 ----------
 2 files changed, 170 insertions(+), 90 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/hisilicon,hns-dsaf-v1.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
Documentation/devicetree/bindings/net/hisilicon,hns-dsaf-v1.yaml new file +170 -0
new file mode 100644
index 000000000000..4629acbba810
@@ -0,0 +1,170 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2025 Hisilicon Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/hisilicon,hns-dsaf-v1.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hisilicon DSA Fabric device controller
+
+maintainers:
+  - Jian Shen <[email protected]>
+  - Jijie Shao <[email protected]>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - hisilicon,hns-dsaf-v1
+          - hisilicon,hns-dsaf-v2
+
+  reg:
+    minItems: 1
+    items:
+      - description:
+          PPE register base and size
+      - description:
+          DSA Fabric base register and size (not required for single-port mode)
+
+  reg-names:
+    minItems: 1
+    items:
+      - const: ppe-base
+      - const: dsaf-base
+
+  interrupts:
+    minItems: 1
+    maxItems: 409
+
+  dma-coherent: true
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  mode:
+    description: DSA Fabric mode string
+    $ref: /schemas/types.yaml#/definitions/string
+    enum:
+      - 2port-64vf
+      - 6port-16rss
+      - 6port-16vf
+      - single-port
+
+  subctrl-syscon:
+    description: syscon handle for external interface control register
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+  reset-field-offset:
+    description: offset of reset field in the control register
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  buf-size:
+    description: RX buffer size (bytes)
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [512, 1024, 2048, 4096]
+
+  desc-num:
+    description: number of descriptors in TX and RX queue
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 16
+    maximum: 1024
+
+patternProperties:
+  "^port@[0-5]$":
+    description: DSA Fabric port node
+    $ref: ethernet-switch-port.yaml#
+    additionalProperties: false
+
+    properties:
+      reg:
+        maximum: 5
+
+      phy-handle: true
+
+      serdes-syscon:
+        description: syscon handle for SerDes register
+        $ref: /schemas/types.yaml#/definitions/phandle
+
+      cpld-syscon:
+        description: syscon handle plus register offset for CPLD register
+        $ref: /schemas/types.yaml#/definitions/phandle-array
+        items:
+          - items:
+              - description: CPLD phandle
+              - description: offset
+
+      port-rst-offset:
+        description: reset field offset for this port
+        $ref: /schemas/types.yaml#/definitions/uint32
+
+      port-mode-offset:
+        description: port mode field offset for this port
+        $ref: /schemas/types.yaml#/definitions/uint32
+
+      mc-mac-mask:
+        description: multicast MAC address mask
+        $ref: /schemas/types.yaml#/definitions/uint8-array
+        maxItems: 6
+
+      media-type:
+        $ref: /schemas/types.yaml#/definitions/string
+        enum:
+          - backplane
+          - copper
+          - fiber
+
+    required:
+      - reg
+      - serdes-syscon
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - subctrl-syscon
+  - mode
+  - buf-size
+  - desc-num
+
+additionalProperties: false
+
+examples:
+  - |
+    dsa@c5000000 {
+        compatible = "hisilicon,hns-dsaf-v1";
+        #address-cells = <1>;
+        #size-cells = <0>;
+        mode = "6port-16rss";
+        reg = <0xc5000000 0x890000
+               0xc7000000 0x60000>;
+        reg-names = "ppe-base", "dsaf-base";
+        subctrl-syscon = <&subctrl>;
+        reset-field-offset = <0>;
+        interrupts = <131 4>, <132 4>, <133 4>, <134 4>,
+                     <135 4>, <136 4>, <137 4>, <138 4>,
+                     <139 4>, <140 4>, <141 4>, <142 4>,
+                     <143 4>, <144 4>, <145 4>, <146 4>,
+                     <147 4>, <148 4>, <384 1>, <385 1>,
+                     <386 1>, <387 1>, <388 1>, <389 1>,
+                     <390 1>, <391 1>;
+        buf-size = <4096>;
+        desc-num = <1024>;
+        dma-coherent;
+
+        port@0 {
+            reg = <0>;
+            phy-handle = <&phy0>;
+            serdes-syscon = <&serdes>;
+            mc-mac-mask = [ff f0 00 00 00 00];
+        };
+
+        port@1 {
+            reg = <1>;
+            serdes-syscon = <&serdes>;
+            mc-mac-mask = [ff f0 00 00 00 00];
+        };
+    };
Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt deleted +0 -90

90 lines not on this page · raw message

Signature · 1 line
2.53.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] dt-bindings: net: incorrect additionalProperties in port node rejects inherited properties --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: net: incorrect additionalProperties in port node rejects inherited properties --

commit 1a8f2a688cef19a71010006753fe6e776c15501b
Author: Rob Herring (Arm) <[email protected]>

dt-bindings: net: Convert HiSilicon hns-dsaf to DT schema

Convert the HiSilicon hns-dsaf binding to DT schema format. Drop the unused phy-handle at the top level, add the undocumented media-type property, and drop support for 4 reg regions as they have long been deprecated.

Documentation/devicetree/bindings/net/hisilicon,hns-dsaf-v1.yaml line 79

Quoted 12 lines
Documentation/devicetree/bindings/net/hisilicon,hns-dsaf-v1.yaml new file +5 -0
new file mode 100644
index 0000000000000..4629acbba8104
@@ -0,0 +1,170 @@
[ ... ]
+patternProperties:
+  "^port@[0-5]$":
+    description: DSA Fabric port node
+    $ref: ethernet-switch-port.yaml#
+    additionalProperties: false

[Severity: Medium]
Will this incorrectly reject standard ethernet port properties inherited from ethernet-switch-port.yaml?

In JSON Schema, additionalProperties does not consider properties defined within a $ref. Thus, any property defined in the referenced schema but not explicitly listed in the local properties block will be incorrectly rejected.

Should this use unevaluatedProperties: false instead when inheriting from another schema?

Quoted 5 lines
Documentation/devicetree/bindings/net/hisilicon,hns-dsaf-v1.yaml new file +4 -0
+
+    properties:
+      reg:
+        maximum: 5
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
author maintainer
#2 lore raw
Quoted 2 lines · On Tue, Oct 06, 2026 at 08:29:20PM +0000, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: net: incorrect additionalProperties in port node rejects inherited properties

Explained before...

Existing users don't have any inherited properties. These are old and barely maintained platforms not likely to get new users.

Rob

#3 lore raw
In reply to Rob Herring (Arm)
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Mon, 5 Oct 2026 15:28:08 -0500 you wrote:

Convert the HiSilicon hns-dsaf binding to DT schema format.

Drop 'phy-handle' at top level as there are no users. Add undocumented 'media-type' property.

Support for 4 'reg' regions is dropped as that has long been deprecated and there are no known users of it.

[...]

Here is the summary with links:
- [net-next,v3] dt-bindings: net: Convert HiSilicon hns-dsaf to DT schema

    https://git.kernel.org/netdev/net-next/c/3917a13917e6

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html