From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_PASS,URIBL_BLOCKED, USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 878D9C282DA for ; Wed, 17 Apr 2019 10:16:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61F022073F for ; Wed, 17 Apr 2019 10:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731672AbfDQKQC (ORCPT ); Wed, 17 Apr 2019 06:16:02 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:55449 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729522AbfDQKQB (ORCPT ); Wed, 17 Apr 2019 06:16:01 -0400 X-Originating-IP: 90.88.160.238 Received: from localhost (aaubervilliers-681-1-42-238.w90-88.abo.wanadoo.fr [90.88.160.238]) (Authenticated sender: maxime.ripard@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id E402C40006; Wed, 17 Apr 2019 10:15:57 +0000 (UTC) Date: Wed, 17 Apr 2019 12:15:57 +0200 From: Maxime Ripard To: Petr =?utf-8?Q?=C5=A0tetiar?= Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, "David S. Miller" , Rob Herring , Mark Rutland , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Frank Rowand , John Crispin , Felix Fietkau Subject: Re: [PATCH] of_net: add mtd-mac-address support to of_get_mac_address() Message-ID: <20190417101557.6jicrn56dqaccxar@flea> References: <1555445100-30936-1-git-send-email-ynezz@true.cz> <20190417080614.edt25ynuvae5fn64@flea> <20190417094921.GB79403@meh.true.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lg7fyg7s3zdxmbqo" Content-Disposition: inline In-Reply-To: <20190417094921.GB79403@meh.true.cz> User-Agent: NeoMutt/20180716 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org --lg7fyg7s3zdxmbqo Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2019 at 11:49:21AM +0200, Petr =C5=A0tetiar wrote: > Maxime Ripard [2019-04-17 10:06:14]: > > Hi Maxime, > > > On Tue, Apr 16, 2019 at 10:05:00PM +0200, Petr =C5=A0tetiar wrote: > > > From: John Crispin > > > > > > Many embedded devices have information such as MAC addresses stored > > > inside MTD devices. This patch allows us to add a property inside a n= ode > > > describing a network interface. The new property points at a MTD > > > partition with an offset where the MAC address can be found. > > > > > > This patch has originated in OpenWrt some time ago, so in order to > > > consider usefulness of this patch, here are some real-world numbers > > > which hopefully speak for themselves: > > > > > > * mtd-mac-address used 497 times in 357 device tree f= iles > > > * mtd-mac-address-increment used 74 times in 58 device tree f= iles > > > * mtd-mac-address-increment-byte used 1 time in 1 device tree f= ile > > > > NVMEM is supported by of_net already and there's an MTD-to-nvmem > > bridge already, so it doesn't look really necessary to create > > additional properties that cover the same use case. > > if those use cases could be handled with NVMEM, then I'm all in. As I can= 't > find any example in some device tree file in the kernel tree yet and the > documentation isn't clear to me about this topic either, could you please= help > me and provide me with some NVMEM based example for the following simplif= ied > use case? Or what do I need to bend/patch in order to support this within > NVME. https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bind= ings/nvmem/nvmem.txt and https://elixir.bootlin.com/linux/latest/source/net/ethernet/eth.c#L564 Should get you started Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --lg7fyg7s3zdxmbqo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXLb83QAKCRDj7w1vZxhR xXZGAQD/EwWeFP6IaeXzvsU5BLH8xSUKvQxEjovhCFYOewVZHQD/dC5kshQ0U2YD 7sPbMUGdx3FepNYwYd48Tg9nLvEz0gk= =0Ems -----END PGP SIGNATURE----- --lg7fyg7s3zdxmbqo--