Adding OpenWrt support for Zyxel EX5601-T0

Ok so the blue RJ45 is a 2.5g wan port.
The first yellow RJ45 next to the blue one is a lan 2.5g baseT port.
The 3 additional RJ45 are 1gbit ports

You can see too the hsgmii SFP port which is an xor of the blue wan port. If you insert an SFP it has precedence on the blue wan port. That's automatically switched by Zyxel bash scripts that constantly look at which port you are using.

With the default mt7986a.dts/i the sfp, wan and lan 2.5 gbit ports are not working at all.
If I plug a cable into the 2.5g lan or 2.5wan or an sfp the serial console is not showing anything.
While if I plug a cable into the 3 gbit they simply work.

Well, you obviously have to describe how the phys and macs connect for all external phys.

I'm still a bit puzzled about the SFP cage connections. The pics show two Maxlinear PHYs in places where it makes sense. One between the SoC and the blue port, and another one next to the switch and almost hidden by the heatsink.

But where does the SERDES link to the SFP cage go? Under the cage, crossing all the switch ports? Looks like there are 6 traces coming out of another layer next to the connector end of the cage. Guess that's it. I still don't see how this is multiplexed, but I guess there's a mux here somewhere too. Maybe under the heatsink?

I tried removing the screws but than the heatsink was not detaching with "reasonable" force. I guess I'll need to poke around with the DTS from Zyxel and the base mt7986a dtsi.

I'm analyzing the bootlog from the Zyxel firmware. When I plug the lan 2.5 gbit port i see the following:
[ 186.872415] Intel GPY211 PHY mdio-bus:05: ###phy_addr[5] [lan5] link up speed[2500]
So there's an Intel driver I'm not loading.

FYI zyxel source is here: ErnyTech/zyxel-ex5601t0: Zyxel EX5601-T0 router GPL source code (github.com)

Out of curiosity, is there any easy way to strip all the zyxel interface and replace that with luci?

I believe I've said this a few times now, but what you have is a Maxlinear GPY211C (guessing the C...). I posted a link to the datasheet from their website. If you read that, the very first page - cover page actually - says

In 2020, MaxLinear acquired the Connected Home Division
business of Intel Corporation, including the former Intelยฎ product/s
referenced in the title of the attached material. The MaxLinear logo
will be added to the attached material upon its next revision.
MaxLinear is now the manufacturer of this product.

So, yes, Intel or Maxlinear, who cares. It's a GPY211 and there is a driver in Linux/OpenWrt and it works perfectly with the MT7531 and MT7986.

And as suspected - it's on the very same address the EX5700 is using. The one connected to the MT7986 is probably on 6, although the SFP stuff could confuse this I guess. I have no idea how that is wired up.

But, no, you don't need to add any crazy vendor-driver for this. And you don't need to configure much of it either. The PHY IDs will be probed and the correct driver loaded automatically as long as you

  1. add the mdio-reset and appropriate delays (those PHYs use a long time to "boot")
  2. add the appropriate phy entries
  3. link the macs fo the phys

What I have is:

&mdio {
	reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
	reset-delay-us = <50000>;
	reset-post-delay-us = <20000>;

	phy5: phy@5 {
		compatible = "ethernet-phy-ieee802.3-c45";
		reg = <5>;
	};

	phy6: phy@6 {
		compatible = "ethernet-phy-ieee802.3-c45";
		reg = <6>;
	};

	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>;
	};
};

This should be enough to get the two PHYs recognised and the driver loaded.

Then you need to connect phy5 to port5 (inside &switch/ports):

		port@5 {
			reg = <5>;
			label = "lan4";
			phy-mode = "2500base-x";
                        phy-handle = <&phy5>;
		};

And phy6 to whatever it is connected to. The EX7500 connects it to the second SoC mac, so that looks like

&eth {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&eth_pins>;

	gmac0: mac@0 {
		compatible = "mediatek,eth-mac";
		reg = <0>;
		phy-mode = "2500base-x";

		fixed-link {
			speed = <2500>;
			full-duplex;
			pause;
		};
	};

	mac@1 {
		compatible = "mediatek,eth-mac";
		reg = <1>;
		label = "wan";
		phy-mode = "2500base-x";
		phy-handle = <&phy6>;
	};

	mdio: mdio-bus {
		#address-cells = <1>;
		#size-cells = <0>;
	};
};

The last part might not work for you. But I see no reason not to try, given that we so far have exactly no info on the SFP

Don't know why I'm repeating all this. It's been said before. I'll just stop now

I understand your point.... Anyways I did like you suggested.

I started with the clean DTS from the owrt sources and built an initram FS. All good but the 2.5 eth ports.
Than i try to fix only the switch and the 2.5 ports so I started changing the switch and mdio to make it match the original Zyxel.
The initramfs buils and starts-up.

Still only the 3 gbit ports and wifi work as expected.
Wan (blue) eth 2,5: no signal
Lan5 (yellow) eth 2.5 blinks for a less than a second but than stops working (even if the serial says that the port goes into forwarding mode)
sfp port not working, if I insert an sfp the entire system becomes unstable (because i guess it's not able to manage the switching between the wan 2.5 and sfp)

bootlog

## Loading kernel from FIT Image at 46000000 ...
   Using 'config-1' configuration
   Trying 'kernel-1' kernel subimage
     Description:  ARM64 OpenWrt Linux-5.15.104
     Type:         Kernel Image
     Compression:  lzma compressed
     Data Start:   0x460000ec
     Data Size:    24414596 Bytes = 23.3 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x48000000
     Entry Point:  0x48000000
     Hash algo:    crc32
     Hash value:   8a32eb35
     Hash algo:    sha1
     Hash value:   17410f0b86226bff855cf88a643353b0a4ac47f5
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 46000000 ...
   Using 'config-1' configuration
   Trying 'fdt-1' fdt subimage
     Description:  ARM64 OpenWrt ex5601-t0-nozyxel device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x47748bb4
     Data Size:    32768 Bytes = 32 KiB
     Architecture: AArch64
     Hash algo:    crc32
     Hash value:   723ee039
     Hash algo:    sha1
     Hash value:   3f5686b6d204ea404cbc3c71d31dca2df4bfc9e9
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x47748bb4
   Uncompressing Kernel Image
   Loading Device Tree to 000000007f7ee000, end 000000007f7f8fff ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.15.104 (piameruo@compiler) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.2.0 r22419-42a5917786) 12.2.0, GNU ld (GNU Binutils) 2.40.0) #0 SMP Mon Mar 27 16:15:13 2023
