2
0

701-mvpp2-read-mac-address-from-nvmem.patch 875 B

123456789101112131415161718192021222324252627
  1. From: Tobias Schramm <[email protected]>
  2. Subject: mvpp2: support fetching mac address from nvmem
  3. The mvpp2 driver did not query nvmem for hardware mac addresses. This
  4. patch adds querying of mac addresses stored in nvmem cells as a further
  5. fallback option before assigning a random address.
  6. Purposely added separately to fwnode_get_mac_address() above to maintain
  7. existing behaviour with builtin adapter mac address still taking
  8. precedence.
  9. Signed-off-by: Tobias Schramm <[email protected]>
  10. ---
  11. --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
  12. +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
  13. @@ -6134,6 +6134,12 @@ static void mvpp2_port_copy_mac_addr(str
  14. }
  15. }
  16. + if (!of_get_mac_address(to_of_node(fwnode), hw_mac_addr)) {
  17. + *mac_from = "nvmem cell";
  18. + eth_hw_addr_set(dev, hw_mac_addr);
  19. + return;
  20. + }
  21. +
  22. *mac_from = "random";
  23. eth_hw_addr_random(dev);
  24. }