Issue enabling the 5th switch port

Hi there!

I'm trying to enable the 5th switch port, but having some problems.
I am using rm65 mt7981-mt797a-mt7531 development board. 1x wan, 4x 1gb poorts and it has a 5th utp port which should be able to run 2,5gbit according to the manufacturer.
I tried the mt7981-rfb firmware + tried out the 2 overlays for 2,5gb ports but they don't work on this board.

My in my dts I configure the ethernet/switch like this:

&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 = "gmii";
		phy-handle = <&int_gbe_phy>;   /* eth1 wan is further configured in mt7981.dsi */
	};

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

		phy5: phy@5 {
			compatible = "ethernet-phy-ieee802.3-c45";
			reg = <5>;
			phy-mode = "2500base-x";
			maxlinear,led-reg = <1008 0 0 0>;
		 /* enable led0 for all link/act, and disable led1~3 */
		};

		switch@1f {
			compatible = "mediatek,mt7531";
			reg = <31>;
			interrupt-controller;
			#interrupt-cells = <1>;
			interrupt-parent = <&pio>;
			interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
			reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;

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

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

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

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

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

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

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

Still no sign of any lan5 port.

Kernel log:


Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.15.150 (neo@goliath) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.
[    0.000000] Machine model: MediaTek MT7981 RFB
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000004fffffff]
[    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-0x0000000047c7ffff]
[    0.000000]   node   0: [mem 0x0000000047c80000-0x0000000047ffffff]
[    0.000000]   node   0: [mem 0x0000000048000000-0x000000004fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000004fffffff]
[    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.4
[    0.000000] percpu: Embedded 18 pages/cpu s33432 r8192 d32104 u73728
[    0.000000] pcpu-alloc: s33432 r8192 d32104 u73728 alloc=18*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    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: 64512
[    0.000000] Kernel command line:
[    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 240996K/262144K available (8064K kernel code, 900K rwdata, 2200K rodata, 448K
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, 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_id
[    0.000000] sched_clock: 56 bits at 13MHz, resolution 76ns, wraps every 4398046511101ns
[    0.000139] Calibrating delay loop (skipped), value calculated using timer frequency.. 26.00 Bogo
[    0.000150] pid_max: default: 32768 minimum: 301
[    0.000440] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.000449] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.001735] rcu: Hierarchical SRCU implementation.
[    0.002099] smp: Bringing up secondary CPUs ...
[    0.002419] Detected VIPT I-cache on CPU1
[    0.002445] GICv3: CPU1: found redistributor 1 region 0:0x000000000c0a0000
[    0.002473] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.002536] smp: Brought up 1 node, 2 CPUs
[    0.002549] SMP: Total of 2 processors activated.
[    0.002554] CPU features: detected: 32-bit EL0 Support
[    0.002558] CPU features: detected: CRC32 instructions
[    0.002587] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.002651] CPU: All CPU(s) started at EL2
[    0.002662] alternatives: patching kernel code
[    0.005883] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 191126044
[    0.005905] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.006048] pinctrl core: initialized pinctrl subsystem
[    0.006704] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.007012] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.007039] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.007063] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.007399] thermal_sys: Registered thermal governor 'fair_share'
[    0.007403] thermal_sys: Registered thermal governor 'bang_bang'
[    0.007408] thermal_sys: Registered thermal governor 'step_wise'
[    0.007412] thermal_sys: Registered thermal governor 'user_space'
[    0.007722] cpuidle: using governor menu
[    0.007751] ASID allocator initialised with 65536 entries
[    0.008305] pstore: Registered ramoops as persistent store backend
[    0.008313] ramoops: using 0x10000@0x42ff0000, ecc: 0
[    0.018686] cryptd: max_cpu_qlen set to 1000
[    0.021088] SCSI subsystem initialized
[    0.022132] clocksource: Switched to clocksource arch_sys_counter
[    0.022789] NET: Registered PF_INET protocol family
[    0.022874] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.023206] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.023225] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.023233] TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.023252] TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    0.023281] TCP: Hash tables configured (established 2048 bind 2048)
[    0.023346] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.023364] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.023485] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.023507] PCI: CLS 0 bytes, default 64
[    0.026123] workingset: timestamp_bits=46 max_order=16 bucket_order=0
[    0.029656] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.029672] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red
[    0.065564] pwm-mediatek 10048000.pwm: clock: top fail: -517
[    0.074007] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.074662] printk: console [ttyS0] disabled
[    0.094798] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 18, base_baud = 2500000) is a ST1665
[    0.694619] printk: console [ttyS0] enabled
[    0.699606] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.708744] loop: module loaded
[    0.713249] spi spi0.1: setup: ignoring unsupported mode bits a00
[    0.719667] spi-nand spi0.1: Macronix SPI NAND was found.
[    0.725104] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    0.733557] 5 fixed-partitions partitions found on MTD device spi0.1
[    0.739910] Creating 5 MTD partitions on "spi0.1":
[    0.744704] 0x000000580000-0x000004580000 : "ubi"
[    0.804717] 0x000000380000-0x000000580000 : "FIP"
[    0.811609] 0x000000180000-0x000000380000 : "Factory"
[    0.818838] 0x000000100000-0x000000180000 : "u-boot-env"
[    0.825073] 0x000000000000-0x000000100000 : "BL2"
[    0.963342] mtk_soc_eth 15100000.ethernet: generated random MAC address 56:8b:18:5a:05:fb
[    0.971582] mtk_soc_eth 15100000.ethernet: generated random MAC address 4a:ce:cb:95:00:77
[    0.997221] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc009400000, irq
[    1.007108] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc009400000, irq
[    1.016735] i2c_dev: i2c /dev entries driver
[    1.022347] mtk-wdt 1001c000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    1.031130] NET: Registered PF_INET6 protocol family
[    1.037241] Segment Routing with IPv6
[    1.040923] In-situ OAM (IOAM) with IPv6
[    1.044896] NET: Registered PF_PACKET protocol family
[    1.050117] 8021q: 802.1Q VLAN Support v1.8
[    1.055438] pstore: Using crash dump compression: deflate
[    1.069759] phy phy-usb-phy@11e10000.1: type_sw - reg 0x218, index 0
[    1.098005] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[    1.107159] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    1.115873] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT75
[    1.136285] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT75
[    1.156447] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT75
[    1.176623] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT75
[    1.188031] mt7530-mdio mdio-bus:1f lan5 (uninitialized): validation of  with support 0000000,000
[    1.203043] mt7530-mdio mdio-bus:1f lan5 (uninitialized): failed to connect to PHY: -EINVAL
[    1.211388] mt7530-mdio mdio-bus:1f lan5 (uninitialized): error -22 setting up PHY for tree 0, sw
[    1.221527] DSA: tree 0 setup
[    1.226718] UBI: auto-attach mtd0
[    1.230053] ubi0: default fastmap pool size: 25
[    1.234586] ubi0: default fastmap WL pool size: 12
[    1.239365] ubi0: attaching mtd0
[    3.119783] ubi0: scanning is finished
[    3.164934] ubi0: attached mtd0 (name "ubi", size 64 MiB)
[    3.170337] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    3.177213] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    3.183992] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    3.190939] ubi0: good PEBs: 511, bad PEBs: 1, corrupted PEBs: 0
[    3.196939] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[    3.204151] ubi0: max/mean erase counter: 7/4, WL threshold: 4096, image sequence number: 0
[    3.212490] ubi0: available PEBs: 0, total reserved PEBs: 511, PEBs reserved for bad PEB handling
[    3.221703] ubi0: background thread "ubi_bgt0d" started, PID 418
[    3.233833] FIT: Selected configuration: "config-1" (OpenWrt hilink_rm65)
[    3.240631] FIT:           kernel sub-image 0x00001000..0x005009bc "kernel-1" (ARM64 OpenWrt Linu
[    3.250569] FIT:          flat_dt sub-image 0x00501000..0x0050728d "fdt-1" (ARM64 OpenWrt hilink_
[    3.261443] FIT:          flat_dt sub-image 0x00508000..0x00508586 "fdt-mt7981-rfb-spim-nand" (AR
[    3.276040] FIT:       filesystem sub-image 0x00509000..0x00feafff "rootfs-1" (ARM64 OpenWrt hili
[    3.286293] FIT: selecting configured loadable "rootfs-1" to be root filesystem
[    3.293593]  ubiblock0_2: p1(rootfs-1)
[    3.293777] block ubiblock0_2: created from ubi0:2(fit)
[    3.324728] VFS: Mounted root (squashfs filesystem) readonly on device 259:0.
[    3.332039] Freeing unused kernel memory: 448K
[    3.372168] Run /sbin/init as init process
[    3.376254]   with arguments:
[    3.379207]     /sbin/init
[    3.381901]   with environment:
[    3.385036]     HOME=/
[    3.387384]     TERM=linux
[    3.971002] init: Console is alive
[    3.974599] init: - watchdog -
[    5.221551] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.286524] usbcore: registered new interface driver usbfs
[    5.292039] usbcore: registered new interface driver hub
[    5.297410] usbcore: registered new device driver usb
[    5.309254] xhci-mtk 11200000.usb: xHCI Host Controller
[    5.314529] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 1
[    5.324925] xhci-mtk 11200000.usb: hcc params 0x01403f99 hci version 0x110 quirks 0x0000000000210
[    5.334096] xhci-mtk 11200000.usb: irq 87, io mem 0x11200000
[    5.339841] xhci-mtk 11200000.usb: xHCI Host Controller
[    5.345085] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 2
[    5.352483] xhci-mtk 11200000.usb: Host supports USB 3.2 Enhanced SuperSpeed
[    5.359983] hub 1-0:1.0: USB hub found
[    5.363785] hub 1-0:1.0: 1 port detected
[    5.368030] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    5.376522] hub 2-0:1.0: USB hub found
[    5.380315] hub 2-0:1.0: 1 port detected
[    5.388852] usbcore: registered new interface driver usb-storage
[    5.395113] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.410722] init: - preinit -
[    6.319586] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[    6.328074] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    6.336778] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    6.343522] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
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
[    8.479794] UBIFS (ubi0:3): Mounting in unauthenticated mode
[    8.485581] UBIFS (ubi0:3): background thread "ubifs_bgt0_3" started, PID 545
[    8.729150] UBIFS (ubi0:3): recovery needed
[    8.805637] random: procd: uninitialized urandom read (4 bytes read)
[    9.318646] UBIFS (ubi0:3): recovery completed
[    9.323177] UBIFS (ubi0:3): UBIFS: mounted UBI device 0, volume 3, name "rootfs_data"
[    9.331000] UBIFS (ubi0:3): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 byte
[    9.340906] UBIFS (ubi0:3): FS size: 41013248 bytes (39 MiB, 323 LEBs), max 333 LEBs, journal siz
[    9.352548] UBIFS (ubi0:3): reserved for root: 1937156 bytes (1891 KiB)
[    9.359150] UBIFS (ubi0:3): media format: w5/r0 (latest is w5/r0), UUID 79EB5B24-4AE3-41FF-BFC8-4
[    9.391146] mount_root: switching to ubifs overlay
[    9.435316] overlayfs: null uuid detected in lower fs '/', falling back to xino=off,index=off,nfs
[    9.472258] urandom-seed: Seeding with /etc/urandom.seed
[    9.633704] procd: - early -
[    9.636656] procd: - watchdog -
[   10.263016] procd: - watchdog -
[   10.277513] procd: - ubus -
[   10.412519] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.441710] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.456723] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.464203] procd: - init -
Please press Enter to activate this console.
[   11.131177] kmodloader: loading kernel modules from /etc/modules.d/*
[   11.146253] crypto-safexcel 10320000.crypto: EIP97:230(0,1,4,4)-HIA:270(0,5,5),PE:150/433(alg:7fc
[   11.167986] Loading modules backported from Linux version v6.1.24-0-g0102425ac76b
[   11.175522] Backport generated by backports.git v5.15.92-1-44-gd6ea70fafd36
[   11.216668] mt798x-wmac 18000000.wifi: attaching wed device 0 version 2
[   11.293368] urngd: v1.0.2 started.
[   11.347900] platform 15010000.wed: MTK WED WO Firmware Version: DEV_000000, Build Time: 202212082
[   11.357238] platform 15010000.wed: MTK WED WO Chip ID 00 Region 3
[   11.505179] random: crng init done
[   11.508581] random: 23 urandom warning(s) missed due to ratelimiting
[   12.068984] mt798x-wmac 18000000.wifi: HW/SW Version: 0x8a108a10, Build Time: 20221208201745a
[   12.068984]
[   12.597216] mt798x-wmac 18000000.wifi: WM Firmware Version: ____000000, Build Time: 2022120820180
[   12.815232] mt798x-wmac 18000000.wifi: WA Firmware Version: DEV_000000, Build Time: 2022120820204
[   12.937081] kmodloader: done loading kernel modules from /etc/modules.d/*
[   18.041299] mtk_soc_eth 15100000.ethernet eth0: Link is Down
[   18.094327] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[   18.116093] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[   18.133887] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[   18.144889] br-lan: port 1(lan1) entered blocking state
[   18.150140] br-lan: port 1(lan1) entered disabled state
[   18.161298] device lan1 entered promiscuous mode
[   18.165963] device eth0 entered promiscuous mode
[   18.181865] mt7530-mdio mdio-bus:1f lan2: configuring for phy/gmii link mode
[   18.196054] br-lan: port 2(lan2) entered blocking state
[   18.201289] br-lan: port 2(lan2) entered disabled state
[   18.211162] device lan2 entered promiscuous mode
[   18.225376] mt7530-mdio mdio-bus:1f lan3: configuring for phy/gmii link mode
[   18.233418] br-lan: port 3(lan3) entered blocking state
[   18.238652] br-lan: port 3(lan3) entered disabled state
[   18.251561] device lan3 entered promiscuous mode
[   18.266222] mt7530-mdio mdio-bus:1f lan4: configuring for phy/gmii link mode
[   18.276564] br-lan: port 4(lan4) entered blocking state
[   18.281817] br-lan: port 4(lan4) entered disabled state
[   18.289470] device lan4 entered promiscuous mode
[   18.319689] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:00] driver [MediaTek MT7981 PHY] (i
[   18.329305] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/gmii link mode
[   18.337453] mtk_soc_eth 15100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[   19.686548] br-lan: port 5(phy0-ap0) entered blocking state
[   19.692165] br-lan: port 5(phy0-ap0) entered disabled state
[   19.697920] device phy0-ap0 entered promiscuous mode
[   19.703066] br-lan: port 5(phy0-ap0) entered blocking state
[   19.708644] br-lan: port 5(phy0-ap0) entered forwarding state
[   19.743270] IPv6: ADDRCONF(NETDEV_CHANGE): phy0-ap0: link becomes ready
[   20.836110] br-lan: port 6(phy1-ap0) entered blocking state
[   20.841690] br-lan: port 6(phy1-ap0) entered disabled state
[   20.847467] device phy1-ap0 entered promiscuous mode
[   20.852559] br-lan: port 6(phy1-ap0) entered blocking state
[   20.858128] br-lan: port 6(phy1-ap0) entered forwarding state
[   20.864775] br-lan: port 6(phy1-ap0) entered disabled state
[   20.882799] mt7530-mdio mdio-bus:1f lan4: Link is Up - 1Gbps/Full - flow control rx/tx
[   20.890893] br-lan: port 4(lan4) entered blocking state
[   20.896171] br-lan: port 4(lan4) entered forwarding state
[   85.646157] br-lan: port 6(phy1-ap0) entered blocking state
[   85.651745] br-lan: port 6(phy1-ap0) entered forwarding state

mdio mdio-bus gives:

root@Hilink:/# mdio mdio-bus
 DEV      PHY-ID  LINK
0x00  0x03a29461  up
0x01  0x00000000  down
0x02  0x00000000  down
0x03  0x00000000  down
0x04  0x00000000  down
0x05  0x00000000  down
0x06  0x00000000  down
0x07  0x00000000  down
0x08  0x00000000  down
0x09  0x00000000  down
0x0a  0x00000000  down
0x0b  0x00000000  down
0x0c  0x00000000  down
0x0d  0x00000000  down
0x0e  0x00000000  down
0x0f  0x00000000  down
0x10  0x00000000  down
0x11  0x00000000  down
0x12  0x00000000  down
0x13  0x00000000  down
0x14  0x00000000  down
0x15  0x00000000  down
0x16  0x00000000  down
0x17  0x00000000  down
0x18  0x00000000  down
0x19  0x00000000  down
0x1a  0x00000000  down
0x1b  0x00000000  down
0x1c  0x00000000  down
0x1d  0x00000000  down
0x1e  0x00000000  down
0x1f  0x9001040c  up
root@Hilink:/#

mdio mt7530-0 gives:

root@Hilink:/# mdio mt7530-0
 DEV      PHY-ID  LINK
0x00  0x03a29441  down
0x01  0x03a29441  down
0x02  0x03a29441  down
0x03  0x03a29441  up
0x04  0x03a29441  down
0x05  0x00000000  down
0x06  0x00000000  down
0x07  0x00000000  down
0x08  0x00000000  down
0x09  0x00000000  down
0x0a  0x00000000  down
0x0b  0x00000000  down
0x0c  0x00000000  down
0x0d  0x00000000  down
0x0e  0x00000000  down
0x0f  0x00000000  down
0x10  0x00000000  down
0x11  0x00000000  down
0x12  0x00000000  down
0x13  0x00000000  down
0x14  0x00000000  down
0x15  0x00000000  down
0x16  0x00000000  down
0x17  0x00000000  down
0x18  0x00000000  down
0x19  0x00000000  down
0x1a  0x00000000  down
0x1b  0x00000000  down
0x1c  0x00000000  down
0x1d  0x00000000  down
0x1e  0x00000000  down
0x1f  0x00000000  down
root@Hilink:/#

in my 02_network (in filogic/base-f/etc/board) I have put:

	hilink,rm65)
		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1
		;;
	mediatek,mt7981-rm65)
		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1
		;;

I put 2 lines in there because I'm not acctually sure which one openwrt will choose :smile: .

According to manufacturer there should be a Maxlineair GP211 phy 2,5GB/s in it.
Which should be compiled in the kernel, I see it in config-5.15 and in make kernel_menuconfig.

What should I do to test / check what kind of ethernet ports/phy's are detected on my router and how should I enable that 5th lan port?

Thanks in advance!

I came to the conclusion that my gmac1 of mt7981 is hardwired to my wan utp port.
That one I can put as 1000mbit or 2500mbit whichever I choose.

After a lot of expirimenting I found out how to enable my that my 5th lan port

		port@4 {
			reg = <4>;
			label = "lan5";
               };

after port 3 was just doing the trick :slight_smile:

I've seen some info about the mt7531 switch and that it has 7 ports, 5 ethernet phy's. 2 sgmii 2,5gbit ports which port 6 is most often used as cpu port to the main cpu soc. And 1 of those sometimes used as a wan port.

My question is, can I just freely put one of those lan ports to 2500mbits? And can I choose one of them to be the wan port? If yes, how do I do it?

For putting say the 5th lan port to 2500mbit, is it enough to do:

		port@4 {
			reg = <4>;
			label = "lan5";
			phy-mode = "2500base-x";

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

I just tried it. the port4 with phy-mode 2500base-x and fixed-link speed 2500 example in previous post.
On the router, when I do ethtool lan5 I see it connected on 2500mbit.

But on the PC it shows connected to 1000mbit and Iperf3 gives around 950mbit/s throughput. So its not connected at 2500mbit.

Since the mt7531 switch has 2x 2500mbit/s ports. (where one (port6) is being used as cpu connection to mt7981 soc) I would like to put lan5 to 2500mbit speed.

Does anyone know how to do it?

Attach the current kernel log and dts.

Okido!

kernel log


Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.15.150 (neo@goliath) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r23809-234f1a2efa) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 SMP Fri Mar 22 22:09:42 2024
[    0.000000] Machine model: MediaTek MT7981 RFB
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000004fffffff]
[    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-0x0000000047c7ffff]
[    0.000000]   node   0: [mem 0x0000000047c80000-0x0000000047ffffff]
[    0.000000]   node   0: [mem 0x0000000048000000-0x000000004fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000004fffffff]
[    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.4
[    0.000000] percpu: Embedded 18 pages/cpu s33432 r8192 d32104 u73728
[    0.000000] pcpu-alloc: s33432 r8192 d32104 u73728 alloc=18*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    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: 64512
[    0.000000] Kernel command line:
[    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 240996K/262144K available (8064K kernel code, 900K rwdata, 2200K rodata, 448K init, 287K bss, 21148K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    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.000138] Calibrating delay loop (skipped), value calculated using timer frequency.. 26.00 BogoMIPS (lpj=130000)
[    0.000149] pid_max: default: 32768 minimum: 301
[    0.000432] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.000442] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.001720] rcu: Hierarchical SRCU implementation.
[    0.002088] smp: Bringing up secondary CPUs ...
[    0.002409] Detected VIPT I-cache on CPU1
[    0.002436] GICv3: CPU1: found redistributor 1 region 0:0x000000000c0a0000
[    0.002464] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.002528] smp: Brought up 1 node, 2 CPUs
[    0.002543] SMP: Total of 2 processors activated.
[    0.002548] CPU features: detected: 32-bit EL0 Support
[    0.002553] CPU features: detected: CRC32 instructions
[    0.002581] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.002645] CPU: All CPU(s) started at EL2
[    0.002657] alternatives: patching kernel code
[    0.005823] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.005844] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.005986] pinctrl core: initialized pinctrl subsystem
[    0.006635] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.006938] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.006967] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.006998] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.007327] thermal_sys: Registered thermal governor 'fair_share'
[    0.007331] thermal_sys: Registered thermal governor 'bang_bang'
[    0.007336] thermal_sys: Registered thermal governor 'step_wise'
[    0.007341] thermal_sys: Registered thermal governor 'user_space'
[    0.007646] cpuidle: using governor menu
[    0.007673] ASID allocator initialised with 65536 entries
[    0.008235] pstore: Registered ramoops as persistent store backend
[    0.008242] ramoops: using 0x10000@0x42ff0000, ecc: 0
[    0.018538] cryptd: max_cpu_qlen set to 1000
[    0.020947] SCSI subsystem initialized
[    0.021990] clocksource: Switched to clocksource arch_sys_counter
[    0.022627] NET: Registered PF_INET protocol family
[    0.022714] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.023045] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.023061] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.023071] TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.023090] TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    0.023121] TCP: Hash tables configured (established 2048 bind 2048)
[    0.023185] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.023202] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.023312] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.023333] PCI: CLS 0 bytes, default 64
[    0.026065] workingset: timestamp_bits=46 max_order=16 bucket_order=0
[    0.029621] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.029636] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.064966] pwm-mediatek 10048000.pwm: clock: top fail: -517
[    0.073740] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.074569] printk: console [ttyS0] disabled
[    0.094736] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 18, base_baud = 2500000) is a ST16650V2
[    0.708134] printk: console [ttyS0] enabled
[    0.713126] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.722557] loop: module loaded
[    0.726976] spi spi0.1: setup: ignoring unsupported mode bits a00
[    0.733457] spi-nand spi0.1: Macronix SPI NAND was found.
[    0.738856] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    0.747326] 5 fixed-partitions partitions found on MTD device spi0.1
[    0.753805] Creating 5 MTD partitions on "spi0.1":
[    0.758588] 0x000000580000-0x000004580000 : "ubi"
[    0.820461] 0x000000380000-0x000000580000 : "FIP"
[    0.827369] 0x000000180000-0x000000380000 : "Factory"
[    0.834600] 0x000000100000-0x000000180000 : "u-boot-env"
[    0.840801] 0x000000000000-0x000000100000 : "BL2"
[    0.973195] mtk_soc_eth 15100000.ethernet: generated random MAC address d6:65:fa:04:32:b4
[    0.981434] mtk_soc_eth 15100000.ethernet: generated random MAC address 26:9f:41:1f:ce:af
[    1.003476] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc009500000, irq 82
[    1.013321] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc009500000, irq 82
[    1.022976] i2c_dev: i2c /dev entries driver
[    1.028556] mtk-wdt 1001c000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    1.037380] NET: Registered PF_INET6 protocol family
[    1.043609] Segment Routing with IPv6
[    1.047291] In-situ OAM (IOAM) with IPv6
[    1.051239] NET: Registered PF_PACKET protocol family
[    1.056541] 8021q: 802.1Q VLAN Support v1.8
[    1.061744] pstore: Using crash dump compression: deflate
[    1.076102] phy phy-usb-phy@11e10000.1: type_sw - reg 0x218, index 0
[    1.104825] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[    1.114008] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    1.122716] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=92)
[    1.143149] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=93)
[    1.163520] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=94)
[    1.183688] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=95)
[    1.203861] mt7530-mdio mdio-bus:1f lan5 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=96)
[    1.215091] DSA: tree 0 setup
[    1.220321] UBI: auto-attach mtd0
[    1.223680] ubi0: default fastmap pool size: 25
[    1.228201] ubi0: default fastmap WL pool size: 12
[    1.232990] ubi0: attaching mtd0
[    3.113391] ubi0: scanning is finished
[    3.158568] ubi0: attached mtd0 (name "ubi", size 64 MiB)
[    3.163984] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    3.170846] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    3.177628] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    3.184580] ubi0: good PEBs: 511, bad PEBs: 1, corrupted PEBs: 0
[    3.190573] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[    3.197784] ubi0: max/mean erase counter: 5/2, WL threshold: 4096, image sequence number: 0
[    3.206123] ubi0: available PEBs: 0, total reserved PEBs: 511, PEBs reserved for bad PEB handling: 19
[    3.215340] ubi0: background thread "ubi_bgt0d" started, PID 418
[    3.227485] FIT: Selected configuration: "config-1" (OpenWrt hilink_rm65)
[    3.234326] FIT:           kernel sub-image 0x00001000..0x005014ae "kernel-1" (ARM64 OpenWrt Linux-5.15.150)
[    3.244253] FIT:          flat_dt sub-image 0x00502000..0x005081ac "fdt-1" (ARM64 OpenWrt hilink_rm65 device tree blob)
[    3.255131] FIT:          flat_dt sub-image 0x00509000..0x00509586 "fdt-mt7981-rfb-spim-nand" (ARM64 OpenWrt hilink_rm65 device tree overlay mt7981-rfb-spim-nand)
[    3.269731] FIT:       filesystem sub-image 0x0050a000..0x0103ffff "rootfs-1" (ARM64 OpenWrt hilink_rm65 rootfs)
[    3.279986] FIT: selecting configured loadable "rootfs-1" to be root filesystem
[    3.287290]  ubiblock0_2: p1(rootfs-1)
[    3.287480] block ubiblock0_2: created from ubi0:2(fit)
[    3.318376] VFS: Mounted root (squashfs filesystem) readonly on device 259:0.
[    3.325707] Freeing unused kernel memory: 448K
[    3.352008] Run /sbin/init as init process
[    3.356093]   with arguments:
[    3.359047]     /sbin/init
[    3.361741]   with environment:
[    3.364884]     HOME=/
[    3.367232]     TERM=linux
[    3.954903] init: Console is alive
[    3.958447] init: - watchdog -
[    5.170554] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.237333] usbcore: registered new interface driver usbfs
[    5.242880] usbcore: registered new interface driver hub
[    5.248233] usbcore: registered new device driver usb
[    5.258100] xhci-mtk 11200000.usb: xHCI Host Controller
[    5.263365] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 1
[    5.273741] xhci-mtk 11200000.usb: hcc params 0x01403f99 hci version 0x110 quirks 0x0000000000210010
[    5.282911] xhci-mtk 11200000.usb: irq 87, io mem 0x11200000
[    5.288654] xhci-mtk 11200000.usb: xHCI Host Controller
[    5.293907] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 2
[    5.301296] xhci-mtk 11200000.usb: Host supports USB 3.2 Enhanced SuperSpeed
[    5.308804] hub 1-0:1.0: USB hub found
[    5.312620] hub 1-0:1.0: 1 port detected
[    5.316870] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    5.325387] hub 2-0:1.0: USB hub found
[    5.329169] hub 2-0:1.0: 1 port detected
[    5.337757] usbcore: registered new interface driver usb-storage
[    5.344124] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.355427] init: - preinit -
[    6.280992] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[    6.289482] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    6.298167] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    6.304912] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
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
[    8.486336] UBIFS (ubi0:3): default file-system created
[    8.500689] UBIFS (ubi0:3): Mounting in unauthenticated mode
[    8.506481] UBIFS (ubi0:3): background thread "ubifs_bgt0_3" started, PID 546
[    8.793168] random: procd: uninitialized urandom read (4 bytes read)
[    8.923074] UBIFS (ubi0:3): UBIFS: mounted UBI device 0, volume 3, name "rootfs_data"
[    8.930904] UBIFS (ubi0:3): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    8.940835] UBIFS (ubi0:3): FS size: 40759296 bytes (38 MiB, 321 LEBs), max 331 LEBs, journal size 2031616 bytes (1 MiB, 16 LEBs)
[    8.952478] UBIFS (ubi0:3): reserved for root: 1925161 bytes (1880 KiB)
[    8.959079] UBIFS (ubi0:3): media format: w5/r0 (latest is w5/r0), UUID DD8890F9-7E9D-4503-9E35-70AD3602F689, small LPT model
[    8.976651] mount_root: overlay filesystem has not been fully initialized yet
[    8.984041] mount_root: switching to ubifs overlay
[    8.997814] overlayfs: null uuid detected in lower fs '/', falling back to xino=off,index=off,nfs_export=off.
[    9.008962] urandom-seed: Seed file not found (/etc/urandom.seed)
[    9.093361] procd: - early -
[    9.096325] procd: - watchdog -
[    9.613826] procd: - watchdog -
[    9.617226] procd: - ubus -
[    9.709084] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.716229] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.736201] procd: - init -
Please press Enter to activate this console.
[   10.185206] random: jshn: uninitialized urandom read (4 bytes read)
[   10.194573] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.201049] random: ubus: uninitialized urandom read (4 bytes read)
[   10.292128] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.307267] crypto-safexcel 10320000.crypto: EIP97:230(0,1,4,4)-HIA:270(0,5,5),PE:150/433(alg:7fcdfc00)/0/0/0
[   10.324480] Loading modules backported from Linux version v6.1.24-0-g0102425ac76b
[   10.331960] Backport generated by backports.git v5.15.92-1-44-gd6ea70fafd36
[   10.520151] urngd: v1.0.2 started.
[   10.679427] random: crng init done
[   10.682855] random: 21 urandom warning(s) missed due to ratelimiting
[   10.692246] mt798x-wmac 18000000.wifi: HW/SW Version: 0x8a108a10, Build Time: 20221208201745a
[   10.692246]
[   11.222249] mt798x-wmac 18000000.wifi: WM Firmware Version: ____000000, Build Time: 20221208201806
[   11.440199] mt798x-wmac 18000000.wifi: WA Firmware Version: DEV_000000, Build Time: 20221208202048
[   11.563867] kmodloader: done loading kernel modules from /etc/modules.d/*
[   19.853927] mtk_soc_eth 15100000.ethernet eth0: Link is Down
[   19.867727] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[   19.882614] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[   19.884161] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[   19.901366] br-lan: port 1(lan1) entered blocking state
[   19.906660] br-lan: port 1(lan1) entered disabled state
[   19.913374] device lan1 entered promiscuous mode
[   19.917999] device eth0 entered promiscuous mode
[   19.924768] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   19.941889] mt7530-mdio mdio-bus:1f lan2: configuring for phy/gmii link mode
[   19.949927] br-lan: port 2(lan2) entered blocking state
[   19.955201] br-lan: port 2(lan2) entered disabled state
[   19.962277] device lan2 entered promiscuous mode
[   19.974969] mt7530-mdio mdio-bus:1f lan3: configuring for phy/gmii link mode
[   19.984849] br-lan: port 3(lan3) entered blocking state
[   19.990082] br-lan: port 3(lan3) entered disabled state
[   19.997257] device lan3 entered promiscuous mode
[   20.009904] mt7530-mdio mdio-bus:1f lan4: configuring for phy/gmii link mode
[   20.020871] br-lan: port 4(lan4) entered blocking state
[   20.026136] br-lan: port 4(lan4) entered disabled state
[   20.033544] device lan4 entered promiscuous mode
[   20.062363] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:00] driver [MediaTek MT7981 PHY] (irq=POLL)
[   20.071950] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/gmii link mode
[   20.081461] br-lan: port 5(eth1) entered blocking state
[   20.086720] br-lan: port 5(eth1) entered disabled state
[   20.092268] device eth1 entered promiscuous mode
[   20.106515] mt7530-mdio mdio-bus:1f lan5: configuring for phy/gmii link mode
[   22.549381] mt7530-mdio mdio-bus:1f lan2: Link is Up - 1Gbps/Full - flow control rx/tx
[   22.557354] br-lan: port 2(lan2) entered blocking state
[   22.562590] br-lan: port 2(lan2) entered forwarding state
[   22.568697] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   23.322759] mt7530-mdio mdio-bus:1f lan5: Link is Up - 1Gbps/Full - flow control rx/tx
[   23.330713] IPv6: ADDRCONF(NETDEV_CHANGE): lan5: link becomes ready



BusyBox v1.36.1 (2024-03-22 22:09:42 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 23.05.3, r23809-234f1a2efa
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@Hilink:/# 

hilink_rm65.dts

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

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

/ {
	model = "MediaTek MT7981 RFB";
	compatible = "mediatek,mt7981-rfb", "mediatek,mt7981";

	aliases {
		serial0 = &uart0;
	};

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

	memory {    /* 256MB ram = 0x10000000 */
		reg = <0 0x40000000 0 0x10000000>;
	};

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

	gpio-keys {
		compatible = "gpio-keys";
		reset {
			label = "reset";
			linux,code = <KEY_RESTART>;
			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
		};
		wps {
			label = "wps";
			linux,code = <KEY_WPS_BUTTON>;
			gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
		};
	};
	
	leds {
		compatible = "gpio-leds";
			gbe_led0 {
				label = "gbe0";
				gpios = <&pio 8 GPIO_ACTIVE_LOW>;
			};

			gbe_led1 {
				label = "gbe1";
				gpios = <&pio 13 GPIO_ACTIVE_LOW>;
			};
			
			wf2g_led {
				label = "wf2g1";
				gpios = <&pio 34 GPIO_ACTIVE_LOW>;
			};
			
			wf5g_led {
				label = "wf5g1";
				gpios = <&pio 35 GPIO_ACTIVE_LOW>;
			};
	};
};

