Adding support for SNR Keep AC10

Hardware:
SOC: MediaTek MT7621AT
RAM: 128 MiB DDR3 ESMT M15T1G1664A
Flash: 16 MiB SPI-NOR XMC 25QH128DHIQ
WI-Fi: MediaTek MT7613BEN + MT7603EN

Ethernet:
1x 10/100/1000 Mbps LAN
1x 10/100/1000 Mbps WAN
Buttons: Reset, WPS
LEDs: RGB with AW2026 (Green: working, Orange: booting)
UART: 57600 8N1

Flash Layout:
0x000000000000 - 0x000000030000 : "Bootloader"
0x000000030000 - 0x000000040000 : "Config"
0x000000040000 - 0x000000050000 : "Factory"
0x000000050000 - 0x000001000000 : "firmware"
0x000000050000 - 0x000000210000 : "kernel"
0x000000210000 - 0x000001000000 : "rootfs"
0x000000940000 - 0x000001000000 : "rootfs_data"

OEM bootlog:


U-Boot 2022.10-rc3 (Dec 11 2024 - 03:03:28 +0000)

CPU:   MediaTek MT7621A ver 1, eco 3
Boot:  DDR3, SPI-NOR 3-Byte Addr
Clock: CPU: 880MHz, DDR: 1200MT/s, Bus: 220MHz, XTAL: 40MHz
Model: SNR-M522-G11
DRAM:  128 MiB
Core:  37 devices, 16 uclasses, devicetree: separate
Loading Environment from nowhere... OK
Net:
Warning: eth@1e100000 (eth0) using random MAC address - ca:6a:f7:87:3b:6a
eth0: eth@1e100000
Saving Environment to nowhere... not possible

  *** U-Boot Boot Menu ***

      1. Startup system (Default)
      2. WEB recovery
      3. Upgrade firmware
      4. Upgrade bootloader
      0. U-Boot console


  Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit
SF: Detected XM25QH128Π‘ with page size 256 Bytes, erase size 4 KiB, total 16 MiB
Reading 'firmware' from 0x50000 to 0x83000000, size 0x40 ... OK
Reading 'firmware' from 0x50000 to 0x83000000, size 0x1b2974 ... OK
## Booting kernel from Legacy Image at 83000000 ...
   Image Name:   SNR-M522-G11
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1780020 Bytes = 1.7 MiB
   Load Address: 81001000
   Entry Point:  81001000
   Verifying Checksum ... OK
   Uncompressing Kernel Image
