[PATCH 1/2] arm64: dts: meson-gxbb-odroidc2: read the Ethernet MAC address from eFuse
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sun Oct 11 10:24:33 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] net: of_get_mac_address_nvmem() fails due to 16-byte cell
--
commit 33c286acfab990fb62603385b64de76b3bd20dfe
Author: Fil Dunsky <filipp.dunsky at gmail.com>
arm64: dts: meson-gxbb-odroidc2: read the Ethernet MAC address from eFuse
This commit updates the meson-gxbb-odroidc2 device tree to read the Ethernet
MAC address from the eFuse nvmem cell instead of relying on the bootloader.
It links the ethmac node to the existing eth_mac nvmem cell using standard
properties.
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> index 5943bc810678e..639b97ad515c0 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> @@ -230,6 +230,9 @@ ðmac {
> phy-handle = <ð_phy0>;
> phy-mode = "rgmii";
>
> + nvmem-cells = <ð_mac>;
> + nvmem-cell-names = "mac-address";
[Severity: Medium]
Will this actually read the MAC address successfully? The network core strict
checks nvmem cells for MAC addresses to ensure they are exactly 6 bytes.
Looking at the eth_mac node defined in meson-gx.dtsi:
eth_mac: eth-mac at 34 {
reg = <0x34 0x10>;
};
This cell has a length of 16 bytes (0x10).
When the stmmac driver probes, it eventually calls of_get_mac_address_nvmem()
in net/core/of_net.c, which enforces this check:
if (len != ETH_ALEN || !is_valid_ether_addr(mac)) {
kfree(mac);
return -EINVAL;
}
Because 16 does not equal ETH_ALEN, this unconditionally returns -EINVAL. It
seems the driver will fall back to a bootloader-programmed or random MAC
address instead, which might be why it appeared to work during testing.
Could we adjust the device tree to point to a 6-byte cell instead?
> +
> amlogic,tx-delay-ns = <2>;
>
> mdio {
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261011-odroidc2-dts-v1-0-f9f0e779af88@gmail.com?part=1
More information about the linux-amlogic
mailing list