&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 = "gmii";
		phy-handle = <&int_gbe_phy>;
	};
};	

&mdio_bus {
	#address-cells = <1>;
	#size-cells = <0>;
/* this for testing (lan5) switch port 4
	phy4: ethernet-phy@4 {
			reg = <4>;
			compatible = "ethernet-phy-ieee802.3-c22";
			phy-mode = "gmii";
	};
*/
	switch: switch@1f {
		compatible = "mediatek,mt7531";
		reg = <31>;
		interrupt-controller;
		#interrupt-cells = <1>;
		interrupt-parent = <&pio>;
		interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
		reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
	};
};

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

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

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

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

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

		port@4 {
			reg = <4>;
			label = "lan5";
		};

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

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

&crypto {
	status = "okay";
};

&pio {
	spi0_flash_pins: spi0-pins {
		mux {
			function = "spi";
			groups = "spi0", "spi0_wp_hold";
		};
		conf-pu {
			pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
			drive-strength = <MTK_DRIVE_8mA>;
			bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
		};
		conf-pd {
			pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
			drive-strength = <MTK_DRIVE_8mA>;
			bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
		};
	};

};

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

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

&uart0 {
	status = "okay";
};

&usb_phy {
	status = "okay";
};

&watchdog {
	status = "okay";
};

