Skip to contentSkip to conversation

dt-bindings: convert mt76 and ieee80211 in yaml

PATCH Superseded Lorenzo Bianconi 3 participants 7 messages Mar 14, 2021 – Mar 24, 2021

Subsystems (4)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Lorenzo Bianconi

author maintainer
#0 lore raw

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

Convert mt76 and ieee802111 dts bindings from .txt to .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      |  41 ++++++
 .../bindings/net/wireless/mediatek,mt76.txt   |  78 ------------
 .../bindings/net/wireless/mediatek,mt76.yaml  | 117 ++++++++++++++++++
 4 files changed, 158 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.29.2
author maintainer
#1 lore raw

PATCH v2 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      | 41 +++++++++++++++++++
 2 files changed, 41 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 +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.29.2
author maintainer
#5 lore raw

PATCH v2 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  | 117 ++++++++++++++++++
 2 files changed, 117 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 +117 -0

117 lines not on this page · raw message

Signature · 1 line
2.29.2
maintainer
#2 lore raw

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

In reply to Lorenzo Bianconi
Quoted 55 lines · Lorenzo Bianconi

Convert generic ieee80211 dts bindings from .txt to .yaml

---
 .../bindings/net/wireless/ieee80211.txt       | 24 -----------
 .../bindings/net/wireless/ieee80211.yaml      | 41 +++++++++++++++++++
 2 files changed, 41 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 +9 -0
new file mode 100644
index 000000000000..6fb9ae7403c1
@@ -0,0 +1,41 @@
+# 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/ieee80211.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common IEEE 802.11 Binding

Documentation/devicetree/bindings/net/wireless/ieee80211.yaml line 19

Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/ieee80211.yaml new file +10 -0
+
+maintainers:
+  - Johannes Berg <[email protected]>
+
+description: |
+  This provides documentation of common properties that are valid for
+  all wireless devices
+
+properties:
+  ieee80211-freq-limit:

Needs a type ref:

$ref: /schemas/types.yaml#/definitions/uint32-matrix items:
minItems: 2
maxItems: 2

Quoted 25 lines
Documentation/devicetree/bindings/net/wireless/ieee80211.yaml new file +22 -0
+    description:
+      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
+
+additionalProperties: true
+
+examples:
+  - |
+    pcie0 {
+      #address-cells = <3>;
+      #size-cells = <2>;
+      wifi@0,0 {
+        reg = <0x0000 0 0 0 0>;
+        ieee80211-freq-limit = <2402000 2482000>,
+                               <5170000 5250000>;
+      };
+    };
Signature · 1 line
2.29.2
maintainer
#6 lore raw

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

In reply to Lorenzo Bianconi
Quoted 135 lines · Lorenzo Bianconi

Convert mt76 dts bindings from .txt to .yaml

---
 .../bindings/net/wireless/mediatek,mt76.txt   |  78 ------------
 .../bindings/net/wireless/mediatek,mt76.yaml  | 117 ++++++++++++++++++
 2 files changed, 117 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 +35 -0
new file mode 100644
index 000000000000..f472a09609e8
@@ -0,0 +1,117 @@
+# 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]>
+
+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.
+
+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 45

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#

This is defining a node 'ieee80211-freq-limit' which in turn has property 'ieee80211-freq-limit'. You need before 'properties':

allOf:
- $ref: ieee80211.yaml#

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

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

Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +10 -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#
additionalProperties: false

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

Quoted 3 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +3 -0
+    properties:
+      led-sources:
+        maxItems: 1

And then drop all this:

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

Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +9 -0
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        description:
+          List of device current outputs the LED is connected to
 
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false

With the above, this will need to be:

unevaluatedProperties: false

Quoted 11 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +11 -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>;

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

Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +10 -0
+        big-endian;
+
+        led {
+          led-sources = <2>;
+        };
+      };
+    };
+
+  - |
+    wmac: wmac@10300000 {

wifi@...

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

Quoted 11 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +11 -0
+      compatible = "mediatek,mt7628-wmac";
+      reg = <0x10300000 0x100000>;
+
+      interrupt-parent = <&cpuintc>;
+      interrupts = <6>;
+
+      mediatek,mtd-eeprom = <&factory 0x0>;
+    };
+
+  - |
+    wlmac: wmac@18000000 {

wifi@...

Quoted 11 lines
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml new file +8 -0
+      compatible = "mediatek,mt7622-wmac";
+      reg = <0x10300000 0x100000>;
+      interrupts = <0 211 8>;
+
+      mediatek,infracfg = <&infracfg>;
+
+      power-domains = <&scpsys 3>;
+    };
Signature · 1 line
2.29.2
maintainer
#3 lore raw

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

In reply to Lorenzo Bianconi
Quoted 5 lines · Lorenzo Bianconi

+++ b/Documentation/devicetree/bindings/net/wireless/ieee80211.yaml

Documentation/devicetree/bindings/net/wireless/ieee80211.yaml new file +2 -0
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.

Documentation/devicetree/bindings/net/wireless/ieee80211.yaml line 12

Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/ieee80211.yaml new file +10 -0
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/wireless/ieee80211.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common IEEE 802.11 Binding
+
+maintainers:
+  - Johannes Berg <[email protected]>

Heh, now I realize why I got CC'ed on these patches.

I'm not sure that's really all that appropriate? I may be the wireless stack maintainer, but I really don't know much about DT, and so I'm not convinced that this entry helps anyone...

johannes

author maintainer
#4 lore raw

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

Quoted 19 lines · Lorenzo Bianconi
Quoted 5 lines

+++ b/Documentation/devicetree/bindings/net/wireless/ieee80211.yaml

Documentation/devicetree/bindings/net/wireless/ieee80211.yaml new file +2 -0
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.

Documentation/devicetree/bindings/net/wireless/ieee80211.yaml line 12

Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/ieee80211.yaml new file +10 -0
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/wireless/ieee80211.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common IEEE 802.11 Binding
+
+maintainers:
+  - Johannes Berg <[email protected]>

Heh, now I realize why I got CC'ed on these patches.

Quoted 3 lines

I'm not sure that's really all that appropriate? I may be the wireless stack maintainer, but I really don't know much about DT, and so I'm not convinced that this entry helps anyone...

ack, I will add myself as maintainer (but I am not an expert as well :))

Regards,
Lorenzo

Quoted 3 lines

johannes