Skip to contentSkip to conversation

dt-bindings: convert mt76 and ieee80211 in yaml

PATCH Superseded Lorenzo Bianconi 2 participants 5 messages Mar 24, 2021 – Mar 27, 2021

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Lorenzo Bianconi

author maintainer
#0 lore raw

v3 cover dt-bindings: convert mt76 and ieee80211 in yaml

Convert mt76 and ieee802111 dts bindings from .txt to .yaml

Changes since v2:
- add myself as ieee80211.yaml maintainer
- add Ryder as mt76.yaml maintainer
- fix led node in mt76.yaml
- fix ieee80211.yaml refernce in mt76.yaml
- fix ieee80211-freq-limit property in ieee80211.yaml

Changes since v1:
- introduce ieee80211.yaml bindings
- remove unnecessary properties in mt76.yaml

Lorenzo Bianconi (2):
dt-bindings:net:wireless:ieee80211: txt to yaml conversion dt-bindings:net:wireless:mediatek,mt76: txt to yaml conversion

 .../bindings/net/wireless/ieee80211.txt       |  24 ----
 .../bindings/net/wireless/ieee80211.yaml      |  45 +++++++
 .../bindings/net/wireless/mediatek,mt76.txt   |  78 -----------
 .../bindings/net/wireless/mediatek,mt76.yaml  | 122 ++++++++++++++++++
 4 files changed, 167 insertions(+), 102 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/wireless/ieee80211.txt
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ieee80211.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
 create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
Signature · 1 line
2.30.2
author maintainer
#1 lore raw

PATCH v3 1/2 dt-bindings:net:wireless:ieee80211: txt to yaml conversion

Convert generic ieee80211 dts bindings from .txt to .yaml

---
 .../bindings/net/wireless/ieee80211.txt       | 24 ----------
 .../bindings/net/wireless/ieee80211.yaml      | 45 +++++++++++++++++++
 2 files changed, 45 insertions(+), 24 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/wireless/ieee80211.txt
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ieee80211.yaml
Documentation/devicetree/bindings/net/wireless/ieee80211.txt deleted +0 -24
deleted file mode 100644
index f6442b1397f5..000000000000
@@ -1,24 +0,0 @@
-Common IEEE 802.11 properties
-
-This provides documentation of common properties that are valid for all wireless
-devices.
-
-Optional properties:
- - ieee80211-freq-limit : list of supported frequency ranges in KHz. This can be
-	used for devices that in a given config support less channels than
-	normally. It may happen chipset supports a wide wireless band but it is
-	limited to some part of it due to used antennas or power amplifier.
-	An example case for this can be tri-band wireless router with two
-	identical chipsets used for two different 5 GHz subbands. Using them
-	incorrectly could not work or decrease performance noticeably.
-
-Example:
-
-pcie@0,0 {
-	reg = <0x0000 0 0 0 0>;
-	wifi@0,0 {
-		reg = <0x0000 0 0 0 0>;
-		ieee80211-freq-limit = <2402000 2482000>,
-				       <5170000 5250000>;
-	};
-};
Documentation/devicetree/bindings/net/wireless/ieee80211.yaml new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.30.2
author maintainer
#3 lore raw

PATCH v3 2/2 dt-bindings:net:wireless:mediatek,mt76: txt to yaml conversion

In reply to Lorenzo Bianconi

Convert mt76 dts bindings from .txt to .yaml

---
 .../bindings/net/wireless/mediatek,mt76.txt   |  78 -----------
 .../bindings/net/wireless/mediatek,mt76.yaml  | 122 ++++++++++++++++++
 2 files changed, 122 insertions(+), 78 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
 create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt deleted +0 -78
