ramips: fix WAN mac address allocation for Unielec 01 and 06 models
authorDavid Bentham <db260179@gmail.com>
Mon, 17 Oct 2022 14:43:29 +0000 (15:43 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 23 Oct 2022 12:21:03 +0000 (14:21 +0200)
Manufacturer has predetermined mac address values for lan and wan ports.

This change keeps inline with other mt7621 devices mac address allocation
from factory mtd partition.

Example from hexdump output:

0xe000 0x6 (lan) -           0xe006 0x6 (wan)

0000e000  70 b3 d5 10 02 96 70 b3  d5 10 02 95 ff ff ff ff

Previous change had created an overlapping mac address situation as it
would increment by one based on the lan mac address location found in the
factory partition, which would sometimes increment to the same as the
mt7603 wifi chip.

Tested on Unielec u7621-01 model

Signed-off-by: David Bentham <db260179@gmail.com>
(cherry picked from commit 67660d36674c8c1504cbf3cd199409d0b209f802)

target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts
target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts
target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts

index 84172cdd175a9da23a401ba2c96b13580d8f67be..aa03a374754dadbc2435a5df58e131c527701704 100644 (file)
        nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
        nvmem-cells = <&macaddr_factory_e000>;
        nvmem-cell-names = "mac-address";
-       mac-address-increment = <1>;
 };
 
 &factory {
@@ -66,4 +65,8 @@
        macaddr_factory_e000: macaddr@e000 {
                reg = <0xe000 0x6>;
        };
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
+       };
 };
index 41aa2dce5e6c60fc2884ecd46db65d3c9b1a7c50..81ee02ea143c20a3ec3daa9b8063a1ead6a4fc90 100644 (file)
        nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
        nvmem-cells = <&macaddr_factory_e000>;
        nvmem-cell-names = "mac-address";
-       mac-address-increment = <1>;
 };
 
 &factory {
@@ -71,4 +70,8 @@
        macaddr_factory_e000: macaddr@e000 {
                reg = <0xe000 0x6>;
        };
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
+       };
 };
index a66969a8035c6614b4a090361649fc51f94901f4..53a1c800e36545e4b03dd838f95037b94e80d77e 100644 (file)
        nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
        nvmem-cells = <&macaddr_factory_e000>;
        nvmem-cell-names = "mac-address";
-       mac-address-increment = <1>;
 };
 
 &factory {
@@ -72,4 +71,8 @@
        macaddr_factory_e000: macaddr@e000 {
                reg = <0xe000 0x6>;
        };
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
+       };
 };