mdio mt7530-0

root@Hilink:/# mdio mt7530-0
 DEV      PHY-ID  LINK
0x00  0x03a29441  down
0x01  0x03a29441  up
0x02  0x03a29441  down
0x03  0x03a29441  down
0x04  0x03a29441  up
0x05  0x00000000  down
0x06  0x00000000  down
0x07  0x00000000  down
0x08  0x00000000  down
0x09  0x00000000  down
0x0a  0x00000000  down
0x0b  0x00000000  down
0x0c  0x00000000  down
0x0d  0x00000000  down
0x0e  0x00000000  down
0x0f  0x00000000  down
0x10  0x00000000  down
0x11  0x00000000  down
0x12  0x00000000  down
0x13  0x00000000  down
0x14  0x00000000  down
0x15  0x00000000  down
0x16  0x00000000  down
0x17  0x00000000  down
0x18  0x00000000  down
0x19  0x00000000  down
0x1a  0x00000000  down
0x1b  0x00000000  down
0x1c  0x00000000  down
0x1d  0x00000000  down
0x1e  0x00000000  down
0x1f  0x00000000  down

Oh I have a question btw for anyone who knows it , just to gain some better understanding.

On mt7981. gmac0 and gmac1 are the 2 sgmii ports on the soc, right?

I've browsed thru a lot of dts files over the past 2 weeks and I see a numerous amount of combinations in dts in &mdio_bus section where phy0:ethernet , phy 5, ph6,
What is the logic here in the phy number? Can we choose it randomly or does it relate to an UTP connector on the router board?
I know the reg value in switch/ports section relates to swith utp port, like reg 0 1st utp port. reg 4 5th utp (wan) port on the mt7531 and port 6 being the 7th port, 2nd sgmii port on the mt7531 mostly used as bridge to the cpu soc.