deleted file mode 100644
index ab7e7a00e534..000000000000
@@ -1,78 +0,0 @@
-* MediaTek mt76xx devices
-
-This node provides properties for configuring the MediaTek mt76xx wireless
-device. The node is expected to be specified as a child node of the PCI
-controller to which the wireless chip is connected.
-
-Alternatively, it can specify the wireless part of the MT7628/MT7688 or
-MT7622 SoC. For SoC, use the following compatible strings:
-
-compatible:
-- "mediatek,mt7628-wmac" for MT7628/MT7688
-- "mediatek,mt7622-wmac" for MT7622
-
-properties:
-- reg: Address and length of the register set for the device.
-- interrupts: Main device interrupt
-
-MT7622 specific properties:
-- power-domains: phandle to the power domain that the WMAC is part of
-- mediatek,infracfg: phandle to the infrastructure bus fabric syscon node
-
-Optional properties:
-
-- ieee80211-freq-limit: See ieee80211.txt
-- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
-- big-endian: if the radio eeprom partition is written in big-endian, specify
-  this property
-- mediatek,eeprom-merge-otp: Merge EEPROM data with OTP data. Can be used on
-  boards where the flash calibration data is generic and specific calibration
-  data should be pulled from the OTP ROM
-
-The MAC address can as well be set with corresponding optional properties
-defined in net/ethernet.txt.
-
-Optional nodes:
-- led: Properties for a connected LED
-  Optional properties:
-    - led-sources: See Documentation/devicetree/bindings/leds/common.txt
-
-&pcie {
-	pcie0 {
-		wifi@0,0 {
-			compatible = "mediatek,mt76";
-			reg = <0x0000 0 0 0 0>;
-			ieee80211-freq-limit = <5000000 6000000>;
-			mediatek,mtd-eeprom = <&factory 0x8000>;
-			big-endian;
-
-			led {
-				led-sources = <2>;
-			};
-		};
-	};
-};
-
-MT7628 example:
-
-wmac: wmac@10300000 {
-	compatible = "mediatek,mt7628-wmac";
-	reg = <0x10300000 0x100000>;
-
-	interrupt-parent = <&cpuintc>;
-	interrupts = <6>;
-
-	mediatek,mtd-eeprom = <&factory 0x0000>;
-};
-
-MT7622 example:
-
-wmac: wmac@18000000 {
-	compatible = "mediatek,mt7622-wmac";
-	reg = <0 0x18000000 0 0x100000>;
-	interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_LOW>;
-
-	mediatek,infracfg = <&infracfg>;
-
-	power-domains = <&scpsys MT7622_POWER_DOMAIN_WB>;
-};
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +122 -0

122 lines not on this page · raw message

Signature · 1 line
2.30.2
maintainer Reviewed-by on v3 1/2
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings:net:wireless:ieee80211: txt to yaml conversion

In reply to Lorenzo Bianconi
Quoted 10 lines · Lorenzo Bianconi

Convert generic ieee80211 dts bindings from .txt to .yaml

---
 .../bindings/net/wireless/ieee80211.txt       | 24 ----------
 .../bindings/net/wireless/ieee80211.yaml      | 45 +++++++++++++++++++
 2 files changed, 45 insertions(+), 24 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/wireless/ieee80211.txt
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ieee80211.yaml
maintainer
#4 lore raw

Re: [PATCH v3 2/2] dt-bindings:net:wireless:mediatek,mt76: txt to yaml conversion

In reply to Lorenzo Bianconi
Quoted 139 lines · Lorenzo Bianconi

Convert mt76 dts bindings from .txt to .yaml

---
 .../bindings/net/wireless/mediatek,mt76.txt   |  78 -----------
 .../bindings/net/wireless/mediatek,mt76.yaml  | 122 ++++++++++++++++++
 2 files changed, 122 insertions(+), 78 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
 create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt deleted +0 -78
