Tp-link archer c20 v4 after 16/128MB

Hello, I installed the RAM: HYNIX H5PS1G63EFR 128 MB (before ESMT M14D5121632A 64 MB) and ROM: WINBOND 25Q128FVSG 16 MB (before cFeon QH64A-104HIP 8 MB). Created patch

+++ b/target/linux/ramips/image/mt76x8.mk
@@ -547,10 +547,10 @@ TARGET_DEVICES += totolink_lr1200

define Device/tplink_archer-c20-v4
  $(Device/tplink-v2)
-  IMAGE_SIZE := 7808k
+  IMAGE_SIZE := 16000k
  DEVICE_MODEL := Archer C20
  DEVICE_VARIANT := v4
-  TPLINK_FLASHLAYOUT := 8Mmtk
+  TPLINK_FLASHLAYOUT := 16Mmtk
  TPLINK_HWID := 0xc200004
  TPLINK_HWREVADD := 0x4
  DEVICE_PACKAGES := kmod-mt76x0e
--- a/target/linux/ramips/dts/mt7628an.dtsi
+++ b/target/linux/ramips/dts/mt7628an.dtsi
@@ -4,7 +4,10 @@
	#address-cells = <1>;
	#size-cells = <1>;
	compatible = "mediatek,mt7628an-soc";
-
+	memory@0 {
+	device_type = "memory";
+	reg = <0x0 0x8000000>;
+	};
	aliases {
		serial0 = &uartlite;
	};
--- a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi
+++ b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi
@@ -35,18 +35,18 @@
			partition@20000 {
				compatible = "tplink,firmware";
				label = "firmware";
-				reg = <0x20000 0x7a0000>;
+				reg = <0x20000 0xfa0000>;
			};