But I still wonder what the deal is with the phy numbers choosen in &mdio_bus section.

Anyone?

Different chips have different outputs, sometimes a built-in switch is used and sometimes it is extended with additional chips. You have to look at it individually.

Zyxel EX5601-T0 has the same chip (Maxlinear GPY211):

		phy5: phy@5 {
			compatible = "ethernet-phy-ieee802.3-c45";
			reg = <5>;
			mxl,led-config = <0x03f0 0x0 0x0 0x0>;
		};
				port@5 {
					reg = <5>;
					label = "lan1";
					phy-mode = "2500base-x";
					phy = <&phy5>;
				};

So.try this:

	phy4: ethernet-phy@4 {
			reg = <4>;
			compatible = "ethernet-phy-ieee802.3-c45";
	};
				port@4 {
					reg = <4>;
					label = "lan5";
					phy-mode = "2500base-x";
					phy = <&phy4>;
				};

Thank you! I will try!
Ps. in your example, what should I do with gmac1?
Comment it out?

/*	gmac1: mac@1 {
		compatible = "mediatek,eth-mac";
		reg = <1>;
		phy-mode = "gmii";
		phy-handle = <&int_gbe_phy>;
	};
*/

Oh btw, In mt7981.dtsi an int_gbe_phy@ethernet-phy0 is declared for gmii 1000mbit.

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

			int_gbe_phy: ethernet-phy@0 {
				reg = <0>;
				compatible = "ethernet-phy-ieee802.3-c22";
				phy-mode = "gmii";
				phy-is-integrated;
				nvmem-cells = <&phy_calibration>;
				nvmem-cell-names = "phy-cal-data";

In my expiriments with trying out stuff for my router board I sometimes think that the phy0 declaration in mt7981.dtsi is hindering my expiriments.
How can I see this? Is my mt7981-rm65.dts overriding what is written in mt7981.dtsi or can the stuff I do in my dts clash with the phy0 port setup in mt7981.dtsi?

I tried to remove the phy0 declaration from mt7981.dtsi but then compiling gives a lot of errors because lot of mt7981 devices are depending on the phy0 declaration in mt7981.dtsi.

I tried your example with phy4 and this is in kernel.log:

[    2.198297] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=92)
[    2.218686] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=93)
[    2.239156] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=94)
[    2.259324] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=95)
[    2.270383] mt7530-mdio mdio-bus:1f lan5 (uninitialized): validation of  with support 0000000,00000000,00006000 and advertisement 0000000,00000000,00000000 failed: -22
[    2.285396] mt7530-mdio mdio-bus:1f lan5 (uninitialized): failed to connect to PHY: -EINVAL
[    2.293750] mt7530-mdio mdio-bus:1f lan5 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 4

