Hello,
I'm working on a pull request to add support for our DPT-Module V1 (https://www.dptechnics.com/docs/openwrtmodule_datasheet_rev3.pdf). This device was previously in the ar71xx
support branch and must now be ported to ath79
. I have about everything working, except the MAC address assignment. We use the following MAC scheme:
- WiFi = sticker MAC
- LAN = sticker MAC - 1
- WAN = sticker MAC + 1
The sticker MAC is read from a factory partition and this is working well for WiFi. The problem however is with the ethernet. Following is the relevant DTS snippet:
ð0 {
status = "okay";
nvmem-cells = <&macaddr_factory>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
gmac-config {
device = <&gmac>;
switch-phy-addr-swap = <0>;
switch-phy-swap = <0>;
};
};
ð1 {
status = "okay";
nvmem-cells = <&macaddr_factory>;
nvmem-cell-names = "mac-address";
mac-address-increment = <(-1)>;
};
There are two strange things:
- eth0 in the DTS is actually eth1 on boot. This is the actual WAN port and is working as such (I added eth1 as WAN in 02_network).
- While eth1 in the DTS (this is eth0 when booted) has the sticker MAC -1 as expected. eth0 in the DTS (this is eth1 when booted) has the sticker MAC + 2.
I have tried every possible combination of numbers but it's always wrong. Can somebody point me in the right direction?
Kind regards,
Daan