]> git.baikalelectronics.ru Git - kernel.git/commit
net: enetc: fetch MAC address from device tree
authorMichael Walle <michael@walle.cc>
Wed, 14 Apr 2021 14:48:14 +0000 (16:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Apr 2021 21:04:36 +0000 (14:04 -0700)
commit494b3eb53433531af2a4b3b8e40bcc19babe0c8c
tree2742e439bbdff1657270ef5dc1d5656980205e1a
parent81d9de4010342b7eca8bf6b6c5ee4361e9f41290
net: enetc: fetch MAC address from device tree

Normally, the bootloader will already initialize the MAC address
registers of the ENETC and the driver will just use them or generate a
random one, if it is not initialized.

Add a new way to provide the MAC address: via device tree. Besides the
usual 'mac-address' property, there is also the possibility to fetch it
via a NVMEM provider. The sl28 board stores the MAC address in the SPI
NOR flash OTP region. Having this will allow linux to fetch the MAC
address from there without being dependent on the bootloader.

No in-tree boards have the device tree properties set, thus for these,
this is a no-op.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc_pf.c