Port4 on the mt7531 is a switch-wan port with 1gb phy. So i suspect port 0-4 on the mt7531 can only be running at 1gb/s. For making a 2,5gb/s connection out of the mt7531 it probably has to be port5.
Information about mt7531 i got from:
mt7531 switch info

But... In the mt7981-rm65 pdf info I received from the manufacturer it says that maxliniear gpy211 2.5gb phy is connected to gmac1 port. (together with usb3)

So my best bet to get a 2.5gb/s ethernet working is to put gmac1 to 2.5gb/s I think.
But I have that problem that in standard openwrt23.05 in mt7981.dtsi the phy0 is set to gmii 1gb/s.

To set the gmac1 eth1 to 2,5gb/s I try this:

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

and iin mt7981.dtsi i change the standard

/*			int_gbe_phy: ethernet-phy@0 {
				reg = <0>;
				compatible = "ethernet-phy-ieee802.3-c22";
				phy-mode = "gmii";
				phy-is-integrated;
				nvmem-cells = <&phy_calibration>;
				nvmem-cell-names = "phy-cal-data";
*/

to

			int_gbe_phy: ethernet-phy@0 {
				reg = <0>;
				compatible = "ethernet-phy-ieee802.3-c45";
				phy-mode = "2500base-x";

and the result kernel log is:

[    1.815889] Creating 5 MTD partitions on "spi0.1":
[    1.820671] 0x000000580000-0x000004580000 : "ubi"
[    1.881155] 0x000000380000-0x000000580000 : "FIP"
[    1.888102] 0x000000180000-0x000000380000 : "Factory"
[    1.895435] 0x000000100000-0x000000180000 : "u-boot-env"
[    1.901703] 0x000000000000-0x000000100000 : "BL2"
[    2.033629] mtk_soc_eth 15100000.ethernet: generated random MAC address 66:0a:7f:c3:3e:79
[    2.041870] mtk_soc_eth 15100000.ethernet: generated random MAC address 46:80:c3:7b:06:c4
[    2.056144] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc009180000, irq 82
[    2.065984] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc009180000, irq 82
[    2.075574] i2c_dev: i2c /dev entries driver
[    2.081129] mtk-wdt 1001c000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    2.089874] NET: Registered PF_INET6 protocol family
[    2.095700] Segment Routing with IPv6
[    2.099382] In-situ OAM (IOAM) with IPv6
[    2.103375] NET: Registered PF_PACKET protocol family
[    2.108558] 8021q: 802.1Q VLAN Support v1.8
[    2.113796] pstore: Using crash dump compression: deflate
[    2.128164] phy phy-usb-phy@11e10000.1: type_sw - reg 0x218, index 0
[    2.176722] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[    2.185888] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    2.194694] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=92)
[    2.215239] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=93)
[    2.235409] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=94)
[    2.255578] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=95)
[    2.267118] DSA: tree 0 setup
[    2.272381] UBI: auto-attach mtd0
[    2.275744] ubi0: default fastmap pool size: 25
[    2.280267] ubi0: default fastmap WL pool size: 12
[    2.285056] ubi0: attaching mtd0
[    4.164777] ubi0: scanning is finished
[    4.209924] ubi0: attached mtd0 (name "ubi", size 64 MiB)
[    4.215348] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    4.222210] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    4.228988] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    4.235940] ubi0: good PEBs: 511, bad PEBs: 1, corrupted PEBs: 0
[    4.241932] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[    4.249143] ubi0: max/mean erase counter: 13/7, WL threshold: 4096, image sequence number: 0
[    4.257569] ubi0: available PEBs: 0, total reserved PEBs: 511, PEBs reserved for bad PEB handling: 19
[    4.266787] ubi0: background thread "ubi_bgt0d" started, PID 391
[    4.278931] FIT: Selected configuration: "config-1" (OpenWrt hilink_rm65)
[    4.285749] FIT:           kernel sub-image 0x00001000..0x0050ec47 "kernel-1" (ARM64 OpenWrt Linux-5.15.150)
[    4.295687] FIT:          flat_dt sub-image 0x0050f000..0x005151ac "fdt-1" (ARM64 OpenWrt hilink_rm65 device tree blob)
[    4.306559] FIT:          flat_dt sub-image 0x00516000..0x00516586 "fdt-mt7981-rfb-spim-nand" (ARM64 OpenWrt hilink_rm65 device tree overlay mt7981-rfb-spim-nand)
[    4.306985] Unable to handle kernel read from unreadable memory at virtual address 00000000000000ac
[    4.321155] FIT:       filesystem sub-image 0x00517000..0x00b55fff "rootfs-1" (ARM64 OpenWrt hilink_rm65 rootfs)
[    4.330163] Mem abort info:
[    4.330165]   ESR = 0x0000000096000005
[    4.330167]   EC = 0x25: DABT (current EL), IL = 32 bits
[    4.340415] FIT: selecting configured loadable "rootfs-1" to be root filesystem
[    4.343184]   SET = 0, FnV = 0
[    4.343186]   EA = 0, S1PTW = 0
[    4.343189]   FSC = 0x05: level 1 translation fault
[    4.346921]  ubiblock0_2: p1(rootfs-1)
[    4.352214] Data abort info:
[    4.352216]   ISV = 0, ISS = 0x00000005
[    4.359672] block ubiblock0_2: created from ubi0:2(fit)
[    4.362541]   CM = 0, WnR = 0
[    4.362544] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000045d8b000
[    4.362548] [00000000000000ac] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
[    4.395543] Internal error: Oops: 0000000096000005 [#1] SMP
    4.395547] Modules linked in:
