lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190417101557.6jicrn56dqaccxar@flea>
Date:   Wed, 17 Apr 2019 12:15:57 +0200
From:   Maxime Ripard <maxime.ripard@...tlin.com>
To:     Petr Štetiar <ynezz@...e.cz>
Cc:     netdev@...r.kernel.org, devicetree@...r.kernel.org,
        "David S. Miller" <davem@...emloft.net>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Frank Rowand <frowand.list@...il.com>,
        John Crispin <john@...ozen.org>, Felix Fietkau <nbd@....name>
Subject: Re: [PATCH] of_net: add mtd-mac-address support to
 of_get_mac_address()

On Wed, Apr 17, 2019 at 11:49:21AM +0200, Petr Štetiar wrote:
> Maxime Ripard <maxime.ripard@...tlin.com> [2019-04-17 10:06:14]:
>
> Hi Maxime,
>
> > On Tue, Apr 16, 2019 at 10:05:00PM +0200, Petr Štetiar wrote:
> > > From: John Crispin <john@...ozen.org>
> > >
> > > Many embedded devices have information such as MAC addresses stored
> > > inside MTD devices. This patch allows us to add a property inside a node
> > > 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 files
> > >  * mtd-mac-address-increment      used  74 times in  58 device tree files
> > >  * mtd-mac-address-increment-byte used   1 time  in   1 device tree file
> >
> > 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 simplified
> 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/bindings/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

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