All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Dinh Nguyen <dinguyen@kernel.org>
Cc: krzysztof.kozlowskii+dt@linaro.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: net: convert socfpga-dwmac.txt to DT schema
Date: Mon, 23 Jun 2025 17:20:57 -0500	[thread overview]
Message-ID: <20250623222057.GA1259495-robh@kernel.org> (raw)
In-Reply-To: <20250621034401.586780-1-dinguyen@kernel.org>

On Fri, Jun 20, 2025 at 10:44:01PM -0500, Dinh Nguyen wrote:
> Convert the socfpga-dwmac.txt to yaml.
> 
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> ---
>  .../bindings/net/altr,dwmac-socfpga.yaml      | 152 ++++++++++++++++++
>  .../devicetree/bindings/net/socfpga-dwmac.txt |  57 -------
>  2 files changed, 152 insertions(+), 57 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/altr,dwmac-socfpga.yaml
>  delete mode 100644 Documentation/devicetree/bindings/net/socfpga-dwmac.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/altr,dwmac-socfpga.yaml b/Documentation/devicetree/bindings/net/altr,dwmac-socfpga.yaml
> new file mode 100644
> index 000000000000..fc088bd55178
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/altr,dwmac-socfpga.yaml
> @@ -0,0 +1,152 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/altr,dwmac-socfpga.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Intel/Altera SoCFPGA DWMAC controller
> +
> +maintainers:
> +  - Dinh Nguyen <dinguyen@kernel.org>
> +

You'll need a custom 'select' to avoid matching on the common compatible 
strings.

> +properties:
> +  compatible:
> +    additionalItems: true
> +    maxItems: 3
> +    items:
> +      - enum:
> +          - altr,socfpga-stmmac
> +          - altr,socfpga-stmmac-a10-s10
> +    contains:
> +      enum:
> +        - snps,dwmac-3.74a
> +        - snps,dwmac-3.70a
> +        - snps,dwmac

Need to define the exact combinations of compatible strings which are 
valid.

> +
> +  reg:
> +    items:
> +      - description: Base DWMAC registers

Just 'maxItems: 1'

> +
> +  iommus:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clocks:
> +    minItems: 1
> +    items:
> +      - description: MAC host clock
> +      - description: MAC timer clock
> +
> +  clock-names:
> +    minItems: 1
> +    maxItems: 2
> +    contains:
> +      enum:
> +        - stmmaceth
> +        - ptp_ref

'contains' passes if either of these strings is present and allows 
anything for the 2nd string. Use 'items' instead and define the exact 
order and entries.

> +
> +  resets:
> +    minItems: 1
> +    items:
> +      - description: GMAC stmmaceth reset
> +      - description: AHB reset
> +
> +  reset-names:
> +    oneOf:
> +      - items:
> +          - enum: [stmmaceth, ahb]

Drop this and add 'minItems: 1' below.

> +      - items:
> +          - const: stmmaceth
> +          - const: ahb
> +
> +  interrupts:
> +    items:
> +      - description: DWAC interrupt

typo.

> +
> +  interrupt-names:
> +    items:
> +      - const: macirq
> +
> +  mac-address: true

Drop

> +
> +  phy-mode:
> +    maxItems: 1
> +    items:
> +      enum:
> +        - rgmii
> +        - gmii
> +        - mii
> +
> +  tx-fifo-depth:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: DWMAC Tx fifo depth(Stratix10, Agilex)
> +
> +  rx-fifo-depth:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: DWMAC Rx fifo depth(Stratix10, Agilex)

Already defined in ethernet-controller.yaml. Drop unless you have 
additional constaints on them.

> +
> +  snps,multicast-filter-bins:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Number of multicast filter hash bins supported by this device
> +      instance

Already defined in snps,dwmac.yaml. Drop unless you have additional 
constaints on it.

> +
> +  altr,sysmgr-syscon:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    items:
> +      - items:
> +          - description: phandle to the sysmgr node
> +          - description: register offset that controls the SDMMC clock phase
> +          - description: register shift for the smplsel(drive in) setting
> +    description:
> +      Should be the phandle to the system manager node that
> +      encompasses the glue register, the register offset, and the register shift.
> +      On Cyclone5/Arria5, the register shift represents the PHY mode bits, while
> +      on the Arria10/Stratix10/Agilex platforms, the register shift represents
> +      bit for each emac to enable/disable signals from the FPGA fabric to the
> +      EMAC modules.
> +
> +  altr,emac-splitter:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      Should be the phandle to the emac splitter soft IP node if DWMAC
> +      controller is connected emac splitter.
> +
> +  altr,sgmii-to-sgmii-converter:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      Phandle to the TSE SGMII converter.
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - phy-mode
> +
> +allOf:
> +  - $ref: snps,dwmac.yaml#
> +
> +additionalProperties: false

unevaluatedProperties: false

> +
> +examples:
> +  - |
> +    soc {
> +        #address-cells = <1>;
> +        #size-cells = <1>;

Don't need this node.

> +
> +        gmac0: ethernet@ff700000 {
> +            compatible = "altr,socfpga-stmmac", "snps,dwmac-3.70a", "snps,dwmac";
> +            altr,sysmgr-syscon = <&sysmgr 0x60 0>;
> +            reg = <0xff700000 0x2000>;
> +            interrupts = <0 115 4>;
> +            interrupt-names = "macirq";
> +            mac-address = [00 00 00 00 00 00];/* Filled in by U-Boot */
> +            clocks = <&emac_0_clk>;
> +            clock-names = "stmmaceth";
> +            phy-mode = "rgmii";
> +            tx-fifo-depth = <16384>;
> +            rx-fifo-depth = <16384>;
> +       };
> +    };

  parent reply	other threads:[~2025-06-23 22:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-21  3:44 [PATCH] dt-bindings: net: convert socfpga-dwmac.txt to DT schema Dinh Nguyen
2025-06-22 21:55 ` Rob Herring (Arm)
2025-06-23 22:20 ` Rob Herring [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-06-21 16:50 kernel test robot
2025-06-21 17:00 kernel test robot
2025-06-23  9:06 kernel test robot
2025-06-23 17:06 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250623222057.GA1259495-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=krzysztof.kozlowskii+dt@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.