[    0.000000] Machine model: MediaTek MT7986a RFB
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000042ffffff]
[    0.000000]   node   0: [mem 0x0000000043000000-0x000000004302ffff]
[    0.000000]   node   0: [mem 0x0000000043030000-0x000000004fbfffff]
[    0.000000]   node   0: [mem 0x000000004fc00000-0x000000004ffbffff]
[    0.000000]   node   0: [mem 0x000000004ffc0000-0x000000007fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.2
[    0.000000] percpu: Embedded 17 pages/cpu s29656 r8192 d31784 u69632
[    0.000000] pcpu-alloc: s29656 r8192 d31784 u69632 alloc=17*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] CPU features: kernel page table isolation disabled by kernel configuration
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258048
[    0.000000] Kernel command line: 
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 992072K/1048576K available (8384K kernel code, 894K rwdata, 2176K rodata, 20096K init, 299K bss, 56504K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 640 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has no Range Selector support
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x000000000c080000
[    0.000000] arch_timer: cp15 timer(s) running at 13.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2ff89eacb, max_idle_ns: 440795202429 ns
[    0.000000] sched_clock: 56 bits at 13MHz, resolution 76ns, wraps every 4398046511101ns
[    0.000144] Calibrating delay loop (skipped), value calculated using timer frequency.. 26.00 BogoMIPS (lpj=130000)
[    0.000152] pid_max: default: 32768 minimum: 301
[    0.000236] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.000245] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.001159] rcu: Hierarchical SRCU implementation.
[    0.001248] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.001455] smp: Bringing up secondary CPUs ...
[    0.001695] Detected VIPT I-cache on CPU1
[    0.001719] GICv3: CPU1: found redistributor 1 region 0:0x000000000c0a0000
[    0.001743] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.002013] Detected VIPT I-cache on CPU2
[    0.002025] GICv3: CPU2: found redistributor 2 region 0:0x000000000c0c0000
[    0.002036] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.002261] Detected VIPT I-cache on CPU3
[    0.002271] GICv3: CPU3: found redistributor 3 region 0:0x000000000c0e0000
[    0.002280] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.002305] smp: Brought up 1 node, 4 CPUs
[    0.002319] SMP: Total of 4 processors activated.
[    0.002323] CPU features: detected: 32-bit EL0 Support
[    0.002326] CPU features: detected: CRC32 instructions
[    0.002402] CPU: All CPU(s) started at EL2
[    0.002413] alternatives: patching kernel code
[    0.004714] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.004737] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.004850] pinctrl core: initialized pinctrl subsystem
[    0.005301] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.005507] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.005528] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.005544] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.005770] thermal_sys: Registered thermal governor 'fair_share'
[    0.005772] thermal_sys: Registered thermal governor 'bang_bang'
[    0.005776] thermal_sys: Registered thermal governor 'step_wise'
[    0.005779] thermal_sys: Registered thermal governor 'user_space'
[    0.005955] ASID allocator initialised with 65536 entries
[    0.006203] pstore: Registered ramoops as persistent store backend
[    0.006207] ramoops: using 0x10000@0x42ff0000, ecc: 0
[    0.014466] cryptd: max_cpu_qlen set to 1000
[    0.016243] SCSI subsystem initialized
[    0.016324] libata version 3.00 loaded.
[    0.017088] clocksource: Switched to clocksource arch_sys_counter
[    0.017454] NET: Registered PF_INET protocol family
[    0.017540] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.017955] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.017969] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.017976] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.018013] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.018093] TCP: Hash tables configured (established 8192 bind 8192)
[    0.018160] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.018177] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.018262] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.018281] PCI: CLS 0 bytes, default 64
[    0.039069] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[    0.041167] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.041182] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.064004] mtk-pcie-gen3 11280000.pcie: host bridge /soc/pcie@11280000 ranges:
[    0.064032] mtk-pcie-gen3 11280000.pcie: Parsing ranges property...
[    0.064042] mtk-pcie-gen3 11280000.pcie:      MEM 0x0020000000..0x002fffffff -> 0x0020000000
[    0.064093] phy phy-soc:t-phy@11c00000.0: u3 auto load valid efuse: ENABLE with value: 1
[    0.064124] phy phy-soc:t-phy@11c00000.0: pcie auto load valid efuse: ENABLE with value: 1
[    0.064147] phy phy-soc:t-phy@11c00000.0: u3 lane1 efuse - intr 28, rx_imp f, tx_imp e
[    0.064200] /soc/pcie@11280000: Failed to get clk index: 0 ret: -517
[    0.064209] mtk-pcie-gen3 11280000.pcie: failed to get clocks
[    0.066383] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.067932] printk: console [ttyS0] disabled
[    0.088108] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 121, base_baud = 2500000) is a ST16650V2
[    0.777510] printk: console [ttyS0] enabled
[    0.802360] 11003000.serial: ttyS1 at MMIO 0x11003000 (irq = 122, base_baud = 1625000) is a ST16650V2
[    0.832296] 11004000.serial: ttyS2 at MMIO 0x11004000 (irq = 123, base_baud = 1625000) is a ST16650V2
[    0.842252] mtk_rng 1020f000.trng: registered RNG driver
[    0.847367] random: crng init done
[    0.847871] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.859000] loop: module loaded
[    0.863404] spi-nand spi0.1: Micron SPI NAND was found.
[    0.868649] spi-nand spi0.1: 512 MiB, block size: 256 KiB, page size: 4096, OOB size: 256
[    3.749863] 8 fixed-partitions partitions found on MTD device spi0.1
[    3.756219] Creating 8 MTD partitions on "spi0.1":
[    3.761005] 0x000000000000-0x000000100000 : "BL2"
[    3.767232] 0x000000100000-0x000000180000 : "u-boot-env"
[    3.773347] 0x000000180000-0x000000380000 : "Factory"
[    3.780954] 0x000000380000-0x000000540000 : "FIP"
[    3.787899] 0x000000540000-0x000000580000 : "zloader"
[    3.793466] 0x000000580000-0x000004580000 : "ubi"
[    3.872956] 0x000004580000-0x000008580000 : "ubi2"
[    3.952103] 0x000008580000-0x00001e000000 : "zyubi"
[    4.670523] Maxlinear Ethernet GPY211B mdio-bus:05: Firmware Version: 0x0000 (test)
[    4.690585] Maxlinear Ethernet GPY211B mdio-bus:06: Firmware Version: 0x0000 (test)
[    4.699360] mtk_soc_eth 15100000.ethernet: generated random MAC address e2:fc:d9:ef:ca:51
[    4.708104] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc00ad00000, irq 133
[    4.717275] mtk_soc_eth 15100000.ethernet: generated random MAC address 92:e3:28:6d:63:65
[    4.726029] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc00ad00000, irq 133
[    4.735516] i2c_dev: i2c /dev entries driver
[    4.740736] mtk-wdt 1001c000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    4.749082] NET: Registered PF_INET6 protocol family
[    4.754582] Segment Routing with IPv6
[    4.758279] In-situ OAM (IOAM) with IPv6
[    4.762218] NET: Registered PF_PACKET protocol family
[    4.767281] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    4.797759] NET: Registered PF_RXRPC protocol family
[    4.802724] Key type rxrpc registered
[    4.806369] Key type rxrpc_s registered
[    4.810252] 8021q: 802.1Q VLAN Support v1.8
[    4.815323] pstore: Using crash dump compression: deflate
[    4.825571] mtk-pcie-gen3 11280000.pcie: host bridge /soc/pcie@11280000 ranges:
[    4.832904] mtk-pcie-gen3 11280000.pcie: Parsing ranges property...
[    4.839176] mtk-pcie-gen3 11280000.pcie:      MEM 0x0020000000..0x002fffffff -> 0x0020000000
[    4.847648] phy phy-soc:t-phy@11c00000.0: u3 auto load valid efuse: ENABLE with value: 1
[    4.855739] phy phy-soc:t-phy@11c00000.0: pcie auto load valid efuse: ENABLE with value: 1
[    4.864002] phy phy-soc:t-phy@11c00000.0: u3 lane1 efuse - intr 28, rx_imp f, tx_imp e
[    5.087121] mtk-pcie-gen3 11280000.pcie: PCIe link down, ltssm reg val: 0x1000001
[    5.094614] mtk-pcie-gen3: probe of 11280000.pcie failed with error -110
[    5.143962] mt7530 mdio-bus:1f: no interrupt support
[    5.187843] mt7530 mdio-bus:1f: configuring for fixed/2500base-x link mode
[    5.195146] mt7530 mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    5.204749] mt7530 mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[    5.224552] mt7530 mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[    5.244068] mt7530 mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[    5.255169] DSA: tree 0 setup
[    5.262051] UBI: auto-attach mtd5
[    5.265363] ubi0: default fastmap pool size: 10
[    5.269901] ubi0: default fastmap WL pool size: 5
[    5.274587] ubi0: attaching mtd5
[    7.107676] ubi0: scanning is finished
[    7.154492] ubi0 warning: ubi_eba_init: cannot reserve enough PEBs for bad PEB handling, reserved 37, need 40
[    7.164786] ubi0: attached mtd5 (name "ubi", size 64 MiB)
[    7.170180] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
[    7.177032] ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
[    7.183800] ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
[    7.190742] ubi0: good PEBs: 256, bad PEBs: 0, corrupted PEBs: 0
[    7.196728] ubi0: user volume: 5, internal volumes: 1, max. volumes count: 128
[    7.203929] ubi0: max/mean erase counter: 37/8, WL threshold: 4096, image sequence number: 1658393161
[    7.213125] ubi0: available PEBs: 0, total reserved PEBs: 256, PEBs reserved for bad PEB handling: 37
[    7.222325] ubi0: background thread "ubi_bgt0d" started, PID 505
[    7.235992] block ubiblock0_1: created from ubi0:1(rootfs)
[    7.241480] ubiblock: device ubiblock0_1 (rootfs) set to be root filesystem
[    7.255643] Freeing unused kernel memory: 20096K
[    7.317126] Run /init as init process
[    7.320773]   with arguments:
[    7.323723]     /init
[    7.325981]   with environment:
[    7.329110]     HOME=/
[    7.331455]     TERM=linux
[    7.772237] init: Console is alive
[    7.775726] init: - watchdog -
[    7.788674] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    7.799168] usbcore: registered new interface driver usbfs
[    7.804676] usbcore: registered new interface driver hub
[    7.810030] usbcore: registered new device driver usb
[    7.819235] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    7.826278] fsl-ehci: Freescale EHCI Host controller driver
[    7.832387] ehci-platform: EHCI generic platform driver
[    7.838939] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    7.845579] ohci-platform: OHCI generic platform driver
[    7.853600] phy phy-soc:t-phy@11e10000.1: u2 auto load valid efuse: ENABLE with value: 1
[    7.861748] phy phy-soc:t-phy@11e10000.2: u3 auto load valid efuse: ENABLE with value: 1
[    7.869877] phy phy-soc:t-phy@11e10000.3: u2 auto load valid efuse: ENABLE with value: 1
[    7.878418] xhci-mtk 11200000.usb: xHCI Host Controller
[    7.883634] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 1
[    7.894089] xhci-mtk 11200000.usb: hcc params 0x01403f99 hci version 0x110 quirks 0x0000000000210010
[    7.903290] xhci-mtk 11200000.usb: irq 126, io mem 0x11200000
[    7.909117] xhci-mtk 11200000.usb: xHCI Host Controller
[    7.914328] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 2
[    7.921714] xhci-mtk 11200000.usb: Host supports USB 3.2 Enhanced SuperSpeed
[    7.929105] hub 1-0:1.0: USB hub found
[    7.932858] hub 1-0:1.0: 2 ports detected
[    7.937108] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    7.945410] hub 2-0:1.0: USB hub found
[    7.949219] hub 2-0:1.0: 1 port detected
[    7.956376] usbcore: registered new interface driver usb-storage
[    7.962678] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.972634] init: - preinit -
[    8.013165] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[    8.021595] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    8.030640] mt7530 mdio-bus:1f lan1: configuring for phy/gmii link mode
[    8.041992] mt7530 mdio-bus:1f lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[    8.049595] IPv6: ADDRCONF(NETDEV_CHANGE): lan1: link becomes ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   18.101091] mt7530 mdio-bus:1f lan1: Link is Down
[   18.108371] procd: - early -
[   18.111294] procd: - watchdog -
Failed to connect to ubus
[   18.626009] procd: - watchdog -
[   18.629302] procd: - ubus -
[   18.682350] procd: - init -
Please press Enter to activate this console.
[   18.756720] urngd: v1.0.2 started.
[   18.785109] kmodloader: loading kernel modules from /etc/modules.d/*
[   18.794908] MACsec IEEE 802.1AE
[   18.800079] NET: Registered PF_ATMPVC protocol family
[   18.805131] NET: Registered PF_ATMSVC protocol family
[   18.811980] ntfs: driver 2.1.32 [Flags: R/O MODULE].
[   18.817964] NET: Registered PF_KEY protocol family
[   18.823358] Initializing XFRM netlink socket
[   18.836712] tun: Universal TUN/TAP device driver, 1.6
[   18.846802] l2tp_core: L2TP core driver, V2.0
[   18.852191] l2tp_netlink: L2TP netlink interface
[   18.857992] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[   18.865276] nat46: module (version 95ca1c3b99376da2d0306919f2df4a8d3c9bb78b) loaded.
[   18.874130] gre: GRE over IPv4 demultiplexor driver
[   18.880017] ip_gre: GRE over IPv4 tunneling driver
[   18.886825] ip6_gre: GRE over IPv6 tunneling driver
[   18.894258] PPP generic driver version 2.4.2
[   18.924573] GACT probability on
[   18.928703] Mirror/redirect action on
[   18.937980] u32 classifier
[   18.940704]     input device check on
[   18.944351]     Actions configured
[   18.954006] fuse: init (API version 7.34)
[   18.960012] crypto-safexcel 10320000.crypto: EIP97:230(0,1,4,4)-HIA:270(0,5,5),PE:150/433(alg:7fcdfc00)/0/0/0
[   18.977351] Bridge firewalling registered
[   18.982426] usbcore: registered new interface driver cdc_acm
[   18.988104] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   18.996937] usbcore: registered new interface driver cdc_wdm
[   19.003195] Loading modules backported from Linux version v6.1-rc8-0-g76dcd734eca2
[   19.010772] Backport generated by backports.git v5.15.81-1-41-g02e352527db5
[   19.021939] hso: drivers/net/usb/hso.c: Option Wireless
[   19.027250] usbcore: registered new interface driver hso
[   19.037117] MRM The MAC Address Re-Mapper is now in the kernel
[   19.056309] PPP MPPE Compression module registered
[   19.061641] NET: Registered PF_PPPOX protocol family
[   19.067143] PPTP driver version 0.8.5
[   19.072885] usbcore: registered new interface driver usblp
[   19.081844] usbcore: registered new interface driver usbserial_generic
[   19.088419] usbserial: USB Serial support registered for generic
[   19.103975] xt_time: kernel timezone is -0000
[   19.109342] usbcore: registered new interface driver cdc_ether
[   19.116365] usbcore: registered new interface driver cdc_ncm
[   19.132002] l2tp_ppp: PPPoL2TP kernel driver, V2.0
[   19.490425] mt7986-wmac 18000000.wmac: HW/SW Version: 0x8a108a10, Build Time: 20221012174648a
[   19.490425] 
[   19.508671] mt7986-wmac 18000000.wmac: WM Firmware Version: ____000000, Build Time: 20221012174725
[   19.545445] mt7986-wmac 18000000.wmac: WA Firmware Version: DEV_000000, Build Time: 20221012174937
[   23.476937] usbcore: registered new interface driver qmi_wwan
[   23.483965] usbcore: registered new interface driver rndis_host
[   23.492595] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[   23.500434] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[   23.519922] usbcore: registered new interface driver option
[   23.525564] usbserial: USB Serial support registered for GSM modem (1-port)
[   23.533654] kmodloader: done loading kernel modules from /etc/modules.d/*
[   28.163800] mtk_soc_eth 15100000.ethernet eth0: Link is Down
[   28.175677] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[   28.184453] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[   28.185704] mt7530 mdio-bus:1f lan1: configuring for phy/gmii link mode
[   28.200786] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   28.207630] br-lan: port 1(lan1) entered blocking state
[   28.212862] br-lan: port 1(lan1) entered disabled state
[   28.219613] device lan1 entered promiscuous mode
[   28.224224] device eth0 entered promiscuous mode
[   28.238972] mt7530 mdio-bus:1f lan2: configuring for phy/gmii link mode
[   28.248401] br-lan: port 2(lan2) entered blocking state
[   28.253633] br-lan: port 2(lan2) entered disabled state
[   28.260665] device lan2 entered promiscuous mode
[   28.269767] mt7530 mdio-bus:1f lan3: configuring for phy/gmii link mode
[   28.279164] br-lan: port 3(lan3) entered blocking state
[   28.284383] br-lan: port 3(lan3) entered disabled state
[   28.291558] device lan3 entered promiscuous mode
[   31.290352] mt7530 mdio-bus:1f lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[   31.297871] br-lan: port 1(lan1) entered blocking state
[   31.303081] br-lan: port 1(lan1) entered forwarding state
[   31.309268] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

ifconfig and ethtool (lan5 is missing because is not inside the br-lan interface still)

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::e0fc:d9ff:feef:ca51/64 Scope:Link
          inet6 addr: fd07:470b:c9f3::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:145 errors:0 dropped:3 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:14659 (14.3 KiB)  TX bytes:1934 (1.8 KiB)

eth0      Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          inet6 addr: fe80::e0fc:d9ff:feef:ca51/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1504  Metric:1
          RX packets:252 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:28161 (27.5 KiB)  TX bytes:15908 (15.5 KiB)
          Interrupt:133 

lan1      Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:252 errors:0 dropped:17 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:23625 (23.0 KiB)  TX bytes:13574 (13.2 KiB)

lan2      Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan3      Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:44 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3432 (3.3 KiB)  TX bytes:3432 (3.3 KiB)

root@OpenWrt:/# ethtool lan5
Settings for lan5:
	Supported ports: [ MII ]
	Supported link modes:   2500baseT/Full
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  2500baseT/Full
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: No
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  2500baseT/Full
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: No
	Link partner advertised FEC modes: Not reported
	Speed: 2500Mb/s
	Duplex: Full
	Auto-negotiation: on
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Supports Wake-on: d
	Wake-on: d
	Link detected: no
root@OpenWrt:/# ehte[Je[Jthtool ehte[Je[Jth0
Settings for eth0:
	Supported ports: [ MII ]
	Supported link modes:   2500baseT/Full
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  2500baseT/Full
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  2500baseT/Full
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: No
	Link partner advertised FEC modes: Not reported
	Speed: 2500Mb/s
	Duplex: Full
	Auto-negotiation: on
	Port: MII
	PHYAD: 0
	Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
	Link detected: yes
root@OpenWrt:/# 
root@OpenWrt:/# ethtool eth0e[Je[J1
Settings for eth1:
	Supported ports: [ MII ]
	Supported link modes:   2500baseT/Full
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  2500baseT/Full
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  2500baseT/Full
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: No
	Link partner advertised FEC modes: Not reported
	Speed: 2500Mb/s
	Duplex: Full
	Auto-negotiation: on
	Port: MII
	PHYAD: 0
	Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
	Link detected: no

moving lan5 inside br-lan

root@OpenWrt:/# [   79.358354] mt7530 mdio-bus:1f lan5: configuring for fixed/2500base-x link mode
[   79.366789] br-lan: port 4(lan5) entered blocking state
[   79.366800] mt7530 mdio-bus:1f lan5: Link is Up - 2.5Gbps/Full - flow control rx/tx
[   79.372018] br-lan: port 4(lan5) entered disabled state
[   79.373986] device lan5 entered promiscuous mode
[   79.392043] br-lan: port 4(lan5) entered blocking state
[   79.397261] br-lan: port 4(lan5) entered forwarding state

than again ethtool and ifconfig. than i unplug the cable from lan 1 and plug it to lan5 (eth lan 2.5). no output---nothing

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::e0fc:d9ff:feef:ca51/64 Scope:Link
          inet6 addr: fd07:470b:c9f3::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1474 errors:0 dropped:3 overruns:0 frame:0
          TX packets:847 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:216811 (211.7 KiB)  TX bytes:322884 (315.3 KiB)

eth0      Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          inet6 addr: fe80::e0fc:d9ff:feef:ca51/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1504  Metric:1
          RX packets:1587 errors:0 dropped:0 overruns:0 frame:0
          TX packets:969 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:254643 (248.6 KiB)  TX bytes:349514 (341.3 KiB)
          Interrupt:133 

lan1      Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1587 errors:0 dropped:19 overruns:0 frame:0
          TX packets:876 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:226077 (220.7 KiB)  TX bytes:334524 (326.6 KiB)

lan2      Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan3      Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan5      Link encap:Ethernet  HWaddr E2:FC:D9:EF:CA:51  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:394 (394.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:265 errors:0 dropped:0 overruns:0 frame:0
          TX packets:265 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:20692 (20.2 KiB)  TX bytes:20692 (20.2 KiB)

root@OpenWrt:/# ethtool lan5
Settings for lan5:
	Supported ports: [ MII ]
	Supported link modes:   2500baseT/Full
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  2500baseT/Full
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: No
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  2500baseT/Full
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: No
	Link partner advertised FEC modes: Not reported
	Speed: 2500Mb/s
	Duplex: Full
	Auto-negotiation: on
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Supports Wake-on: d
	Wake-on: d
	Link detected: yes
root@OpenWrt:/# [   97.848185] br-lan: port 1(lan1) entered disabled state
[   97.853669] mt7530 mdio-bus:1f lan1: Link is Down

You did not do what I suggested

i Just recompiled without fixed link on lan5 but that's not appearing at all in the bootlog.

// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
 * Copyright (C) 2021 MediaTek Inc.
 * Author: Sam.Shih <sam.shih@mediatek.com>
 */

