Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target: ipq806x: remove mac-address-increment #13952

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Nov 11, 2023

It's deprecated.

ping @rmilecki @Ansuel

@github-actions github-actions bot added target/ipq806x pull request/issue for ipq806x target kernel pull request/issue with Linux kernel related changes labels Nov 12, 2023
@neheb
Copy link
Contributor Author

neheb commented Nov 21, 2023

ping @computersforpeace

It's deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Fixes dtc warnings

Signed-off-by: Rosen Penev <rosenp@gmail.com>
@openwrt-bot openwrt-bot merged commit d44c037 into openwrt:main Nov 21, 2023
1 check passed
@neheb neheb deleted the 1 branch November 21, 2023 23:51
@hnyman
Copy link
Contributor

hnyman commented Dec 6, 2023

@neheb @Ansuel
cc @shelterx

Current r24586-f3cdc9f988 build for R7800 reads a wrong MAC address for wan, while lan ports and wlan do have the corrects MACs.

I suspect this commit, as it handles the MAC reading from flash.
R7800 / nighthawk reads wrongly MAC from 0x6, which code is changed slightly differently by defining "mac-base" than the other MAC definitions in nighthawk.dtsi.

Lan and wlan MACs are ok, but wan (eth0) MAC is wrong.

with r24586-f3cdc9f988:

root@router1:~# ifconfig  | grep encap
br-lan    Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
**eth0      Link encap:Ethernet  HWaddr 7E:EE:32:C0:0D:32**
eth1      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
hn2wlan   Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E7
hn5wpa3   Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E6
ifb-dns   Link encap:Ethernet  HWaddr 26:96:D7:32:D4:5A
ifb4wan   Link encap:Ethernet  HWaddr FA:14:12:9C:9A:37
lan1      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
lan2      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
lan3      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
lan4      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
lo        Link encap:Local Loopback
**wan       Link encap:Ethernet  HWaddr 7E:EE:32:C0:0D:32**

with my previous build r24368-36b1dd75fd (from mid-November):

root@router1:~# ifconfig  | grep encap
br-lan    Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
eth0      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E5
eth1      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
hn2wlan   Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E7
hn5wpa3   Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E6
ifb-dns   Link encap:Ethernet  HWaddr 9A:AD:7E:E1:29:3D
ifb4wan   Link encap:Ethernet  HWaddr 32:17:33:7C:FF:94
lan1      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
lan2      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
lan3      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
lan4      Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E4
lo        Link encap:Local Loopback
wan       Link encap:Ethernet  HWaddr DC:EF:09:EF:F3:E5

Flash contents:

root@router1:~# hexdump -C -n 18 /dev/mtd3 | head -n 2
00000000  dc ef 09 ef f3 e4 dc ef  09 ef f3 e5 dc ef 09 ef  |................|
00000010  f3 e6                                             |..|

I have not yet tried reverting this commit, but I do not see much other possibilities in the regression range.

EDIT:
like @shelterx said in forum discussion, the wan MAC is now random and changes at each boot:

root@router1:~# ifconfig | grep ^wan.*encap
wan       Link encap:Ethernet  HWaddr 22:62:1F:FE:9C:92

@DragonBluep
Copy link
Contributor

@hnyman here is a mistake. Change this line to nvmem-cells = <&macaddr_art_6 0>; should fix it.

@hnyman
Copy link
Contributor

hnyman commented Dec 6, 2023

Thanks for confirming my own thoughts.
Already test compiling just that change ;-)
Will see if that helps.

--- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi
@@ -427,7 +427,7 @@
        pinctrl-0 = <&rgmii2_pins>;
        pinctrl-names = "default";
 
-       nvmem-cells = <&macaddr_art_6>;
+       nvmem-cells = <&macaddr_art_6 0>;
        nvmem-cell-names = "mac-address";
 
        fixed-link {

EDIT:
That helped:
wan Link encap:Ethernet HWaddr DC:EF:09:EF:F3:E5

hnyman added a commit to hnyman/openwrt that referenced this pull request Dec 6, 2023
Correct the NVMEM mac-base field usage to read the wan MAC
correctly from flash.

Reference to discussion at openwrt#13952 (comment)

Fixes: d264d3a ("ipq806x: remove mac-address-increment")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
ptpt52 pushed a commit to x-wrt/x-wrt that referenced this pull request Dec 6, 2023
Correct the NVMEM mac-base field usage to read the wan MAC
correctly from flash.

Reference to discussion at openwrt#13952 (comment)

Fixes: d264d3a ("ipq806x: remove mac-address-increment")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
hauke pushed a commit to hnyman/openwrt that referenced this pull request Dec 6, 2023
Correct the NVMEM mac-base field usage to read the wan MAC
correctly from flash.

Reference to discussion at openwrt#13952 (comment)

Fixes: d264d3a ("ipq806x: remove mac-address-increment")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
darknblack pushed a commit to darknblack/openwrt that referenced this pull request Dec 9, 2023
Correct the NVMEM mac-base field usage to read the wan MAC
correctly from flash.

Reference to discussion at openwrt#13952 (comment)

Fixes: d264d3a ("ipq806x: remove mac-address-increment")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Dec 24, 2023
Correct the NVMEM mac-base field usage to read the wan MAC
correctly from flash.

Reference to discussion at openwrt#13952 (comment)

Fixes: d264d3a ("ipq806x: remove mac-address-increment")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
db260179 pushed a commit to db260179/openwrt that referenced this pull request Dec 24, 2023
Correct the NVMEM mac-base field usage to read the wan MAC
correctly from flash.

Reference to discussion at openwrt#13952 (comment)

Fixes: d264d3a ("ipq806x: remove mac-address-increment")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel pull request/issue with Linux kernel related changes target/ipq806x pull request/issue for ipq806x target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants