Hi,
a friend of mine using GPL sources initially provided bringup for Openwrt.
He had some custom patches and a DTS mainly based on the VENDOR one and I've taken up his work to properly bring up a clean Openwrt to be accepted by the community.
The hardware consist of:
SoC: MediaTek MT7986A (Filogic 830)
RAM: 512 MiB DDR3
Flash (Storage): 256 MiB SPI-NAND (UBI Layout)
WLAN 2.4 GHz: MediaTek MT7975 (I haven't opened the EMI cages to verify)
WLAN 5 GHz: MediaTek MT7975 (I haven't opened the EMI cages to verify)
Secondary SoC: EcoNet EN7516 (Dedicated xDSL / Coprocessor)
VoIP SoC/Slic: SI3228 (Interface handled via secondary coprocessor / 2x FXS ports)
Switch/PHY: Built-in MediaTek MT7531
Port Configuration:
* 1x 2.5 Gbps Ethernet WAN (PHY: EN8811H via MAC1)
* 1x 2.5 Gbps Ethernet LAN (PHY: EN8811H via Switch Port5)
* 2x 1.0 Gbps Ethernet LAN
* 1x SFP Port (Integrated cage, max 2.5G, XOR via SGMII MUX between the case and WAN phy)
* 1x RJ11 DSL Port (terminated via EN7516)
USB: 1x USB 3.0 Type-A SuperSpeed
Serial (UART): 2x Header Locations on PCB
* UART0: Main CPU (MediaTek MT7986A) - 115200n1, 3.3V
* UART1: Secondary DSL CPU (EcoNet EN7516)
From this, and other people reports, it should be all working fine, but building on top of snapshot using his provided patches and using Openwrt built in logic and scripting I'm facing two issues:
- The phy on the 2.5 LAN is correctly loading the firmware but the switch driver fails the phy capabilities/verification match throwing an error.
I cannot find a way to properly load the EEPROM data for the WIFI.
Lets tackle each issue by starting from the PHY.
This is the dmesg in question:
[ 2.490355] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[ 2.499155] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[ 2.509117] mt7530-mdio mdio-bus:1f lan0 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=124)
[ 2.534642] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=125)
[ 2.559858] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=126)
[ 2.576078] mt7530-mdio mdio-bus:1f lan3 (uninitialized): validation of 2500base-x with support 0000000,00000000,00000000,000062e8 and advertisement 0000000,00000000,00000000,000062c0 failed: -EINVAL
[ 2.606424] mt7530-mdio mdio-bus:1f lan3 (uninitialized): failed to connect to PHY: -EINVAL
[ 2.614766] mt7530-mdio mdio-bus:1f lan3 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 5
[ 2.625167] mtk_soc_eth 15100000.ethernet eth0: entered promiscuous mode
[ 2.631882] DSA: tree 0 setup
...
[ 8.686743] Airoha EN8811H mdio-bus:0e: MD32 firmware version: 25062302
[ 10.851327] Airoha EN8811H mdio-bus:0f: MD32 firmware version: 25062302
From what I understand supported c advertised so this should not be an issue.
But digging deeper I get that the C45 are somehow different and not matching so the init is halted.
Now, this message is printed here:
And the error is a EINVAL, no additional output is printed. so I suppose that the failure can then in two places:
I need to find a way to make the kernel verbose on initramfs boot. For what I've seen uboot is overriding the bootargs.
I've read somewhere that the EN8011H have a missing bit for the 2500 on the C45 response. I tried to hardcode the ETHTOOL_LINK_MODE_2500baseT_Full_BIT. No results.
At this point any suggestion is welcome as I have no idea on what is causing this issue as the same layout is used on the EX5601 I helped bringing Openwrt up without any such issue.
The relevant DTS:
&mdio {
phy_lan25g: ethernet-phy@e {
compatible = "ethernet-phy-id03a2.a411";
reg = <0xe>;
reset-gpios = <&pio 11 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <10000>;
phy-mode = "2500base-x";
full-duplex;
pause;
};
phy_wan: ethernet-phy@f {
compatible = "ethernet-phy-id03a2.a411";
reg = <0xf>;
reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <10000>;
phy-mode = "2500base-x";
full-duplex;
pause;
};
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&pio>;
interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
mediatek,p5-sgmii;
};
};
&switch {
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "lan0";
};
port@1 {
reg = <1>;
label = "lan2";
};
port@2 {
reg = <2>;
label = "lan1";
};
port@5 {
reg = <5>;
label = "lan3";
phy-mode = "2500base-x";
phy-handle = <&phy_lan25g>;
};
port@6 {
reg = <6>;
ethernet = <&gmac0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
};
Now lets step back to the WIFI problem.
Iḿ welcome with a firmware load error:
[ 17.406308] mt798x-wmac 18000000.wifi: HW/SW Version: 0x8a108a10, Build Time: 20260515120518a
[ 17.422756] mt798x-wmac 18000000.wifi: WM Firmware Version: ____000000, Build Time: 20260515120536
[ 17.460735] mt798x-wmac 18000000.wifi: WA Firmware Version: DEV_000000, Build Time: 20260515120626
[ 17.607070] mt798x-wmac 18000000.wifi: eeprom load fail, use default bin
[ 17.613815] mt798x-wmac 18000000.wifi: Direct firmware load for mediatek/mt7986_eeprom_mt7975_dual.bin failed with error -2
[ 17.624925] mt798x-wmac 18000000.wifi: Falling back to sysfs fallback for: mediatek/mt7986_eeprom_mt7975_dual.bin
[ 17.655861] mt798x-wmac 18000000.wifi: probe with driver mt798x-wmac failed with error -12
Now we have to discuss a bit on where this data is. It is in a UBI volume inside the misc_ro MTD partition.
The UBI volume is not raw data, but instead contains some binary files like the EEPROM data and the MAC address. (Don't let the file names mess you up, yes they are named like memory addresses)
[ 1.986090] 9 fixed-partitions partitions found on MTD device spi0.1
[ 1.992445] Creating 9 MTD partitions on "spi0.1":
[ 1.997239] 0x000000000000-0x000000200000 : "boot"
[ 2.003915] 0x000000200000-0x000000300000 : "u-boot-env"
[ 2.010152] 0x000000300000-0x000000900000 : "misc_ro"
[ 2.019879] 0x000000900000-0x000000f00000 : "misc_rw"
[ 2.029840] 0x000000f00000-0x000003700000 : "ubi0"
[ 2.064567] 0x000003700000-0x000005f00000 : "ubi1"
[ 2.099415] 0x000005f00000-0x000006500000 : "misc_rw_bak"
[ 2.109637] 0x000006500000-0x000006b00000 : "bflag"
[ 2.119211] 0x000006b00000-0x000007100000 : "misc_isp"
This partition is loaded using the preinit scripts.
And on caldata script it is linking the correct file:
And then the firmware is loaded via:
Now please note the dd in there, this was my last attempt to see if it was due to the file being too bit to be loaded on the reserved memory. But even by directly linking the file the error was the same.
What I wasn't expecting was the same failure even with built-in eeprom firmware from the Openwrt packages. I was expecting low performance, not working wireless but not a firmware load error.
Full device tree:
Full bootlog:
Edit: I probably had a brain-fart with the EEPROM. The only issue I keep having is the PHY.