openwrt/target/linux/mvebu/patches-6.1/701-mvpp2-read-mac-address-from-nvmem.patch
Tobias Schramm 336a531c15 mvebu: add support for SolidRun ClearFog Pro
The SolidRun ClearFog Pro is a router based on the SolidRun CN9130 SOM.

Specs:
 - SoC: Quad-Core Cortex-A72 CN9130 SoC
 - RAM: 4GiB DDR4
 - Serial: Micro-USB port on front (FT232R, 115200 8n1)
 - Storage: 8GiB eMMC, microSD card slot, 8MiB SPI NOR flash
 - Ethernet: 7x GbE (1 port dedicated on SoC, 6 port switch with single GbE CPU port)
 - SFP: 1x SFP+
 - USB: 1x USB-A 3.1 Gen 1
 - PCIe: 2x mini PCIe (one slot with USB and SIM card socket)
 - SATA: 1x M.2 Key-B

In addition to the usual connectivity options this device also features
an internal mikroBUS expansion connector.

SATA is currently untested due to lack of a suitable M.2 SSD.

Installation
============

1. Write sdcard sysupgrade image to microSD card using dd or similar
2. Insert microSD card into router and apply power
3. Device boots into OpenWRT
4. (optional) dd sysupgrade image to /dev/mmcblk0 to install to eMMC

Signed-off-by: Tobias Schramm <tobias@t-sys.eu>
2024-03-02 14:21:20 +01:00

28 lines
875 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
@@ -6134,6 +6134,12 @@ static void mvpp2_port_copy_mac_addr(str
}
}
+ 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;
+ }
+
*mac_from = "random";
eth_hw_addr_random(dev);
}