/dts-v1/;
#include "mt7986a.dtsi"

/ {
	model = "MediaTek MT7986a RFB";
	compatible = "mediatek,mt7986a-rfb";

	aliases {
		serial0 = &uart0;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	memory {
		reg = <0 0x40000000 0 0x40000000>;
	};

	reg_1p8v: regulator-1p8v {
		compatible = "regulator-fixed";
		regulator-name = "fixed-1.8V";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-boot-on;
		regulator-always-on;
	};

	reg_3p3v: regulator-3p3v {
		compatible = "regulator-fixed";
		regulator-name = "fixed-3.3V";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-boot-on;
		regulator-always-on;
	};

	reg_5v: regulator-5v {
		compatible = "regulator-fixed";
		regulator-name = "fixed-5V";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-boot-on;
		regulator-always-on;
	};
};

&eth {
	status = "okay";

	gmac0: mac@0 {
		compatible = "mediatek,eth-mac";
		reg = <0>;
		phy-mode = "2500base-x";

		fixed-link {
			speed = <2500>;
			full-duplex;
			pause;
		};
	};

	gmac1: mac@1 {
		compatible = "mediatek,eth-mac";
		reg = <1>;
		phy-mode = "2500base-x";

		fixed-link {
			speed = <2500>;
			full-duplex;
			pause;
		};
	};

	mdio: mdio-bus {
		#address-cells = <1>;
		#size-cells = <0>;
	};
};

&wmac {
	status = "okay";
	pinctrl-names = "default", "dbdc";
	pinctrl-0 = <&wf_2g_5g_pins>;
	pinctrl-1 = <&wf_dbdc_pins>;
};

&mdio {
	phy5: phy@5 {
		compatible = "ethernet-phy-id67c9.de0a";
		reg = <5>;
		reset-gpios = <&pio 6 1>;
		reset-assert-us = <50000>;
		reset-deassert-us = <20000>;
		phy-mode = "2500base-x";
		maxlinear,led-reg = <1008 0 0 0>;
		ifname = "lan5";
	};

	phy6: phy@6 {
		compatible = "ethernet-phy-id67c9.de0a";
		reg = <6>;
		phy-mode = "2500base-x";
		maxlinear,led-reg = <240 0 0 0>;
		ifname = "eth1";
	};

	switch: switch@0 {
		compatible = "mediatek,mt7531";
		reg = <31>;
		reset-gpios = <&pio 5 0>;
	};
};

&crypto {
	status = "okay";
};

&mmc0 {
	pinctrl-names = "default", "state_uhs";
	pinctrl-0 = <&mmc0_pins_default>;
	pinctrl-1 = <&mmc0_pins_uhs>;
	bus-width = <8>;
	max-frequency = <200000000>;
	cap-mmc-highspeed;
	mmc-hs200-1_8v;
	mmc-hs400-1_8v;
	hs400-ds-delay = <0x14014>;
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&reg_1p8v>;
	non-removable;
	no-sd;
	no-sdio;
	status = "disabled";
};

&pcie {
	pinctrl-names = "default";
	pinctrl-0 = <&pcie_pins>;
	status = "okay";
};

&pcie_phy {
	status = "okay";
};

&pio {
	mmc0_pins_default: mmc0-pins {
		mux {
			function = "emmc";
			groups = "emmc_51";
		};
		conf-cmd-dat {
			pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
			       "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
			       "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
			input-enable;
			drive-strength = <4>;
			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
		};
		conf-clk {
			pins = "EMMC_CK";
			drive-strength = <6>;
			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
		};
		conf-ds {
			pins = "EMMC_DSL";
			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
		};
		conf-rst {
			pins = "EMMC_RSTB";
			drive-strength = <4>;
			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
		};
	};

	mmc0_pins_uhs: mmc0-uhs-pins {
		mux {
			function = "emmc";
			groups = "emmc_51";
		};
		conf-cmd-dat {
			pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
			       "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
			       "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
			input-enable;
			drive-strength = <4>;
			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
		};
		conf-clk {
			pins = "EMMC_CK";
			drive-strength = <6>;
			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
		};
		conf-ds {
			pins = "EMMC_DSL";
			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
		};
		conf-rst {
			pins = "EMMC_RSTB";
			drive-strength = <4>;
			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
		};
	};

	pcie_pins: pcie-pins {
		mux {
			function = "pcie";
			groups = "pcie_clk", "pcie_wake", "pcie_pereset";
		};
	};

	spic_pins_g2: spic-pins-29-to-32 {
		mux {
			function = "spi";
			groups = "spi1_2";
		};
	};

	spi_flash_pins: spi-flash-pins-33-to-38 {
		mux {
			function = "spi";
			groups = "spi0", "spi0_wp_hold";
		};
		conf-pu {
			pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
			drive-strength = <8>;
			mediatek,pull-up-adv = <0>;	/* bias-disable */
		};
		conf-pd {
			pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
			drive-strength = <8>;
			mediatek,pull-down-adv = <0>;	/* bias-disable */
		};
	};

	uart1_pins: uart1-pins {
		mux {
			function = "uart";
			groups = "uart1";
		};
	};

	uart2_pins: uart2-pins {
		mux {
			function = "uart";
			groups = "uart2";
		};
	};

	wf_2g_5g_pins: wf_2g_5g-pins {
		mux {
			function = "wifi";
			groups = "wf_2g", "wf_5g";
		};
		conf {
			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
			       "WF1_TOP_CLK", "WF1_TOP_DATA";
			drive-strength = <4>;
		};
	};

	wf_dbdc_pins: wf_dbdc-pins {
		mux {
			function = "wifi";
			groups = "wf_dbdc";
		};
		conf {
			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
			       "WF1_TOP_CLK", "WF1_TOP_DATA";
			drive-strength = <4>;
		};
	};
};

&spi0 {
	pinctrl-names = "default";
	pinctrl-0 = <&spi_flash_pins>;
	cs-gpios = <0>, <0>;
	#address-cells = <1>;
	#size-cells = <0>;
	status = "disabled";
};

&spi1 {
	pinctrl-names = "default";
	pinctrl-0 = <&spic_pins_g2>;
	status = "okay";

	proslic_spi: proslic_spi@0 {
		compatible = "silabs,proslic_spi";
		reg = <0>;
		spi-max-frequency = <10000000>;
		spi-cpha = <1>;
		spi-cpol = <1>;
		channel_count = <1>;
		debug_level = <4>;       /* 1 = TRC, 2 = DBG, 4 = ERR */
		reset_gpio = <&pio 7 0>;
		ig,enable-spi = <1>;     /* 1: Enable, 0: Disable */
	};
};

&switch {
	ports {
		#address-cells = <1>;
		#size-cells = <0>;

		port@1 {
			reg = <1>;
			label = "lan1";
		};

		port@2 {
			reg = <2>;
			label = "lan2";
		};

		port@3 {
			reg = <3>;
			label = "lan3";
		};

		port@5 {
			reg = <5>;
			label = "lan5";
			phy-mode= "2500base-x";
			phy-handle = <&phy5>;
		};

		port@6 {
			reg = <6>;
			ethernet = <&gmac0>;
			phy-mode = "2500base-x";

			fixed-link {
				speed = <2500>;
				full-duplex;
				pause;
			};
		};
	};
};

&ssusb {
	vusb33-supply = <&reg_3p3v>;
	vbus-supply = <&reg_5v>;
	status = "okay";
};

&uart0 {
	status = "okay";
};

&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart1_pins>;
	status = "okay";
};

