diff mbox series

[v4,2/5] dt-bindings: net: Add bindings for AX88796C SPI Ethernet Adapter

Message ID 20201028214012.9712-3-l.stelmach@samsung.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series [v4,1/5] dt-bindings: vendor-prefixes: Add asix prefix | expand

Commit Message

Lukasz Stelmach Oct. 28, 2020, 9:40 p.m. UTC
Add bindings for AX88796C SPI Ethernet Adapter.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
---
 .../bindings/net/asix,ax88796c.yaml           | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/asix,ax88796c.yaml

Comments

Rob Herring (Arm) Oct. 29, 2020, 3:28 p.m. UTC | #1
On Wed, 28 Oct 2020 22:40:09 +0100, Łukasz Stelmach wrote:
> Add bindings for AX88796C SPI Ethernet Adapter.
> 
> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
> ---
>  .../bindings/net/asix,ax88796c.yaml           | 69 +++++++++++++++++++
>  1 file changed, 69 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/asix,ax88796c.yaml
> 


My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/net/asix,ax88796c.example.dts:23.13-25: Warning (reg_format): /example-0/ethernet@0:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Documentation/devicetree/bindings/net/asix,ax88796c.example.dt.yaml: Warning (pci_device_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/net/asix,ax88796c.example.dt.yaml: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/net/asix,ax88796c.example.dt.yaml: Warning (simple_bus_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/net/asix,ax88796c.example.dt.yaml: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/net/asix,ax88796c.example.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/asix,ax88796c.example.dt.yaml: example-0: ethernet@0:reg:0: [0] is too short
	From schema: /usr/local/lib/python3.8/dist-packages/dtschema/schemas/reg.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/asix,ax88796c.example.dt.yaml: ethernet@0: 'interrupt-parrent' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/asix,ax88796c.yaml


See https://patchwork.ozlabs.org/patch/1389785

The base for the patch is generally the last rc1. Any dependencies
should be noted.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Marc Kleine-Budde Oct. 29, 2020, 5:06 p.m. UTC | #2
On 10/28/20 10:40 PM, Łukasz Stelmach wrote:
> Add bindings for AX88796C SPI Ethernet Adapter.
> 
> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
> ---
>  .../bindings/net/asix,ax88796c.yaml           | 69 +++++++++++++++++++
>  1 file changed, 69 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/asix,ax88796c.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/asix,ax88796c.yaml b/Documentation/devicetree/bindings/net/asix,ax88796c.yaml
> new file mode 100644
> index 000000000000..05093c1ec509
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/asix,ax88796c.yaml
> @@ -0,0 +1,69 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/asix,ax88796c.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ASIX AX88796C SPI Ethernet Adapter
> +
> +maintainers:
> +  - Łukasz Stelmach <l.stelmach@samsung.com>
> +
> +description: |
> +  ASIX AX88796C is an Ethernet controller with a built in PHY. This
> +  describes SPI mode of the chip.
> +
> +  The node for this driver must be a child node of an SPI controller,
> +  hence all mandatory properties described in
> +  ../spi/spi-controller.yaml must be specified.
> +
> +allOf:
> +  - $ref: ethernet-controller.yaml#
> +
> +properties:
> +  compatible:
> +    const: asix,ax88796c
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency:
> +    maximum: 40000000
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  reset-gpios:
> +    description:
> +      A GPIO line handling reset of the chip. As the line is active low,
> +      it should be marked GPIO_ACTIVE_LOW.
> +    maxItems: 1
> +
> +  local-mac-address: true
> +
> +  mac-address: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - spi-max-frequency
> +  - interrupts
> +  - interrupt-parrent
                   ^^

typo?

Marc
Lukasz Stelmach Oct. 29, 2020, 8:06 p.m. UTC | #3
It was <2020-10-29 czw 18:06>, when Marc Kleine-Budde wrote:
> On 10/28/20 10:40 PM, Łukasz Stelmach wrote:
>> Add bindings for AX88796C SPI Ethernet Adapter.
>> 
>> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
>> ---
>>  .../bindings/net/asix,ax88796c.yaml           | 69 +++++++++++++++++++
>>  1 file changed, 69 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/asix,ax88796c.yaml
>> 
>> diff --git
>> a/Documentation/devicetree/bindings/net/asix,ax88796c.yaml
>> b/Documentation/devicetree/bindings/net/asix,ax88796c.yaml
>> new file mode 100644
>> index 000000000000..05093c1ec509

[...]

>> +  - interrupts
>> +  - interrupt-parrent
>                    ^^
>
> typo?

Indeed, removing this but thanks anyway.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/asix,ax88796c.yaml b/Documentation/devicetree/bindings/net/asix,ax88796c.yaml
new file mode 100644
index 000000000000..05093c1ec509
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/asix,ax88796c.yaml
@@ -0,0 +1,69 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/asix,ax88796c.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ASIX AX88796C SPI Ethernet Adapter
+
+maintainers:
+  - Łukasz Stelmach <l.stelmach@samsung.com>
+
+description: |
+  ASIX AX88796C is an Ethernet controller with a built in PHY. This
+  describes SPI mode of the chip.
+
+  The node for this driver must be a child node of an SPI controller,
+  hence all mandatory properties described in
+  ../spi/spi-controller.yaml must be specified.
+
+allOf:
+  - $ref: ethernet-controller.yaml#
+
+properties:
+  compatible:
+    const: asix,ax88796c
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 40000000
+
+  interrupts:
+    maxItems: 1
+
+  reset-gpios:
+    description:
+      A GPIO line handling reset of the chip. As the line is active low,
+      it should be marked GPIO_ACTIVE_LOW.
+    maxItems: 1
+
+  local-mac-address: true
+
+  mac-address: true
+
+required:
+  - compatible
+  - reg
+  - spi-max-frequency
+  - interrupts
+  - interrupt-parrent
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+  # Artik5 eval board
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/gpio/gpio.h>
+    ethernet@0 {
+        compatible = "asix,ax88796c";
+        reg = <0x0>;
+        local-mac-address = [00 00 00 00 00 00]; /* Filled in by a bootloader */
+        interrupt-parent = <&gpx2>;
+        interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+        spi-max-frequency = <40000000>;
+        reset-gpios = <&gpe0 2 GPIO_ACTIVE_LOW>;
+    };