[   4.395551] CPU: 0 PID: 354 Comm: irq/62-mt7530 Not tainted 5.15.150 #0
[    4.412935] Freeing unused kernel memory: 448K
[    4.419248] Hardware name: MediaTek MT7981 RFB (DT)
[    4.428537] pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    4.435484] pc : handle_nested_irq+0x34/0x1c0
[    4.439835] lr : handle_nested_irq+0x14/0x1c0
[    4.444180] sp : ffffffc009773d40
[    4.447481] x29: ffffffc009773d40 x28: 0000000000000000 x27: ffffffc00808a864
[    4.454606] x26: ffffff80001452e0 x25: ffffffc00808a950 x24: ffffff8005f0ad80
[    4.461731] x23: 00000000000000ac x22: ffffff800032b980 x21: ffffff8005ebd880
[    4.468855] x20: 0000000000000000 x19: 0000000000000005 x18: 000000002a803b19
[    4.475980] x17: ffffffc008b6ee20 x16: ffffffc008b6edb0 x15: 00000000b2cb4163
[    4.483104] x14: 00011224f110a06d x13: 0036aa8abf1c21f0 x12: ffffffc008817678
[    4.490228] x11: 0000000000000040 x10: ffffffc008b4a230 x9 : ffffffc008b4a228
[    4.497352] x8 : ffffff8000400b90 x7 : 0000000000000000 x6 : 0000000000000000
[    4.504475] x5 : ffffff8000400b68 x4 : ffffff8000400b90 x3 : 0000000000000000
[    4.511599] x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000
[    4.518722] Call trace:
[    4.521157]  handle_nested_irq+0x34/0x1c0
[    4.525156]  mt7530_irq_thread_fn+0xa8/0xfc
[    4.529331]  irq_thread_fn+0x28/0x90
[    4.532896]  irq_thread+0x10c/0x210
[    4.536373]  kthread+0x11c/0x130
[    4.539593]  ret_from_fork+0x10/0x20
[    4.543162] Code: d2800000 9102b297 52800022 f98002f1 (885ffee1)
[    4.549240] ---[ end trace c19f557820b24cde ]---
[    4.556599] Kernel panic - not syncing: Oops: Fatal exception
[    4.562331] SMP: stopping secondary CPUs
[    4.566242] Kernel Offset: disabled
[    4.569716] CPU features: 0x0,00000000,20000802
[    4.574233] Memory Limit: none
[    4.579964] Rebooting in 1 seconds..