&uart2 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart2_pins>;
	status = "okay";
};

&usb_phy {
	status = "okay";
};
[    5.133786] mt7530 mdio-bus:1f: no interrupt support
[    5.187483] mt7530 mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[    5.207307] mt7530 mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[    5.226840] mt7530 mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[    5.277850] mt7530 mdio-bus:1f lan5 (uninitialized): validation of 2500base-x with support 0000000,00000000,00006000 and advertisement 0000000,00000000,00006000 failed: -22
[    5.357013] mt7530 mdio-bus:1f lan5 (uninitialized): failed to connect to PHY: -EINVAL
[    5.364910] mt7530 mdio-bus:1f lan5 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 5

I managed to make the SFP work, I added the mtk feed and added a package that allows me to switch between SPF and eth wan (reusing Zyxel scripts).

I'm than able to plug an SFP, ping it and ssh into it too.

As soon as I remove the SFP the script switch back to eth mode.

Still lan2.5 and wan eth 2.5 are not working.

Too no matter what if I remove the fixed link 2500 stuff from the dts the bootlog will be full of

[    5.277850] mt7530 mdio-bus:1f lan5 (uninitialized): validation of 2500base-x with support 0000000,00000000,00006000 and advertisement 0000000,00000000,00006000 failed: -22
[    5.357013] mt7530 mdio-bus:1f lan5 (uninitialized): failed to connect to PHY: -EINVAL
[    5.364910] mt7530 mdio-bus:1f lan5 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 5

