Cudy WR1300 v3 Hardware on OpenWRT 19.07 - Low TX power on mt7613be car

Hello,

I've been backporting support for OpenWRT 19 to the Cudy v3 hardware and while I've managed to get the board booting and the wifi interfaces online, we seem to be stuck with low transmit power on the mt7613be card. I've tried a number of things including zekica's eeprom patch for the config without any luck. I tried upgrading the mt7663pr2h_rebb.bin file to the newer version but I'm getting a hung boot and then a watchdoog reset of the entire system.

===================================================================
                MT7621   stage1 code done
                CPU=500000000 HZ BUS=166666666 HZ
===================================================================


U-Boot 1.1.3 (Jul 19 2022 - 13:47:34)

Board: Ralink APSoC DRAM:  128 MB
mtest end addr: 87f31f88
relocate_code Pointer at: 87f94000

Config XHCI 40M PLL
flash manufacture id: 20, device id 40 18
find flash: xm25qh128c
*** Warning - bad CRC, using default environment

#Reset_MT7530
set LAN/WAN WLLLL

3: System Boot system code via Flash.
## Booting image at bc050000 ...
   Image Name:   MIPS slouter Linux-4.14.180
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1748868 Bytes =  1.7 MB
   Load Address: 80001000
   Entry Point:  80001000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80001000) ...
## Giving linux memsize in MB, 128

Starting kernel ...

