netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Petr Štetiar" <ynezz@true.cz>
To: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Frank Rowand <frowand.list@gmail.com>,
	John Crispin <john@phrozen.org>, Felix Fietkau <nbd@nbd.name>
Subject: Re: [PATCH] of_net: add mtd-mac-address support to of_get_mac_address()
Date: Wed, 17 Apr 2019 18:06:00 +0200	[thread overview]
Message-ID: <20190417160600.GD79403@meh.true.cz> (raw)
In-Reply-To: <20190417080614.edt25ynuvae5fn64@flea>

Maxime Ripard <maxime.ripard@bootlin.com> [2019-04-17 10:06:14]:

> NVMEM is supported by of_net already

Well, not anymore:

 commit afa64a72b862a7a9d04f8d07fba632eaf06b23f8
 Author: Bartosz Golaszewski <bgolaszewski@baylibre.com>
 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 used;

which is actually misleading and confusing. There are only two ethernet
drivers in the tree cadence and davinci which support this properties. Well
there's nixge, but this one is special, because it has renamed `mac-address`
to `address` with it's own implementation in `nixge_get_nvmem_address`.

All other ethernet drivers (and few others) simply use `of_get_mac_address`
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, probably
if we could wire `nvmem_get_mac_address` into `of_get_mac_address` and find a
way how to handle the remaining use cases currently not handled in NVMEM:

 * MAC address (octet/byte) incrementation (already handled by the proposed 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 really
necessary, so it would really help me if someone could tell me how this should
be implemented in NVMEM and I'll simply do it in this acceptable way and call
it a day.

Thanks!

-- ynezz

  parent reply	other threads:[~2019-04-17 16:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 20:05 [PATCH] of_net: add mtd-mac-address support to of_get_mac_address() Petr Štetiar
2019-04-17  0:29 ` Florian Fainelli
2019-04-17  3:01   ` Frank Rowand
2019-04-30  0:48     ` Rob Herring
2019-04-30  1:15       ` Frank Rowand
2019-04-17  5:00 ` Heiner Kallweit
2019-04-17  8:06 ` Maxime Ripard
2019-04-17  9:49   ` Petr Štetiar
2019-04-17 10:15     ` Maxime Ripard
2019-04-17 12:10       ` Petr Štetiar
2019-04-17 16:06   ` Petr Štetiar [this message]
2019-04-17 18:05     ` Maxime Ripard

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=20190417160600.GD79403@meh.true.cz \
    --to=ynezz@true.cz \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=john@phrozen.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).