Skip to content

Commit

Permalink
ipq806x: Stabilize LAN 2 MAC address, interface ordering
Browse files Browse the repository at this point in the history
Part 1 of openwrt#13629 split.

* Sets the LAN 2 MAC address in the DTS by deriving it from LAN 1's
address. The factory OS derives this from the `eth1addr` u-boot env
variable, but the nvmem_u-boot-env driver doesn't support parsing MAC
addresses from fields other than `ethaddr`. But for all of the device
samples I've checked (~10) it derives the correct MAC.

* Updates 02_network to ensure that interfaces are assigned to roles
correctly and consistently.

Signed-off-by: Bryan Berg <[email protected]>
  • Loading branch information
berg committed Nov 30, 2023
1 parent fa55f59 commit 54f2865
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions target/linux/ipq806x/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ ipq806x_setup_interfaces()
ucidef_set_network_device_conduit "lan1" "eth1"
ucidef_set_network_device_conduit "wan" "eth0"
;;
edgecore,ecw5410 |\
extreme,ap3935)
edgecore,ecw5410)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
qcom,ipq8064-ap161)
Expand All @@ -62,6 +61,7 @@ ipq806x_setup_interfaces()
meraki,mr42)
ucidef_set_interface_lan "eth0"
;;
extreme,ap3935 |\
meraki,mr52)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
reg = <0x02a0000 0x0010000>;

ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};

Expand Down Expand Up @@ -327,7 +328,7 @@
phy-mode = "rgmii";
phy-handle = <&phy1>;

nvmem-cells = <&ethaddr>;
nvmem-cells = <&ethaddr 0>;
nvmem-cell-names = "mac-address";

fixed-link {
Expand All @@ -344,6 +345,9 @@

phy-mode = "sgmii";
phy-handle = <&phy2>;

nvmem-cells = <&ethaddr 1>;
nvmem-cell-names = "mac-address";
};

&adm_dma {
Expand Down

0 comments on commit 54f2865

Please sign in to comment.