-			partition@7c0000 {
+			partition@fc0000 {
				label = "config";
-				reg = <0x7c0000 0x10000>;
+				reg = <0xfc0000 0x10000>;
				read-only;
			};

-			factory: partition@7d0000 {
+			factory: partition@fd0000 {
				label = "factory";
-				reg = <0x7d0000 0x30000>;
+				reg = <0xfd0000 0x30000>;
				read-only;
			};
		};
--- a/tools/firmware-utils/patches/001-16mb-mktplinkfw2.patch
+++ b/tools/firmware-utils/patches/001-16mb-mktplinkfw2.patch
@@ -0,0 +1,15 @@
+--- firmware-utils.orig/src/mktplinkfw2.c
++++ firmware-utils/src/mktplinkfw2.c
+@@ -149,6 +149,12 @@ static struct flash_layout layouts[] = {
+ 		.kernel_la	= 0x80000000,
+ 		.kernel_ep	= 0x80000000,
+ 		.rootfs_ofs	= 0x140000,
++	}, {
++		.id		= "16Mmtk",
++		.fw_max_len	= 0xfa0000,
++		.kernel_la	= 0x80000000,
++		.kernel_ep	= 0x80000000,
++		.rootfs_ofs	= 0x140000,
+ 	}, {
+ 		.id		= "8MSUmtk", /* Split U-Boot OS */
+ 		.fw_max_len	= 0x770000,

But openwrt used 64 mb only. If more than 64 MB is exceeded, the system will restart.

[    0.000000] Linux version 5.15.162 (builder@buildhost) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r24012-d8dd03c46f) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Mon Jul 15 22:14:18 2024
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is TP-Link Archer C20 v4
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    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] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Writing ErrCtl register=00059883
[    0.000000] Readback ErrCtl register=00059883
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 120932K/131072K available (5980K kernel code, 605K rwdata, 748K rodata, 1232K init, 217K bss, 10140K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] intc: using register map from devicetree
[    0.000000] CPU Clock: 580MHz
[    0.000000] timer_probe: no matching timers found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000002] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.007640] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.073555] pid_max: default: 32768 minimum: 301
[    0.079119] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.086145] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.102350] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.111891] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.118652] pinctrl core: initialized pinctrl subsystem
[    0.125837] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.132156] thermal_sys: Registered thermal governor 'step_wise'
[    0.400284] PCI host bridge to bus 0000:00
[    0.410003] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.416636] pci_bus 0000:00: root bus resource [io  0x10160000-0x1016ffff]
[    0.423267] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.430984] pci 0000:00:00.0: [14c3:0801] type 01 class 0x060400
[    0.436746] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    0.442795] pci 0000:00:00.0: reg 0x14: [mem 0x20200000-0x2020ffff]
[    0.448906] pci 0000:00:00.0: supports D1
[    0.452713] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.460098] pci 0000:01:00.0: [14c3:7650] type 00 class 0x028000
[    0.465885] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
[    0.472106] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    0.478287] pci 0000:01:00.1: [14c3:8650] type 00 class 0x0d1100
[    0.484111] pci 0000:01:00.1: reg 0x10: [mem 0x00000000-0x000fffff]
[    0.490250] pci 0000:01:00.1: supports D1
[    0.494056] pci 0000:01:00.1: PME# supported from D0 D1 D3hot D3cold
[    0.501689] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.508045] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.514491] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.520825] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.527557] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x201fffff]
[    0.534098] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.540667] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff]
[    0.547206] pci 0000:01:00.1: BAR 0: assigned [mem 0x20100000-0x201fffff]
[    0.553766] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.558544] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x201fffff]
[    0.565643] clocksource: Switched to clocksource MIPS
[    0.572190] NET: Registered PF_INET protocol family
[    0.577261] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.585333] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.593563] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.601003] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.608409] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.615203] TCP: Hash tables configured (established 1024 bind 1024)
[    0.621542] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.627896] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.635076] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.640661] PCI: CLS 0 bytes, default 32
[    0.649187] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.662199] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.667886] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.679156] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.689659] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.695281] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.701128] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.707200] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.716740] printk: console [ttyS0] disabled
[    0.720914] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.729714] printk: console [ttyS0] enabled
[    0.729714] printk: console [ttyS0] enabled
[    0.738119] printk: bootconsole [early0] disabled
[    0.738119] printk: bootconsole [early0] disabled
[    0.749502] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    0.778627] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.783581] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.790145] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    0.797629] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    0.805358] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    0.812845] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    0.820921] Creating 4 MTD partitions on "spi0.0":
[    0.825869] 0x000000000000-0x000000020000 : "boot"
[    0.835403] 0x000000020000-0x000000fc0000 : "firmware"
[    0.842632] 2 tplink-fw partitions found on MTD device firmware
[    0.848758] Creating 2 MTD partitions on "firmware":
[    0.853801] 0x000000000000-0x000000234ec6 : "kernel"
[    0.858849] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[    0.870509] 0x000000234ec8-0x000000fa0000 : "rootfs"
[    0.875580] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    0.886331] mtd: setting mtd3 (rootfs) as root device
[    0.892665] 1 squashfs-split partitions found on MTD device rootfs
[    0.899055] 0x0000005a0000-0x000000fa0000 : "rootfs_data"
[    0.906019] 0x000000fc0000-0x000000fd0000 : "config"
[    0.914199] 0x000000fd0000-0x000001000000 : "factory"
[    0.952272] rt3050-esw 10110000.esw: mediatek esw at 0xb0110000, irq 25 initialized
[    0.961183] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.972104] NET: Registered PF_INET6 protocol family
[    0.984733] Segment Routing with IPv6
[    0.988660] In-situ OAM (IOAM) with IPv6
[    0.992781] NET: Registered PF_PACKET protocol family
[    0.998042] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.011572] 8021q: 802.1Q VLAN Support v1.8
[    1.018120] clk: Disabling unused clocks
[    1.034371] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    1.048292] Freeing unused kernel image (initmem) memory: 1232K
[    1.054307] This architecture does not have kernel memory protection.
[    1.060882] Run /sbin/init as init process
[    2.034673] init: Console is alive
[    2.038956] init: - watchdog -
[    3.297012] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    3.391424] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    3.409533] init: - preinit -
[    4.489328] rt3050-esw 10110000.esw: port 0 link up
[    5.010701] random: jshn: uninitialized urandom read (4 bytes read)
[    5.039600] rt3050-esw 10110000.esw: port 3 link up
[    5.208167] random: jshn: uninitialized urandom read (4 bytes read)
[    5.448955] random: jshn: uninitialized urandom read (4 bytes read)
[    5.986790] rt3050-esw 10110000.esw: port 0 link down
[    5.991957] rt3050-esw 10110000.esw: port 3 link down
[    6.186663] random: procd: uninitialized urandom read (4 bytes read)
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