Hence there must be something weird on how Zyxel wired this stuff.

I'm done, i don't know what else to do.

I m sure Zyxel did many changes to the software too (which is why IMHO their source code has additional stuff inside the /target/Linux/mediatek/files* folder)

Anyone can suggest here what to do next?

The problem is that none of the two work :smiley: with the work i've currently done I'm able to use only wifi, 3 gbit ports and the wan sfp 2.5. So you end up losing the 2.5lan port which is the nicest thing of this router.

I'm still investigating in the hardware of this router and I think the following:

probably both the lan 2.5 and the wan 2.5 are XOR ports of the respectives sfp/ethernet ports, if you look closely there are 2 sfp cages indeed.. That's why I'm able to use the wan 2.5 sfp (thanks to the zyxel script exporting the GPIOs).

There unfortunately is no script to switch the LAN 2.5 gpio pins from sfp to ethernet (probably the zyxel firmware has something embedded in the code to default to eth ports both the two phys.)

these are the script that detect the sfp and switch to it the wan port or to ethernet port
zyxel-ex5601t0/sfp_wan.sh at V5.70(ACDZ.0)C0 ยท ErnyTech/zyxel-ex5601t0 (github.com)
zyxel-ex5601t0/check_sfp_link.sh at V5.70(ACDZ.0)C0 ยท ErnyTech/zyxel-ex5601t0 (github.com)

There is no script to switch the lan port to ethernet instead of sfp (there is no need to because the case of the router will physically deny you access to it hence the zyxel firmware will default to lan ethernet 2.5)

I compiled the zyxel DTS but the clock mappings of the zyxel firmware are not matching the clock mappings of the default openwrt mt7986a.dtsi. Hence you need to change the clock mappings into zyxel-ex5601t0/mt7986-clk.h at V5.70(ACDZ.0)C0 ยท ErnyTech/zyxel-ex5601t0 (github.com) and everything messes up.
zyxel-ex5601t0/ex5601-t0.dts at V5.70(ACDZ.0)C0 ยท ErnyTech/zyxel-ex5601t0 (github.com)

this is the result than :smiley:

[    0.414998] of_clk_src_onecell_get: invalid clock index 75
[    0.420552] clk: couldn't get assigned clock 0 for /ethernet@15100000
[    0.427044] mtk_soc_eth: probe of 15100000.ethernet failed with error -22

Ok I'm back with some news.

I had suspects that the 5.15 kernel is not really ok with this device (the mediatek feeds and git repos are only referring to 5.4) indeed the zyxel firmware mt7986a.dtsi is based on kernel 5.4 (owrt 21.02) and in 5.15 many clock mappings are missing.

So i decided to

git clone --branch openwrt-21.02 https://git.openwrt.org/openwrt/openwrt.git

add mediatek feeds, update and install all the feeds and than
git clone mediatek repo.

Merge the mediatek stuff with the owrt 21.02 repo with prepare_sdk.sh and started working on the DTS (this was very easy because the mt7986a.dtsi was totally the same of the zyxel firmware, including clock and stuff)

I compiled and nothing, neither in this version the lan 2,5 ethernet and wan 2.5 ethernet are working.
So there must be something in the zyxel code which swaps the phy to ethernet mode.

After hours i found it!
During init here is what happens:

Set: port6 dev1Eh_reg8h = 0xA4E2
Set: port5 dev1Eh_reg8h = 0xA4E2

I started looking for strings inside binaries and here we go:

mii_mgr_cl45 -s -p 0x6 -d 0x1e -r 0x8 -v A4E2
mii_mgr_cl45 -s -p 0x5 -d 0x1e -r 0x8 -v A4E2

I decided to look for any commands regarding mii_mgr_cl45
and here we go:

mii_mgr_cl45 -g -p 0x6 -d 0x0 -r 0x18 > /tmp/port6

these are commands launched from the sfp_wan script to check the status of the wan phy
Now here is the thing

Owrt 21.02 5.4 kernel
root@OpenWrt:/bin# mii_mgr_cl45 -g -p 0x5 -d 0x0 -r 0x18
Get: port5 dev0h_reg18h = 0x0003
root@OpenWrt:/bin# mii_mgr_cl45 -g -p 0x6 -d 0x0 -r 0x18
Get: port6 dev0h_reg18h = 0x020B

Let's try the set commands manually!

mii_mgr_cl45 -s -p 0x6 -d 0x1e -r 0x8 -v A4E2
mii_mgr_cl45 -s -p 0x5 -d 0x1e -r 0x8 -v A4E2

