2024-03-23 20:58:53 +00:00
|
|
|
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
|
2024-06-27 17:56:04 +00:00
|
|
|
@@ -6156,6 +6156,12 @@ static int mvpp2_port_copy_mac_addr(stru
|
2024-03-28 18:05:32 +00:00
|
|
|
return 0;
|
2024-03-23 20:58:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ if (!of_get_mac_address(to_of_node(fwnode), hw_mac_addr)) {
|
|
|
|
+ *mac_from = "nvmem cell";
|
|
|
|
+ eth_hw_addr_set(dev, hw_mac_addr);
|
2024-03-28 18:05:32 +00:00
|
|
|
+ return 0;
|
2024-03-23 20:58:53 +00:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
*mac_from = "random";
|
|
|
|
eth_hw_addr_random(dev);
|
2024-03-28 18:05:32 +00:00
|
|
|
|