mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-26 00:41:17 +00:00
2260ec4fb7
Manually refreshed: * 309-linksys-status-led.patch * 310-linksys-use-eth0-as-cpu-port.patch * 320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch * 701-mvpp2-read-mac-address-from-nvmem.patch * 902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch All other patches automatically refreshed. Signed-off-by: Stijn Segers <foss@volatilesystems.org>
28 lines
884 B
Diff
28 lines
884 B
Diff
From: Tobias Schramm <tobias@t-sys.eu>
|
|
Subject: mvpp2: support fetching mac address from nvmem
|
|
|
|
The mvpp2 driver did not query nvmem for hardware mac addresses. This
|
|
patch adds querying of mac addresses stored in nvmem cells as a further
|
|
fallback option before assigning a random address.
|
|
Purposely added separately to fwnode_get_mac_address() above to maintain
|
|
existing behaviour with builtin adapter mac address still taking
|
|
precedence.
|
|
|
|
Signed-off-by: Tobias Schramm <tobias@t-sys.eu>
|
|
---
|
|
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
|
|
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
|
|
@@ -6153,6 +6153,12 @@ static int mvpp2_port_copy_mac_addr(stru
|
|
return 0;
|
|
}
|
|
|
|
+ if (!of_get_mac_address(to_of_node(fwnode), hw_mac_addr)) {
|
|
+ *mac_from = "nvmem cell";
|
|
+ eth_hw_addr_set(dev, hw_mac_addr);
|
|
+ return 0;
|
|
+ }
|
|
+
|
|
*mac_from = "random";
|
|
eth_hw_addr_random(dev);
|
|
|