It works!!!! Lan5 2.5 is working (even if not blinking, but I don't care)
the sfp_wan script works and activates the sfp, after removing the sfp even the wan ethernet 2.5 works!

Let's try this with 5.15, and I immediately notice something strange:

Owrt 5.15 kernel
root@OpenWrt:/# mii_mgr_cl45 -g -p 0x6 -d 0x0 -r 0x18
Get: port6 dev0h_reg18h = 0x0000
root@OpenWrt:/# mii_mgr_cl45 -g -p 0x5 -d 0x0 -r 0x18
Get: port5 dev0h_reg18h = 0x0000

Even if I use the set commands the values are not changing and the 2.5 ports are not working.
What's the issue with 5.15?
How do I understand what are good values for mii_mgr settings? I'd like to better understand what I'm really passing to the phys with mii_mgr -s instead of just trying zyxel stuff.

You could say, just use 5.4.... well the wifi is not working in 5.4... the wbsys is declared as Ok, with lsmod i see the mt7915e loaded and in the device tree i see too wbsys. But no radios are brought up and no /etc/config/wireless configuration is generated. Bootlog shows no errors.

1 Like

@bmork sorry for tagging you directly where did you take
pinctrl-0 = <&eth_pins>;

If I use that the labels $eth_pins is not declared anywhere and the DTS build fails
ERROR (phandle_references): /soc/ethernet@15100000: Reference to non-existent node or label "eth_pins

It's defined right there in the same dts: https://github.com/bmork/openwrt/blob/ex5700/target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts#L249

Don't remember exactly where I found that, but I'm pretty sure I did't invent it myself. Probably direct copy from one of the supported filogic devices

1 Like

I'm becoming blind... sorry. One question in your opinion is a DTS problem the fact that mdio-tools or mii_mgr in kernel 5.15 are not able to edit or get the registers values?

mdio-tools works for me. I even got it running on the OEM firmware by hacking up a few compatibility functions for 5.4 kernels: https://github.com/wkz/mdio-tools/pull/25

If it doesn't work, then I guess it means you mdio bus doesn't work. That sounds like a DTS problem, yes.

Ok, so in your last opinion, I'm sorry for getting back to this but why if I remove

		fixed-link {
			speed = <2500>;
			full-duplex;
			pause;
		};

from

	port@5 {
		reg = <5>;
		label = "lan5";
		phy-mode= "2500base-x";
		phy-handle = <&phy5>;
	};

I get the following

[    5.277850] mt7530 mdio-bus:1f lan5 (uninitialized): validation of 2500base-x with support 0000000,00000000,00006000 and advertisement 0000000,00000000,00006000 failed: -22
[    5.357013] mt7530 mdio-bus:1f lan5 (uninitialized): failed to connect to PHY: -EINVAL
[    5.364910] mt7530 mdio-bus:1f lan5 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 5

I can't really find an answer to this. And I tried that for the wan (port 6 reg 6), the same thing happens

CONFIG_MT753X_GSW definition missing in kernel_menconfig ยท Issue #12491 ยท openwrt/openwrt (github.com)

While I try to figure out the 5.15 phy regs I decided to build a sysupgrade with the Zyxel fwid to see if I can finally flash and boot a firmware with zloader.

To recap I've ubi and ubi2 and zloader is responsible to load one or the other.

So I started with the Zyxel firmware on ubi and via web gui i flashed my custom firmware and it is successfully flashed into ubi2 thanks to the Zyxel build scripts.

The router than reboots and i see that the boot cmdline mentions rootubi=ubi2 which is perfect!

The problem is that a some point I think it's ignoring the command line and loading mtd6 which is ubi!!!

UBI: auto-attach mtd6

The result is the kernel loaded from my firmware but the rootfs loaded from ubi instead of ubi2(i think), a complete mess

Here is the bootlog of my custom firmware flashed on ubi2

ubi0: attaching mtd8
ubi0: scanning is finished
ubi0: attached mtd8 (name "ubi2", size 64 MiB)
ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
ubi0: good PEBs: 256, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 5, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 52/44, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 0, total reserved PEBs: 256, PEBs reserved for bad PEB handling: 38
Reading from volume 'kernel' to 0x46000000, size 0x0 ... OK
##

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.4.238 (piameruo@compiler) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r20110-eab0d53b0d)) #0 SMP Tue Apr 11 14:32:10 2023
[    0.000000] Machine model: MediaTek MT7986a RFB
[    0.000000] earlycon: uart8250 at MMIO32 0x0000000011002000 (options '')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] On node 0 totalpages: 261136
[    0.000000]   DMA32 zone: 4096 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 261136 pages, LIFO batch:63
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.0
[    0.000000] percpu: Embedded 20 pages/cpu s44056 r8192 d29672 u81920
[    0.000000] pcpu-alloc: s44056 r8192 d29672 u81920 alloc=20*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] CPU features: kernel page table isolation disabled by kernel configuration
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 257040
[    0.000000] Kernel command line: console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 rootubi=ubi2
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 1013472K/1044544K available (7230K kernel code, 528K rwdata, 2012K rodata, 448K init, 290K bss, 31072K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	CONFIG_RCU_FANOUT set to non-default value of 32.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 640 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has no Range Selector support
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: no VLPI support, no direct LPI support
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x000000000c080000
[    0.000000] arch_timer: cp15 timer(s) running at 12.98MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2feb955e7, max_idle_ns: 440795202655 ns
[    0.000002] sched_clock: 56 bits at 12MHz, resolution 77ns, wraps every 4398046511072ns
[    0.008210] Calibrating delay loop (skipped), value calculated using timer frequency.. 25.97 BogoMIPS (lpj=51944)
[    0.018536] pid_max: default: 32768 minimum: 301
[    0.023245] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.030687] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.039361] ASID allocator initialised with 65536 entries
[    0.044842] rcu: Hierarchical SRCU implementation.
[    0.049954] smp: Bringing up secondary CPUs ...
[    0.054750] Detected VIPT I-cache on CPU1
[    0.054769] GICv3: CPU1: found redistributor 1 region 0:0x000000000c0a0000
[    0.054789] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.055037] Detected VIPT I-cache on CPU2
[    0.055048] GICv3: CPU2: found redistributor 2 region 0:0x000000000c0c0000
[    0.055057] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.055278] Detected VIPT I-cache on CPU3
[    0.055286] GICv3: CPU3: found redistributor 3 region 0:0x000000000c0e0000
[    0.055293] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.055320] smp: Brought up 1 node, 4 CPUs
[    0.111934] SMP: Total of 4 processors activated.
[    0.116661] CPU features: detected: 32-bit EL0 Support
[    0.121826] CPU features: detected: CRC32 instructions
[    0.127079] CPU: All CPU(s) started at EL2
[    0.131202] alternatives: patching kernel code
[    0.137896] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.147720] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.154720] pinctrl core: initialized pinctrl subsystem
[    0.160491] NET: Registered protocol family 16
[    0.165144] DMA: preallocated 256 KiB pool for atomic allocations
[    0.171965] pstore: Registered ramoops as persistent store backend
[    0.178195] ramoops: using 0x10000@0x42ff0000, ecc: 0
[    0.191162] cryptd: max_cpu_qlen set to 1000
[    0.196637] SCSI subsystem initialized
[    0.200494] libata version 3.00 loaded.
[    0.204548] usbcore: registered new interface driver usbfs
[    0.210086] usbcore: registered new interface driver hub
[    0.215444] usbcore: registered new device driver usb
[    0.221215] Bluetooth: Core ver 2.22
[    0.224833] NET: Registered protocol family 31
[    0.229298] Bluetooth: HCI device and connection manager initialized
[    0.235689] Bluetooth: HCI socket layer initialized
[    0.240591] Bluetooth: L2CAP socket layer initialized
[    0.245672] Bluetooth: SCO socket layer initialized
[    0.251294] rbus 18000000.wbsys: PCI host bridge to bus 0000:00
[    0.257253] pci_bus 0000:00: root bus resource [mem 0x18000000-0x18ffffff]
[    0.264168] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.269682] pci_bus 0000:00: scanning bus
[    0.273720] pci 0000:00:00.0: [14c3:7986] type 00 class 0x000280
[    0.279768] pci 0000:00:00.0: reg 0x10: [mem 0x18000000-0x1800000f 64bit]
[    0.286594] pci 0000:00:00.0: reg 0x18: [mem 0x00000000-0x0000000f]
[    0.292896] pci 0000:00:00.0: reg 0x1c: [mem 0x00000000-0x0000000f]
[    0.299197] pci 0000:00:00.0: reg 0x20: [mem 0x00000000-0x0000000f]
[    0.305499] pci 0000:00:00.0: reg 0x24: [mem 0x00000000-0x0000000f]
[    0.312620] pci_bus 0000:00: fixups for bus
[    0.316825] pci_bus 0000:00: bus scan returning with max=00
[    0.322689] clocksource: Switched to clocksource arch_sys_counter
[    0.329448] thermal_sys: Registered thermal governor 'fair_share'
[    0.329452] thermal_sys: Registered thermal governor 'bang_bang'
[    0.335592] thermal_sys: Registered thermal governor 'step_wise'
[    0.341631] thermal_sys: Registered thermal governor 'user_space'
[    0.347670] thermal_sys: Registered thermal governor 'power_allocator'
[    0.354015] NET: Registered protocol family 2
[    0.365044] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.372879] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.381300] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.389121] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.396459] TCP: Hash tables configured (established 8192 bind 8192)
[    0.402912] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.409576] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.416741] NET: Registered protocol family 1
[    0.421140] PCI: CLS 0 bytes, default 64
[    0.425757] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[    0.434338] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.440224] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.457864] NET: Registered protocol family 38
[    0.471557] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.478413] printk: console [ttyS0] disabled
[    0.502827] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 11, base_baud = 2500000) is a ST16650V2
[    0.512043] printk: console [ttyS0] enabled
[    0.512043] printk: console [ttyS0] enabled
[    0.520401] printk: bootconsole [uart8250] disabled
[    0.520401] printk: bootconsole [uart8250] disabled
[    0.550491] 11003000.serial: ttyS1 at MMIO 0x11003000 (irq = 12, base_baud = 1625000) is a ST16650V2
[    0.579931] 11004000.serial: ttyS2 at MMIO 0x11004000 (irq = 13, base_baud = 1625000) is a ST16650V2
[    0.589497] mtk_rng 1020f000.trng: registered RNG driver
[    0.589703] random: crng init done
[    0.594934] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.605941] loop: module loaded
[    0.609791] mt7986-pinctrl 1001f000.pinctrl: pin_config_set op failed for pin 36
[    0.617186] mtk-spi 1100a000.spi: Error applying setting, reverse things back
[    0.624714] spi-nor spi0.0: unrecognized JEDEC id bytes: ff 2c 34 2c 34 2c
[    0.631599] spi-nor: probe of spi0.0 failed with error -2
[    0.637208] spi-nand spi0.1: Micron SPI NAND was found.
[    0.642437] spi-nand spi0.1: 512 MiB, block size: 256 KiB, page size: 4096, OOB size: 256
[    0.652433] [mtk_hw_init] reset_lock:0, force:0
[    0.656988] [mtk_hw_init] execute fe cold reset
[    0.772780] mtk_soc_eth 15100000.ethernet: generated random MAC address 56:38:e6:59:64:90
[    0.781177] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc011780000, irq 122
[    0.790319] mtk_soc_eth 15100000.ethernet: generated random MAC address ae:33:34:c2:4d:9d
[    0.798646] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc011780000, irq 122
[    0.807769] (unnamed net_device) (dummy): netif_napi_add() called with weight 256
[    0.815472] xhci-mtk 11200000.xhci: 11200000.xhci supply vbus not found, using dummy regulator
[    0.824103] xhci-mtk 11200000.xhci: 11200000.xhci supply vusb33 not found, using dummy regulator
[    0.832995] phy phy-usb-phy@11e10000.1: try to get sw efuse
[    0.838558] phy phy-usb-phy@11e10000.1: try to get sw efuse+
[    0.844218] phy phy-usb-phy@11e10000.1: u2 auto load valid efuse: ENABLE with value: 1
[    0.852127] phy phy-usb-phy@11e10000.1: u2 efuse - intr 13
[    0.857607] phy phy-usb-phy@11e10000.2: try to get sw efuse
[    0.863167] phy phy-usb-phy@11e10000.2: try to get sw efuse+
[    0.868820] phy phy-usb-phy@11e10000.2: u3 auto load valid efuse: ENABLE with value: 1
[    0.876739] phy phy-usb-phy@11e10000.2: u3 efuse - intr 28, rx_imp f, tx_imp f
[    0.883952] phy phy-usb-phy@11e10000.3: try to get sw efuse
[    0.889513] phy phy-usb-phy@11e10000.3: try to get sw efuse+
[    0.895170] phy phy-usb-phy@11e10000.3: u2 auto load valid efuse: ENABLE with value: 1
[    0.903082] phy phy-usb-phy@11e10000.3: u2 efuse - intr 13
[    0.908971] xhci-mtk 11200000.xhci: xHCI Host Controller
[    0.914285] xhci-mtk 11200000.xhci: new USB bus registered, assigned bus number 1
[    0.924820] xhci-mtk 11200000.xhci: hcc params 0x01403f99 hci version 0x110 quirks 0x0000000000210010
[    0.934063] xhci-mtk 11200000.xhci: irq 132, io mem 0x11200000
[    0.939960] xhci-mtk 11200000.xhci: xHCI Host Controller
[    0.945265] xhci-mtk 11200000.xhci: new USB bus registered, assigned bus number 2
[    0.952739] xhci-mtk 11200000.xhci: Host supports USB 3.2 Enhanced SuperSpeed
[    0.960143] hub 1-0:1.0: USB hub found
[    0.963907] hub 1-0:1.0: 2 ports detected
[    0.968134] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    0.976407] hub 2-0:1.0: USB hub found
[    0.980162] hub 2-0:1.0: 1 port detected
[    0.984373] usbcore: registered new interface driver uas
[    0.989716] usbcore: registered new interface driver usb-storage
[    0.995811] i2c /dev entries driver
[    1.000411] mtk-wdt 1001c000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    1.008320] device-mapper: ioctl: 4.41.0-ioctl (2019-09-16) initialised: dm-devel@redhat.com
[    1.016829] Bluetooth: HCI UART driver ver 2.3
[    1.021265] Bluetooth: HCI UART protocol H4 registered
[    1.026393] Bluetooth: HCI UART protocol BCSP registered
[    1.031747] Bluetooth: HCI UART protocol Broadcom registered
[    1.037410] Bluetooth: HCI UART protocol QCA registered
[    1.043014] crypto-safexcel 10320000.crypto: EIP97:230(0,1,4,4)-HIA:270(0,5,5),PE:150/433(alg:7fcdfc00)/0/0/0
[    1.056933] Initializing XFRM netlink socket
[    1.061460] NET: Registered protocol family 10
[    1.066383] Segment Routing with IPv6
[    1.070102] NET: Registered protocol family 17
[    1.074566] Bridge firewalling registered
[    1.078635] 8021q: 802.1Q VLAN Support v1.8
[    1.083286] pstore: Using crash dump compression: deflate
[    1.095498] nmbm nmbm_spim_nand: Signature found at block 2047 [0x1ffc0000]
[    1.104886] nmbm nmbm_spim_nand: First info table with writecount 0 found in block 1920
[    1.120245] nmbm nmbm_spim_nand: Second info table with writecount 0 found in block 1923
[    1.128331] nmbm nmbm_spim_nand: NMBM has been successfully attached 
[    1.134894] 8 fixed-partitions partitions found on MTD device nmbm_spim_nand
[    1.141935] Creating 8 MTD partitions on "nmbm_spim_nand":
[    1.147413] 0x000000000000-0x000000100000 : "BL2"
[    1.152552] 0x000000100000-0x000000180000 : "u-boot-env"
[    1.158188] 0x000000180000-0x000000380000 : "Factory"
[    1.163543] 0x000000380000-0x000000540000 : "FIP"
[    1.168528] 0x000000540000-0x000000580000 : "zloader"
[    1.173871] 0x000000580000-0x000004580000 : "ubi"
[    1.178909] 0x000004580000-0x000008580000 : "ubi2"
[    1.184021] 0x000008580000-0x00001e000000 : "zyubi"
[    1.399679] mt7530 mdio-bus:1f lan1 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY]
[    1.409119] mt7530 mdio-bus:1f lan2 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY]
[    1.418460] mt7530 mdio-bus:1f lan3 (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY]
[    1.427435] mt7530 mdio-bus:1f: configuring for fixed/2500base-x link mode
[    1.434583] DSA: tree 0 setup
[    1.434832] mt7530 mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    1.437542] mt7530-nl: genl_register_family_with_ops 
[    1.450585] UBI: auto-attach mtd6
[    1.453899] ubi0: attaching mtd6
[    1.753874] ubi0: scanning is finished
[    1.765123] ubi0: attached mtd6 (name "ubi", size 64 MiB)
[    1.770517] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
[    1.777378] ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
[    1.784153] ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
[    1.791101] ubi0: good PEBs: 256, bad PEBs: 0, corrupted PEBs: 0
[    1.797095] ubi0: user volume: 5, internal volumes: 1, max. volumes count: 128
[    1.804304] ubi0: max/mean erase counter: 47/10, WL threshold: 4096, image sequence number: 1658393161
[    1.813594] ubi0: available PEBs: 1, total reserved PEBs: 255, PEBs reserved for bad PEB handling: 38
[    1.822803] ubi0: background thread "ubi_bgt0d" started, PID 809
[    1.823752] block ubiblock0_1: created from ubi0:1(rootfs)
[    1.834276] ubiblock: device ubiblock0_1 (rootfs) set to be root filesystem
[    1.841230] hctosys: unable to open rtc device (rtc0)
[    1.851167] VFS: Mounted root (squashfs filesystem) readonly on device 253:0.
[    1.858457] Freeing unused kernel memory: 448K
[    1.878721] Run /sbin/init as init process
[    2.077908] init: Console is alive
[    2.081453] init: - watchdog -
[    2.097940] kmodloader: no module folders for kernel version 5.4.238 found
[    2.114996] init: - preinit -
[    2.704337] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[    2.712663] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
/etc/preinit: line 30: lock: not found
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
/etc/preinit: line 67: lock: not found
/etc/preinit: line 39: lock: not found
rm: can't remove '/tmp/tmp.bOCJlo': No such file or directory
/etc/preinit: line 72: lock: not found
[    4.777816] mount_root: loading kmods from internal overlay
[    4.786424] kmodloader: no module folders for kernel version 5.4.238 found
[    4.793536] mount_root: failed to launch kmodloader from internal overlay
[    7.220157] UBIFS (ubi0:4): Mounting in unauthenticated mode
[    7.225898] UBIFS (ubi0:4): background thread "ubifs_bgt0_4" started, PID 870
[    7.297990] UBIFS (ubi0:4): recovery needed
[    7.585932] UBIFS (ubi0:4): recovery completed
[    7.590446] UBIFS (ubi0:4): UBIFS: mounted UBI device 0, volume 4, name "rootfs_data"
[    7.598271] UBIFS (ubi0:4): LEB size: 253952 bytes (248 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
[    7.608173] UBIFS (ubi0:4): FS size: 8380416 bytes (7 MiB, 33 LEBs), journal size 2031617 bytes (1 MiB, 6 LEBs)
[    7.618249] UBIFS (ubi0:4): reserved for root: 395827 bytes (386 KiB)
[    7.624684] UBIFS (ubi0:4): media format: w5/r0 (latest is w5/r0), UUID 6E0B34AB-5019-4D60-815A-29C24B4432A2, small LPT model
[    7.639593] block: attempting to load /tmp/ubifs_cfg/upper/etc/config/fstab
[    7.657253] block: extroot: not configured
[    7.661441] UBIFS (ubi0:4): un-mount UBI device 0
[    7.666147] UBIFS (ubi0:4): background thread "ubifs_bgt0_4" stops
[    7.675639] UBIFS (ubi0:4): Mounting in unauthenticated mode
[    7.681353] UBIFS (ubi0:4): background thread "ubifs_bgt0_4" started, PID 873
[    7.815907] UBIFS (ubi0:4): UBIFS: mounted UBI device 0, volume 4, name "rootfs_data"
[    7.823736] UBIFS (ubi0:4): LEB size: 253952 bytes (248 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
[    7.833637] UBIFS (ubi0:4): FS size: 8380416 bytes (7 MiB, 33 LEBs), journal size 2031617 bytes (1 MiB, 6 LEBs)
[    7.843709] UBIFS (ubi0:4): reserved for root: 395827 bytes (386 KiB)
[    7.850139] UBIFS (ubi0:4): media format: w5/r0 (latest is w5/r0), UUID 6E0B34AB-5019-4D60-815A-29C24B4432A2, small LPT model
[    7.869794] mount_root: loading kmods from internal overlay
[    7.881671] kmodloader: no module folders for kernel version 5.4.238 found
[    7.888731] mount_root: failed to launch kmodloader from internal overlay
[   10.248113] block: attempting to load /tmp/ubifs_cfg/upper/etc/config/fstab
[   10.264018] block: extroot: not configured
[   10.270852] mount_root: switching to ubifs overlay
[   10.346674] urandom-seed: Seed file not found (/etc/urandom.seed)
[   10.410741] procd: - early -
[   10.413639] procd: - watchdog -
[   10.926273] procd: - watchdog -
[   10.930829] procd: - ubus -
[   10.983733] procd: - init -
Please press Enter to activate this console.
[   11.279901] urngd: v1.0.2 started.
[   11.334745] kmodloader: no module folders for kernel version 5.4.238 found
[   12.614612] mtk_soc_eth 15100000.ethernet eth0: TX vlan offload cannot be enabled when dsa is attached.
[   12.624518] mtk_soc_eth 15100000.ethernet eth0: TX vlan offload cannot be enabled when dsa is attached.
[   15.174308] /dev/ubi0_3: Can't open blockdev
[   15.242900] block ubiblock0_3: created from ubi0:3(zydefault)
[   15.268051] ubi1: attaching mtd8
[   16.874652] ubi1: scanning is finished
[   16.886361] ubi1: attached mtd8 (name "zyubi", size 346 MiB)
[   16.892023] ubi1: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
[   16.898888] ubi1: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
[   16.905664] ubi1: VID header offset: 4096 (aligned 4096), data offset: 8192
[   16.912612] ubi1: good PEBs: 1386, bad PEBs: 0, corrupted PEBs: 0
[   16.918692] ubi1: user volume: 5, internal volumes: 1, max. volumes count: 128
[   16.925902] ubi1: max/mean erase counter: 8/4, WL threshold: 4096, image sequence number: 2420492800
[   16.935019] ubi1: available PEBs: 0, total reserved PEBs: 1386, PEBs reserved for bad PEB handling: 38
[   16.944315] ubi1: background thread "ubi_bgt1d" started, PID 1263
[   16.966883] UBIFS (ubi1:3): Mounting in unauthenticated mode
[   16.972615] UBIFS (ubi1:3): background thread "ubifs_bgt1_3" started, PID 1271
[   17.130380] UBIFS (ubi1:3): UBIFS: mounted UBI device 1, volume 3, name "data"
[   17.137601] UBIFS (ubi1:3): LEB size: 253952 bytes (248 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
[   17.147503] UBIFS (ubi1:3): FS size: 18538496 bytes (17 MiB, 73 LEBs), journal size 2031617 bytes (1 MiB, 6 LEBs)
[   17.157748] UBIFS (ubi1:3): reserved for root: 875618 bytes (855 KiB)
[   17.164180] UBIFS (ubi1:3): media format: w5/r0 (latest is w5/r0), UUID B6227958-D77B-4218-93A3-024B2D1DEA2B, small LPT model
[   17.190663] UBIFS (ubi1:4): Mounting in unauthenticated mode
[   17.196397] UBIFS (ubi1:4): background thread "ubifs_bgt1_4" started, PID 1276
[   17.348209] UBIFS (ubi1:4): UBIFS: mounted UBI device 1, volume 4, name "misc"
[   17.355435] UBIFS (ubi1:4): LEB size: 253952 bytes (248 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
[   17.365337] UBIFS (ubi1:4): FS size: 310583296 bytes (296 MiB, 1223 LEBs), journal size 15491072 bytes (14 MiB, 61 LEBs)
[   17.376189] UBIFS (ubi1:4): reserved for root: 4952683 bytes (4836 KiB)
[   17.382794] UBIFS (ubi1:4): media format: w5/r0 (latest is w5/r0), UUID C74F7EC9-F1F8-487B-A585-A684B2F89030, small LPT model

Fortunately i switch back via zloader to ubi and it loads again the firmware on ubi successfully, hence i can do multiple tests...

Here is an example bootlog of the firmware loaded from ubi2, same thing but I read that:

UBI: plan to attach ubi2
 UBI: auto-attach mtd7

Full bootlog on ubi2

Everything loads fine of course... But why my firmware is ignoring the boot args that i read in the bootlog?