Message ID | 20230424123522.18302-19-nikita.shubin@maquefel.me |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2642503vqo; Mon, 24 Apr 2023 03:33:32 -0700 (PDT) X-Google-Smtp-Source: AKy350bklIhPYVXPJ6ihP5RZ0WgdJGav5Y6ayMqNmoxK6M6euBU2c4JaSarnm0L/1A8Vtzpp6qWP X-Received: by 2002:a05:6a00:1806:b0:63b:67d5:be9c with SMTP id y6-20020a056a00180600b0063b67d5be9cmr18518936pfa.29.1682332412454; Mon, 24 Apr 2023 03:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682332412; cv=none; d=google.com; s=arc-20160816; b=mjLSzWmhw03juZWiNhS0dbixcjbk9+oEeRNFdb7qxVVykAOFzXVczUxdhIsJNXt4/n QgmxmF7RL1pPBArPaQOX0aev45gXxJ0y/PzBD4C5rWd5XSMSh2xeULuVnH801Xjxxbih yXgdjxGvo0wSlHJV9FFng+owfvNgwUujreLflgMSpJDtjv0fJIyJF8middE2LABnkx02 b1vMMl4HHvuzf2MpQxXUF8XWPoQktBBVAvFohCFQQ36kmsGGWd/TqcOwX/aiCtDI+c3D 8RxVBS25VKWw1vqABzF6Cm8s1Lb95oGFEWWfsHXhpsm3G6Tw2RM8dHoUSAqhlJjGnM/0 pP9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=9OWyaTijH8WZgd/u9wb0Try8woOOARXYqCsnpX6d1qM=; b=Ijd1ma/RPgUTNI0E13oiLn79A+p3kk2mSGSXDo0vx3bzeGC3HABYado9N05Hwir0oE lDOHDYVylHd4gvspQJN/qZ7PCWEJap78fKQWivAaD5Ew1tFmbvoSxTliR5V8qFTSxbbF L9rJ0jbupKpnlP6GionpRKNWjXzrclaNCYl+kXd/WxTWAEjIY4XfqCRiYhgfTak79LJ2 PDunyElB/wL7pjbJ+rHTxHEU58gND8GjApuzDSMv+2h+slnAbck85OY/sXIQV3sd8qpC Ha/H3aTfk94pdNO4a7peS3kQK/I9uG/6ImbUQ1tU052dhRQbKNca+/8c0xWAHbTAh8PX tZOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@maquefel.me header.s=mail header.b=nBWGWBMi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t127-20020a625f85000000b0063b897210a4si10827425pfb.14.2023.04.24.03.33.18; Mon, 24 Apr 2023 03:33:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@maquefel.me header.s=mail header.b=nBWGWBMi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231137AbjDXKUv (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Mon, 24 Apr 2023 06:20:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbjDXKUk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Apr 2023 06:20:40 -0400 X-Greylist: delayed 1516 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 24 Apr 2023 03:20:37 PDT Received: from forward501c.mail.yandex.net (forward501c.mail.yandex.net [IPv6:2a02:6b8:c03:500:1:45:d181:d501]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4722010DF; Mon, 24 Apr 2023 03:20:37 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:261e:0:640:2e3d:0]) by forward501c.mail.yandex.net (Yandex) with ESMTP id 7DE0C5EE97; Mon, 24 Apr 2023 12:35:51 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id JZBb1pbWwKo0-71ti2XdL; Mon, 24 Apr 2023 12:35:51 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1682328951; bh=9OWyaTijH8WZgd/u9wb0Try8woOOARXYqCsnpX6d1qM=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=nBWGWBMiM9Od+YnfT7BAtTGa5YQ2BdqzrkqVqtMVbSvilPeSrljQzo0e40adGGbAt VZ/hKmw+vqOkRC0+6yP4k5wVL5MvARibL+ByuJg+cR3DG3Pb6B7vT7wlu5OtzXYVJZ ZKVDu9N7Z/18CSukw+SRwoBx1iquZpX99c0PACbk= Authentication-Results: mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net; dkim=pass header.i=@maquefel.me From: Nikita Shubin <nikita.shubin@maquefel.me> Cc: Arnd Bergmann <arnd@kernel.org>, Linus Walleij <linusw@kernel.org>, Alexander Sverdlin <alexander.sverdlin@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Hartley Sweeten <hsweeten@visionengravers.com>, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/43] dt-bindings: net: Add DT bindings ep93xx eth Date: Mon, 24 Apr 2023 15:34:34 +0300 Message-Id: <20230424123522.18302-19-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230424123522.18302-1-nikita.shubin@maquefel.me> References: <20230424123522.18302-1-nikita.shubin@maquefel.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764053391944953895?= X-GMAIL-MSGID: =?utf-8?q?1764053391944953895?= |
Series |
ep93xx device tree conversion
|
|
Commit Message
Nikita Shubin
April 24, 2023, 12:34 p.m. UTC
Add YAML bindings for ep93xx SoC.
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
.../bindings/net/cirrus,ep93xx_eth.yaml | 51 +++++++++++++++++++
1 file changed, 51 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/cirrus,ep93xx_eth.yaml
Comments
On Mon, Apr 24, 2023 at 03:34:34PM +0300, Nikita Shubin wrote: > Add YAML bindings for ep93xx SoC. > > Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me> > --- > .../bindings/net/cirrus,ep93xx_eth.yaml | 51 +++++++++++++++++++ > 1 file changed, 51 insertions(+) > create mode 100644 Documentation/devicetree/bindings/net/cirrus,ep93xx_eth.yaml > > diff --git a/Documentation/devicetree/bindings/net/cirrus,ep93xx_eth.yaml b/Documentation/devicetree/bindings/net/cirrus,ep93xx_eth.yaml > new file mode 100644 > index 000000000000..7e73cf0ddde9 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/cirrus,ep93xx_eth.yaml > @@ -0,0 +1,51 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/cirrus,ep93xx_eth.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: The ethernet hardware included in EP93xx CPUs module Device Tree Bindings > + > +maintainers: > + - Hartley Sweeten <hsweeten@visionengravers.com> Should be referencing ethernet-controller.yaml. > + > +properties: > + compatible: > + const: cirrus,ep9301-eth > + > + reg: > + items: > + - description: The physical base address and size of IO range > + > + interrupts: > + items: > + - description: Combined signal for various interrupt events > + > + copy_addr: > + type: boolean > + description: > + Flag indicating that the MAC address should be copied > + from the IndAd registers (as programmed by the bootloader) The bootloader is supposed to fill in local-mac-address if it sets the MAC address. > + > + phy_id: > + description: MII phy_id to use type? There's standard properties for dealing with phy connections. Surely they work for this. > + > +required: > + - compatible > + - reg > + - interrupts > + > +additionalProperties: false > + > +examples: > + - | > + eth0: eth@80010000 { ethernet@... > + compatible = "cirrus,ep9301-eth"; > + reg = <0x80010000 0x10000>; > + interrupt-parent = <&vic1>; > + interrupts = <7>; > + copy_addr; > + phy_id = < 1 >; > + }; > + > +... > -- > 2.39.2 >
Hello Andrew! On Mon, 2023-04-24 at 15:39 +0200, Andrew Lunn wrote: > > + copy_addr: > > + type: boolean > > + description: > > + Flag indicating that the MAC address should be copied > > + from the IndAd registers (as programmed by the bootloader) > > Looking at ep93xx_register_eth(), all callers are setting copy_addr > to > 1. So i don't think you need this. Agreed. Dropped copy_addr entirely. > > > + > > + phy_id: > > + description: MII phy_id to use > > The eEP93xx Ethernet driver is a very old driver, so it is doing MDIO > and PHY the old way. Ideally you should be using ep93xx_mdio_read() > and ep93xx_mdio_write() to create an MDIO bus with > of_mdiobus_regsiter, and then use a phy-handle to point to the PHY on > the bus. It will then be the same as all other ethernet drivers using > DT. I've tinkered with the preferred way, however this involves turning on - CONFIG_PHYLIB - CONFIG_MDIO_DEVICE And maybe CONFIG_MICREL_PHY (at least for me, unless i can use some common phy driver) which implies a kernel size increase - which is undesirable for us. Can we slip by with something like: + np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); + if (!np) { + dev_err(&pdev->dev, "Please provide \"phy-handle\"\n"); + return -ENODEV; + } + + if (of_property_read_u32(np, "reg", &phy_id)) { + dev_err(&pdev->dev, "Failed to locate \"phy_id\"\n"); + return -ENOENT; + } And standard device tree bindings ?: + ethernet@80010000 { + compatible = "cirrus,ep9301-eth"; + reg = <0x80010000 0x10000>; + interrupt-parent = <&vic1>; + interrupts = <7>; + phy-handle = <&phy0>; + mdio { + #address-cells = <1>; + #size-cells = <0>; + phy0: ethernet-phy@1 { + reg = <1>; + device_type = "ethernet-phy"; + }; + }; + }; > > Andrew
diff --git a/Documentation/devicetree/bindings/net/cirrus,ep93xx_eth.yaml b/Documentation/devicetree/bindings/net/cirrus,ep93xx_eth.yaml new file mode 100644 index 000000000000..7e73cf0ddde9 --- /dev/null +++ b/Documentation/devicetree/bindings/net/cirrus,ep93xx_eth.yaml @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/cirrus,ep93xx_eth.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: The ethernet hardware included in EP93xx CPUs module Device Tree Bindings + +maintainers: + - Hartley Sweeten <hsweeten@visionengravers.com> + +properties: + compatible: + const: cirrus,ep9301-eth + + reg: + items: + - description: The physical base address and size of IO range + + interrupts: + items: + - description: Combined signal for various interrupt events + + copy_addr: + type: boolean + description: + Flag indicating that the MAC address should be copied + from the IndAd registers (as programmed by the bootloader) + + phy_id: + description: MII phy_id to use + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + eth0: eth@80010000 { + compatible = "cirrus,ep9301-eth"; + reg = <0x80010000 0x10000>; + interrupt-parent = <&vic1>; + interrupts = <7>; + copy_addr; + phy_id = < 1 >; + }; + +...