linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check
@ 2021-09-24  7:27 Maxime Ripard
  2021-09-24  7:27 ` [RESEND v2 2/4] dt-bindings: bluetooth: realtek: Add missing max-speed Maxime Ripard
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Maxime Ripard @ 2021-09-24  7:27 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard, Jernej Škrabec, Rob Herring,
	Frank Rowand
  Cc: linux-arm-kernel, devicetree, linux-sunxi, David S. Miller,
	Jakub Kicinski, netdev, Linus Walleij, Rob Herring

The original binding was mentioning that valid values for the clocks and
clock-names property were one or two clocks from extclk, txco and lpo,
with extclk being deprecated in favor of txco.

However, the current binding lists a valid array as extclk, txco and
lpo, with either one or two items.

While this looks similar, it actually enforces that all the device trees
use either ["extclk"], or ["extclk", "txco"]. That doesn't make much
sense, since the two clocks are said to be equivalent, with one
superseeding the other.

lpo is also not a valid clock anymore, and would be as the third clock
of the list, while we could have only this clock in the previous binding
(and in DTs).

Let's rework the clock clause to allow to have either:

 - extclk, and mark it a deprecated
 - txco alone
 - lpo alone
 - txco, lpo

While ["extclk", "lpo"] wouldn't be valid, it wasn't found in any device
tree so it's not an issue in practice.

Similarly, ["lpo", "txco"] is still considered invalid, but it's
generally considered as a best practice to fix the order of clocks.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 .../bindings/net/broadcom-bluetooth.yaml        | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
index fbdc2083bec4..5aac094fd217 100644
--- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
+++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
@@ -50,16 +50,29 @@ properties:
       by interrupts and "host-wakeup" interrupt-names
 
   clocks:
+    minItems: 1
     maxItems: 2
     description: 1 or 2 clocks as defined in clock-names below,
       in that order
 
   clock-names:
     description: Names of the 1 to 2 supplied clocks
-    items:
+    oneOf:
+      - const: extclk
+        deprecated: true
+        description: Deprecated in favor of txco
+
       - const: txco
+        description: >
+          external reference clock (not a standalone crystal)
+
       - const: lpo
-      - const: extclk
+        description: >
+          external low power 32.768 kHz clock
+
+      - items:
+          - const: txco
+          - const: lpo
 
   vbat-supply:
     description: phandle to regulator supply for VBAT
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RESEND v2 2/4] dt-bindings: bluetooth: realtek: Add missing max-speed
  2021-09-24  7:27 [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check Maxime Ripard
@ 2021-09-24  7:27 ` Maxime Ripard
  2021-09-24  7:27 ` [RESEND v2 3/4] dt-bindings: net: dwmac: Fix typo in the R40 compatible Maxime Ripard
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2021-09-24  7:27 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard, Jernej Škrabec, Rob Herring,
	Frank Rowand
  Cc: linux-arm-kernel, devicetree, linux-sunxi, Alistair Francis,
	David S. Miller, Jakub Kicinski, netdev, Vasily Khoruzhick,
	Rob Herring

additionalProperties prevent any property not explicitly defined in the
binding to be used. Yet, some serial properties like max-speed are valid
and validated through the serial/serial.yaml binding.

Even though the ideal solution would be to use unevaluatedProperties
instead, it's not pratical due to the way the bus bindings have been
described. Let's add max-speed to remove the warning.

Cc: Alistair Francis <alistair@alistair23.me>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
Cc: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 Documentation/devicetree/bindings/net/realtek-bluetooth.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
index 0634e69dd9a6..157d606bf9cb 100644
--- a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
+++ b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
@@ -34,6 +34,8 @@ properties:
     maxItems: 1
     description: GPIO specifier, used to wakeup the host processor
 
+  max-speed: true
+
 required:
   - compatible
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RESEND v2 3/4] dt-bindings: net: dwmac: Fix typo in the R40 compatible
  2021-09-24  7:27 [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check Maxime Ripard
  2021-09-24  7:27 ` [RESEND v2 2/4] dt-bindings: bluetooth: realtek: Add missing max-speed Maxime Ripard
