Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1833484rwd; Mon, 15 May 2023 03:50:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Jtsclif3O3VLMGZxdfowO1Xwe3KR9wlFXYXVA0XBfg0AhrPgEPqwzgeuWzne0LDt7Rn9e X-Received: by 2002:a17:90b:388e:b0:23f:2661:f94c with SMTP id mu14-20020a17090b388e00b0023f2661f94cmr5891372pjb.47.1684147858120; Mon, 15 May 2023 03:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684147858; cv=none; d=google.com; s=arc-20160816; b=USnhZKZ9zE+1z5nDB7IkGAhzFWnfhJ+2URA5Lp7uMlKOUAgbmlLZS/ldwptEgkqz62 PD8mut+L+wuvA4A9846ROaj+bbEfYuTeq+Vagwizgtwglp+kxUaUd3FgxGg7jMC257hF Y8tPOyn1PBgN6DhxzU+6taVIixhdmRJs/HPc6kOW0XgwFW1DhLvEBGu4GvauBW9R3+1a vZIJFSVHXxbs4l6z3B5K03m4dAAjnIn9wpr2/ICUoiRmorsqvdZLM72BYS7ybHIJuXAp cE15Xub/tz860YDGJk7lNAQM/L/ZJaJIul5VoxyMD1YH80fIY3C1w4aErqxCISZAXROt oKGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=5Yf+nT9MWwC9WKid3XZN6dD355P7wOWx3LcVfWCOKwU=; b=j2tyMJeepkz94ZC/s9F0CgCZl+xtrvN+jbGn8TCpVbY6ofxIFeAqazM6Tu36wkQYwX TZZL5WB807BgYiqDy2Ozrw5Fb7rJS30i6oiBv5aotALjAa6V+AyQUDm/nY9uIEtRF9LD GSaxL0I8c09hb5kmGRcAMNGHRoLibhE6PeK+ePxrXwkbyELrOrUr0WfUarciFyByzj0y vOcIk/tKlaWqtQ4c74plY/RRZpIzm46p2NnKP7q7KGLJwob19LL+bM5iiPxXCVfg9PdU UXD9HvRK/AKgFYfL/bOdBWOvilGTA/HuZYVjzpioQlGmlZIozg0qx4nPR4196UbXoPG+ kRPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maquefel.me header.s=mail header.b=Kw42ataQ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g130-20020a636b88000000b005138de75d17si15401974pgc.116.2023.05.15.03.50.45; Mon, 15 May 2023 03:50:58 -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=pass header.i=@maquefel.me header.s=mail header.b=Kw42ataQ; 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 S240690AbjEOKnG (ORCPT + 99 others); Mon, 15 May 2023 06:43:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235490AbjEOKnE (ORCPT ); Mon, 15 May 2023 06:43:04 -0400 Received: from forward500a.mail.yandex.net (forward500a.mail.yandex.net [178.154.239.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3488196; Mon, 15 May 2023 03:43:02 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-18.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-18.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:5f1d:0:640:49bf:0]) by forward500a.mail.yandex.net (Yandex) with ESMTP id A5D035EB08; Mon, 15 May 2023 13:42:58 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-18.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id vgXTnwxsAGk0-U9VWOEj0; Mon, 15 May 2023 13:42:57 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1684147377; bh=5Yf+nT9MWwC9WKid3XZN6dD355P7wOWx3LcVfWCOKwU=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=Kw42ataQQQf6GiAII5s/bVVcljzb8dMqqPOKnGk2UH1RgDrMoSaaZ6HPsy8gmkQBd /Ewuww9pyci6rIgsziayoea/GQeSqIvFV8m7tNxu19Jj87Y0X4XGN8vyfZRJwpSnpX wgHU8sdZ60mBnoDD4DQeGfNBCokPGSO2PVfb5/wk= Authentication-Results: mail-nwsmtp-smtp-production-main-18.vla.yp-c.yandex.net; dkim=pass header.i=@maquefel.me Message-ID: Subject: Re: [PATCH 18/43] dt-bindings: net: Add DT bindings ep93xx eth From: Nikita Shubin To: Andrew Lunn Cc: Arnd Bergmann , Linus Walleij , Alexander Sverdlin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Hartley Sweeten , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 15 May 2023 16:42:57 +0300 In-Reply-To: <7f05ecdc-cbbd-40b0-9a40-229e18aec721@lunn.ch> References: <20230424123522.18302-1-nikita.shubin@maquefel.me> <20230424123522.18302-19-nikita.shubin@maquefel.me> <7f05ecdc-cbbd-40b0-9a40-229e18aec721@lunn.ch> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andrew! On Mon, 2023-04-24 at 15:39 +0200, Andrew Lunn wrote: > > +=C2=A0 copy_addr: > > +=C2=A0=C2=A0=C2=A0 type: boolean > > +=C2=A0=C2=A0=C2=A0 description: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Flag indicating that the MAC address sh= ould be copied > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 from the IndAd registers (as programmed= by the bootloader) >=20 > 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. >=20 > > + > > +=C2=A0 phy_id: > > +=C2=A0=C2=A0=C2=A0 description: MII phy_id to use >=20 > 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=20 - 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 =3D 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 =3D "cirrus,ep9301-eth"; + reg =3D <0x80010000 0x10000>; + interrupt-parent =3D <&vic1>; + interrupts =3D <7>; + phy-handle =3D <&phy0>; + mdio { + #address-cells =3D <1>; + #size-cells =3D <0>; + phy0: ethernet-phy@1 { + reg =3D <1>; + device_type =3D "ethernet-phy"; + }; + }; + }; >=20 > =C2=A0=C2=A0=C2=A0 Andrew