I've read in some openwrt forum posts that to enable to maxlineair gpy211 there has to be some resetdelays orso in or before the phy declaration. Otherwise the maxlineair will not be detected.

I'm currently trying this one in mt7981.dtsi:

			reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
			reset-delay-us = <600>;
			reset-post-delay-us = <20000>;

			int_gbe_phy: ethernet-phy@5 {
				reg = <5>;
				compatible = "ethernet-phy-ieee802.3-c45";
				phy-mode = "2500base-x";

and in rm65.dts still same

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

and the kernel log result is:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.15.150 (neo@goliath) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.
[    0.000000] Machine model: MediaTek MT7981 RFB
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000004fffffff]
[    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-0x0000000047c7ffff]
[    0.000000]   node   0: [mem 0x0000000047c80000-0x0000000047ffffff]
[    0.000000]   node   0: [mem 0x0000000048000000-0x000000004fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000004fffffff]
[    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.4
[    0.000000] percpu: Embedded 17 pages/cpu s32664 r8192 d28776 u69632
[    0.000000] pcpu-alloc: s32664 r8192 d28776 u69632 alloc=17*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    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: 64512
[    0.000000] Kernel command line:
[    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 234904K/262144K available (8192K kernel code, 890K rwdata, 2228K rodata, 448K
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    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_id
[    0.000000] sched_clock: 56 bits at 13MHz, resolution 76ns, wraps every 4398046511101ns
[    0.000135] Calibrating delay loop (skipped), value calculated using timer frequency.. 26.00 Bogo
[    0.000145] pid_max: default: 32768 minimum: 301
[    0.000428] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.000437] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.001713] rcu: Hierarchical SRCU implementation.
[    0.002068] smp: Bringing up secondary CPUs ...
[    0.002387] Detected VIPT I-cache on CPU1
[    0.002413] GICv3: CPU1: found redistributor 1 region 0:0x000000000c0a0000
[    0.002442] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.002507] smp: Brought up 1 node, 2 CPUs
[    0.002520] SMP: Total of 2 processors activated.
[    0.002526] CPU features: detected: 32-bit EL0 Support
[    0.002530] CPU features: detected: CRC32 instructions
[    0.002557] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.002619] CPU: All CPU(s) started at EL2
[    0.002630] alternatives: patching kernel code
[    0.005879] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 191126044
[    0.005901] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.006040] pinctrl core: initialized pinctrl subsystem
[    0.006690] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.006991] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.007020] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.007044] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.007384] thermal_sys: Registered thermal governor 'fair_share'
[    0.007389] thermal_sys: Registered thermal governor 'bang_bang'
[    0.007394] thermal_sys: Registered thermal governor 'step_wise'
[    0.007398] thermal_sys: Registered thermal governor 'user_space'
[    0.007564] ASID allocator initialised with 65536 entries
[    0.008119] pstore: Registered ramoops as persistent store backend
[    0.008126] ramoops: using 0x10000@0x42ff0000, ecc: 0
[    0.018711] cryptd: max_cpu_qlen set to 1000
[    0.021109] SCSI subsystem initialized
[    0.021270] libata version 3.00 loaded.
[    0.022404] clocksource: Switched to clocksource arch_sys_counter
[    0.023064] NET: Registered PF_INET protocol family
[    0.023150] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.023507] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.023525] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.023533] TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.023560] TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    0.023589] TCP: Hash tables configured (established 2048 bind 2048)
[    0.023653] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.023670] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.023780] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.023802] PCI: CLS 0 bytes, default 64
[    0.024095] Unpacking initramfs...
[    0.025806] workingset: timestamp_bits=46 max_order=16 bucket_order=0
[    0.029419] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.029436] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red
[    0.063927] pwm-mediatek 10048000.pwm: clock: top fail: -517
[    0.072490] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.073235] printk: console [ttyS0] disabled
[    0.093529] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 18, base_baud = 2500000) is a ST1665
[    0.710612] printk: console [ttyS0] enabled
[    0.715629] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.725775] loop: module loaded
[    0.730664] spi spi0.1: setup: ignoring unsupported mode bits a00
[    0.737306] spi-nand spi0.1: Macronix SPI NAND was found.
[    0.742741] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    1.799176] Freeing initrd memory: 5900K
[    1.809569] 5 fixed-partitions partitions found on MTD device spi0.1
[    1.815946] Creating 5 MTD partitions on "spi0.1":
[    1.820727] 0x000000580000-0x000004580000 : "ubi"
[    1.880935] 0x000000380000-0x000000580000 : "FIP"
[    1.887888] 0x000000180000-0x000000380000 : "Factory"
[    1.895249] 0x000000100000-0x000000180000 : "u-boot-env"
[    1.901463] 0x000000000000-0x000000100000 : "BL2"
[    2.033611] mtk_soc_eth 15100000.ethernet: generated random MAC address 86:17:74:e4:34:c5
[    2.041849] mtk_soc_eth 15100000.ethernet: generated random MAC address 76:b3:61:93:46:f5
[    2.088166] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc009180000, irq
[    2.098030] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc009180000, irq
[    2.107610] i2c_dev: i2c /dev entries driver
[    2.113165] mtk-wdt 1001c000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    2.121859] NET: Registered PF_INET6 protocol family
[    2.127706] Segment Routing with IPv6
[    2.131398] In-situ OAM (IOAM) with IPv6
[    2.135385] NET: Registered PF_PACKET protocol family
[    2.140549] 8021q: 802.1Q VLAN Support v1.8
[    2.146022] pstore: Using crash dump compression: deflate
[    2.160392] phy phy-usb-phy@11e10000.1: type_sw - reg 0x218, index 0
[    2.209044] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[    2.218204] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    2.226898] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT75
[    2.238523] Unable to handle kernel read from unreadable memory at virtual address 00000000000000
[    2.247565] Mem abort info:
[    2.250346]   ESR = 0x0000000096000005
[    2.254082]   EC = 0x25: DABT (current EL), IL = 32 bits
[    2.259380]   SET = 0, FnV = 0
[    2.262422]   EA = 0, S1PTW = 0
[    2.265550]   FSC = 0x05: level 1 translation fault
[    2.270413] Data abort info:
[    2.273280]   ISV = 0, ISS = 0x00000005
[    2.277101]   CM = 0, WnR = 0
[    2.280057] user pgtable: 4k pages, 39-bit VAs, pgdp=00000000460ba000
[    2.286482] [00000000000000ac] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
[    2.295170] Internal error: Oops: 0000000096000005 [#1] SMP
[    2.300728] Modules linked in:
[    2.303772] CPU: 1 PID: 354 Comm: irq/62-mt7530 Not tainted 5.15.150 #0
[    2.310373] Hardware name: MediaTek MT7981 RFB (DT)
[    2.315237] pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    2.322186] pc : handle_nested_irq+0x34/0x1c0
[    2.326536] lr : handle_nested_irq+0x14/0x1c0
[    2.330881] sp : ffffffc00977bd40
[    2.334182] x29: ffffffc00977bd40 x28: 0000000000000000 x27: ffffffc00808a864
[    2.341307] x26: ffffff80001458e0 x25: ffffffc00808a950 x24: ffffff800022ca00
[    2.348432] x23: 00000000000000ac x22: ffffff80002aae00 x21: ffffff8005b53880
[    2.355556] x20: 0000000000000000 x19: 0000000000000005 x18: 0000000000000000
[    2.362680] x17: 0004000600000000 x16: 000300080066313a x15: 7375622d6f69646d
[    2.369803] x14: 01b99c7341451ee4 x13: 000128462f4e680e x12: ffffffc008817678
[    2.376927] x11: 0000000000000040 x10: ffffffc008b4a230 x9 : ffffffc008b4a228
[    2.384051] x8 : ffffff8000400700 x7 : 0000000000000000 x6 : 0000000000000000
[    2.391175] x5 : ffffff80004006d8 x4 : ffffff8000400700 x3 : 0000000000000000
[    2.398299] x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000
[    2.405423] Call trace:
[    2.407857]  handle_nested_irq+0x34/0x1c0
[    2.411856]  mt7530_irq_thread_fn+0xa8/0xfc
[    2.416032]  irq_thread_fn+0x28/0x90
[    2.419597]  irq_thread+0x10c/0x210
[    2.423074]  kthread+0x11c/0x130
[    2.426295]  ret_from_fork+0x10/0x20
[    2.429865] Code: d2800000 9102b297 52800022 f98002f1 (885ffee1)
[    2.435943] ---[ end trace c68e77d7bd73af51 ]---
[    2.442805] Kernel panic - not syncing: Oops: Fatal exception
[    2.448538] SMP: stopping secondary CPUs
[    2.452449] Kernel Offset: disabled
[    2.455923] CPU features: 0x0,00000000,20000802
[    2.460441] Memory Limit: none
[    2.465693] Rebooting in 1 seconds..

