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=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 C52AAC282DA for ; Wed, 17 Apr 2019 18:05:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 989EC20663 for ; Wed, 17 Apr 2019 18:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730120AbfDQSFd (ORCPT ); Wed, 17 Apr 2019 14:05:33 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50989 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbfDQSFd (ORCPT ); Wed, 17 Apr 2019 14:05:33 -0400 X-Originating-IP: 90.89.68.76 Received: from localhost (lfbn-1-10718-76.w90-89.abo.wanadoo.fr [90.89.68.76]) (Authenticated sender: maxime.ripard@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 6C7AEE0003; Wed, 17 Apr 2019 18:05:28 +0000 (UTC) Date: Wed, 17 Apr 2019 20:05:27 +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: <20190417180527.6s2sidbfv5ffjlxo@flea> References: <1555445100-30936-1-git-send-email-ynezz@true.cz> <20190417080614.edt25ynuvae5fn64@flea> <20190417160600.GD79403@meh.true.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ihj2csaliyp5lbsh" Content-Disposition: inline In-Reply-To: <20190417160600.GD79403@meh.true.cz> User-Agent: NeoMutt/20180716 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org --ihj2csaliyp5lbsh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2019 at 06:06:00PM +0200, Petr =C5=A0tetiar wrote: > Maxime Ripard [2019-04-17 10:06:14]: > > > NVMEM is supported by of_net already > > Well, not anymore: > > commit afa64a72b862a7a9d04f8d07fba632eaf06b23f8 > Author: Bartosz Golaszewski > Date: Fri Nov 30 09:20:59 2018 +0100 > > of: net: kill of_get_nvmem_mac_address() > > Now, I'm really confused. > > Documentation/devicetree/bindings/net/ethernet.txt states following: > > - nvmem-cells: phandle, reference to an nvmem node for the MAC address; > - nvmem-cell-names: string, should be "mac-address" if nvmem is to be us= ed; > > which is actually misleading and confusing. There are only two ethernet > drivers in the tree cadence and davinci which support this properties. We= ll > there's nixge, but this one is special, because it has renamed `mac-addre= ss` > to `address` with it's own implementation in `nixge_get_nvmem_address`. > > All other ethernet drivers (and few others) simply use `of_get_mac_addres= s` > which doesn't support NVMEM and the documented nvmem-cells* properties. > > > so it doesn't look really necessary to create additional properties that > > cover the same use case. > > NVMEM could be reused for this purpose and it seems like a way to go, pro= bably > if we could wire `nvmem_get_mac_address` into `of_get_mac_address` and fi= nd a > way how to handle the remaining use cases currently not handled in NVMEM: > > * MAC address (octet/byte) incrementation (already handled by the propos= ed patch) > * MAC address stored as ascii/text (0090FEC9CBE4 and 00:90:FE:C9:CB:E4 > formats) which is currently missing but would be nice to have > > I can prepare patches for that, just don't want to waste more time then r= eally > necessary, so it would really help me if someone could tell me how this s= hould > be implemented in NVMEM and I'll simply do it in this acceptable way and = call > it a day. Just send whatever you have in mind with the nvmem developpers as recepients. They are not in this thread, so I'm not sure we can point you in the direction they want Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --ihj2csaliyp5lbsh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXLdq5wAKCRDj7w1vZxhR xWqoAQDG46t4rsfYiL4z4h7gW422AN3slbWNjmpT/atW05rqqgEA+AIabZ0VShbm SoU2eoCipSlCFFRP9UYTKl0jCvf3rgY= =KZoZ -----END PGP SIGNATURE----- --ihj2csaliyp5lbsh--