deleted file mode 100644
index ab7e7a00e534..000000000000
@@ -1,78 +0,0 @@
-* MediaTek mt76xx devices
-
-This node provides properties for configuring the MediaTek mt76xx wireless
-device. The node is expected to be specified as a child node of the PCI
-controller to which the wireless chip is connected.
-
-Alternatively, it can specify the wireless part of the MT7628/MT7688 or
-MT7622 SoC. For SoC, use the following compatible strings:
-
-compatible:
-- "mediatek,mt7628-wmac" for MT7628/MT7688
-- "mediatek,mt7622-wmac" for MT7622
-
-properties:
-- reg: Address and length of the register set for the device.
-- interrupts: Main device interrupt
-
-MT7622 specific properties:
-- power-domains: phandle to the power domain that the WMAC is part of
-- mediatek,infracfg: phandle to the infrastructure bus fabric syscon node
-
-Optional properties:
-
-- ieee80211-freq-limit: See ieee80211.txt
-- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
-- big-endian: if the radio eeprom partition is written in big-endian, specify
-  this property
-- mediatek,eeprom-merge-otp: Merge EEPROM data with OTP data. Can be used on
-  boards where the flash calibration data is generic and specific calibration
-  data should be pulled from the OTP ROM
-
-The MAC address can as well be set with corresponding optional properties
-defined in net/ethernet.txt.
-
-Optional nodes:
-- led: Properties for a connected LED
-  Optional properties:
-    - led-sources: See Documentation/devicetree/bindings/leds/common.txt
-
-&pcie {
-	pcie0 {
-		wifi@0,0 {
-			compatible = "mediatek,mt76";
-			reg = <0x0000 0 0 0 0>;
-			ieee80211-freq-limit = <5000000 6000000>;
-			mediatek,mtd-eeprom = <&factory 0x8000>;
-			big-endian;
-
-			led {
-				led-sources = <2>;
-			};
-		};
-	};
-};
-
-MT7628 example:
-
-wmac: wmac@10300000 {
-	compatible = "mediatek,mt7628-wmac";
-	reg = <0x10300000 0x100000>;
-
-	interrupt-parent = <&cpuintc>;
-	interrupts = <6>;
-
-	mediatek,mtd-eeprom = <&factory 0x0000>;
-};
-
-MT7622 example:
-
-wmac: wmac@18000000 {
-	compatible = "mediatek,mt7622-wmac";
-	reg = <0 0x18000000 0 0x100000>;
-	interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_LOW>;
-
-	mediatek,infracfg = <&infracfg>;
-
-	power-domains = <&scpsys MT7622_POWER_DOMAIN_WB>;
-};
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +39 -0
new file mode 100644
index 000000000000..65b2d82caad4
@@ -0,0 +1,122 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/wireless/mediatek,mt76.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek mt76 wireless devices Generic Binding
+
+maintainers:
+  - Felix Fietkau <[email protected]>
+  - Lorenzo Bianconi <[email protected]>
+  - Ryder Lee <[email protected]>
+
+description: |
+  This node provides properties for configuring the MediaTek mt76xx
+  wireless device. The node is expected to be specified as a child
+  node of the PCI controller to which the wireless chip is connected.
+  Alternatively, it can specify the wireless part of the MT7628/MT7688
+  or MT7622 SoC.
+
+allOf:
+  - $ref: ieee80211.yaml#
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt76
+      - mediatek,mt7628-wmac
+      - mediatek,mt7622-wmac
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  power-domains:

Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml line 49

Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +10 -0
+    maxItems: 1
+
+  mediatek,infracfg:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to the infrastructure bus fabric syscon node.
+      This property is MT7622 specific
+
+  ieee80211-freq-limit:
+    $ref: ieee80211.yaml#

Drop the $ref.

Just 'ieee80211-freq-limit: true' unless there are some constraints you can define like how many entries.

Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml line 59

Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +10 -0
+
+  mediatek,mtd-eeprom:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Phandle to a MTD partition + offset containing EEPROM data
+
+  big-endian:
+    type: boolean
+    description:
+      Specify if the radio eeprom partition is written in big-endian

That's not how this property is defined. It applied to how 'reg' is accessed. But I guess it's already used...

Quoted 11 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +11 -0
+
+  mediatek,eeprom-merge-otp:
+    type: boolean
+    description:
+      Merge EEPROM data with OTP data. Can be used on boards where the flash
+      calibration data is generic and specific calibration data should be
+      pulled from the OTP ROM
+
+  led:
+    type: object
+    $ref: /schemas/leds/common.yaml#

Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml line 80

Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +10 -0
+    additionalProperties: false
+    properties:
+      led-sources:
+        maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false

'additionalProperties: false' should work here and is a bit stricter.

Quoted 45 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +42 -0
+
+examples:
+  - |
+    pcie0 {
+      #address-cells = <3>;
+      #size-cells = <2>;
+      wifi@0,0 {
+        compatible = "mediatek,mt76";
+        reg = <0x0000 0 0 0 0>;
+        ieee80211-freq-limit = <5000000 6000000>;
+        mediatek,mtd-eeprom = <&factory 0x8000>;
+        big-endian;
+
+        led {
+          led-sources = <2>;
+        };
+      };
+    };
+
+  - |
+    wifi@10300000 {
+      compatible = "mediatek,mt7628-wmac";
+      reg = <0x10300000 0x100000>;
+
+      interrupt-parent = <&cpuintc>;
+      interrupts = <6>;
+
+      mediatek,mtd-eeprom = <&factory 0x0>;
+    };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    wifi@18000000 {
+      compatible = "mediatek,mt7622-wmac";
+      reg = <0x10300000 0x100000>;
+      interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_LOW>;
+
+      mediatek,infracfg = <&infracfg>;
+
+      power-domains = <&scpsys 3>;
+    };
Signature · 1 line
2.30.2