[    0.000000] Linux version 4.4.198 (dev@runner-rztzusz-project-2117-concurrent-0) (gcc version 5.4.0 (LEDE GCC 5.4.0 2.7.0-dev-2503171801-38261f752) ) #0 SMP Fri Mar 28 11:54:47 UTC 2025
[    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 SNR-Keep-AC10
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x0000000000ffffff]
[    0.000000]   Normal   [mem 0x0000000001000000-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] 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] PERCPU: Embedded 10 pages/cpu @816b4000 s8576 r8192 d24192 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,57600 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=00018840
[    0.000000] Readback ErrCtl register=00018840
[    0.000000] Memory: 123928K/131072K available (4180K kernel code, 204K rwdata, 920K rodata, 252K init, 201K bss, 7144K reserved, 0K cma-reserved)
[    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] 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.000008] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
[    0.015459] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[    0.080674] pid_max: default: 32768 minimum: 301
[    0.089935] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.102974] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    1.464859] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    1.464869] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    1.464878] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    1.465023] CPU1 revision is: 0001992f (MIPS 1004Kc)
[    0.227310] Synchronize counters for CPU 1: done.
[    1.106241] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    1.106247] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    1.106254] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    1.106322] CPU2 revision is: 0001992f (MIPS 1004Kc)
[    0.347374] Synchronize counters for CPU 2: done.
[    1.226086] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    1.226092] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    1.226098] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    1.226177] CPU3 revision is: 0001992f (MIPS 1004Kc)
[    0.466931] Synchronize counters for CPU 3: done.
[    0.476354] Brought up 4 CPUs
[    0.486983] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.506452] futex hash table entries: 1024 (order: 3, 32768 bytes)
[    0.518898] pinctrl core: initialized pinctrl subsystem
[    0.530506] NET: Registered protocol family 16
[    0.579501] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    0.590605] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    0.601673] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    0.613228] mt7621-pci 1e140000.pcie: Failed to get gpio for PCIe1
[    0.625426] mt7621-pci 1e140000.pcie: Failed to get gpio for PCIe2
[    1.940794] PCIe port 2 link down
[    1.947230] PCI coherence region base: 0x60000000, mask/settings: 0xf0000002
[    1.993974] PCI host bridge to bus 0000:00
[    2.002065] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    2.015651] pci_bus 0000:00: root bus resource [io  0x1e160000-0x1e16ffff]
[    2.029299] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    2.042773] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    2.059369] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    2.075172] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    2.092532] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    2.105926] pci 0000:00:01.0: BAR 9: assigned [mem 0x60100000-0x602fffff pref]
[    2.120242] pci 0000:00:00.0: BAR 1: assigned [mem 0x60300000-0x6030ffff]
[    2.133721] pci 0000:00:01.0: BAR 1: assigned [mem 0x60310000-0x6031ffff]
[    2.147209] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff]
[    2.160679] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.170504] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    2.184028] pci 0000:02:00.0: BAR 0: assigned [mem 0x60100000-0x601fffff 64bit pref]
[    2.199405] pci 0000:02:00.0: BAR 2: assigned [mem 0x60200000-0x60203fff 64bit pref]
[    2.214777] pci 0000:02:00.0: BAR 4: assigned [mem 0x60204000-0x60204fff 64bit pref]
[    2.230156] pci 0000:00:01.0: PCI bridge to [bus 02]
[    2.239970] pci 0000:00:01.0:   bridge window [mem 0x60100000-0x602fffff pref]
[    2.256017] clocksource: Switched to clocksource GIC
[    2.267609] NET: Registered protocol family 2
[    2.276986] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    2.290742] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    2.303335] TCP: Hash tables configured (established 1024 bind 1024)
[    2.316046] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    2.327528] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    2.340231] NET: Registered protocol family 1
[    2.363100] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.374626] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.396981] io scheduler noop registered
[    2.404629] io scheduler deadline registered (default)
[    2.416555] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    2.430132] console [ttyS0] disabled
[    2.437156] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 33, base_baud mβ–’β–’rβ–’β–’β–’β–’β–’β–’β–’β–’β–’Ν½β–’β–’β–’β–’β–’β–’β–’Mβ–’β–’*β–’β–’β–’β–’β–’β–’5Rβ–’β–’rβ–’β–’β–’β–’β–’β–’β–’β–’β–’Ν½β–’β–’β–’β–’β–’β–’β–’Mβ–’β–’*β–’β–’β–’β–’β–’β–’5Rβ–’β–’rβ–’β–’β–’β–’ ▒▒▒э▒▒ͽ▒▒▒ڕ▒ɱ▒▒▒"β–’Ν…β–’β–’β–’β–’5Rβ–’β–’rβ–’β–’β–’β–’ ▒▒▒э▒▒ͽ▒▒▒ڕ▒ɱ▒▒▒"β–’Ν…β–’β–’β–’β–’5Rβ–’[    2.488055] m25p80 spi32766.0: XM25QH128C (16384 Kbytes)
[    2.498761] 4 ofpart partitions found on MTD device spi32766.0
[    2.510430] Creating 4 MTD partitions on "spi32766.0":
[    2.520718] 0x000000000000-0x000000030000 : "Bootloader"
[    2.532697] 0x000000030000-0x000000040000 : "Config"
[    2.543894] 0x000000040000-0x000000050000 : "Factory"
[    2.555157] 0x000000050000-0x000001000000 : "firmware"
[    2.578383] no rootfs found after FIT image in "firmware"
[    2.612600] 2 uimage-fw partitions found on MTD device firmware
[    2.624452] 0x000000050000-0x000000210000 : "kernel"
[    2.635671] 0x000000210000-0x000001000000 : "rootfs"
[    2.646823] mtd: device 5 (rootfs) set to be root filesystem
[    2.658247] 1 squashfs-split partitions found on MTD device rootfs
[    2.670618] 0x000000940000-0x000001000000 : "rootfs_data"
[    2.683070] libphy: Fixed MDIO Bus: probed
[    2.726234] libphy: mdio: probed
[    2.733241] mtk_soc_eth 1e100000.ethernet: generated random MAC address d2:5c:e2:47:cc:ab
[    2.750085] mtk_soc_eth 1e100000.ethernet: connected mac 0 to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    2.771619] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 10
[    2.788414] mtk_soc_eth 1e100000.ethernet: generated random MAC address 96:b8:27:1b:4d:d7
[    2.805277] mtk_soc_eth 1e100000.ethernet: connected mac 1 to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]
[    2.826707] mtk_soc_eth 1e100000.ethernet eth1: mediatek frame engine at 0xbe100000, irq 10
[    2.844498] mt7621_wdt 1e000100.wdt: Initialized
[    2.855312] NET: Registered protocol family 10
[    2.865802] NET: Registered protocol family 17
[    2.874795] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    2.900053] Bridge firewalling registered
[    2.908077] 8021q: 802.1Q VLAN Support v1.8
[    2.956129] mt753x gsw: Switch is MediaTek MT7530 rev 1
[    2.992851] libphy: mt753x_mdio: probed
[    3.006635] hctosys: unable to open rtc device (rtc0)
[    3.021496] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    3.036375] Freeing unused kernel memory: 252K
[    3.045256] This architecture does not have kernel memory protection.
[    3.716250] init: Console is alive
[    3.723263] init: - watchdog -
[    5.025457] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.077954] aw2026_led_init: driver version: V1.0.3
[    5.089895] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.106293] init: - preinit -
[    5.989688] random: jshn: uninitialized urandom read (4 bytes read, 112 bits of entropy available)
[    6.108912] random: jshn: uninitialized urandom read (4 bytes read, 112 bits of entropy available)
[    6.258738] random: jshn: uninitialized urandom read (4 bytes read, 113 bits of entropy available)
[    6.358716] random: jshn: uninitialized urandom read (4 bytes read, 114 bits of entropy available)
[    6.442961] random: jshn: uninitialized urandom read (4 bytes read, 116 bits of entropy available)
/etc/preinit: line 127: netmsg: not found
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.599874] random: nonblocking pool is initialized
[    9.817639] jffs2: notice: (453) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[    9.850247] mount_root: switching to jffs2 overlay
[    9.874381] urandom-seed: Seeding with /etc/urandom.seed
[   10.125270] procd: - early -
[   10.131850] procd: - watchdog -
[   10.816156] procd: - watchdog -
[   10.822738] procd: - ubus -
[   11.055903] procd: - init -
Please press Enter to activate this console.
[   11.347091] kmodloader: loading kernel modules from /etc/modules.d/*
[   11.404699] l2tp_core: L2TP core driver, V2.0
[   11.414610] l2tp_netlink: L2TP netlink interface
[   11.425722] sit: IPv6 over IPv4 tunneling driver
[   11.441511] gre: GRE over IPv4 demultiplexor driver
[   11.452758] ip_gre: GRE over IPv4 tunneling driver
[   11.468678] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   11.487532] Netfilter messages via NETLINK v0.30.
[   11.499050] ip_set: protocol 6
[   11.552433] i2c /dev entries driver
[   11.565788] aw2026_led 0-0064: AW2026 chip id 31
[   11.586202] i2c-gpio 1e000000.palmbus:i2c@0: using pins 3 (SDA) and 4 (SCL)
[   11.614770] u32 classifier
[   11.620238]     input device check on
[   11.627586]     Actions configured
[   11.636284] GACT probability on
[   11.643681] Mirror/redirect action on
[   11.661237] nf_conntrack version 0.5.0 (1940 buckets, 7760 max)
[   12.595611] mtk-eip93 1e004000.crypto: Assigning IRQ: 26
[   12.608274] mtk-eip93 1e004000.crypto: Init succesfull
[   12.621106] ip_tables: (C) 2000-2006 Netfilter Core Team
[   13.022389] MT7603 AP Driver version: 4.1.2.2
[   13.035729] [mtfwd] init, version 1.0nf_conntrack_rtsp v0.7 loading
[   13.232797] nf_nat_rtsp v0.7 loading
[   13.296678] xt_time: kernel timezone is -0000
[   13.321016] PPP generic driver version 2.4.2
[   13.331447] PPP MPPE Compression module registered
[   13.342438] NET: Registered protocol family 24
[   13.352987] PPTP driver version 0.8.5
[   13.363207] l2tp_ppp: PPPoL2TP kernel driver, V2.0
[   13.379702] kmodloader: done loading kernel modules from /etc/modules.d/*
[   19.676813] mediatek_soc_hnat 1e100000.hnat: wan = eth1
[   19.687390] mediatek_soc_hnat 1e100000.hnat: lan = eth0
[   19.697909] mediatek_soc_hnat 1e100000.hnat: ppd = eth0
[   19.708436] mediatek_soc_hnat 1e100000.hnat: gmac num = 2
[   19.719771] mediatek_soc_hnat 1e100000.hnat: ext devices = rai0
[   19.731768] mediatek_soc_hnat 1e100000.hnat: ext devices = ra0
[   19.743553] mediatek_soc_hnat 1e100000.hnat: ext devices = rai1
[   19.755494] mediatek_soc_hnat 1e100000.hnat: ext devices = ra1
[   19.767244] mediatek_soc_hnat 1e100000.hnat: ext devices = rai2
[   19.779180] mediatek_soc_hnat 1e100000.hnat: ext devices = ra2
[   19.790931] mediatek_soc_hnat 1e100000.hnat: ext devices = rai3
[   19.802865] mediatek_soc_hnat 1e100000.hnat: ext devices = ra3
[   19.814603] mediatek_soc_hnat 1e100000.hnat: ext devices = apclii0
[   19.827061] mediatek_soc_hnat 1e100000.hnat: ext devices = apcli0
[   19.841813] mediatek_soc_hnat 1e100000.hnat: FOE entry number = 8192
[   19.856154] mediatek_soc_hnat 1e100000.hnat: hwnat start
[   19.866955] hnat roaming work enable
[   26.849568] efuse_probe: efuse = 511161
[   28.613653] rai0: init reduce TCP ACK
[   29.750724] extif_set_dev(rai0)
[   29.758731] [mtfwd] Mac: 8c:ae:db:2d:e9:a2 was aleady existed.
[   29.813993] device eth0 entered promiscuous mode
[   29.827235] br-lan: port 1(eth0) entered forwarding state
[   29.838293] br-lan: port 1(eth0) entered forwarding state
[   29.883074] device rai0 entered promiscuous mode
[   29.893059] br-lan: port 2(rai0) entered forwarding state
[   29.904109] br-lan: port 2(rai0) entered forwarding state
[   30.558927] MT7603 Andes FW Version: CL173766_R
[   30.568305] MT7603 Andes FW Build Date: 20171110105932
[   31.836016] br-lan: port 1(eth0) entered forwarding state
[   31.896022] br-lan: port 2(rai0) entered forwarding state
[   32.811442] extif_set_dev(ra0)
[   32.879365] device ra0 entered promiscuous mode
[   32.888903] br-lan: port 3(ra0) entered forwarding state
[   32.899823] br-lan: port 3(ra0) entered forwarding state
1
card 1  -cra0
1
card 2  -cra0 -crai0
[   34.896046] br-lan: port 3(ra0) entered forwarding state
[   41.934620] module exit
[   43.827073] [mtfwd] no net device found for eth0 or
[   44.852401] [mtfwd] exit
[   48.739751] [mtfwd] init, version 1.0[mtfwd] Mac: 8c:ae:db:2d:e9:a2 was aleady existed.
[   49.855177] [mtfwd] Mac: 8c:ae:db:2d:e9:a2 was aleady existed.
[   49.867479] [mtfwd] Mac: 8c:ae:db:2d:e9:a2 was aleady existed.
[   49.879321] [mtfwd] Mac: 8c:ae:db:2d:e9:a2 was aleady existed.
[   50.310536] extif_put_dev(rai0)
[   50.348319] rai0: exit reduce TCP ACK
[   50.356245] br-lan: port 2(rai0) entered disabled state
[   53.634758] efuse_probe: efuse = 511161
[   55.373272] rai0: init reduce TCP ACK
[   56.485172] extif_set_dev(rai0)
[   56.491982] br-lan: port 2(rai0) entered forwarding state
[   56.502956] br-lan: port 2(rai0) entered forwarding state
[   56.691920] extif_put_dev(ra0)
[   57.342326] br-lan: port 3(ra0) entered disabled state
[   57.572447] MT7603 Andes FW Version: CL173766_R
[   57.581568] MT7603 Andes FW Build Date: 20171110105932
[   58.495987] br-lan: port 2(rai0) entered forwarding state
[   59.603873] br-lan: port 3(ra0) entered forwarding state
[   59.614665] br-lan: port 3(ra0) entered forwarding state
[   59.625526] extif_set_dev(ra0)
1
card 1  -cra0
1
card 2  -cra0 -crai0
[   61.606006] br-lan: port 3(ra0) entered forwarding state
[   70.873701] [mtfwd] no net device found for eth0 or
[   71.902255] [mtfwd] exit
[   77.608323] [mtfwd] init, version 1.0[mtfwd] Mac: 8c:ae:db:2d:e9:a2 was aleady existed.
[   78.728487] [mtfwd] Mac: 8c:ae:db:2d:e9:a2 was aleady existed.
[   78.740428] [mtfwd] Mac: 8c:ae:db:2d:e9:a2 was aleady existed.
[   78.752498] [mtfwd] Mac: 8c:ae:db:2d:e9:a2 was aleady existed.

Now wrap all cli output you posted using the </> button on top of the message window, making it readable.

1 Like

Kind of OTA server directories are listable

https://snr.systems/site/data-files/SNR%20WiFi/Firmware/EasyWRT%20Firmware/3.4.x/3.4.4/

full of firmwares

https://snr.systems/site/data-files/SNR%20WiFi/Firmware/EasyWRT%20Firmware/3.4.x/3.4.4/SNR-KEEP-AC10-WRT-3.4.4-2602261058-9adc778ce3.bin

For the later

67299c3d00e62258debd446f5085397b1fc16c70  SNR-KEEP-AC10-WRT-3.4.4-2602261058-9adc778ce3.bin

leds: add Awinic AW2026 driver [LWN.net]
linux kernel patch that adds AW2026 LED driver support

Leds come much later. First would be to netboot some random mt7621 initramfs kernel and back up oem setup.

Done. Booting initramfs from SNR-CPE-ME2-Lite worked out. I also made a new dts for this router, added new target in .mk file, built openwrt image and netbooted initramfs. It worked, but not entirely. What did I do wrong?

DTS file:
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

/ {
	compatible = "snr,snr-m522-g11", "mediatek,mt7621-soc";
	model = "SNR-M522-G11";

	leds {
		compatible = "gpio-leds";

		led_sys: led-0 {
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_STATUS;
			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
		};

		led_vpn: led-1 {
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_STATUS;
			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
		};
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	};
};

&state_default {
	gpio {
		groups = "jtag", "wdt";
		function = "gpio";
	};
};

&gdma {
	status = "okay";
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <50000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x0 0x30000>;
				read-only;
			};

			partition@30000 {
				label = "config";
				reg = <0x30000 0x10000>;
			};

			partition@40000 {
				label = "factory";
				reg = <0x40000 0x10000>;
				read-only;

				nvmem-layout {
					compatible = "fixed-layout";
					#address-cells = <1>;
					#size-cells = <1>;

					eeprom_factory_0: eeprom@0 {
						reg = <0x0 0x400>;
					};

					eeprom_factory_8000: eeprom@8000 {
						reg = <0x8000 0x4da8>;
					};

					macaddr_factory_e000: macaddr@e000 {
						reg = <0xe000 0x6>;
					};

					macaddr_factory_e006: macaddr@e006 {
						reg = <0xe006 0x6>;
					};
				};
			};

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0xfb0000>;
			};
		};
	};
};

&sdhci {
	status = "okay";
};

&ethphy0 {
	/delete-property/ interrupts;
};

&gmac0 {
	nvmem-cells = <&macaddr_factory_e000>;
	nvmem-cell-names = "mac-address";
};

&gmac1 {
	status = "okay";
	label = "wan";
	phy-handle = <&ethphy0>;

	nvmem-cells = <&macaddr_factory_e006>;
	nvmem-cell-names = "mac-address";
};

&switch0 {
	ports {
		port@3 {
			status = "okay";
			label = "wan";
		};

		port@4 {
			status = "okay";
			label = "lan";
		};
	};
};

&pcie {
	status = "okay";
};

&pcie0 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		nvmem-cells = <&eeprom_factory_0>;
		nvmem-cell-names = "eeprom";
		ieee80211-freq-limit = <2400000 2500000>;
	};
};

&pcie1 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		nvmem-cells = <&eeprom_factory_8000>;
		nvmem-cell-names = "eeprom";
		ieee80211-freq-limit = <5000000 6000000>;
	};
};

Openwrt bootlog:
## Booting kernel from Legacy Image at 83000000 ...
   Image Name:   MIPS OpenWrt Linux-6.12.74
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    7116901 Bytes = 6.8 MiB
   Load Address: 80001000
   Entry Point:  80001000
   Verifying Checksum ... OK
   Uncompressing Kernel Image
[    0.000000] Linux version 6.12.74 (user@localhost.localdomain) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 14.3.0 r33319-1e9da9798a) 14.3.0, GNU ld (GNU Binutils) 2.44) #0 SMP Fri Mar  6 23:04:48 2026
[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] printk: legacy bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] MIPS: machine is SNR-M522-G11
[    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] 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] OF: reserved mem: Reserved memory: No reserved-memory node in the DT
[    0.000000] percpu: Embedded 13 pages/cpu s22800 r8192 d22256 u53248
[    0.000000] Kernel command line: console=ttyS0,57600 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=00018840
[    0.000000] Readback ErrCtl register=00018840
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32768
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] RCU Tasks Trace: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=4.
[    0.000000] NR_IRQS: 256
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
[    0.000004] sched_clock: 64 bits at 880MHz, resolution 1ns, wraps every 4398046511103ns
[    0.015965] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[    0.088219] pid_max: default: 32768 minimum: 301
[    0.107292] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.121705] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.146917] rcu: Hierarchical SRCU implementation.
[    0.156383] rcu:     Max phase no-delay instances is 1000.
[    0.167177] Timer migration: 1 hierarchy levels; 8 children per group; 1 crossnode level
[    0.183931] smp: Bringing up secondary CPUs ...
[    0.193769] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.193803] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.193819] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.193867] CPU1 revision is: 0001992f (MIPS 1004Kc)
[    0.255372] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.255399] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.255413] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.255447] CPU2 revision is: 0001992f (MIPS 1004Kc)
[    0.315625] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.315652] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.315664] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.315701] CPU3 revision is: 0001992f (MIPS 1004Kc)
[    0.374735] smp: Brought up 1 node, 4 CPUs
[    0.534772] Memory: 112236K/131072K available (8419K kernel code, 653K rwdata, 1812K rodata, 4848K init, 226K bss, 17512K reserved, 0K cma-reserved)
[    0.566557] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.586060] futex hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.605423] pinctrl core: initialized pinctrl subsystem
[    0.619132] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.634184] /pinctrl: Fixed dependency cycle(s) with /pinctrl/pinctrl0
[    0.666301] clocksource: Switched to clocksource GIC
[    0.685865] NET: Registered PF_INET protocol family
[    0.695735] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.710830] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.727386] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.742749] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.757966] TCP bind hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    0.772178] TCP: Hash tables configured (established 1024 bind 1024)
[    0.785742] MPTCP token hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.800423] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.813331] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.828182] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.839421] PCI: CLS 0 bytes, default 32
[    0.856849] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.872551] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.884049] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.379708] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.391496] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.403388] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.415431] mt7621-pci 1e140000.pcie: host bridge /pcie@1e140000 ranges:
[    1.428785] mt7621-pci 1e140000.pcie:   No bus range found for /pcie@1e140000, using [bus 00-ff]
[    1.446267] mt7621-pci 1e140000.pcie:      MEM 0x0060000000..0x006fffffff -> 0x0060000000
[    1.462460] mt7621-pci 1e140000.pcie:       IO 0x001e160000..0x001e16ffff -> 0x0000000000
[    1.816323] mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK)
[    1.830124] mt7621-pci 1e140000.pcie: PCIE0 enabled
[    1.839764] mt7621-pci 1e140000.pcie: PCIE1 enabled
[    1.849642] PCI coherence region base: 0x60000000, mask/settings: 0xf0000002
[    1.863873] mt7621-pci 1e140000.pcie: PCI host bridge to bus 0000:00
[    1.876456] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.887298] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    1.900995] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    1.913327] pci 0000:00:00.0: [0e8d:0801] type 01 class 0x060400 PCIe Root Port
[    1.927786] pci 0000:00:00.0: BAR 0 [mem 0x00000000-0x7fffffff]
[    1.939537] pci 0000:00:00.0: BAR 1 [mem 0x60500000-0x6050ffff]
[    1.951270] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.961115] pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
[    1.973199] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    1.986699] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
[    2.001110] pci 0000:00:00.0: supports D1
[    2.008981] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    2.021244] pci 0000:00:01.0: [0e8d:0801] type 01 class 0x060400 PCIe Root Port
[    2.035753] pci 0000:00:01.0: BAR 0 [mem 0x00000000-0x7fffffff]
[    2.047487] pci 0000:00:01.0: BAR 1 [mem 0x60510000-0x6051ffff]
[    2.059226] pci 0000:00:01.0: PCI bridge to [bus 02]
[    2.069068] pci 0000:00:01.0:   bridge window [io  0x0000-0x0fff]
[    2.081154] pci 0000:00:01.0:   bridge window [mem 0x60200000-0x602fffff]
[    2.094628] pci 0000:00:01.0:   bridge window [mem 0x60300000-0x604fffff pref]
[    2.109068] pci 0000:00:01.0: supports D1
[    2.116942] pci 0000:00:01.0: PME# supported from D0 D1 D3hot
[    2.130725] pci 0000:01:00.0: [14c3:7603] type 00 class 0x028000 PCIe Endpoint
[    2.145067] pci 0000:01:00.0: BAR 0 [mem 0x00000000-0x000fffff]
[    2.156944] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    2.169416] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[    2.179823] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    2.193435] pci 0000:02:00.0: [14c3:7663] type 00 class 0x000280 PCIe Endpoint
[    2.207794] pci 0000:02:00.0: BAR 0 [mem 0x00000000-0x000fffff 64bit pref]
[    2.221419] pci 0000:02:00.0: BAR 2 [mem 0x00000000-0x00003fff 64bit pref]
[    2.235049] pci 0000:02:00.0: BAR 4 [mem 0x00000000-0x00000fff 64bit pref]
[    2.248845] pci 0000:02:00.0: supports D1 D2
[    2.257229] pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    2.270396] pci 0000:02:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:01.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
[    2.300311] pci 0000:00:01.0: PCI bridge to [bus 02-ff]
[    2.310672] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 02
[    2.323865] pci 0000:00:00.0: BAR 0 [mem size 0x80000000]: can't assign; no space
[    2.338663] pci 0000:00:00.0: BAR 0 [mem size 0x80000000]: failed to assign
[    2.352492] pci 0000:00:01.0: BAR 0 [mem size 0x80000000]: can't assign; no space
[    2.367345] pci 0000:00:01.0: BAR 0 [mem size 0x80000000]: failed to assign
[    2.381170] pci 0000:00:00.0: bridge window [mem 0x60000000-0x600fffff]: assigned
[    2.396016] pci 0000:00:00.0: bridge window [mem 0x60100000-0x601fffff pref]: assigned
[    2.411767] pci 0000:00:01.0: bridge window [mem 0x60200000-0x602fffff]: assigned
[    2.426629] pci 0000:00:01.0: bridge window [mem 0x60300000-0x604fffff pref]: assigned
[    2.442336] pci 0000:00:00.0: BAR 1 [mem 0x60500000-0x6050ffff]: assigned
[    2.455817] pci 0000:00:01.0: BAR 1 [mem 0x60510000-0x6051ffff]: assigned
[    2.469304] pci 0000:00:00.0: bridge window [io  0x0000-0x0fff]: assigned
[    2.482768] pci 0000:00:01.0: bridge window [io  0x1000-0x1fff]: assigned
[    2.496343] pci 0000:01:00.0: BAR 0 [mem 0x60000000-0x600fffff]: assigned
[    2.509784] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.519613] pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
[    2.531711] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    2.545180] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
[    2.559573] pci 0000:02:00.0: BAR 0 [mem 0x60300000-0x603fffff 64bit pref]: assigned
[    2.574946] pci 0000:02:00.0: BAR 2 [mem 0x60400000-0x60403fff 64bit pref]: assigned
[    2.590309] pci 0000:02:00.0: BAR 4 [mem 0x60404000-0x60404fff 64bit pref]: assigned
[    2.605691] pci 0000:00:01.0: PCI bridge to [bus 02]
[    2.615510] pci 0000:00:01.0:   bridge window [io  0x1000-0x1fff]
[    2.627640] pci 0000:00:01.0:   bridge window [mem 0x60200000-0x602fffff]
[    2.641182] pci 0000:00:01.0:   bridge window [mem 0x60300000-0x604fffff pref]
[    2.655528] pci_bus 0000:00: Some PCI device resources are unassigned, try booting with pci=realloc
[    2.673468] pci_bus 0000:00: resource 4 [mem 0x60000000-0x6fffffff]
[    2.685914] pci_bus 0000:00: resource 5 [io  0x0000-0xffff]
[    2.696963] pci_bus 0000:01: resource 0 [io  0x0000-0x0fff]
[    2.708007] pci_bus 0000:01: resource 1 [mem 0x60000000-0x600fffff]
[    2.720448] pci_bus 0000:01: resource 2 [mem 0x60100000-0x601fffff pref]
[    2.733767] pci_bus 0000:02: resource 0 [io  0x1000-0x1fff]
[    2.744817] pci_bus 0000:02: resource 1 [mem 0x60200000-0x602fffff]
[    2.757281] pci_bus 0000:02: resource 2 [mem 0x60300000-0x604fffff pref]
[    2.773307] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    2.788718] printk: legacy console [ttyS0] disabled
[    2.799304] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 18, base_baud = 3125000) is a 16550A
[    2.817315] printk: legacy console [ttyS0] enabled
[    2.817315] printk: legacy console [ttyS0] enabled
[    2.836291] printk: legacy bootconsole [early0] disabled
[    2.836291] printk: legacy bootconsole [early0] disabled
[    3.065421] spi-mt7621 1e000b00.spi: sys_freq: 220000000
[    3.078174] 4 fixed-partitions partitions found on MTD device spi0.0
[    3.091360] Creating 4 MTD partitions on "spi0.0":
[    3.100959] 0x000000000000-0x000000030000 : "u-boot"
[    3.112569] 0x000000030000-0x000000040000 : "config"
[    3.123678] 0x000000040000-0x000000050000 : "factory"
[    3.135318] 0x000000050000-0x000001000000 : "firmware"
[    3.146951] 2 uimage-fw partitions found on MTD device firmware
[    3.158794] Creating 2 MTD partitions on "firmware":
[    3.168697] 0x000000000000-0x0000001c0000 : "kernel"
[    3.179811] 0x0000001c0000-0x000000fb0000 : "rootfs"
[    3.190721] mtd: setting mtd5 (rootfs) as root device
[    3.200920] 1 squashfs-split partitions found on MTD device rootfs
[    3.213257] 0x0000008f0000-0x000000fb0000 : "rootfs_data"
[    3.359830] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module
[    3.384923] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 19
[    3.404689] mtk_soc_eth 1e100000.ethernet eth1: mediatek frame engine at 0xbe100000, irq 19
[    3.423363] i2c_dev: i2c /dev entries driver
[    3.435675] NET: Registered PF_INET6 protocol family
[    3.449715] Segment Routing with IPv6
[    3.457196] In-situ OAM (IOAM) with IPv6
[    3.465146] NET: Registered PF_PACKET protocol family
[    3.475926] 8021q: 802.1Q VLAN Support v1.8
[    3.517925] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module
[    6.180635] mt7530-mdio mdio-bus:1f: configuring for fixed/rgmii link mode
[    6.195573] mt7530-mdio mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx
[    6.198277] mt7530-mdio mdio-bus:1f wan (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7530 PHY] (irq=23)
[    6.233958] mt7530-mdio mdio-bus:1f lan (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7530 PHY] (irq=24)
[    6.256543] mtk_soc_eth 1e100000.ethernet eth0: entered promiscuous mode
[    6.270073] DSA: tree 0 setup
[    6.277048] clk: Disabling unused clocks
[    6.302240] Freeing unused kernel image (initmem) memory: 4848K
[    6.314127] This architecture does not have kernel memory protection.
[    6.326997] Run /init as init process
[    6.766116] init: Console is alive
[    6.773433] init: - watchdog -
[    6.793864] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.810454] gpio_button_hotplug: loading out-of-tree module taints kernel.
[    6.828485] leds-gpio leds: Led green:status renamed to green:status_1 due to name collision
[    6.846997] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    6.872175] init: - preinit -
ip: SIOCSIFNAME: File exists
[   10.196299] random: crng init done
Cannot parse config file '/etc/fw_env.config': No such file or directory
Failed to find NVMEM device
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
[   14.802395] procd: - early -
[   14.808418] procd: - watchdog -
[   15.371025] procd: - watchdog -
[   15.377776] procd: - ubus -
[   15.439738] procd: - init -
Please press Enter to activate this console.
[   15.860963] kmodloader: loading kernel modules from /etc/modules.d/*
[   15.888994] mtk-eip93 1e004000.crypto: EIP93 Crypto Engine Initialized.
[   16.463092] Loading modules backported from Linux version v6.18.7-0-g5dfbc5357
[   16.477691] Backport generated by backports.git c8a37ce
[   16.556724] pci 0000:00:00.0: enabling device (0006 -> 0007)
[   16.568115] mt7603e 0000:01:00.0: enabling device (0000 -> 0002)
[   16.580324] mt7603e 0000:01:00.0: ASIC revision: 76030010
[   16.595210] mt7603e 0000:01:00.0: Firmware Version: ap_pcie
[   16.606397] mt7603e 0000:01:00.0: Build Time: 20160107100755
[   16.656324] mt7603e 0000:01:00.0: firmware init done
[   16.833493] mt7603e 0000:01:00.0: registering led 'mt76-phy0'
[   17.017687] PPP generic driver version 2.4.2
[   17.029569] NET: Registered PF_PPPOX protocol family
[   17.031946] urngd: v1.0.2 started.
[   17.048183] kmodloader: done loading kernel modules from /etc/modules.d/*
[   38.194477] mtk_soc_eth 1e100000.ethernet eth0: configuring for fixed/rgmii link mode
[   38.214700] mtk_soc_eth 1e100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   38.222411] mt7530-mdio mdio-bus:1f wan: configuring for phy/gmii link mode

Looks good, back up oem flash extra time, check that at least something can be restored from uboot alone, check also that wifi power levels are ok in EU/US/JP alongside where you are (iw phy shows them, but do not activate radio, changing global DFS mode usually degrades wifi transmissions)

LAN port doesn’t work (no link message when I plug the cable) and its LED is always lit up. WAN port shows the message when I plug the cable but its LED doesn’t light up. I can’t connect to router with ssh, web 192.168.1.1 also doesn’t work.

There’s also no 5G radio, only 2.4G:

Summary

root@OpenWrt:~# uci show | grep radio
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.path='1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
wireless.radio0.band='2g'
wireless.radio0.channel='1'
wireless.radio0.htmode='HT20'
wireless.default_radio0=wifi-iface
wireless.default_radio0.device='radio0'
wireless.default_radio0.network='lan'
wireless.default_radio0.mode='ap'
wireless.default_radio0.ssid='OpenWrt'
wireless.default_radio0.encryption='none'
wireless.default_radio0.disabled='1'

When I backed up OEM flash with me2-lite initramfs, both radios were present in luci and LAN port was working.

Edit: I forgot to include wireless packages kmod-mt7615 and mt7663
DTS is not quite correct too. I can’t declare wan in switch0 (assuming from me2-lite’s .dts).

Do not program anything before in-memory image is functional.

What’s the next step then? I don’t understand. I didn’t program anything except for initramfs. RIght now I’m trying to figure out how to make LAN port work. I’m assuming DTS is not correct.

You have to tftpboot and bootm the initramfs part.
If you flashed it then IF actual caldata were near "kernel" partition it may have veen wiped forever.

I’ve already done that

This is what happens when I tftpboot openwrt initramfs for this router.

Did you create/build this image ?

Yessir. What I did is I took snr-cpe-me2-lite dts and changed switch0 ports (since there is only one LAN port). And I also changed gmac1 because WAN port is not number 0 but number 3. I also checked cudy-m1300-v2 dts for reference, and it’s almost the same, except for port numbers.

Current DTS:
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

/ {
	compatible = "snr,snr-m522-g11", "mediatek,mt7621-soc";
	model = "SNR-M522-G11";

	leds {
		compatible = "gpio-leds";

		led_sys: led-0 {
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_STATUS;
			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
		};

		led_vpn: led-1 {
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_STATUS;
			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
		};
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	};
};

&state_default {
	gpio {
		groups = "jtag", "wdt";
		function = "gpio";
	};
};

&gdma {
	status = "okay";
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <50000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x0 0x30000>;
				read-only;
			};

			partition@30000 {
				label = "config";
				reg = <0x30000 0x10000>;
			};

			partition@40000 {
				label = "factory";
				reg = <0x40000 0x10000>;
				read-only;

				nvmem-layout {
					compatible = "fixed-layout";
					#address-cells = <1>;
					#size-cells = <1>;

					eeprom_factory_0: eeprom@0 {
						reg = <0x0 0x400>;
					};

					eeprom_factory_8000: eeprom@8000 {
						reg = <0x8000 0x4da8>;
					};

					macaddr_factory_e000: macaddr@e000 {
						reg = <0xe000 0x6>;
					};

					macaddr_factory_e006: macaddr@e006 {
						reg = <0xe006 0x6>;
					};
				};
			};

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0xfb0000>;
			};
		};
	};
};

&sdhci {
	status = "okay";
};

&gmac0 {
	nvmem-cells = <&macaddr_factory_e000>;
	nvmem-cell-names = "mac-address";
};

&gmac1 {
	status = "okay";
	label = "wan";
	phy-handle = <&ethphy3>;

	nvmem-cells = <&macaddr_factory_e006>;
	nvmem-cell-names = "mac-address";
};

&ethphy3 {
	/delete-property/ interrupts;
};

&switch0 {
    ports {
		port@4 {
			status = "okay";
			label = "lan";
		};
	};
};

&pcie {
	status = "okay";
};

&pcie0 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		nvmem-cells = <&eeprom_factory_0>;
		nvmem-cell-names = "eeprom";
		ieee80211-freq-limit = <2400000 2500000>;
	};
};

&pcie1 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		nvmem-cells = <&eeprom_factory_8000>;
		nvmem-cell-names = "eeprom";
		ieee80211-freq-limit = <5000000 6000000>;
	};
};

Then I guess your changes were incorrect and/or incomplete ?

I understand that and I’m trying to figure out how to fix this

1 Like

Do you have them in github or something?

Do you mean the .dts files? No, I don’t. Do you need me to commit them to my openwrt fork?

Branch first... Somebody can look at them and OEM DTS and maybe assist you.

EDIT: something booting somewhat is already a lot. Problem at this point is if anything crashes it is the next driver in line showing no message. If you build it you can add debug kernel parameter.

1 Like

Stock firmware DTS:

Stock firmware DTS
/dts-v1/;

/ {
	#address-cells = <0x01>;
	#size-cells = <0x01>;
	compatible = "mediatek,mt7621-soc";
	model = "SNR-Keep-AC10";

	cpus {

		cpu@0 {
			compatible = "mips,mips1004Kc";
		};

		cpu@1 {
			compatible = "mips,mips1004Kc";
		};
	};

	cpuintc@0 {
		#address-cells = <0x00>;
		#interrupt-cells = <0x01>;
		interrupt-controller;
		compatible = "mti,cpu-interrupt-controller";
	};

	aliases {
		serial0 = "/palmbus@1e000000/uartlite@c00";
	};

	cpuclock@0 {
		#clock-cells = <0x00>;
		compatible = "mtk,mt7621-cpu-clock";
		linux,phandle = <0x15>;
		phandle = <0x15>;
	};

	sysbusclock@0 {
		#clock-cells = <0x00>;
		compatible = "mtk,mt7621-sys-bus-clock";
		linux,phandle = <0x07>;
		phandle = <0x07>;
	};

	apll@0 {
		#clock-cells = <0x00>;
		compatible = "fixed-clock";
		clock-frequency = <0x1017df80>;
		linux,phandle = <0x04>;
		phandle = <0x04>;
	};

	sysclock50M@0 {
		#clock-cells = <0x00>;
		compatible = "fixed-clock";
		clock-frequency = <0x2faf080>;
		linux,phandle = <0x09>;
		phandle = <0x09>;
	};

	sysclock125M@0 {
		#clock-cells = <0x00>;
		compatible = "fixed-clock";
		clock-frequency = <0x7735940>;
		linux,phandle = <0x11>;
		phandle = <0x11>;
	};

	palmbus@1e000000 {
		compatible = "palmbus";
		reg = <0x1e000000 0x100000>;
		ranges = <0x00 0x1e000000 0xfffff>;
		#address-cells = <0x01>;
		#size-cells = <0x01>;

		sysc@0 {
			compatible = "mtk,mt7621-sysc";
			reg = <0x00 0x100>;
		};

		wdt@100 {
			compatible = "mtk,mt7621-wdt";
			reg = <0x100 0x100>;
		};

		gpio@600 {
			#address-cells = <0x01>;
			#size-cells = <0x00>;
			compatible = "mtk,mt7621-gpio";
			reg = <0x600 0x100>;
			interrupt-parent = <0x01>;
			interrupts = <0x00 0x0c 0x04>;

			bank@0 {
				reg = <0x00>;
				compatible = "mtk,mt7621-gpio-bank";
				gpio-controller;
				#gpio-cells = <0x02>;
				linux,phandle = <0x02>;
				phandle = <0x02>;
			};

			bank@1 {
				reg = <0x01>;
				compatible = "mtk,mt7621-gpio-bank";
				gpio-controller;
				#gpio-cells = <0x02>;
			};

			bank@2 {
				reg = <0x02>;
				compatible = "mtk,mt7621-gpio-bank";
				gpio-controller;
				#gpio-cells = <0x02>;
			};
		};

		i2c@0 {
			compatible = "i2c-gpio";
			gpios = <0x02 0x03 0x01 0x02 0x04 0x01>;
			i2c-gpio,delay-us = <0x03>;
			#address-cells = <0x01>;
			#size-cells = <0x00>;
			status = "okay";
			pinctrl-names = "default";
			pinctrl-0 = <0x03>;

			aw2026@64 {
				compatible = "awinic,aw2026_led";
				reg = <0x64>;

				aw2026,red {
					aw2026,name = "snr-m522-g11:red:aw2026";
					aw2026,id = <0x00>;
					aw2026,imax = <0x01>;
					aw2026,led-current = <0xff>;
					aw2026,max-brightness = <0xff>;
					aw2026,brightness = <0xff>;
					aw2026,rise-time-ms = <0x06>;
					aw2026,hold-time-ms = <0x00>;
					aw2026,fall-time-ms = <0x06>;
					aw2026,off-time-ms = <0x04>;
				};

				aw2026,green {
					aw2026,name = "snr-m522-g11:green:aw2026";
					aw2026,id = <0x01>;
					aw2026,imax = <0x01>;
					aw2026,led-current = <0xff>;
					aw2026,max-brightness = <0xff>;
					aw2026,brightness = <0x00>;
					aw2026,rise-time-ms = <0x06>;
					aw2026,hold-time-ms = <0x00>;
					aw2026,fall-time-ms = <0x06>;
					aw2026,off-time-ms = <0x04>;
				};

				aw2026,blue {
					aw2026,name = "snr-m522-g11:blue:aw2026";
					aw2026,id = <0x02>;
					aw2026,imax = <0x01>;
					aw2026,led-current = <0xff>;
					aw2026,max-brightness = <0xff>;
					aw2026,brightness = <0x00>;
					aw2026,rise-time-ms = <0x06>;
					aw2026,hold-time-ms = <0x00>;
					aw2026,fall-time-ms = <0x06>;
					aw2026,off-time-ms = <0x04>;
				};
			};
		};

		i2s@a00 {
			compatible = "mediatek,mt7621-i2s";
			reg = <0xa00 0x100>;
			clocks = <0x04>;
			resets = <0x05 0x11>;
			reset-names = "i2s";
			interrupt-parent = <0x01>;
			interrupts = <0x00 0x10 0x04>;
			txdma-req = <0x02>;
			rxdma-req = <0x03>;
			dmas = <0x06 0x04 0x06 0x06>;
			dma-names = "tx", "rx";
			status = "disabled";
		};

		spi@b00 {
			status = "okay";
			compatible = "mediatek,mt7621-spi";
			reg = <0xb00 0x100>;
			clocks = <0x07>;
			resets = <0x05 0x12>;
			reset-names = "spi";
			#address-cells = <0x01>;
			#size-cells = <0x00>;
			pinctrl-names = "default";
			pinctrl-0 = <0x08>;

			m25p80@0 {
				#address-cells = <0x01>;
				#size-cells = <0x01>;
				compatible = "jedec,spi-nor";
				reg = <0x00>;
				spi-max-frequency = <0x17d7840>;

				partition@0 {
					label = "Bootloader";
					reg = <0x00 0x30000>;
				};

				partition@30000 {
					label = "Config";
					reg = <0x30000 0x10000>;
				};

				partition@40000 {
					label = "Factory";
					reg = <0x40000 0x10000>;
				};

				partition@50000 {
					label = "firmware";
					reg = <0x50000 0xfb0000>;
				};
			};
		};

		uartlite@c00 {
			compatible = "mediatek,mt6577-uart", "ns16550a";
			reg = <0xc00 0x100>;
			clocks = <0x09>;
			clock-frequency = <0x2faf080>;
			interrupt-parent = <0x01>;
			interrupts = <0x00 0x1a 0x04>;
			reg-shift = <0x02>;
			reg-io-width = <0x04>;
			no-loopback-test;
		};

		uartfull@d00 {
			compatible = "mediatek,mt6577-uart", "ns16550a";
			reg = <0xd00 0x100>;
			clocks = <0x09>;
			clock-frequency = <0x2faf080>;
			interrupt-parent = <0x01>;
			interrupts = <0x00 0x1b 0x04>;
			reg-shift = <0x02>;
			reg-io-width = <0x04>;
			no-loopback-test;
			status = "disabled";
		};

		uartfull@e00 {
			compatible = "mediatek,mt6577-uart", "ns16550a";
			reg = <0xe00 0x100>;
			clocks = <0x09>;
			clock-frequency = <0x2faf080>;
			interrupt-parent = <0x01>;
			interrupts = <0x00 0x1c 0x04>;
			reg-shift = <0x02>;
			reg-io-width = <0x04>;
			no-loopback-test;
			status = "disabled";
		};

		gdma@2800 {
			compatible = "mtk,rt3883-gdma";
			reg = <0x2800 0x800>;
			resets = <0x05 0x0e>;
			reset-names = "dma";
			interrupt-parent = <0x01>;
			interrupts = <0x00 0x0d 0x04>;
			#dma-cells = <0x01>;
			#dma-channels = <0x10>;
			#dma-requests = <0x10>;
			status = "disabled";
			linux,phandle = <0x06>;
			phandle = <0x06>;
		};

		ecc@3800 {
			compatible = "mediatek,mt7621-ecc";
			reg = <0x3800 0x800>;
			status = "disabled";
			linux,phandle = <0x0a>;
			phandle = <0x0a>;
		};

		nand@3000 {
			compatible = "mediatek,mt7621-nfc";
			reg = <0x3000 0x800>;
			ecc-engine = <0x0a>;
			#address-cells = <0x01>;
			#size-cells = <0x01>;
			pinctrl-names = "default";
			pinctrl-0 = <0x0b>;
			status = "disabled";
		};

		memc@5000 {
			compatible = "mtk,mt7621-memc";
			reg = <0x5000 0x1000>;
		};

		hsdma@7000 {
			compatible = "mediatek,mt7621-hsdma";
			reg = <0x7000 0x1000>;
			resets = <0x05 0x05>;
			reset-names = "hsdma";
			interrupt-parent = <0x01>;
			interrupts = <0x00 0x0b 0x04>;
			#dma-cells = <0x01>;
			#dma-channels = <0x01>;
			#dma-requests = <0x01>;
			status = "disabled";
		};
	};

	rstctrl {
		compatible = "ralink,rt2880-reset";
		#reset-cells = <0x01>;
		linux,phandle = <0x05>;
		phandle = <0x05>;
	};

	clkctrl {
		compatible = "ralink,rt2880-clock";
		#clock-cells = <0x01>;
		linux,phandle = <0x10>;
		phandle = <0x10>;
	};

	ethsys@1e000000 {
		compatible = "mediatek,mt7621-ethsys", "syscon";
		reg = <0x1e000000 0x8000>;
		linux,phandle = <0x0c>;
		phandle = <0x0c>;
	};

	raeth@1e100000 {
		compatible = "mediatek,mt7621-eth";
		reg = <0x1e100000 0xe000>;
		interrupt-parent = <0x01>;
		interrupts = <0x00 0x03 0x04>;
		mediatek,ethsys = <0x0c>;
		status = "disabled";
	};

	ethernet@1e100000 {
		compatible = "mediatek,mt7621-eth", "syscon";
		reg = <0x1e100000 0xe000>;
		#address-cells = <0x01>;
		#size-cells = <0x00>;
		interrupt-parent = <0x01>;
		interrupts = <0x00 0x03 0x04>;
		mediatek,ethsys = <0x0c>;
		status = "okay";

		mac@0 {
			compatible = "mediatek,eth-mac";
			reg = <0x00>;
			phy-mode = "trgmii";

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

		mac@1 {
			compatible = "mediatek,eth-mac";
			reg = <0x01>;
			phy-mode = "rgmii";

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

		mdio-bus {
			#address-cells = <0x01>;
			#size-cells = <0x00>;
			linux,phandle = <0x0d>;
			phandle = <0x0d>;

			ethernet-phy@1f {
				reg = <0x1f>;
				phy-mode = "rgmii";
			};
		};
	};

	gsw {
		compatible = "mediatek,mt753x";
		mt7530,direct-phy-access;
		interrupt-parent = <0x01>;
		interrupts = <0x00 0x17 0x04>;
		#address-cells = <0x01>;
		#size-cells = <0x00>;
		mediatek,mdio = <0x0d>;
		mediatek,portmap = "llllw";
		mediatek,mcm;
		resets = <0x05 0x02>;
		reset-names = "mcm";

		port@5 {
			compatible = "mediatek,mt753x-port";
			reg = <0x05>;
			phy-mode = "rgmii";

			fixed-link {
				speed = <0x3e8>;
				full-duplex;
			};
		};

		port@6 {
			compatible = "mediatek,mt753x-port";
			reg = <0x06>;
			phy-mode = "trgmii";

			fixed-link {
				speed = <0x3e8>;
				full-duplex;
			};
		};

		mdio-bus {
			#address-cells = <0x01>;
			#size-cells = <0x00>;
		};
	};

	hnat@1e100000 {
		compatible = "mediatek,mtk-hnat_v1";
		reg = <0x1e100000 0x3000>;
		resets = <0x0c 0x00>;
		reset-names = "mtketh";
		status = "okay";
		mtketh-wan = "eth1";
		mtketh-ppd = "eth0";
		ext-devices = "rai0", "ra0", "rai1", "ra1", "rai2", "ra2", "rai3", "ra3", "apclii0", "apcli0";
		mtketh-max-gmac = <0x02>;
	};

	sdhci@1e130000 {
		status = "okay";
		compatible = "mediatek,mt7621-sdhci";
		reg = <0x1e130000 0x4000>;
		interrupt-parent = <0x01>;
		interrupts = <0x00 0x14 0x04>;
		pinctrl-names = "default";
		pinctrl-0 = <0x0e>;
	};

	pcie@1e140000 {
		compatible = "mediatek,mt7621-pci";
		reg = <0x1e140000 0x40000>;
		#address-cells = <0x03>;
		#size-cells = <0x02>;
		pinctrl-names = "default";
		pinctrl-0 = <0x0f>;
		device_type = "pci";
		bus-range = <0x00 0xff>;
		ranges = <0x2000000 0x00 0x00 0x60000000 0x00 0x10000000 0x1000000 0x00 0x00 0x1e160000 0x00 0x10000>;
		interrupt-parent = <0x01>;
		interrupts = <0x00 0x04 0x04 0x00 0x18 0x04 0x00 0x19 0x04>;
		status = "okay";
		resets = <0x05 0x18 0x05 0x19 0x05 0x1a>;
		reset-names = "pcie0", "pcie1", "pcie2";
		clocks = <0x10 0x18 0x10 0x19 0x10 0x1a>;
		clock-names = "pcie0", "pcie1", "pcie2";
		reset-gpios = <0x02 0x13 0x01>;
		reset-gpio-names = "pcie";

		pcie0 {
			reg = <0x00 0x00 0x00 0x00 0x00>;
			#address-cells = <0x03>;
			#size-cells = <0x02>;
			device_type = "pci";
		};

		pcie1 {
			reg = <0x800 0x00 0x00 0x00 0x00>;
			#address-cells = <0x03>;
			#size-cells = <0x02>;
			device_type = "pci";
		};

		pcie2 {
			reg = <0x1000 0x00 0x00 0x00 0x00>;
			#address-cells = <0x03>;
			#size-cells = <0x02>;
			device_type = "pci";
		};
	};

	usb@1e1c0000 {
		compatible = "mediatek,mt7621-xhci", "mediatek,mt2701-xhci";
		reg = <0x1e1c0000 0x1000 0x1e1d0700 0x100>;
		reg-names = "mac", "ippc";
		interrupt-parent = <0x01>;
		interrupts = <0x00 0x16 0x04>;
		clocks = <0x11 0x11 0x11 0x11>;
		clock-names = "sys_ck", "free_ck", "ahb_ck", "dma_ck";
		phys = <0x12 0x03 0x13 0x04 0x14 0x03>;
		status = "okay";
	};

	usb-phy@1e1d0000 {
		compatible = "mediatek,mt7621-u3phy", "mediatek,mt2701-u3phy";
		#address-cells = <0x01>;
		#size-cells = <0x01>;
		ranges;
		reg = <0x1e1d0000 0x300>;
		status = "okay";

		usb-phy@0x1e1d0800 {
			reg = <0x1e1d0800 0x100>;
			#phy-cells = <0x01>;
			clocks = <0x11>;
			clock-names = "ref";
			linux,phandle = <0x12>;
			phandle = <0x12>;
		};

		usb-phy@0x1e1d0900 {
			reg = <0x1e1d0900 0x700>;
			#phy-cells = <0x01>;
			clocks = <0x11>;
			clock-names = "ref";
			linux,phandle = <0x13>;
			phandle = <0x13>;
		};

		usb-phy@0x1e1d1000 {
			reg = <0x1e1d1000 0x100>;
			#phy-cells = <0x01>;
			clocks = <0x11>;
			clock-names = "ref";
			linux,phandle = <0x14>;
			phandle = <0x14>;
		};
	};

	interrupt-controller@1fbc0000 {
		compatible = "mti,gic";
		reg = <0x1fbc0000 0x2000>;
		interrupt-controller;
		#interrupt-cells = <0x03>;
		mti,reserved-cpu-vectors = <0x07>;
		linux,phandle = <0x01>;
		phandle = <0x01>;

		timer {
			compatible = "mti,gic-timer";
			interrupts = <0x01 0x01 0x00>;
			clocks = <0x15>;
		};
	};

	pinctrl {
		compatible = "mtk,mtkmips-pinmux";
		pinctrl-names = "default";
		pinctrl-0 = <0x16>;

		pinctrl0 {
			linux,phandle = <0x16>;
			phandle = <0x16>;

			gpio {
				mtk,group = "uart2", "uart3", "jtag";
				mtk,function = "gpio";
			};

			rgmii2 {
				mtk,group = "rgmii2";
				mtk,function = "rgmii2";
			};
		};

		i2c {
			linux,phandle = <0x03>;
			phandle = <0x03>;

			i2c {
				mtk,group = "i2c";
				mtk,function = "gpio";
			};
		};

		mdio {

			mdio {
				mtk,group = "mdio";
				mtk,function = "mdio";
			};
		};

		nand {
			linux,phandle = <0x0b>;
			phandle = <0x0b>;

			spi-nand {
				mtk,group = "spi";
				mtk,function = "nand1";
			};

			sdhci-nand {
				mtk,group = "sdhci";
				mtk,function = "nand2";
			};
		};

		pcie {
			linux,phandle = <0x0f>;
			phandle = <0x0f>;

			pcie {
				mtk,group = "pcie";
				mtk,function = "gpio";
			};
		};

		rgmii1 {

			rgmii1 {
				mtk,group = "rgmii1";
				mtk,function = "rgmii1";
			};
		};

		rgmii2 {

			rgmii2 {
				mtk,group = "rgmii2";
				mtk,function = "rgmii2";
			};
		};

		sdhci {
			linux,phandle = <0x0e>;
			phandle = <0x0e>;

			sdhci {
				mtk,group = "sdhci";
				mtk,function = "sdhci";
			};
		};

		spi {
			linux,phandle = <0x08>;
			phandle = <0x08>;

			spi {
				mtk,group = "spi";
				mtk,function = "spi";
			};
		};

		uart1 {

			uart1 {
				mtk,group = "uart1";
				mtk,function = "uart1";
			};
		};

		uart2 {

			uart2 {
				mtk,group = "uart2";
				mtk,function = "uart2";
			};
		};

		uart3 {

			uart3 {
				mtk,group = "uart3";
				mtk,function = "uart3";
			};
		};

		jtag {

			jtag {
				mtk,group = "jtag";
				mtk,function = "jtag";
			};
		};
	};

	crypto@1e004000 {
		status = "okay";
		compatible = "mediatek,mtk-eip93";
		reg = <0x1e004000 0x1000>;
		interrupt-parent = <0x01>;
		interrupts = <0x00 0x13 0x04>;
	};

	chosen {
		bootargs = "console=ttyS0,57600";
	};

	gpio-keys-polled {
		compatible = "gpio-keys-polled";
		#address-cells = <0x01>;
		#size-cells = <0x00>;
		poll-interval = <0x14>;

		reset {
			label = "reset";
			gpios = <0x02 0x08 0x01>;
			linux,code = <0x198>;
		};

		mesh {
			label = "mesh";
			gpios = <0x02 0x0a 0x01>;
			linux,code = <0xee>;
		};
	};

	leds {
		compatible = "gpio-leds";

		wan {
			label = "snr-m522-g11:green:wan";
			gpios = <0x02 0x0f 0x01>;
		};

		lan {
			label = "snr-m522-g11:green:lan";
			gpios = <0x02 0x0d 0x01>;
		};
	};
};

Any help would be greatly apprectiated