Installing ffmpeg (4.3.5-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/packages/ffmpeg_4.3.5-1_mipsel_24kc.ipk
Installing zlib (1.2.11-6) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/base/zlib_1.2.11-6_mipsel_24kc.ipk
Installing libbz2-1.0 (1.0.8-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/base/libbz2-1.0_1.0.8-1_mipsel_24kc.ipk
Installing kmod-input-core (5.4.238-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/targets/ramips/mt76x8/packages/kmod-input-core_5.4.238-1_mipsel_24kc.ipk
Installing kmod-sound-core (5.4.238-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/targets/ramips/mt76x8/packages/kmod-sound-core_5.4.238-1_mipsel_24kc.ipk
Installing librt (1.1.24-3) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/targets/ramips/mt76x8/packages/librt_1.1.24-3_mipsel_24kc.ipk
Installing alsa-lib (1.2.4-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/packages/alsa-lib_1.2.4-1_mipsel_24kc.ipk
Installing libgmp10 (6.2.1-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/base/libgmp10_6.2.1-1_mipsel_24kc.ipk
Installing libnettle8 (3.6-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/base/libnettle8_3.6-1_mipsel_24kc.ipk
Installing libatomic1 (8.4.0-3) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/targets/ramips/mt76x8/packages/libatomic1_8.4.0-3_mipsel_24kc.ipk
Installing libgnutls (3.7.1-2) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/packages/libgnutls_3.7.1-2_mipsel_24kc.ipk
Installing libopus (1.3.1-3) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/packages/libopus_1.3.1-3_mipsel_24kc.ipk
Installing shine (3.1.1-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/packages/shine_3.1.1-1_mipsel_24kc.ipk
Installing fdk-aac (2.0.1-4) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/packages/fdk-aac_2.0.1-4_mipsel_24kc.ipk
Installing libffmpeg-full (4.3.5-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.7/packages/mipsel_24kc/packages/libffmpeg-full_4.3.5-1_mipsel_24kc.ipk
[  479.769273] Unhandled kernel unaligned access[#1]:
[  479.774150] CPU: 0 PID: 3852 Comm: opkg Not tainted 5.4.238 #0
[  479.780057] $ 0   : 00000000 00000001 0b00f641 0000e002
[  479.785358] $ 4   : 87c02e00 00000cc0 81000020 3240f400
[  479.790656] $ 8   : 87466500 000018c8 6bf10ed0 3697089b
[  479.795954] $12   : 1487757a 000000cf 00000001 b66f1571
[  479.801252] $16   : 87c02e00 0b00f641 00000cc0 80740000
[  479.806550] $20   : 0000cef0 00000000 00000606 00000000
[  479.811847] $24   : 00000002 c04bafe4                  
[  479.817145] $28   : 87da2000 87da3a50 87445000 801dfb8c
[  479.822444] Hi    : 0000cef0
[  479.825356] Lo    : 0000007a
[  479.828275] epc   : 80120eec 0x80120eec
[  479.832158] ra    : 801dfb8c 0x801dfb8c
[  479.836038] Status: 1100f403	KERNEL EXL IE 
[  479.840278] Cause : 00800010 (ExcCode 04)
[  479.844335] BadVA : 0b00f641
[  479.847249] PrId  : 00019655 (MIPS 24KEc)
[  479.851305] Modules linked in: pppoe ppp_async mt76x0e mt76x0_common iptable_nat xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD xt_CT pppox ppp_generic nf_nat nf_flow_table_hw nf_flow_table nf_conntrack mt76x02_lib mt7603e mt76 mac80211 ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG slhc nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables crc_ccitt compat nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 leds_gpio gpio_button_hotplug
[  479.906107] Process opkg (pid: 3852, threadinfo=159eb4fb, task=80f656dc, tls=77e9dec8)
[  479.914123] Stack : 00000003 c042e000 00000000 00000000 00000008 876b5120 87482000 87da3b70
[  479.922597]         00000002 801dfb8c 00000000 00000000 8025e764 874455c2 00000a3e 87482000
[  479.931070]         007acef0 87da3b70 00000002 87da3b68 00000000 801d9954 00000000 00000000
[  479.939543]         87445000 805d0000 87da3bd4 00000000 007acef0 000005c2 864b3500 87482000
[  479.948016]         87a59b28 801db764 87da3b64 00000000 87da3b04 800ce1d8 007acef0 00000000
[  479.956490]         ...
[  479.958964] Call Trace:
[  479.958997] [<801dfb8c>] 0x801dfb8c
[  479.964998] [<8025e764>] 0x8025e764
[  479.968536] [<801d9954>] 0x801d9954
[  479.972074] [<801db764>] 0x801db764
[  479.975605] [<800ce1d8>] 0x800ce1d8
[  479.979153] [<801d19c4>] 0x801d19c4
[  479.982707] [<801d23cc>] 0x801d23cc
[  479.986238] [<800cf208>] 0x800cf208
[  479.989783] [<801cc654>] 0x801cc654
[  479.993318] [<800cb668>] 0x800cb668
[  479.996856] [<800cdc48>] 0x800cdc48
[  480.000390] [<8004e1f0>] 0x8004e1f0
[  480.003923] [<800cde40>] 0x800cde40
[  480.007454] [<8020ab68>] 0x8020ab68
[  480.010986] [<80048ae4>] 0x80048ae4
[  480.014521] [<80134850>] 0x80134850
[  480.018055] [<801556c8>] 0x801556c8
[  480.021594] [<80135d80>] 0x80135d80
[  480.025128] [<801e87ec>] 0x801e87ec
[  480.028659] [<80155850>] 0x80155850
[  480.032191] [<801e942c>] 0x801e942c
[  480.035730] [<80134850>] 0x80134850
[  480.039266] [<80135d80>] 0x80135d80
[  480.042810] [<80136008>] 0x80136008
[  480.046356] [<801360a8>] 0x801360a8
[  480.049889] [<8000e3cc>] 0x8000e3cc
[  480.053429] 
[  480.054932] Code: 00000000  8e020014  02221021 <8c430000> 41626000  30420001  000000c0  8e040000  8c860000 
[  480.064823] 
[  480.066420] CPU 0 Unable to handle kernel paging request at virtual address 120596fc, epc == 80039b48, ra == 80039b0c
[  480.077169] Oops[#2]:
[  480.079474] CPU: 0 PID: 3852 Comm: opkg Tainted: G      D           5.4.238 #0
[  480.086787] $ 0   : 00000000 00000001 120596e8 87e96c28
[  480.092085] $ 4   : 805b94a4 00000000 00000009 a441653a
[  480.097382] $ 8   : 87800000 00000000 87800014 00000002
[  480.102680] $12   : fffffffd 00000402 805b94a8 00000040
[  480.107978] $16   : 87e96c24 00000050 81000200 87c06000
[  480.113276] $20   : 00000000 00000001 80710000 80710000
[  480.118574] $24   : 00000018 80269384                  
[  480.123871] $28   : 87da2000 87c0beb8 805c0000 80039b0c
[  480.129170] Hi    : 0059e2c2
[  480.132083] Lo    : f2361712
[  480.134998] epc   : 80039b48 0x80039b48
[  480.138881] ra    : 80039b0c 0x80039b0c
[  480.142761] Status: 1100f402	KERNEL EXL 
[  480.146735] Cause : 00800008 (ExcCode 02)
[  480.150792] BadVA : 120596fc
[  480.153705] PrId  : 00019655 (MIPS 24KEc)
[  480.157761] Modules linked in: pppoe ppp_async mt76x0e mt76x0_common iptable_nat xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD xt_CT pppox ppp_generic nf_nat nf_flow_table_hw nf_flow_table nf_conntrack mt76x02_lib mt7603e mt76 mac80211 ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG slhc nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables crc_ccitt compat nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 leds_gpio gpio_button_hotplug
[  480.212546] Process opkg (pid: 3852, threadinfo=159eb4fb, task=80f656dc, tls=77e9dec8)
[  480.220562] Stack : 00000000 0000006f c00dbc84 80508e7c 00000001 00000000 80710000 80514e28
[  480.229035]         00000100 8003a444 805c89c0 805d0000 805c89d4 805d0000 00200000 00000122
[  480.237509]         ffffffff 80069520 00000000 00000001 80513efc 00000100 0000afbf 0000afbe
[  480.245982]         00400100 1b428c4e 805d3060 00000000 87c0bf4c 8006970c 0000001b 00000000
[  480.254455]         00000000 0000fd37 00000000 805c8a1c 8050f55c 00000000 00000000 801dfb8c
[  480.262927]         ...
[  480.265401] Call Trace:
[  480.265408] [<80508e7c>] 0x80508e7c
[  480.271409] [<8003a444>] 0x8003a444
[  480.274941] [<80069520>] 0x80069520
[  480.278473] [<8006970c>] 0x8006970c
[  480.282006] [<801dfb8c>] 0x801dfb8c
[  480.285537] [<805e0000>] 0x805e0000
[  480.289068] [<80269384>] 0x80269384
[  480.292601] [<805e0000>] 0x805e0000
[  480.296132] [<80508fa0>] 0x80508fa0
[  480.299663] [<80061edc>] 0x80061edc
[  480.303200] [<8005d1e0>] 0x8005d1e0
[  480.306734] [<801dfb8c>] 0x801dfb8c
[  480.310268] [<800055b0>] 0x800055b0
[  480.313796] 
[  480.315299] Code: 8e470008  00071080  02421021 <8c430014> 24630001  ac430014  8e420050  8e430054  0043182a 
[  480.325190] 
[  480.326729] ---[ end trace 7afcef28c9a8529b ]---
[  480.331419] Kernel panic - not syncing: Fatal exception in interrupt
[  480.337859] Rebooting in 3 seconds..

[04060B0D][04060B0F][7E7D0000][25243938][00252443]
DU Setting Cal Done

Openwrt 21.02.7

opkg install ffmpeg
Installing ffmpeg (5.1.3-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/packages/ffmpeg_5.1.3-1_mipsel_24kc.ipk
Installing zlib (1.2.13-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/base/zlib_1.2.13-1_mipsel_24kc.ipk
Installing libbz2-1.0 (1.0.8-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/base/libbz2-1.0_1.0.8-1_mipsel_24kc.ipk
Installing kmod-input-core (5.15.162-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/targets/ramips/mt76x8/packages/kmod-input-core_5.15.162-1_mipsel_24kc.ipk
Installing kmod-sound-core (5.15.162-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/targets/ramips/mt76x8/packages/kmod-sound-core_5.15.162-1_mipsel_24kc.ipk
Installing librt (1.2.4-4) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/targets/ramips/mt76x8/packages/librt_1.2.4-4_mipsel_24kc.ipk
Installing alsa-lib (1.2.9-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/packages/alsa-lib_1.2.9-1_mipsel_24kc.ipk
Installing libgmp10 (6.2.1-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/base/libgmp10_6.2.1-1_mipsel_24kc.ipk
Installing libnettle8 (3.9.1-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/base/libnettle8_3.9.1-1_mipsel_24kc.ipk
Installing libatomic1 (12.3.0-4) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/targets/ramips/mt76x8/packages/libatomic1_12.3.0-4_mipsel_24kc.ipk
Installing libgnutls (3.8.3-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/packages/libgnutls_3.8.3-1_mipsel_24kc.ipk
Installing libopus (1.3.1-3) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/packages/libopus_1.3.1-3_mipsel_24kc.ipk
Installing shine (3.1.1-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/packages/shine_3.1.1-1_mipsel_24kc.ipk
Installing fdk-aac (2.0.1-5) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/packages/fdk-aac_2.0.1-5_mipsel_24kc.ipk
Installing libffmpeg-full (5.1.3-1) to root...
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/packages/libffmpeg-full_5.1.3-1_mipsel_24kc.ipk

[04060B0C][04060B0E][7E7D0000][25243938][00252443]
DU Setting Cal Done

openwrt 23.05.4
root@OpenWrt:/# free
total used free shared buff/cache available
Mem: 122164 16328 70952 20296 34884 53672
Swap: 0 0 0
root@OpenWrt:/# [ 597.052968] Reserved instruction in kernel code[#1]:
[ 597.058047] CPU: 0 PID: 2727 Comm: utpl Not tainted 5.15.162 #0
[ 597.064057] $ 0 : 00000000 00000001 00000000 00000002
[ 597.069379] $ 4 : 81fdb7bc 00000100 00000001 0010009e
[ 597.074698] $ 8 : 00000000 00000015 00000000 00000000
[ 597.080015] $12 : 00000001 000044fd 00000000 00000000
[ 597.085332] $16 : 7fb4c754 7fb4ccc8 00041000 77d36000
[ 597.090651] $20 : 00000100 00000000 77d36000 00000000
[ 597.095969] $24 : 81914c70 77df7e70
[ 597.101286] $28 : 80ce6000 80ce7f28 77e3886c 80015e90
[ 597.106605] Hi : 00000000
[ 597.109521] Lo : 00000000
[ 597.112437] epc : 80002340 0x80002340
[ 597.116330] ra : 80015e90 0x80015e90
[ 597.120219] Status: 1100e403 KERNEL EXL IE
[ 597.124472] Cause : 10800028 (ExcCode 0a)
[ 597.128535] PrId : 00019655 (MIPS 24KEc)
[ 597.132597] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_ipv6 nf_flow_table_ipv4 nf_flow_table_inet pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mt7603e mt76 mac80211 lzo cfg80211 slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 lzo_rle lzo_decompress lzo_compress libcrc32c crc_ccitt compat sha512_generic seqiv jitterentropy_rng drbg hmac cmac crypto_acompress leds_gpio gpio_button_hotplug crc32c_generic
[ 597.195890] Process utpl (pid: 2727, threadinfo=40d3df6f, task=d13afa1e, tls=77e40dfc)
[ 597.203930] Stack : 00000000 0000ffff 00000042 0000040a 00000004 0000002f 00000000 77dce3a0
[ 597.212441] 00000000 00000001 77d7671f 00000000 77d77000 00000000 000008e1 00000000
[ 597.220949] 00000000 00000401 81d32b40 00100077 7fb4c660 80710000 81d32b50 00000000
[ 597.229458] 7fb4c754 7fb4ccc8 00041000 77d36000 00000100 00000000 77d36000 00000000
[ 597.237968] 81914c70 77df7e70 00000012 00000000 77e3f2b0 7fb4c698 77e3886c 77e0c068
[ 597.246478] ...
[ 597.248960] Call Trace:
[ 597.249000]
[ 597.252976] Code: 0001be7d 000115c1 000115e9 <0001937d> 000191ed 0001a9a1 00019285 00019c11 0001984d
[ 597.262910]

Is the makefile pulling the correct dtsi file? You have 8m in the file name and

+  TPLINK_FLASHLAYOUT := 16Mmtk

in the define section.

1 Like

this is done in order not to add a new file mt7628an_tplink_16m.dtsi

+++ b/tools/firmware-utils/patches/001-16mb-mktplinkfw2.patch

The problem is not in ROM. It's in RAM.

Solution: modify uboot for 1024mbit (128mb) support. Download tplink source glp. Make menuconfig. Select 1024 mbit. Save. Make. Uboot flash with kmod-mtd-rw.

DONT edit mt7628an.dtsi. This is probably the solution.