diff mbox series

[v5,2/9] dt-bindings: net: add schema for Microchip/SMSC LAN95xx USB Ethernet controllers

Message ID 20220216074927.3619425-3-o.rempel@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series document dt-schema and fix node names for some USB Ethernet controllers | expand

Commit Message

Oleksij Rempel Feb. 16, 2022, 7:49 a.m. UTC
Create initial schema for Microchip/SMSC LAN95xx USB Ethernet controllers and
import some of currently supported USB IDs form drivers/net/usb/smsc95xx.c

These devices are already used in some of DTs. So, this schema makes it official.
NOTE: there was no previously documented txt based DT binding for this
controllers.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 .../bindings/net/microchip,lan95xx.yaml       | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/microchip,lan95xx.yaml

Comments

Rob Herring (Arm) Feb. 24, 2022, 5:18 p.m. UTC | #1
On Wed, Feb 16, 2022 at 08:49:20AM +0100, Oleksij Rempel wrote:
> Create initial schema for Microchip/SMSC LAN95xx USB Ethernet controllers and
> import some of currently supported USB IDs form drivers/net/usb/smsc95xx.c
> 
> These devices are already used in some of DTs. So, this schema makes it official.
> NOTE: there was no previously documented txt based DT binding for this
> controllers.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  .../bindings/net/microchip,lan95xx.yaml       | 80 +++++++++++++++++++
>  1 file changed, 80 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/microchip,lan95xx.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/microchip,lan95xx.yaml b/Documentation/devicetree/bindings/net/microchip,lan95xx.yaml
> new file mode 100644
> index 000000000000..8521c65366b4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/microchip,lan95xx.yaml
> @@ -0,0 +1,80 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/microchip,lan95xx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: The device tree bindings for the USB Ethernet controllers
> +
> +maintainers:
> +  - Oleksij Rempel <o.rempel@pengutronix.de>
> +
> +description: |
> +  Device tree properties for hard wired SMSC95xx compatible USB Ethernet
> +  controller.
> +
> +allOf:
> +  - $ref: ethernet-controller.yaml#
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - usb424,9500   # SMSC9500 USB Ethernet Device
> +          - usb424,9505   # SMSC9505 USB Ethernet Device
> +          - usb424,9530   # SMSC LAN9530 USB Ethernet Device
> +          - usb424,9730   # SMSC LAN9730 USB Ethernet Device
> +          - usb424,9900   # SMSC9500 USB Ethernet Device (SAL10)
> +          - usb424,9901   # SMSC9505 USB Ethernet Device (SAL10)
> +          - usb424,9902   # SMSC9500A USB Ethernet Device (SAL10)
> +          - usb424,9903   # SMSC9505A USB Ethernet Device (SAL10)
> +          - usb424,9904   # SMSC9512/9514 USB Hub & Ethernet Device (SAL10)
> +          - usb424,9905   # SMSC9500A USB Ethernet Device (HAL)
> +          - usb424,9906   # SMSC9505A USB Ethernet Device (HAL)
> +          - usb424,9907   # SMSC9500 USB Ethernet Device (Alternate ID)
> +          - usb424,9908   # SMSC9500A USB Ethernet Device (Alternate ID)
> +          - usb424,9909   # SMSC9512/9514 USB Hub & Ethernet Devic.  ID)
> +          - usb424,9e00   # SMSC9500A USB Ethernet Device
> +          - usb424,9e01   # SMSC9505A USB Ethernet Device
> +          - usb424,9e08   # SMSC LAN89530 USB Ethernet Device
> +          - usb424,ec00   # SMSC9512/9514 USB Hub & Ethernet Device
> +
> +  reg: true
> +  local-mac-address: true
> +  mac-address: true
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    usb {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        ethernet@1 {
> +            compatible = "usb424,ec00";

If this is a hub/ethernet combo device, how is it valid to be standalone 
without the hub?

> +            reg = <1>;
> +            local-mac-address = [00 00 00 00 00 00];
> +        };
> +    };
> +  - |
> +    usb {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        usb1@1 {
> +            compatible = "usb424,9514";

Not documented.

> +            reg = <1>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            ethernet@1 {
> +               compatible = "usb424,ec00";
> +               reg = <1>;
> +            };
> +        };
> +    };
> -- 
> 2.30.2
> 
>
Oleksij Rempel Feb. 25, 2022, 8:40 a.m. UTC | #2
On Thu, Feb 24, 2022 at 11:18:30AM -0600, Rob Herring wrote:
> On Wed, Feb 16, 2022 at 08:49:20AM +0100, Oleksij Rempel wrote:
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    usb {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        ethernet@1 {
> > +            compatible = "usb424,ec00";
> 
> If this is a hub/ethernet combo device, how is it valid to be standalone 
> without the hub?

What is the best way to describe two type of devices: with and without
hub in package? Have two different schema to keep things simple?

Regards,
Oleksij
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/microchip,lan95xx.yaml b/Documentation/devicetree/bindings/net/microchip,lan95xx.yaml
new file mode 100644
index 000000000000..8521c65366b4
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/microchip,lan95xx.yaml
@@ -0,0 +1,80 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/microchip,lan95xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: The device tree bindings for the USB Ethernet controllers
+
+maintainers:
+  - Oleksij Rempel <o.rempel@pengutronix.de>
+
+description: |
+  Device tree properties for hard wired SMSC95xx compatible USB Ethernet
+  controller.
+
+allOf:
+  - $ref: ethernet-controller.yaml#
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - usb424,9500   # SMSC9500 USB Ethernet Device
+          - usb424,9505   # SMSC9505 USB Ethernet Device
+          - usb424,9530   # SMSC LAN9530 USB Ethernet Device
+          - usb424,9730   # SMSC LAN9730 USB Ethernet Device
+          - usb424,9900   # SMSC9500 USB Ethernet Device (SAL10)
+          - usb424,9901   # SMSC9505 USB Ethernet Device (SAL10)
+          - usb424,9902   # SMSC9500A USB Ethernet Device (SAL10)
+          - usb424,9903   # SMSC9505A USB Ethernet Device (SAL10)
+          - usb424,9904   # SMSC9512/9514 USB Hub & Ethernet Device (SAL10)
+          - usb424,9905   # SMSC9500A USB Ethernet Device (HAL)
+          - usb424,9906   # SMSC9505A USB Ethernet Device (HAL)
+          - usb424,9907   # SMSC9500 USB Ethernet Device (Alternate ID)
+          - usb424,9908   # SMSC9500A USB Ethernet Device (Alternate ID)
+          - usb424,9909   # SMSC9512/9514 USB Hub & Ethernet Devic.  ID)
+          - usb424,9e00   # SMSC9500A USB Ethernet Device
+          - usb424,9e01   # SMSC9505A USB Ethernet Device
+          - usb424,9e08   # SMSC LAN89530 USB Ethernet Device
+          - usb424,ec00   # SMSC9512/9514 USB Hub & Ethernet Device
+
+  reg: true
+  local-mac-address: true
+  mac-address: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    usb {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ethernet@1 {
+            compatible = "usb424,ec00";
+            reg = <1>;
+            local-mac-address = [00 00 00 00 00 00];
+        };
+    };
+  - |
+    usb {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        usb1@1 {
+            compatible = "usb424,9514";
+            reg = <1>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            ethernet@1 {
+               compatible = "usb424,ec00";
+               reg = <1>;
+            };
+        };
+    };