[PATCH v2 1/2] arm64: dts: meson-gxbb-odroidc2: read the Ethernet MAC address from eFuse
Neil Armstrong
neil.armstrong at linaro.org
Mon Oct 12 02:25:59 PDT 2026
On 10/11/26 20:31, Fil Dunsky via B4 Relay wrote:
> From: Fil Dunsky <filipp.dunsky at gmail.com>
>
> The vendor programs a unique factory MAC address into the SoC eFuse at
> offset 0x34, where meson-gx.dtsi already describes the eth_mac nvmem
> cell. Reference the cell from the Ethernet controller so the kernel
> picks up the factory address itself instead of depending on the
> bootloader to populate local-mac-address, or falling back to a random
> one when it does not.
>
> The cell is 16 bytes long in meson-gx.dtsi, while
> of_get_mac_address_nvmem() only accepts a cell of exactly ETH_ALEN
> bytes, so narrow it to the 6 bytes of the address for this board.
>
> Tested on an ODROID-C2 with the bootloader's MAC fixup out of the way
> (ethernet0 alias removed from the DTB): with the 16-byte cell the
> driver falls back to a random address, with the 6-byte cell eth0 comes
> up with the factory address from the eFuse.
>
> Signed-off-by: Fil Dunsky <filipp.dunsky at gmail.com>
> ---
> arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> index 5943bc810..3b74528ef 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> @@ -223,6 +223,10 @@ &cec_AO {
> hdmi-phandle = <&hdmi_tx>;
> };
>
> +ð_mac {
> + reg = <0x34 0x6>;
> +};
> +
> ðmac {
> status = "okay";
> pinctrl-0 = <ð_rgmii_pins>;
> @@ -230,6 +234,9 @@ ðmac {
> phy-handle = <ð_phy0>;
> phy-mode = "rgmii";
>
> + nvmem-cells = <ð_mac>;
> + nvmem-cell-names = "mac-address";
> +
> amlogic,tx-delay-ns = <2>;
>
> mdio {
>
Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>
Thanks,
Neil
More information about the linux-amlogic
mailing list