I'm trying to configure custom ethernet mac addresses from u-boot and convey it to Linux on LX2160A-RDB based custom hw. I could configure the mac addresses on u-boot using "mac" command. However, Linux eth interfaces still shows random mac addresses. Please find the details below.
As per my understanding, u-boot provides “mac” command to configure eth mac addresses for DPAA2 (fsl-mc). “mac” command store this mac configuration in EEPROM. after configuring mac, uboot updates ethaddr/ethXaddr environment variable.
u-boot then loads Linux device tree and before passing it to the kernel, it calls fdt_fixup_ethernet(blob) api to updates "mac-address" and "local-mac-address" fields with ethaddr/ethXaddr mac entries in Linux device tree for dpmac nodes.
DPL device tree contains dpmac configurations. Do we also need "mac_addr" field in DPL for dpni nodes?
On Linux side, It still uses random mac addresses for eth interfaces. Does fsl-dpaa2-mac/fsl-dpaa2-eth driver uses "mac-address" field from dpmac node from Linux device tree?
Is there any additional configuration required for Linux to uses mac addresses passed from uboot?
From u-boot console:
eth0: DPMAC3@10gbase-r, eth1: DPMAC4@10gbase-r, eth2: DPMAC5@10gbase-r, eth3: DPMAC6@10gbase-r
=> mac
ID: NXID v1
SN: blbx3-63
Errata: na
Eth0: 00:04:9f:04:68:b1
Eth1: 00:04:9f:04:68:b2
Eth2: 00:04:9f:04:68:b3
Eth3: 00:04:9f:04:68:b4
=> printenv
ethaddr=00:04:9F:04:68:B1
eth1addr=00:04:9F:04:68:B2
eth2addr=00:04:9F:04:68:B3
eth3addr=00:04:9F:04:68:B4
Linux device tree configuration:
aliases {
ethernet0 = &dpmac3;
ethernet1 = &dpmac4;
ethernet2 = &dpmac5;
ethernet3 = &dpmac6;
};
&dpmac3 {
status = "okay";
phy-connection-type = "10gbase-r";
mac-address = [00 00 00 00 00 00];
};
&dpmac4 {
status = "okay";
phy-connection-type = "10gbase-r";
mac-address = [00 00 00 00 00 00];
};
&dpmac5 {
status = "okay";
phy-connection-type = "10gbase-r";
mac-address = [00 00 00 00 00 00];
};
&dpmac6 {
status = "okay";
phy-connection-type = "10gbase-r";
mac-address = [00 00 00 00 00 00];
};
Linux console:
root@blackcomb-rev1:~# ip link
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether a2:04:30:ae:34:99 <= Random mac address
5: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 12:9b:71:f2:aa:b7 <= Random mac address
6: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 82:12:40:b9:3e:78 <= Random mac address
7: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 26:59:9f:47:61:a6 <= Random mac address
Hi,
Thank you for your interest in NXP Semiconductor products,
You have enabled FDT_SEQ_MACADDR_FROM_ENV in your configs?
Regards
Hi,
I understand, by the time you tried with FDT...CONFIG you hadn't any MAC addresses in DTS, right? I saw that you tried in DTS set them to a different value.
Also, it'd worth trying to remove this property from defconfig
Regards,