microchip: lan865x: Minor improvements
v2 cover microchip: lan865x: Minor improvements
Recently I setup a custom i.MX93 board which contains a LAN8651 chip. These minor improvements were considered as helpful.
The series has been tested with the mentioned i.MX93 board.
Changes in V2:
- add Andrew's RB to Patch #1
- implement fetching of MAC from NVMEM in a generic helper, so lan865x doesn't need any modifications (Patch #2)
Stefan Wahren (2):
microchip: lan865x: Enable MAC address validation
ethernet: Extend device_get_mac_address() to use NVMEM
drivers/net/ethernet/microchip/lan865x/lan865x.c | 1 + net/ethernet/eth.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1
PATCH v2 1/2 microchip: lan865x: Enable MAC address validation
Use the generic eth_validate_addr() function for MAC address validation.
--- drivers/net/ethernet/microchip/lan865x/lan865x.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/microchip/lan865x/lan865x.c +1 -0
@@ -326,6 +326,7 @@ static const struct net_device_ops lan865x_netdev_ops = { .ndo_start_xmit = lan865x_send_packet, .ndo_set_rx_mode = lan865x_set_multicast_list, .ndo_set_mac_address = lan865x_set_mac_address, + .ndo_validate_addr = eth_validate_addr, .ndo_eth_ioctl = phy_do_ioctl_running, };
Signature · 1 line
2.34.1
PATCH v2 2/2 ethernet: Extend device_get_mac_address() to use NVMEM
In reply to Stefan WahrenA lot of modern SoC have the ability to store MAC addresses in their NVMEM. So extend the generic function device_get_mac_address() to obtain the MAC address from an nvmem cell named 'mac-address' in case there is no firmware node which contains the MAC address directly.
--- net/ethernet/eth.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/ethernet/eth.c +4 -1
@@ -613,7 +613,10 @@ EXPORT_SYMBOL(fwnode_get_mac_address);*/ int device_get_mac_address (struct device *dev,char *addr) { -return fwnode_get_mac_address (dev_fwnode (dev), addr); +if (!fwnode_get_mac_address (dev_fwnode (dev), addr)) +return 0 ; + +return nvmem_get_mac_address (dev, addr); }EXPORT_SYMBOL (device_get_mac_address);
Signature · 1 line
2.34.1
Re: [PATCH V2 2/2 net-next] ethernet: Extend device_get_mac_address() to use NVMEM
Quoted 6 lines · Stefan Wahren
A lot of modern SoC have the ability to store MAC addresses in their NVMEM. So extend the generic function
device_get_mac_address()to obtain the MAC address from an nvmem cell named 'mac-address' in case there is no firmware node which contains the MAC address directly.Signed-off-by Stefan Wahren <[email protected]>
Andrew
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Fri, 12 Sep 2025 16:03:30 +0200 you wrote:
Recently I setup a custom i.MX93 board which contains a LAN8651 chip. These minor improvements were considered as helpful.
The series has been tested with the mentioned i.MX93 board.
Changes in V2:
- add Andrew's RB to Patch #1
- implement fetching of MAC from NVMEM in a generic helper, so lan865x doesn't need any modifications (Patch #2)[...]
Here is the summary with links:
- [V2,1/2,net-next] microchip: lan865x: Enable MAC address validation
https://git.kernel.org/netdev/net-next/c/c5b7509d3a47 - [V2,2/2,net-next] ethernet: Extend device_get_mac_address() to use NVMEM https://git.kernel.org/netdev/net-next/c/d2d3f529e7b6
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html