[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56f30191-029a-4af5-be47-72480b8d32ad@gmx.net>
Date: Fri, 5 Sep 2025 12:30:20 +0200
From: Stefan Wahren <wahrenst@....net>
To: Andrew Lunn <andrew@...n.ch>
Cc: Parthiban Veerasooran <parthiban.veerasooran@...rochip.com>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH RFC 2/2 next] microchip: lan865x: Allow to fetch MAC from
NVMEM
Hi Andrew,
Am 04.09.25 um 20:54 schrieb Andrew Lunn:
> On Thu, Sep 04, 2025 at 12:09:16PM +0200, Stefan Wahren wrote:
>> A lot of modern SoC have the ability to store MAC addresses in
>> their NVMEM. The generic function device_get_ethdev_address()
>> doesn't provide this feature. So try to fetch the MAC from
>> NVMEM if the generic function fails.
> I notice this is RFC. What comments would you like?
>
>> - if (device_get_ethdev_address(&spi->dev, netdev))
>> - eth_hw_addr_random(netdev);
>> + if (device_get_ethdev_address(&spi->dev, netdev)) {
>> + /* Get the MAC address from NVMEM */
>> + if (of_get_ethdev_address(spi->dev.of_node, netdev))
>> + eth_hw_addr_random(netdev);
>> + }
> Maybe chain this onto the end of device_get_ethdev_address() ?
yes, this was one of the reasons I had in mind to add RFC here.
I will give it a try.
Regards
> Looking
> at the current users of device_get_ethdev_address(), bcmgenet,
> enc28j60, and emac are all likely to be DT systems which could benefit
> from this. You just need to make sure ACPI don't dereference a NULL
> pointer.
>
> Andrew
Powered by blists - more mailing lists