@ 2021-09-24  7:27 ` Maxime Ripard
  2021-09-24  7:27 ` [RESEND v2 4/4] dt-bindings: net: wireless: Convert ESP ESP8089 binding to a schema Maxime Ripard
  2021-10-12 14:08 ` [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check Rob Herring
  3 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2021-09-24  7:27 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard, Jernej Škrabec, Rob Herring,
	Frank Rowand
  Cc: linux-arm-kernel, devicetree, linux-sunxi, Alexandre Torgue,
	David S. Miller, Giuseppe Cavallaro, Jakub Kicinski, Jose Abreu,
	netdev, Rob Herring

Even though both the driver and the device trees all use the
allwinner,sun8i-r40-gmac compatible, we documented the compatible as
allwinner,sun8i-r40-emac in the binding. Let's fix this.

Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: netdev@vger.kernel.org
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml  | 4 ++--
 Documentation/devicetree/bindings/net/snps,dwmac.yaml       | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
index 9eb4bb529ad5..407586bc366b 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
@@ -15,7 +15,7 @@ properties:
     oneOf:
       - const: allwinner,sun8i-a83t-emac
       - const: allwinner,sun8i-h3-emac
-      - const: allwinner,sun8i-r40-emac
+      - const: allwinner,sun8i-r40-gmac
       - const: allwinner,sun8i-v3s-emac
       - const: allwinner,sun50i-a64-emac
       - items:
@@ -93,7 +93,7 @@ allOf:
         compatible:
           contains:
             enum:
-              - allwinner,sun8i-r40-emac
+              - allwinner,sun8i-r40-gmac
 
     then:
       properties:
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 42689b7d03a2..3de8bca418f0 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -49,7 +49,7 @@ properties:
         - allwinner,sun7i-a20-gmac
         - allwinner,sun8i-a83t-emac
         - allwinner,sun8i-h3-emac
-        - allwinner,sun8i-r40-emac
+        - allwinner,sun8i-r40-gmac
         - allwinner,sun8i-v3s-emac
         - allwinner,sun50i-a64-emac
         - loongson,ls2k-dwmac
@@ -316,7 +316,7 @@ allOf:
               - allwinner,sun7i-a20-gmac
               - allwinner,sun8i-a83t-emac
               - allwinner,sun8i-h3-emac
-              - allwinner,sun8i-r40-emac
+              - allwinner,sun8i-r40-gmac
               - allwinner,sun8i-v3s-emac
               - allwinner,sun50i-a64-emac
               - ingenic,jz4775-mac
@@ -364,7 +364,7 @@ allOf:
               - allwinner,sun7i-a20-gmac
               - allwinner,sun8i-a83t-emac
               - allwinner,sun8i-h3-emac
-              - allwinner,sun8i-r40-emac
+              - allwinner,sun8i-r40-gmac
               - allwinner,sun8i-v3s-emac
               - allwinner,sun50i-a64-emac
               - loongson,ls2k-dwmac
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RESEND v2 4/4] dt-bindings: net: wireless: Convert ESP ESP8089 binding to a schema
  2021-09-24  7:27 [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check Maxime Ripard
  2021-09-24  7:27 ` [RESEND v2 2/4] dt-bindings: bluetooth: realtek: Add missing max-speed Maxime Ripard
  2021-09-24  7:27 ` [RESEND v2 3/4] dt-bindings: net: dwmac: Fix typo in the R40 compatible Maxime Ripard
@ 2021-09-24  7:27 ` Maxime Ripard
  2021-10-12 14:08 ` [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check Rob Herring
  3 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2021-09-24  7:27 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard, Jernej Škrabec, Rob Herring,
	Frank Rowand
  Cc: linux-arm-kernel, devicetree, linux-sunxi, David S. Miller,
	de Goede, Jakub Kicinski, Kalle Valo, linux-wireless, netdev,
	Rob Herring

The ESP8089 Wireless Chip is supported by Linux (through an out-of-tree
driver) thanks to its device tree binding.

Now that we have the DT validation in place, let's convert the device
tree bindings for that driver over to a YAML schema.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: de Goede <hdegoede@redhat.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 .../bindings/net/wireless/esp,esp8089.txt     | 30 -------------
 .../bindings/net/wireless/esp,esp8089.yaml    | 43 +++++++++++++++++++
 2 files changed, 43 insertions(+), 30 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/wireless/esp,esp8089.txt
 create mode 100644 Documentation/devicetree/bindings/net/wireless/esp,esp8089.yaml

diff --git a/Documentation/devicetree/bindings/net/wireless/esp,esp8089.txt b/Documentation/devicetree/bindings/net/wireless/esp,esp8089.txt
deleted file mode 100644
index 6830c4786f8a..000000000000
--- a/Documentation/devicetree/bindings/net/wireless/esp,esp8089.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-Espressif ESP8089 wireless SDIO devices
-
-This node provides properties for controlling the ESP8089 wireless device.
-The node is expected to be specified as a child node to the SDIO controller
-that connects the device to the system.
-
-Required properties:
-
- - compatible : Should be "esp,esp8089".
-
-Optional properties:
- - esp,crystal-26M-en: Integer value for the crystal_26M_en firmware parameter
-
-Example:
-
-&mmc1 {
-	#address-cells = <1>;
-	#size-cells = <0>;
-
-	vmmc-supply = <&reg_dldo1>;
-	mmc-pwrseq = <&wifi_pwrseq>;
-	bus-width = <4>;
-	non-removable;
-
-	esp8089: sdio_wifi@1 {
-		compatible = "esp,esp8089";
-		reg = <1>;
-		esp,crystal-26M-en = <2>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/net/wireless/esp,esp8089.yaml b/Documentation/devicetree/bindings/net/wireless/esp,esp8089.yaml
new file mode 100644
index 000000000000..284ef45add99
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/esp,esp8089.yaml
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/wireless/esp,esp8089.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Espressif ESP8089 Device Tree Bindings
+
+maintainers:
+  - Hans de Goede <hdegoede@redhat.com>
+
+properties:
+  compatible:
+    const: esp,esp8089
+
+  reg:
+    maxItems: 1
+
+  esp,crystal-26M-en:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: >
+      Value for the crystal_26M_en firmware parameter
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+      mmc {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          wifi@1 {
+              compatible = "esp,esp8089";
+              reg = <1>;
+              esp,crystal-26M-en = <2>;
+          };
+      };
+
+...
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check
  2021-09-24  7:27 [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check Maxime Ripard
                   ` (2 preceding siblings ...)
  2021-09-24  7:27 ` [RESEND v2 4/4] dt-bindings: net: wireless: Convert ESP ESP8089 binding to a schema Maxime Ripard
@ 2021-10-12 14:08 ` Rob Herring
  3 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2021-10-12 14:08 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Jernej Škrabec, Frank Rowand,
	linux-arm-kernel, devicetree, linux-sunxi, David S. Miller,
	Jakub Kicinski, netdev, Linus Walleij

