Re: [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622

From: Felix Fietkau
Date: Wed Apr 06 2022 - 08:26:38 EST



On 06.04.22 10:09, Krzysztof Kozlowski wrote:
On 05/04/2022 21:57, Felix Fietkau wrote:
From: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>

Document the binding for the Wireless Ethernet Dispatch core on the MT7622
SoC, which is used for Ethernet->WLAN offloading
Add related info in mediatek-net bindings.

Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
Signed-off-by: Felix Fietkau <nbd@xxxxxxxx>

Thank you for your patch. There is something to discuss/improve.

---
.../arm/mediatek/mediatek,mt7622-wed.yaml | 50 +++++++++++++++++++
.../devicetree/bindings/net/mediatek-net.txt | 2 +
2 files changed, 52 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml

Don't store drivers in arm directory. See:
https://lore.kernel.org/linux-devicetree/YkJa1oLSEP8R4U6y@xxxxxxxxxxxxxxxxxx/

Isn't this a network offload engine? If yes, then probably it should be
in "net/".
It's not a network offload engine by itself. It's a SoC component that connects to the offload engine and controls a MTK PCIe WLAN device, intercepting interrupts and DMA rings in order to be able to inject packets coming in from the offload engine.
Do you think it still belongs in net, or maybe in soc instead?

diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
new file mode 100644
index 000000000000..787d6673f952
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-wed.yaml#";
+$schema: "http://devicetree.org/meta-schemas/core.yaml#";
+
+title: MediaTek Wireless Ethernet Dispatch Controller for MT7622
+
+maintainers:
+ - Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
+ - Felix Fietkau <nbd@xxxxxxxx>
+
+description:
+ The mediatek wireless ethernet dispatch controller can be configured to
+ intercept and handle access to the WLAN DMA queues and PCIe interrupts
+ and implement hardware flow offloading from ethernet to WLAN.
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - mediatek,mt7622-wed
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ soc {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ wed0: wed@1020a000 {

Generic node name, "wed" is specific. Maybe "network-offload"? Or
"network-accelerator"? You probably know better what this device does,
so maybe come with some generic name?
wed stands for "wireless ethernet dispatch". Both network-offload and network-accelerator don't really fit. Would it make sense to spell it out, or do you have any better naming ideas?

Thanks,

- Felix