The problem currently is that I cannot get gmac1 to connect to its external maxlinear gpy211 for 2.5gb/s ethernet connection to eth1.

Is there something I can do to probe for the maxlinear gpy211?
The driver is available in the kernel, its just a matter of seeing how it is connected at what adress/reg.
When I do "mdio mdio-bus" I only see the internal 1gb/s phy at reg <0> and the mt7531 at reg <31> (0x1f). Or atleast I assume that the <31> is the switch because in the DTS the switch is setup at reg<31> at the mdio-bus.

0x00  0x03a29461  down
0x01  0x00000000  down
0x02  0x00000000  down
0x03  0x00000000  down
0x04  0x00000000  down
0x05  0x00000000  down
0x06  0x00000000  down
0x07  0x00000000  down
0x08  0x00000000  down
0x09  0x00000000  down
0x0a  0x00000000  down
0x0b  0x00000000  down
0x0c  0x00000000  down
0x0d  0x00000000  down
0x0e  0x00000000  down
0x0f  0x00000000  down
0x10  0x00000000  down
0x11  0x00000000  down
0x12  0x00000000  down
0x13  0x00000000  down
0x14  0x00000000  down
0x15  0x00000000  down
0x16  0x00000000  down
0x17  0x00000000  down
0x18  0x00000000  down
0x19  0x00000000  down
0x1a  0x00000000  down
0x1b  0x00000000  down
0x1c  0x00000000  down
0x1d  0x00000000  down
0x1e  0x00000000  down
0x1f  0x9000040c  down

Oh, In the maxlinear gpy211 datasheet I found that the connection towards it must be in sgmii mode. So in my dts I'm trying

	gmac1: mac@1 {
		compatible = "mediatek,eth-mac";
		reg = <1>;
		phy-mode = "sgmii";
		phy-handle = <&phy5>;
	};
};

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

	reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
	reset-delay-us = <10000>;
	reset-post-delay-us = <30000>;

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