On Fri, Sep 24, 2021 at 09:27:53AM +0200, Maxime Ripard wrote:
> The original binding was mentioning that valid values for the clocks and
> clock-names property were one or two clocks from extclk, txco and lpo,
> with extclk being deprecated in favor of txco.
> 
> However, the current binding lists a valid array as extclk, txco and
> lpo, with either one or two items.
> 
> While this looks similar, it actually enforces that all the device trees
> use either ["extclk"], or ["extclk", "txco"]. That doesn't make much
> sense, since the two clocks are said to be equivalent, with one
> superseeding the other.
> 
> lpo is also not a valid clock anymore, and would be as the third clock
> of the list, while we could have only this clock in the previous binding
> (and in DTs).
> 
> Let's rework the clock clause to allow to have either:
> 
>  - extclk, and mark it a deprecated
>  - txco alone
>  - lpo alone
>  - txco, lpo
> 
> While ["extclk", "lpo"] wouldn't be valid, it wasn't found in any device
> tree so it's not an issue in practice.
> 
> Similarly, ["lpo", "txco"] is still considered invalid, but it's
> generally considered as a best practice to fix the order of clocks.
> 
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: netdev@vger.kernel.org
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>  .../bindings/net/broadcom-bluetooth.yaml        | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)

I've applied this and the rest of the series.

Rob

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-12 14:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24  7:27 [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check Maxime Ripard
2021-09-24  7:27 ` [RESEND v2 2/4] dt-bindings: bluetooth: realtek: Add missing max-speed Maxime Ripard
2021-09-24  7:27 ` [RESEND v2 3/4] dt-bindings: net: dwmac: Fix typo in the R40 compatible Maxime Ripard
2021-09-24  7:27 ` [RESEND v2 4/4] dt-bindings: net: wireless: Convert ESP ESP8089 binding to a schema Maxime Ripard
2021-10-12 14:08 ` [RESEND v2 1/4] dt-bindings: bluetooth: broadcom: Fix clocks check Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).