[    0.000000] Linux version 4.14.180 (dpraymond@ubuntu2004build) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 20240216-210256)) #0 SMP Tue Feb 20 14:22:43 2024
[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] MIPS: machine is Cudy WR1300 v3
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] VPE topology {2,2} total 4
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from 0x80515744 with crng_init=0
[    0.000000] percpu: Embedded 14 pages/cpu s26192 r8192 d22960 u57344
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=0000c062
[    0.000000] Readback ErrCtl register=0000c062
[    0.000000] Memory: 122900K/131072K available (4492K kernel code, 235K rwdata, 464K rodata, 1260K init, 248K bss, 8172K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 880MHz
[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
[    0.000009] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
[    0.007803] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[    0.073978] pid_max: default: 32768 minimum: 301
[    0.078742] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.085251] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.094011] Hierarchical SRCU implementation.
[    0.099158] smp: Bringing up secondary CPUs ...
[    0.105202] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.105211] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.105222] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.105356] CPU1 revision is: 0001992f (MIPS 1004Kc)
[    0.163903] Synchronize counters for CPU 1: done.
[    0.205248] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.205257] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.205265] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.205338] CPU2 revision is: 0001992f (MIPS 1004Kc)
[    0.255018] Synchronize counters for CPU 2: done.
[    0.286283] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.286290] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.286297] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.286372] CPU3 revision is: 0001992f (MIPS 1004Kc)
[    0.340201] Synchronize counters for CPU 3: done.
[    0.370052] smp: Brought up 1 node, 4 CPUs
[    0.377846] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.387635] futex hash table entries: 1024 (order: 3, 32768 bytes)
[    0.393922] pinctrl core: initialized pinctrl subsystem
[    0.400369] NET: Registered protocol family 16
[    0.411234] pull PCIe RST: RALINK_RSTCTRL = 0
[    0.715965] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.721013] ***** Xtal 40MHz *****
[    0.724369] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.729463] Port 0 N_FTS = 1b102800
[    0.732933] Port 1 N_FTS = 1b102800
[    0.736376] Port 2 N_FTS = 1b102800
[    1.891692] PCIE2 no card, disable it(RST&CLK)
[    1.896051]  -> 21007f2
[    1.898453] PCIE0 enabled
[    1.901045] PCIE1 enabled
[    1.903652] PCI host bridge /pcie@1e140000 ranges:
[    1.908425]  MEM 0x0000000060000000..0x000000006fffffff
[    1.913582]   IO 0x000000001e160000..0x000000001e16ffff
[    1.918779] PCI coherence region base: 0xbfbf8000, mask/settings: 0x60000000
[    1.934369] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.940123] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.945875] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.953016] PCI host bridge to bus 0000:00
[    1.957088] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    1.963858] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    1.969747] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.976469] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    1.985054] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.992957] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    2.002231] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    2.008742] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.015714] pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
[    2.022225] pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.029160] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    2.035878] pci 0000:00:01.0: BAR 9: assigned [mem 0x60100000-0x602fffff pref]
[    2.043064] pci 0000:00:00.0: BAR 1: assigned [mem 0x60300000-0x6030ffff]
[    2.049787] pci 0000:00:01.0: BAR 1: assigned [mem 0x60310000-0x6031ffff]
[    2.056553] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff]
[    2.063270] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.068216] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    2.074938] pci 0000:02:00.0: BAR 0: assigned [mem 0x60100000-0x601fffff 64bit pref]
[    2.082648] pci 0000:02:00.0: BAR 2: assigned [mem 0x60200000-0x60203fff 64bit pref]
[    2.090315] pci 0000:02:00.0: BAR 4: assigned [mem 0x60204000-0x60204fff 64bit pref]
[    2.098025] pci 0000:00:01.0: PCI bridge to [bus 02]
[    2.102925] pci 0000:00:01.0:   bridge window [mem 0x60100000-0x602fffff pref]
[    2.111448] clocksource: Switched to clocksource GIC
[    2.117885] NET: Registered protocol family 2
[    2.122890] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    2.129760] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    2.136108] TCP: Hash tables configured (established 1024 bind 1024)
[    2.142515] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    2.148277] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    2.154741] NET: Registered protocol family 1
[    2.391349] 4 CPUs re-calibrate udelay(lpj = 2924544)
[    2.397706] Crashlog allocated RAM at address 0x3f00000
[    2.403112] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    2.416600] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.422401] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.434636] random: fast init done
[    2.438981] io scheduler noop registered
[    2.442874] io scheduler deadline registered (default)
[    2.448951] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    2.456653] console [ttyS0] disabled
[    2.460193] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 19, base_baud = 3125000) is a 16550A
[    2.469205] console [ttyS0] enabled
[    2.469205] console [ttyS0] enabled
[    2.476083] bootconsole [early0] disabled
[    2.476083] bootconsole [early0] disabled
[    2.486103] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error
[    2.493533] spi-mt7621 1e000b00.spi: sys_freq: 220000000
[    2.499718] m25p80 spi0.0: XM25QH128C (16384 Kbytes)
[    2.504771] 7 fixed-partitions partitions found on MTD device spi0.0
[    2.511094] Creating 7 MTD partitions on "spi0.0":
[    2.515896] 0x000000000000-0x000000030000 : "u-boot"
[    2.521916] 0x000000030000-0x000000040000 : "u-boot-env"
[    2.528090] 0x000000040000-0x000000050000 : "factory"
[    2.534060] 0x000000050000-0x000000fd0000 : "firmware"
[    2.540190] 2 uimage-fw partitions found on MTD device firmware
[    2.546151] Creating 2 MTD partitions on "firmware":
[    2.551108] 0x000000000000-0x0000001aafc4 : "kernel"
[    2.556971] 0x0000001aafc4-0x000000f80000 : "rootfs"
[    2.562769] mtd: device 5 (rootfs) set to be root filesystem
[    2.568496] 1 squashfs-split partitions found on MTD device rootfs
[    2.574714] 0x000000dc0000-0x000000f80000 : "rootfs_data"
[    2.580941] 0x000000fd0000-0x000000fe0000 : "debug"
[    2.586751] 0x000000fe0000-0x000000ff0000 : "backup"
[    2.592618] 0x000000ff0000-0x000001000000 : "bdinfo"
[    2.599071] libphy: Fixed MDIO Bus: probed
[    2.673379] libphy: mdio: probed
[    4.076163] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
[    4.082793] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21
[    4.093784] NET: Registered protocol family 10
[    4.099783] Segment Routing with IPv6
[    4.103605] NET: Registered protocol family 17
[    4.108083] 8021q: 802.1Q VLAN Support v1.8
[    4.114647] hctosys: unable to open rtc device (rtc0)
[    4.123991] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    4.135244] Freeing unused kernel memory: 1260K
[    4.139770] This architecture does not have kernel memory protection.
[    4.660314] init: Console is alive
[    4.664006] init: - watchdog -
[    5.648402] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.667172] mtk_soc_eth 1e100000.ethernet eth0: port 0 link up
[    5.719897] mtk_soc_eth 1e100000.ethernet eth0: port 4 link up
[    5.728596] usbcore: registered new interface driver usbfs
[    5.734206] usbcore: registered new interface driver hub
[    5.739657] usbcore: registered new device driver usb
[    5.748830] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.761723] init: - preinit -
[    6.721690] mtk_soc_eth 1e100000.ethernet: PPE started
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
[    9.925950] jffs2: notice: (445) jffs2_build_xattr_subsystem: complete building xattr subsystem, 7 of xdatum (2 unchecked, 5 orphan) and 25 of xref (5 dead, 0 orphan) found.
[    9.943086] mount_root: switching to jffs2 overlay
[    9.970317] overlayfs: upper fs does not support tmpfile.
[    9.980334] urandom-seed: Seed file not found (/etc/urandom.seed)
[   10.045969] mtk_soc_eth 1e100000.ethernet: 0x100 = 0x6060000c, 0x10c = 0x80818
[   10.060819] procd: - early -
[   10.063856] procd: - watchdog -
[   10.761540] procd: - watchdog -
[   10.765026] procd: - ubus -
[   10.814176] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.822830] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.829542] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.836784] procd: - init -
Please press Enter to activate this console.
[   11.463864] kmodloader: loading kernel modules from /etc/modules.d/*
[   11.480627] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   11.490673] Netfilter messages via NETLINK v0.30.
[   11.497049] ip_set: protocol 6
[   11.521458] i2c /dev entries driver
[   11.534056] hidraw: raw HID events driver (C) Jiri Kosina
[   11.553782] Bluetooth: Core ver 2.22
[   11.557504] NET: Registered protocol family 31
[   11.561960] Bluetooth: HCI device and connection manager initialized
[   11.568305] Bluetooth: HCI socket layer initialized
[   11.573183] Bluetooth: L2CAP socket layer initialized
[   11.578255] Bluetooth: SCO socket layer initialized
[   11.584471] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   11.589781] Bluetooth: BNEP filters: protocol multicast
[   11.595052] Bluetooth: BNEP socket layer initialized
[   11.603048] usbcore: registered new interface driver btusb
[   11.609579] Loading modules backported from Linux version v4.19.237-0-ga6e4a1818efa
[   11.612963] urngd: v1.0.2 started.
[   11.617295] Backport generated by backports.git v4.19.237-1-0-gffb89fd9
[   11.629507] Bluetooth: HCI UART driver ver 2.3
[   11.633985] Bluetooth: HCI UART protocol H4 registered
[   11.639098] Bluetooth: HCI UART protocol BCSP registered
[   11.645686] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[   11.651673] Bluetooth: HIDP socket layer initialized
[   11.658249] ip_tables: (C) 2000-2006 Netfilter Core Team
[   11.672003] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
[   11.679921] ctnetlink v0.93: registering with nfnetlink.
[   11.720759] Bluetooth: RFCOMM TTY layer initialized
[   11.725734] Bluetooth: RFCOMM socket layer initialized
[   11.730888] Bluetooth: RFCOMM ver 1.11
[   11.757596] random: crng init done
[   11.758603] xt_time: kernel timezone is -0000
[   11.761010] random: 7 urandom warning(s) missed due to ratelimiting
[   11.834662] bus=0x1, slot = 0x0, irq=0xff
[   11.838705] PCI: Enabling device 0000:00:00.0 (0004 -> 0006)
[   11.844607] mt7603e 0000:01:00.0: ASIC revision: 76030010
[   12.882626] mt7603e 0000:01:00.0: Firmware Version: ap_pcie
[   12.888198] mt7603e 0000:01:00.0: Build Time: 20160107100755
[   12.931402] mt7603e 0000:01:00.0: firmware init done
[   13.109527] bus=0x2, slot = 0x1, irq=0x0
[   13.113532] PCI: Enabling device 0000:00:01.0 (0004 -> 0006)
[   13.127203] mt7615e 0000:02:00.0: EEPROM data load successful
[   13.151877] mt7615e 0000:02:00.0: Direct firmware load for mediatek/mt7663pr2h.bin failed with error -2
[   13.161334] mt7615e 0000:02:00.0: Falling back to user helper
[   13.170401] kmodloader: done loading kernel modules from /etc/modules.d/*
[   14.303137] firmware mediatek!mt7663pr2h.bin: firmware_loading_store: map pages failed
[   14.311998] mt7615e 0000:02:00.0: mediatek/mt7663pr2h.bin not found, switching to mediatek/mt7663pr2h_rebb.bin
[   14.445019] mt7615e 0000:02:00.0: HW/SW Version: 0x65322d31, Build Time: 2009041715da1a1
[   14.445019]
[   14.599910] mt7615e 0000:02:00.0: N9 Firmware Version: 7663mp1827, Build Time: 20190914043434
[   14.608472] mt7615e 0000:02:00.0: Region number: 0x3
[   14.613502] mt7615e 0000:02:00.0: Parsing tailer Region: 0
[   14.623857] mt7615e 0000:02:00.0: Region 0, override_addr = 0x00112c00
[   14.630398] mt7615e 0000:02:00.0: Parsing tailer Region: 1
[   14.637025] mt7615e 0000:02:00.0: Parsing tailer Region: 2
[   14.642985] mt7615e 0000:02:00.0: override_addr = 0x00112c00, option = 3

The entire system bogs down, I can sometimes access the terminal but all I see are messages such as

[   58.161415] mt7615e 0000:02:00.0: Message 78 (seq 4) timeout

and eventually the system restarts. Am I missing something when it comes to running the latest firmware for this chipset?

Why? 19.07 has been EOL and unsupported for several years already -- it is has been superseded by 3 major revisions. Among the many reasons to avoid 19.07, there are many known major vulnerabilities that have not been (and will never be) patched. Although I don't know the differences between the v1/v2 versions and the v3 you're working with, the v1/v2 are supported with 23.05 and have plenty of flash and ram to be supported moving forward until at least 24.x or 25.x.

Is there a specific reason you are trying to use such an old version of OpenWrt?

There is an existing product built on that platform, unfortunately the hardware being used has gone EoL and replaced by the v3 hardware and in an effort to reduce the amount of uncertantiy and churn, it was decided to stay on the existing OpenWRT platform.

The v3 hardware is identical to the v2 hardware in regards to specs, the only difference is that the wifi interfaces are on different pcie interfaces ( mirrored ).

Get in writing from your client/boss, that you warned repeatedly against using that old version.
Specify, that such an installation should only run fully air-gapped.

If in Email-form, print it out, and take it home to store savely!

Then, when the devices have become part of a massive botnet, and the client/boss comes to you screaming, you can calmly pull out the print-out, and your ass is covered.

Probably best to look for an new employer/client too.