Support for Dlink DAP-1620

I'm try to make build for this device, I loaded openwrt-19.07.3-ramips-mt7620-mt7620a_mt7610e-initramfs-kernel and openwrt-ramips-mt7620-edimax_ew-7476rpc-initramfs-kernel device boots but wireless and Ethernet don't work below is the log. was trying to to test GPIOs but always receive
rt2880-pinmux pinctrl: pin 5 is not set to gpio mux

Boot log:

[    0.000000] Linux version 5.4.60 (roman@buntu18) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r14257-e12ac40552)) #0 Tue Aug 25 12:12:51 2020
[    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 MT7620A ver:2 eco:6
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Dlink DAP-1620
[    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-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000]   Normal zone: 144 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=0007e4ee
[    0.000000] Readback ErrCtl register=0007e4ee
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 54884K/65536K available (4576K kernel code, 200K rwdata, 1024K rodata, 3920K init, 205K bss, 10652K 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] random: get_random_bytes called from start_kernel+0x32c/0x518 with crng_init=0
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000011] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015473] Calibrating delay loop... 385.02 BogoMIPS (lpj=770048)
[    0.059576] pid_max: default: 32768 minimum: 301
[    0.068954] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.083358] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.104960] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.124261] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.137873] pinctrl core: initialized pinctrl subsystem
[    0.148787] NET: Registered protocol family 16
[    0.187333] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.198389] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.211368] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.234359] clocksource: Switched to clocksource systick
[    0.246229] NET: Registered protocol family 2
[    0.255733] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.272300] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.287464] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.301480] TCP: Hash tables configured (established 1024 bind 1024)
[    0.314266] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.327173] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.341309] NET: Registered protocol family 1
[    0.349887] PCI: CLS 0 bytes, default 32
[    1.222338] random: fast init done
[    5.619528] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    5.633755] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    5.655035] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    5.666541] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    5.702957] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    5.716618] printk: console [ttyS0] disabled
[    5.725093] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    5.744730] printk: console [ttyS0] enabled
[    5.761311] printk: bootconsole [early0] disabled
[    5.781905] libphy: Fixed MDIO Bus: probed
[    5.802358] gsw: setting port4 to ephy mode
[    5.810812] mtk_soc_eth 10100000.ethernet: generated random MAC address 9e:34:5r:f7:7e:f8
[    5.827325] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    5.839915] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    5.856939] rt2880_wdt 10000120.watchdog: Initialized
[    5.868478] NET: Registered protocol family 10
[    5.881951] Segment Routing with IPv6
[    5.889467] NET: Registered protocol family 17
[    5.898424] 8021q: 802.1Q VLAN Support v1.8
[    5.930444] Freeing unused kernel memory: 3920K
[    5.939498] This architecture does not have kernel memory protection.
[    5.952328] Run /init as init process
[    5.974826] init: Console is alive
[    5.982011] init: - watchdog -
[    6.013495] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.036090] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    6.052814] init: - preinit -
[    6.298324] random: jshn: uninitialized urandom read (4 bytes read)
[    6.397072] random: jshn: uninitialized urandom read (4 bytes read)
[    6.432270] random: jshn: uninitialized urandom read (4 bytes read)
[    6.641533] 8021q: adding VLAN 0 to HW filter on device eth0
[    7.238913] procd: - early -
[    7.244872] procd: - watchdog -
[    7.337217] procd: - watchdog -
[    7.343888] procd: - ubus -
[    7.358468] urandom_read: 5 callbacks suppressed
[    7.358478] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.383655] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.397976] procd: - init -
[    8.003052] kmodloader: loading kernel modules from /etc/modules.d/*
[    8.063238] Loading modules backported from Linux version v5.8-0-gbcf876870b95
[    8.077713] Backport generated by backports.git v5.8-1-0-g79400d9e
[    8.164540] xt_time: kernel timezone is -0000
[    8.342556] PPP generic driver version 2.4.2
[    8.368494] NET: Registered protocol family 24
[    8.465622] urngd: jent-rng init failed, err: 2
[    8.476820] ieee80211 phy0: rt2x00lib_request_eeprom_file: Info - Loading EEPROM data from 'soc_wmac.eeprom'.
[    8.498564] rt2800_wmac 10180000.wmac: Direct firmware load for soc_wmac.eeprom failed with error -2
[    8.516861] rt2800_wmac 10180000.wmac: Falling back to sysfs fallback for: soc_wmac.eeprom
[    8.609122] ieee80211 phy0: rt2x00lib_request_eeprom_file: Error - Failed to request EEPROM.
[    8.626086] rt2800_wmac: probe of 10180000.wmac failed with error -12
[    8.666549] kmodloader: done loading kernel modules from /etc/modules.d/*
[   13.534285] random: crng init done
[   36.961609] 8021q: adding VLAN 0 to HW filter on device eth0
[   36.986703] br-lan: port 1(eth0) entered blocking state
[   36.997185] br-lan: port 1(eth0) entered disabled state
[   37.008036] device eth0 entered promiscuous mode
[   37.075918] br-lan: port 1(eth0) entered blocking state
[   37.086405] br-lan: port 1(eth0) entered forwarding state
[   37.990298] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

Something wrong with your log.
If

why

[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Dlink DAP-1620

?
It will be better to see orignal vendor firmware bootlog.

This you see because I start making DTS file for it.

Original firmware log:

U-Boot 1.1.3 (Mar 21 2016 - 16:55:00)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb0000
enable ephy clock...done. rf reg 29 = 5
SSC disabled.
spi_wait_nsec: 29
spi device id: c2 20 17 c2 20 (2017c220)
find flash: MX25L6405D
raspi_read: from:30000 len:1000
*** Warning - bad CRC, using default environment

============================================
Ralink UBoot Version: 4.1.1.0
--------------------------------------------
ASIC 7620_MP (Port5<->Phy)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Mar 21 2016  Time:16:55:00
Cameo Version: v1.00 Build:02
Module Name: D-Link DAP-1620A1
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 580 MHZ ####
 estimate memory size =64 Mbytes
raspi_read: from:50000 len:40
raspi_read: from:4f0000 len:40

=================================================
Check image validation:
Image1 Header Magic Number --> OK
Image2 Header Magic Number --> OK
Image1 Header Checksum --> OK
Image2 Header Checksum --> OK
Image1 Data Checksum --> raspi_read: from:50040 len:dc7e6
OK
Image2 Data Checksum --> raspi_read: from:4f0040 len:c9469
OK

Image1: OK Image2: OK
Both images are OK!!!

=================================================

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.                                                             0

3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    903142 Bytes = 882 kB
   Load Address: 80000000
   Entry Point:  8000c310
raspi_read: from:50040 len:dc7e6
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c310) ...
## Giving linux memsize in MB, 64

Starting kernel ...


LINUX started...

 THIS IS ASIC
Linux version 2.6.36.x (root@roger-1620a-desktop) (gcc version 3.4.2) #2 Mon Dec 11 10:56:07 CST 2017

 The CPU feqenuce set to 580 MHz
 PCIE: bypass PCIe DLL.
 PCIE: Elastic buffer control: Addr:0x68 -> 0xB4
 disable all power about PCIe
CPU revision is: 00019650 (MIPS 24Kc)
Software DMA cache coherency
Determined physical RAM map:
 memory: 04000000 @ 00000000 (usable)
Zone PFN ranges:
  Normal   0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttyS1,57600n8 root=/dev/mtdblock5 console=ttyS0,57600 root=31:05 rootfstype=squashfs init=/sbin/init
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Primary instruction cache 64kB, VIPT, , 4-waylinesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
Writing ErrCtl register=0003a00b
Readback ErrCtl register=0003a00b
Memory: 61980k/65536k available (2209k kernel code, 3556k reserved, 339k data, 168k init, 0k highmem)
NR_IRQS:128
console [ttyS1] enabled
Calibrating delay loop... 386.04 BogoMIPS (lpj=772096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
RALINK_GPIOMODE = 1a301d
RALINK_GPIOMODE = 18301d
PPLL_CFG1=0xe48000
MT7620 PPLL lock
PPLL_DRV =0x80080504
start PCIe register access
RALINK_RSTCTRL = 2400000
RALINK_CLKCFG1 = 75afffc0

*************** MT7620 PCIe RC mode *************
PCIE0 enabled
Port 0 N_FTS = 1b105000
init_rt2880pci done
bio: create slab <bio-0> at 0
vgaarb: loaded
pci 0000:00:00.0: BAR 0: can't assign mem (size 0x80000000)
pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
pci 0000:00:00.0: BAR 1: set to [mem 0x20200000-0x2020ffff] (PCI address [0x20200000-0x2020ffff]
pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
pci 0000:01:00.0: BAR 0: set to [mem 0x20000000-0x200fffff 64bit] (PCI address [0x20000000-0x200fffff]
pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
pci 0000:00:00.0: PCI bridge to [bus 01-01]
pci 0000:00:00.0:   bridge window [io  disabled]
pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
BAR0 at slot 0 = 0
bus=0x0, slot = 0x0
res[0]->start = 0
res[0]->end = 0
res[1]->start = 20200000
res[1]->end = 2020ffff
res[2]->start = 0
res[2]->end = 0
res[3]->start = 0
res[3]->end = 0
res[4]->start = 0
res[4]->end = 0
res[5]->start = 0
res[5]->end = 0
bus=0x1, slot = 0x0
res[0]->start = 20000000
res[0]->end = 200fffff
res[1]->start = 0
res[1]->end = 0
res[2]->start = 0
res[2]->end = 0
res[3]->start = 0
res[3]->end = 0
res[4]->start = 0
res[4]->end = 0
res[5]->start = 0
res[5]->end = 0
Switching to clocksource Ralink Systick timer
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
Load Ralink Timer0 Module
Load Ralink Timer1 Module
squashfs: version 4.0 (2009/01/31) Phillip Lougher
msgmni has been set to 121
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered (default)
Ralink gpio driver initialized
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x10000500 (irq = 37) is a 16550A
serial8250: ttyS1 at MMIO 0x10000c00 (irq = 12) is a 16550A
brd: module loaded
deice id : c2 20 17 c2 20 (2017c220)
MX25L6405D(c2 2017c220) (8192 Kbytes)
mtd .name = raspi, .size = 0x00800000 (0M) .erasesize = 0x00000008 (0K) .numeraseregions = 65536
Creating 9 MTD partitions on "raspi":
0x000000000000-0x000000800000 : "ALL"
0x000000000000-0x000000030000 : "u-boot"
0x000000030000-0x000000040000 : "nvram"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000140000 : "linux4"
0x000000140000-0x0000004e0000 : "rootfs"
0x0000004e0000-0x0000004f0000 : "LANG"
0x0000004f0000-0x0000005c0000 : "linux4b"
0x0000005c0000-0x000000800000 : "rootfsb"
rdm_major = 253
SMACCR1 -- : 0x0000000c
SMACCR0 -- : 0x43762077
Ralink APSoC Ethernet Driver Initilization. v3.1  512 rx/tx descriptors allocated, mtu = 1500!
SMACCR1 -- : 0x0000000c
SMACCR0 -- : 0x43762077
PROC INIT OK!
TCP cubic registered
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
Freeing unused kernel memory: 168k freed
init started:  BusyBox v1.01 (2017.12.11-02:52+0000) multi-call binary
Algorithmics/MIPS FPU Emulator v1.5
devpts: called with bogus options
init NVRAM_SPACE from mtdblock size
init nvram memory map size: 0x10000 order of pages: 0x4
nvram module init:
        /dev/nvram major number 225 glues to mtd: "nvram" size: 0x00010000
        nvram_space: 0x00010000 mapped via mmap(2)
openfile :/etc/sysinfo
read_mp_info: read 65536 data from /dev/mtdblock3 successfully
openfile :/etc/nvram.default


BusyBox v1.01 (2017.12.11-02:52+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

/ # rm: cannot remove `/var/wizard_lang.js': No such file or directory
eth2: Cannot assign requested address
umount: cannot umount /tmp/lang_pack: No such file or Raeth v3.1 (directory
Tasklet,SkbRecycle)

phy_tx_ring = 0x03fd6000, tx_ring = 0xa3fd6000

phy_rx_ring0 = 0x03fd8000, rx_ring0 = 0xa3fd8000
SMACCR1 -- : 0x0000409b
SMACCR0 -- : 0xcd7c27ce
CDMA_CSG_CFG = 81000000
GDMA1_FWD_CFG = 20710000
umount: cannot umount /tmp/lang_pack: No such file or directory
eth2: Cannot assign requested address
mount: mounting /dev/mtdblock6 on /tmp/lang_pack failed
device eth2 entered promiscuous mode
killall: syslogd: no process killed
killall: klogd: no process killed
Thu Jan  1 00:00:00 UTC 2015
/tmp/password has been created
2015-01-01 00:00:00: (network.c.247) warning: please use server.use-ipv6 only for hostnames, not without server.bind / empty address; your config will break if the kernel default for IPV6_V6ONLY changes
checksum=0x849E141B
openfile :/etc/nvram.default
nvram: ap_wlan0_5g_auto_channel_enable="0", but default is "br0: port 1(eth2) entering forwarding state
1"
nvram: ap_wlbr0: port 1(eth2) entering forwarding state
an0_11n_protection="20", but default is "auto"
nvram: ap_wlan0_auto_channel_enable="0", but default is "1"
nvram: ap_wlan0_channel="4", but default is "11"
nvram: ap_wlan0_disablecoext="0", but default is "1"
nvram: cookie="1144823555", but default is "X"
nvram: wlan0_5g_enable="0", but default is "1"
nvram: ap_ipv6_wan_proto="link_local", but default is "ipv6_autoconfig"
nvram: default_downlink_ssid="0", but default is "1"
nvram: setup_wizard_ap="0", but default is "1"
nvram: wlan1_psk_pass_phrase="", but default is "1234567890"
nvram: wlan0_disable_wps_pbc="1", but default is "0"
nvram: wlan0_wps_configured_mode="1", but default is "5"
nvram: wlan0_wps_enable="0", but default is "1"
nvram: wlan0_disablecoext="0", but default is "1"
nvram: wlan0_11n_protection="20", but default is "auto"
nvram: wlan0_auto_channel_enable="0", but default is "1"
nvram: wlan0_channel="4", but default is "11"
nvram: wlan0_5g_auto_channel_enable="0", but default is "1"
nvram: dhcpc_enable="0", but default is "1"
nvram: ap_primary_dns="192.168.2.1", but default is "0.0.0.0"
nvram: ap_gateway="192.168.2.50", but default is "0.0.0.0"
nvram: ap_ipaddr="192.168.2.50", but default is "192.168.0.50"
nvram: admin_password="abc123test", but default is ""
nvram: wlan1_enable="0", but default is "1"
nvram: rp_mode="0", but default is "1"
default_val=0
===============DUTinfo_file detail=============
[Type]0x0001[Length]8[Value]DAP-1620
[Type]0x0002[Length]2[Value]A2
[Type]0x0004[Length]1[Value]0
[Type]0x0005[Length]7[Value]1.06b04
[Type]0x0009[Length]17[Value]40:9b:cd:7c:27:ce
[Type]0x000A[Length]17[Value]40:9b:cd:7c:27:ce
[Type]0x000B[Length]17[Value]40:9b:cd:7c:27:d0
[Type]0x000C[Length]4[Value]0x37
[Type]0x0010[Length]10[Value]dlink-27CE
[Type]0x0011[Length]15[Value]dlink-27CE-5GHz
[Type]0x0012[Length]10[Value]ayyce34805
[Type]0x0013[Length]12[Value]abc123test
[Type]0x0014[Length]10[Value]0x849E141B
[Type]0x001A[Length]12[Value]201760101662
[Type]0x000D[Length]9[Value]/var/tmp/
[Type]0x000E[Length][Value]
set_5G_wlan_basic: >>>> wlan0_5g_dfs_enable[0]
set_5G_wlan_basic: A11>>>> forced_enable[0] wlan1_enable[0] current_system_mode[0] wlan0_5g_dfs_enable[0]
set_5G_wlan_basic: A22>>>> wlan1_enable[0] current_system_mode[0]
register rt2860


=== pAd = c0582000, size = 2286352 ===

<-- RTMPAllocTxRxRingMemory, Status=0
<-- RTMPAllocAdapterBlock, Status=0
pAd->CSRBaseAddress =0xc0480000, csr_addr=0xc0480000!
device_id =0x7662
==>rlt_wlan_chip_onoff(): OnOff:1, Reset= 1, pAd->WlanFunCtrl:0x0, Reg-WlanFunCtrl=0x20a
RtmpChipOpsEepromHook::e2p_type=0, inf_Type=5
RtmpEepromGetDefault::e2p_dafault=2
NVM is efuse and the information is too less to bring up the interface
Force to use Flash mode
NVM is FLASH mode (pAd->flash_offset = 0x48000)
get_dev_name_prefix(): dev_idx = 1, dev_name_prefix=rai
===> rt2880_probe


=== pAd = c07b3000, size = 2286352 ===

<-- RTMPAllocTxRxRingMemory, Status=0
<-- RTMPAllocAdapterBlock, Status=0
RtmpChipOpsEepromHook::e2p_type=0, inf_Type=4
RtmpEepromGetDefault::e2p_dafault=2
NVM is FLASH mode (pAd->flash_offset = 0x40000)
get_dev_name_prefix(): dev_idx = 0, dev_name_prefix=ra
ra0: at CSR addr 0xb0180000, IRQ 4.
<=== rt2880_probe
RX[0] DESC a2f35000 size = 4096
RX[1] DESC a2f36000 size = 4096
cfg_mode=9
cfg_mode=9
wmode_band_equal(): Band Equal!
APSDCapable[0]=0
APSDCapable[1]=0
APSDCapable[2]=0
APSDCapable[3]=0
APSDCapable[4]=0
APSDCapable[5]=0
APSDCapable[6]=0
APSDCapable[7]=0
APSDCapable[8]=0
APSDCapable[9]=0
APSDCapable[10]=0
APSDCapable[11]=0
APSDCapable[12]=0
APSDCapable[13]=0
APSDCapable[14]=0
APSDCapable[15]=0
default ApCliAPSDCapable[0]=0
pAd->ed_threshold = 90
pAd->ed_chk = 2
pAd->ed_false_cca_threshold = 3000
IF(ra0) The length of WAPI PSKPassPhrase is invalid(len=0).
1. Phy Mode = 14
Country Region from e2p = ffff
E2PROM: D0 target power=0xff1e
E2PROM: 40 MW Power Delta= 0
2. Phy Mode = 14
3. Phy Mode = 14
AntCfgInit: primary/secondary ant 0/1
D1 = 1, D2 = 3, CalCode = 5 !!!
RT6352_Temperature_Init : BBPR49 = 0x1
RT6352_Temperature_Init : TemperatureRef25C = 0xfffffff7
Current Temperature from BBP_R49=0xfffffff1
 TX BW Filter Calibration !!!
 RX BW Filter Calibration !!!
LOFT Calibration Done!
IQCalibration Start!
IQCalibration Done! CH = 0, (gain= 1, phase=3d)
IQCalibration Start!
IQCalibration Done! CH = 1, (gain= f, phase= 2)
TX IQ Calibration Done!
ChipStructAssign(): RALINK6352 hook !
MCS Set = ff ff 00 00 00
APStartUp(): AP Set CentralFreq at 4(Prim=4, HT-CentCh=4, VHT-CentCh=0, BBP_BW=0)
@@@ ed_monitor_init : ===>
@@@ ed_monitor_init : <===
Main bssid = 40:9b:cd:7c:27:ce
<==== rt28xx_init, Status=0
get_dev_name_prefix(): dev_idx = 0, dev_name_prefix=apcli
RTMPDrvOpen(1):Check if PDMA is idle!
RTMPDrvOpen(2):Check if PDMA is idle!
@@@ ed_monitor_init : ===>
@@@ ed_monitor_init : <===
device ra0 entered promiscuous mode
br0: port 2(ra0) entering forwarding state
br0: port 2(ra0) entering forwarding state
build time =
20141115060606a
rom patch for E3 IC

platform =
ALPS
hw/sw version =
▒▒
patch version =

FW Version:0.0.00 Build:1
Build Time:201507311614____
fw for E3 IC
RX[0] DESC a36a6000 size = 4096
RX[1] DESC a36a7000 size = 4096
cfg_mode=14
cfg_mode=14
wmode_band_equal(): Band Not Equal!
APSDCapable[0]=0
APSDCapable[1]=0
APSDCapable[2]=0
APSDCapable[3]=0
APSDCapable[4]=0
APSDCapable[5]=0
APSDCapable[6]=0
APSDCapable[7]=0
APSDCapable[8]=0
APSDCapable[9]=0
APSDCapable[10]=0
APSDCapable[11]=0
APSDCapable[12]=0
APSDCapable[13]=0
APSDCapable[14]=0
APSDCapable[15]=0
default ApCliAPSDCapable[0]=0
IF(ra0) The length of WAPI PSKPassPhrase is invalid(len=0).
1. Phy Mode = 49
get_chl_grp:illegal channel (167)
get_chl_grp:illegal channel (167)
get_chl_grp:illegal channel (169)
get_chl_grp:illegal channel (169)
get_chl_grp:illegal channel (171)
get_chl_grp:illegal channel (171)
/home/AthSDK/wireless/MT76x2E_24G_5G_v3040P/rlt_wifi_ap/../rlt_wifi/chips/mt76x2.c:2915 assert (ad->TxPower[choffset].Channel == 42)failed
Country Region from e2p = ffff
mt76x2_read_temp_info_from_eeprom:: is_temp_tx_alc=0, temp_tx_alc_enable=0
mt76x2_read_tx_alc_info_from_eeprom:: is_ePA_mode=0, ePA_type=3
mt76x2_read_tx_alc_info_from_eeprom:: [5G band] high_temp_slope=0, low_temp_slope=0
mt76x2_read_tx_alc_info_from_eeprom:: [2G band] high_temp_slope=0, low_temp_slope=0
mt76x2_read_tx_alc_info_from_eeprom:: [5G band] tc_lower_bound=0, tc_upper_bound=0
mt76x2_read_tx_alc_info_from_eeprom:: [2G band] tc_lower_bound=0, tc_upper_bound=0
mt76x2_get_external_lna_gain::LNA type=0x11, BLNAGain=0x0, ALNAGain0=0x0, ALNAGain1=0x0, ALNAGain2=0x0
2. Phy Mode = 49
3. Phy Mode = 49
andes_pci_fw_init
0x1300 = 00073200
AntCfgInit: primary/secondary ant 0/1
andes_load_cr:cr_type(2)
ChipStructAssign(): MT76x2 hook !
MCS Set = ff ff 00 00 01
mt76x2_bbp_adjust():rf_bw=2, ext_ch=1, PrimCh=36, HT-CentCh=38, VHT-CentCh=42
TX0 power compensation = 0x38
TX1 power compensation = 0x38
APStartUp(): AP Set CentralFreq at 42(Prim=36, HT-CentCh=38, VHT-CentCh=42, BBP_BW=2)
mt76x2_calibration(channel = 42)
@@@ ed_monitor_init : ===>
@@@ ed_monitor_init : <===
Main bssid = 40:9b:cd:7c:27:d0
mt76x2_reinit_agc_gain:original agc_vga0 = 0x5c, agc_vga1 = 0x5c
mt76x2_reinit_agc_gain:updated agc_vga0 = 0x5c, agc_vga1 = 0x5c
mt76x2_reinit_hi_lna_gain:original hi_lna0 = 0x27, hi_lna1 = 0x27
mt76x2_reinit_hi_lna_gain:updated hi_lna0 = 0x27, hi_lna1 = 0x27
original vga value(chain0) = 5c
original vga value(chain1) = 5c
<==== rt28xx_init, Status=0
get_dev_name_prefix(): dev_idx = 1, dev_name_prefix=apclii
RTMPDrvOpen(1):Check if PDMA is idle!
RTMPDrvOpen(2):Check if PDMA is idle!
@@@ ed_monitor_init : ===>
@@@ ed_monitor_init : <===
device rai0 entered promiscuous mode
br0: port 3(rai0) entering forwarding state
br0: port 3(rai0) entering forwarding state
device rai0 left promiscuous mode
br0: port 3(rai0) entering forwarding state
@@@ APStop: go to ed_monitor_exit()!!
@@@ ed_monitor_exit : ===>
@@@ ed_monitor_exit : <===
andes_pci_erasefw
==>rlt_wlan_chip_onoff(): OnOff:0, Reset= 0, pAd->WlanFunCtrl:0x20b, Reg-WlanFunCtrl=0x20b

Edimax firmware log:

ASIC 7620_MP (Port5<->Phy)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Mar 21 2016  Time:16:55:00
Cameo Version: v1.00 Build:02
Module Name: D-Link DAP-1620A1
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 580 MHZ ####
 estimate memory size =64 Mbytes
raspi_read: from:50000 len:40
raspi_read: from:4f0000 len:40

=================================================
Check image validation:
Image1 Header Magic Number --> OK
Image2 Header Magic Number --> Failed
Image1 Header Checksum --> OK
Image1 Data Checksum --> raspi_read: from:50040 len:485347


U-Boot 1.1.3 (Mar 21 2016 - 16:55:00)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb0000
enable ephy clock...done. rf reg 29 = 5
SSC disabled.
spi_wait_nsec: 29
spi device id: c2 20 17 c2 20 (2017c220)
find flash: MX25L6405D
raspi_read: from:30000 len:1000
*** Warning - bad CRC, using default environment

============================================
Ralink UBoot Version: 4.1.1.0
--------------------------------------------
ASIC 7620_MP (Port5<->Phy)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Mar 21 2016  Time:16:55:00
Cameo Version: v1.00 Build:02
Module Name: D-Link DAP-1620A1
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 580 MHZ ####
 estimate memory size =64 Mbytes
raspi_read: from:50000 len:40
raspi_read: from:4f0000 len:40

=================================================
Check image validation:
Image1 Header Magic Number --> OK
Image2 Header Magic Number --> Failed
Image1 Header Checksum --> OK
Image1 Data Checksum --> raspi_read: from:50040 len:485347
OK

Image1: OK Image2: Broken
Only Image2 is borken!!

=================================================

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.                     0

3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
   Image Name:   MIPS OpenWrt Linux-5.4.60
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4739911 Bytes =  4.5 MB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:50040 len:485347
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 64

Starting kernel ...

[    0.000000] Linux version 5.4.60 (roman@buntu18) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r14257-e12ac40552)) #0 Tue Aug 25 12:12:51 2020
[    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 MT7620A ver:2 eco:6
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Edimax EW-7478AC
[    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-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=0006e6ee
[    0.000000] Readback ErrCtl register=0006e6ee
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 54868K/65536K available (4576K kernel code, 200K rwdata, 1024K rodata, 3920K init, 205K bss, 10668K 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] random: get_random_bytes called from start_kernel+0x32c/0x518 with crng_init=0
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000011] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015472] Calibrating delay loop... 385.02 BogoMIPS (lpj=770048)
[    0.059576] pid_max: default: 32768 minimum: 301
[    0.068951] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.083357] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.106319] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.125627] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.139244] pinctrl core: initialized pinctrl subsystem
[    0.150159] NET: Registered protocol family 16
[    0.643372] PCI host bridge /pcie@10140000 ranges:
[    0.652767]  MEM 0x0000000020000000..0x000000002fffffff
[    0.663140]   IO 0x0000000010160000..0x000000001016ffff
[    0.695988] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.707043] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.719627] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.730635] rt2880_gpio 10000638.gpio: registering 16 irq handlers
[    0.743231] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.754240] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.767346] PCI host bridge to bus 0000:00
[    0.775398] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.789015] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.800786] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.814285] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.830078] pci 0000:00:00.0: [1814:0801] type 01 class 0x060400
[    0.842008] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    0.854445] pci 0000:00:00.0: reg 0x14: [mem 0x00000000-0x0000ffff]
[    0.866981] pci 0000:00:00.0: supports D1
[    0.874861] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.888930] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.904943] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
[    0.916828] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[    0.930288] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.943685] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    0.958338] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.971391] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.984540] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.997666] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    1.011513] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    1.025015] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    1.039377] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    1.052889] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    1.067435] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    1.081780] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.091645] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    1.105142] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    1.119612] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    1.144342] clocksource: Switched to clocksource systick
[    1.156249] NET: Registered protocol family 2
[    1.165733] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.182300] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    1.197467] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    1.211481] TCP: Hash tables configured (established 1024 bind 1024)
[    1.224264] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.237169] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.251318] NET: Registered protocol family 1
[    1.259957] PCI: CLS 0 bytes, default 32
[    1.712338] random: fast init done
[    6.539917] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    6.554108] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    6.575385] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    6.586895] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    6.624033] rt2880-pinmux pinctrl: pin 17 is not set to gpio mux
[    6.635928] rt2880-pinmux pinctrl: request() failed for pin 17
[    6.647441] rt2880-pinmux pinctrl: pin-17 (pio:17) status -22
[    6.658894] rt2880-pinmux pinctrl: pin 18 is not set to gpio mux
[    6.670808] rt2880-pinmux pinctrl: request() failed for pin 18
[    6.682401] rt2880-pinmux pinctrl: pin-18 (pio:18) status -22
[    6.693856] rt2880-pinmux pinctrl: pin 19 is not set to gpio mux
[    6.705769] rt2880-pinmux pinctrl: request() failed for pin 19
[    6.717366] rt2880-pinmux pinctrl: pin-19 (pio:19) status -22
[    6.728816] rt2880-pinmux pinctrl: pin 20 is not set to gpio mux
[    6.740730] rt2880-pinmux pinctrl: request() failed for pin 20
[    6.752323] rt2880-pinmux pinctrl: pin-20 (pio:20) status -22
[    6.763779] rt2880-pinmux pinctrl: pin 21 is not set to gpio mux
[    6.775691] rt2880-pinmux pinctrl: request() failed for pin 21
[    6.787284] rt2880-pinmux pinctrl: pin-21 (pio:21) status -22
[    6.798742] rt2880-pinmux pinctrl: pin 24 is not set to gpio mux
[    6.810651] rt2880-pinmux pinctrl: request() failed for pin 24
[    6.822246] rt2880-pinmux pinctrl: pin-24 (pio:24) status -22
[    6.833700] rt2880-pinmux pinctrl: pin 25 is not set to gpio mux
[    6.845613] rt2880-pinmux pinctrl: request() failed for pin 25
[    6.857207] rt2880-pinmux pinctrl: pin-25 (pio:25) status -22
[    6.868660] rt2880-pinmux pinctrl: pin 26 is not set to gpio mux
[    6.880574] rt2880-pinmux pinctrl: request() failed for pin 26
[    6.892167] rt2880-pinmux pinctrl: pin-26 (pio:26) status -22
[    6.903622] rt2880-pinmux pinctrl: pin 27 is not set to gpio mux
[    6.915535] rt2880-pinmux pinctrl: request() failed for pin 27
[    6.927129] rt2880-pinmux pinctrl: pin-27 (pio:27) status -22
[    6.938583] rt2880-pinmux pinctrl: pin 28 is not set to gpio mux
[    6.950496] rt2880-pinmux pinctrl: request() failed for pin 28
[    6.962090] rt2880-pinmux pinctrl: pin-28 (pio:28) status -22
[    6.973518] gpio-export gpio-export: 7 gpio(s) exported
[    6.984205] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    6.997889] printk: console [ttyS0] disabled
[    7.006365] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    7.026002] printk: console [ttyS0] enabled
[    7.026002] printk: console [ttyS0] enabled
[    7.042590] printk: bootconsole [early0] disabled
[    7.042590] printk: bootconsole [early0] disabled
[    7.068566] spi spi0.0: force spi mode3
[    7.077232] spi-nor spi0.0: mx25l6405d (8192 Kbytes)
[    7.087248] 5 fixed-partitions partitions found on MTD device spi0.0
[    7.099911] Creating 5 MTD partitions on "spi0.0":
[    7.109467] 0x000000000000-0x000000030000 : "u-boot"
[    7.120506] 0x000000030000-0x000000040000 : "u-boot-env"
[    7.132109] 0x000000040000-0x000000050000 : "factory"
[    7.143313] 0x000000050000-0x000000070000 : "cimage"
[    7.154276] 0x000000070000-0x000000800000 : "firmware"
[    7.553313] libphy: Fixed MDIO Bus: probed
[    7.570519] gsw: setting port4 to ephy mode
[    7.583232] libphy: mdio: probed
[    7.589748] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[    7.602981] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    7.615506] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    7.632529] rt2880_wdt 10000120.watchdog: Initialized
[    7.644173] NET: Registered protocol family 10
[    7.657793] Segment Routing with IPv6
[    7.665322] NET: Registered protocol family 17
[    7.674261] 8021q: 802.1Q VLAN Support v1.8
[    7.706550] Freeing unused kernel memory: 3920K
[    7.715610] This architecture does not have kernel memory protection.
[    7.728441] Run /init as init process
[    7.751969] init: Console is alive
[    7.759185] init: - watchdog -
[    7.790530] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    7.815544] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.833265] init: - preinit -
[    8.116949] random: jshn: uninitialized urandom read (4 bytes read)
[    8.215515] random: jshn: uninitialized urandom read (4 bytes read)
[    8.297758] random: jshn: uninitialized urandom read (4 bytes read)
[    8.577357] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[    8.593779] 8021q: adding VLAN 0 to HW filter on device eth0
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.185567] mtk_soc_eth 10100000.ethernet eth0: port 5 link down
[    9.210097] procd: - early -
[    9.216059] procd: - watchdog -
[    9.335925] procd: - watchdog -
[    9.342686] procd: - ubus -
[    9.357158] urandom_read: 5 callbacks suppressed
[    9.357168] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.382317] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.396725] procd: - init -
Please press Enter to activate this console.
[    9.997380] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.057420] Loading modules backported from Linux version v5.8-0-gbcf876870b95
[   10.071894] Backport generated by backports.git v5.8-1-0-g79400d9e
[   10.160410] xt_time: kernel timezone is -0000
[   10.332859] PPP generic driver version 2.4.2
[   10.354805] NET: Registered protocol family 24
[   10.461613] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "factory"
[   10.476101] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[   10.491568] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 7620 detected
[   10.545918] urngd: jent-rng init failed, err: 2
[   10.582078] kmodloader: done loading kernel modules from /etc/modules.d/*
[   15.775583] random: crng init done



BusyBox v1.31.1 () built-in shell (ash)

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

Great to see efforts on supporting this device :grinning:
I have a few of these, but am currently focusing on ath79 devices, so bear with me if I'm not familiar with all the details of the ramips target.

Since you have serial access to the device, getting the flash layout correct and 2.4G wifi to work is probably the best thing to try first. Since the built-in switch of MT7620 supports 10/100M only, they must be using an external Ethernet phy for 1000M here, so the default settings for most of the mt7620-based routers (using the internal switch) will not apply for this device. (Instead, you would configure the mt7620 gmac to rgmii mode and also specify the mdio bus address of the phy in the dts... So, wifi is probably easier to begin with :wink:)

Could you provide the current state of your .dts and makefile?

Looking at the OEM bootlog, your dts node for the flash layout should probably look something like this: (not sure about spi-max-frequency and the uimage compatible string though; is the DAP-1620 based on edimax devices?)

&spi {
	status = "okay";

	num-cs = <1>;

	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 = "u-boot-env";
				reg = <0x30000 0x10000>;
				read-only;
			};

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

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

			partition@4e0000 {
				label = "lang";
				reg = <0x4e0000 0x10000>;
				read-only;
			};

			partition@4f0000 {
				label = "linux4b";
				reg = <0x4f0000 0xd0000>;
				read-only;
			};

			partition@5c0000 {
				label = "rootfsb";
				reg = <0x5c0000 0x240000>;
				read-only;
			};
		};
	};
};

I think it's better to start with Flash layout , because I have :

root@OpenWrt:/overlay# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00001000 "u-boot"
mtd1: 00010000 00001000 "u-boot-env"
mtd2: 00010000 00001000 "factory"
mtd3: 007b0000 00001000 "firmware"
root@OpenWrt:/overlay# df -h
Filesystem                Size      Used Available Use% Mounted on
tmpfs                    29.3M     56.0K     29.3M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev

I found 5 GPIO still can't figure out the buttons and ethernet.
here is the dts:

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

/dts-v1/;

#include "mt7620a.dtsi"

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

/ {
	compatible = "dlink,dap-1620", "ralink,mt7620a-soc";
	model = "Dlink DAP-1620";
	leds {
		compatible = "gpio-leds";

		led_power: power {
			label = "dap-1620:green:power";
			gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
		};

		lan {
			label = "dap-1620:green:lan";
			gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
		};

		wlan2g {
			label = "dap-1620:blue:wlan2g";
			gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy1radio";
		};

		wlan5g {
			label = "dap-1620:blue:wlan5g";
			gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0radio";
		};

		wps {
			label = "dap-1620:green:wps";
			gpios = <&gpio2 9 GPIO_ACTIVE_LOW>;
		};
	};
};

Maybe I was wrong to assume nvram refers to uboot environment variables, since the OEM bootlog has several entries about configuration (e.g. wifi SSID) related to "nvram", so maybe that's were the manufacturer will store the device configuration :thinking:

I'm not sure if Factory partition can be oerwritten, the OEM bootlog says

## Booting image at bc050000 ...

so 0x50000 is probably where the kernel image should be located in the flash, i.e. at the end of factory.

Regarding Ethernet, this device contains an rtl8211e phy, so you might want to have a look at other devices e.g. rt3883_trendnet_tew-691gr.dts or mt7620a_dlink_dwr-118-a2.dts, maybe the &ethernet node can just be copied.

Best candidate is Edimax ew-7476 but it has completly different flash layout .

How did you upload the initramfs images, is there any way to boot via tftp?

Or could the image be flashed via the recovery http loader (I'm not sure about the image format of the firmware offered by D-Link, this does not look like the edimax format)?

While booting, there is no chance to interrupt u-boot, it has option 3 (boot from flash) selected with no timeout to change boot mode...

You can interupt u-boot during booting press 2 and after flash mt7620 initramfs-kernel from tftp, if we install edimax bootloader I think we can get rid of dual images for d-link but for now I didn't find u-boot or fullflash for edimax.

No luck accessing uboot by pressing 2 :thinking:

Maybe we have different versions of the device (mine says H/W Ver. A1 F/W Ver. 1.01), or my uart connection is broken, but there's also no boot countdown, it will select option 3 without any delay.

Information I have currently collected on this device:

Feel free to test / base your dts on this / ... I'll hopefully find the time to continue testing tomorrow.

Still wondering what's in the factory partition though, hopefully MAC addresses...

Could you try to hexdump the flash starting at 0x40000 ? Though I'm not sure how to access the partition from initramfs-images, since there are no mtd partitions for the flash...

The second image seems to be the recovery, though this is usually done only for devices without ethernet port (e.g. DAP-1320, DCH-M225, ...) where they can't use wifi from uboot; so I would rather keep that untouched, even though it wastes a lot of space, just leaving 4.7 MiB for the actual OpenWRT image.

My revision is also A1 (I don't think there is any other revision) I press 2 even before the prompt,
this are correct gpio for leds:

leds {
		compatible = "gpio-leds";

		led_power: power {
			label = "dap-1620:green:power";
			gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
		};

		lan {
			label = "dap-1620:green:lan";
			gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
		};

		wlan2g {
			label = "dap-1620:blue:wlan2g";
			gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy1radio";
		};

		wlan5g {
			label = "dap-1620:blue:wlan5g";
			gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0radio";
		};

		wps {
			label = "dap-1620:green:wps";
			gpios = <&gpio2 9 GPIO_ACTIVE_LOW>;
		};

There is also led for ethernet but I think it turns on when enternet is active . for the flash layout I have no idea where to look for mac and calibration.

bootlog after some dts changes:

U-Boot 1.1.3 (Mar 21 2016 - 16:55:00)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb0000
enable ephy clock...done. rf reg 29 = 5
SSC disabled.
******************************
Software System Reset Occurred
******************************
spi_wait_nsec: 29
spi device id: c2 20 17 c2 20 (2017c220)
find flash: MX25L6405D
raspi_read: from:30000 len:1000
*** Warning - bad CRC, using default environment

============================================
Ralink UBoot Version: 4.1.1.0
--------------------------------------------
ASIC 7620_MP (Port5<->Phy)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Mar 21 2016  Time:16:55:00
Cameo Version: v1.00 Build:02
Module Name: D-Link DAP-1620A1
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 580 MHZ ####
 estimate memory size =64 Mbytes
raspi_read: from:50000 len:40
raspi_read: from:4f0000 len:40

=================================================
Check image validation:
Image1 Header Magic Number --> OK
Image2 Header Magic Number --> Failed
Image1 Header Checksum --> OK
Image1 Data Checksum --> raspi_read: from:50040 len:48a827
OK

Image1: OK Image2: Broken
Only Image2 is borken!!

=================================================

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.                                                           0

3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
   Image Name:   MIPS OpenWrt Linux-5.4.60
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4761639 Bytes =  4.5 MB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:50040 len:48a827
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 64

Starting kernel ...

[    0.000000] Linux version 5.4.60 (roman@buntu18) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r14267-18fbb9aa21)) #0 Tue Aug 25 18:54:24 2020
[    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 MT7620A ver:2 eco:6
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Dlink DAP-1620
[    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-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=0007e4e0
[    0.000000] Readback ErrCtl register=0007e4e0
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 54880K/65536K available (4576K kernel code, 200K rwdata, 1024K rodata, 3920K init, 205K bss, 10656K 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] random: get_random_bytes called from start_kernel+0x32c/0x518 with crng_init=0
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000011] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015472] Calibrating delay loop... 385.02 BogoMIPS (lpj=770048)
[    0.059579] pid_max: default: 32768 minimum: 301
[    0.068955] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.083359] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.105428] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.124738] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.138344] pinctrl core: initialized pinctrl subsystem
[    0.149257] NET: Registered protocol family 16
[    0.420360] PCI host bridge /pcie@10140000 ranges:
[    0.429757]  MEM 0x0000000020000000..0x000000002fffffff
[    0.440129]   IO 0x0000000010160000..0x000000001016ffff
[    0.472804] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.483860] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.496422] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.507429] rt2880_gpio 10000638.gpio: registering 16 irq handlers
[    0.520047] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.531060] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.543675] rt2880_gpio 10000688.gpio: registering 1 gpios
[    0.554509] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[    0.567423] PCI host bridge to bus 0000:00
[    0.575474] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.589092] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.600862] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.614361] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.630155] pci 0000:00:00.0: [1814:0801] type 01 class 0x060400
[    0.642085] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    0.654522] pci 0000:00:00.0: reg 0x14: [mem 0x00000000-0x0000ffff]
[    0.667059] pci 0000:00:00.0: supports D1
[    0.674938] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.688410] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.704443] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
[    0.716334] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[    0.729789] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.743187] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    0.757155] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.770206] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.783357] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.796483] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.810330] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.823832] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.838194] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.851705] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.866251] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.880596] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.890462] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.903960] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.918435] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.943710] clocksource: Switched to clocksource systick
[    0.955609] NET: Registered protocol family 2
[    0.965095] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.981663] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.996824] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    1.010844] TCP: Hash tables configured (established 1024 bind 1024)
[    1.023623] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.036531] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.050710] NET: Registered protocol family 1
[    1.059342] PCI: CLS 0 bytes, default 32
[    1.531697] random: fast init done
[    6.373100] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    6.387398] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    6.408680] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    6.420189] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    6.456530] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    6.470309] printk: console [ttyS0] disabled
[    6.478783] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    6.498421] printk: console [ttyS0] enabled
[    6.498421] printk: console [ttyS0] enabled
[    6.515001] printk: bootconsole [early0] disabled
[    6.515001] printk: bootconsole [early0] disabled
[    6.539428] spi spi0.0: force spi mode3
[    6.548166] spi-nor spi0.0: mx25l6405d (8192 Kbytes)
[    6.558182] 7 fixed-partitions partitions found on MTD device spi0.0
[    6.570846] Creating 7 MTD partitions on "spi0.0":
[    6.580404] 0x000000000000-0x000000030000 : "u-boot"
[    6.591373] 0x000000030000-0x000000040000 : "u-boot-env"
[    6.603016] 0x000000040000-0x000000050000 : "factory"
[    6.614160] 0x000000050000-0x0000004e0000 : "firmware"
[    6.628764] 0x0000004e0000-0x0000004f0000 : "lang"
[    6.639469] 0x0000004f0000-0x0000005c0000 : "linux4b"
[    6.650611] 0x0000005c0000-0x000000800000 : "rootfsb"
[    6.662686] libphy: Fixed MDIO Bus: probed
[    6.681729] gsw: setting port4 to ephy mode
[    6.690580] libphy: mdio: probed
[    6.723242] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    6.735879] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    6.752883] rt2880_wdt 10000120.watchdog: Initialized
[    6.764535] NET: Registered protocol family 10
[    6.778340] Segment Routing with IPv6
[    6.785855] NET: Registered protocol family 17
[    6.794806] 8021q: 802.1Q VLAN Support v1.8
[    6.826995] Freeing unused kernel memory: 3920K
[    6.836055] This architecture does not have kernel memory protection.
[    6.848886] Run /init as init process
[    6.872739] init: Console is alive
[    6.879964] init: - watchdog -
[    6.910986] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.933017] rt2880-pinmux pinctrl: pin 53 is not set to gpio mux
[    6.945083] rt2880-pinmux pinctrl: request() failed for pin 53
[    6.956712] rt2880-pinmux pinctrl: pin-53 (pio:53) status -22
[    6.968188] leds-gpio: probe of leds failed with error -22
[    6.980184] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    6.996623] init: - preinit -
[    7.239708] random: jshn: uninitialized urandom read (4 bytes read)
[    7.338038] random: jshn: uninitialized urandom read (4 bytes read)
[    7.373180] random: jshn: uninitialized urandom read (4 bytes read)
[    7.579509] 8021q: adding VLAN 0 to HW filter on device eth0
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    8.175006] procd: - early -
[    8.180964] procd: - watchdog -
[    8.310062] procd: - watchdog -
[    8.316730] procd: - ubus -
[    8.331262] urandom_read: 5 callbacks suppressed
[    8.331273] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.356383] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.370754] procd: - init -
Please press Enter to activate this console.
[    8.964615] kmodloader: loading kernel modules from /etc/modules.d/*
[    9.027482] Loading modules backported from Linux version v5.8-0-gbcf876870b95
[    9.041947] Backport generated by backports.git v5.8-1-0-g79400d9e
[    9.127873] xt_time: kernel timezone is -0000
[    9.273595] mt76x2e 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[    9.286229] mt76x2e 0000:01:00.0: ASIC revision: 76120044
[    9.370270] urngd: jent-rng init failed, err: 2
[    9.441198] mt76x2e 0000:01:00.0: ROM patch build: 20141115060606a
[    9.458381] mt76x2e 0000:01:00.0: Firmware Version: 0.0.00
[    9.469362] mt76x2e 0000:01:00.0: Build: 1
[    9.477524] mt76x2e 0000:01:00.0: Build Time: 201507311614____
[    9.494538] mt76x2e 0000:01:00.0: Firmware running!
[    9.560053] PPP generic driver version 2.4.2
[    9.579645] NET: Registered protocol family 24
[    9.669675] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "factory"
[    9.684165] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[    9.735788] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 7620 detected
[    9.785096] kmodloader: done loading kernel modules from /etc/modules.d/*
[   14.933744] random: crng init done
[   39.804570] 8021q: adding VLAN 0 to HW filter on device eth0
[   39.830148] br-lan: port 1(eth0) entered blocking state
[   39.840625] br-lan: port 1(eth0) entered disabled state
[   39.851472] device eth0 entered promiscuous mode



BusyBox v1.31.1 () built-in shell (ash)

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

ok, both wireless working , ui also working fast now need flash and ethernet.

change dts partition layout:

&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 = "u-boot-env";
				reg = <0x30000 0x10000>;
				read-only;
			};

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

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0xf0000>;
			};
			
			partition@140000 {
				compatible = "denx,uimage";
				label = "rootfs";
				reg = <0x140000 0x3a0000>;
			};
			partition@4e0000 {
				label = "lang";
				reg = <0x4e0000 0x10000>;
				read-only;
			};

			partition@4f0000 {
				compatible = "denx,uimage";
				label = "linux4b";
				reg = <0x4f0000 0xd0000>;
			};

			partition@5c0000 {
			    compatible = "denx,uimage";
				label = "rootfsb";
				reg = <0x5c0000 0x240000>;
			};
		};
	};
};

now during the boot:

[    6.522089] spi spi0.0: force spi mode3
[    6.530749] spi-nor spi0.0: mx25l6405d (8192 Kbytes)
[    6.540777] 8 fixed-partitions partitions found on MTD device spi0.0
[    6.553440] Creating 8 MTD partitions on "spi0.0":
[    6.562997] 0x000000000000-0x000000030000 : "u-boot"
[    6.573962] 0x000000030000-0x000000040000 : "u-boot-env"
[    6.585624] 0x000000040000-0x000000050000 : "factory"
[    6.596850] 0x000000050000-0x000000140000 : "firmware"
[    6.626987] 0x000000140000-0x0000004e0000 : "rootfs"
[    6.637971] mtd: device 4 (rootfs) set to be root filesystem
[    6.650265] mtdsplit: no squashfs found in "rootfs"
[    6.720852] 0x0000004e0000-0x0000004f0000 : "lang"
[    6.731499] 0x0000004f0000-0x0000005c0000 : "linux4b"
[    6.758064] 0x0000005c0000-0x000000800000 : "rootfsb"

Still looking the way to mount rootfs and enable Ethernet.

Usually a single firmware partition is used with OpenWRT that contains kernel + rootfs, i.e. the rootfs partition will occupy the remaining free space after the kernel (this prevents wasting space from zero-padding the kernel image and it allows for bigger kernels than the oem firmware).

The firmware partition is less than 1 MiB in the oem layout, which would not suffice for current kernels. So, at the moment it seems you flashed the initramfs image to 0x50000, and mtd tries to mount rootfs at 0x140000, but there is no start of rootfs there, just the remainder of the kernel image.

The compatible = "denx,uimage"; string lets mtdsplit know that this is a combined kernel + rootfs partition with flexible layout.

For the leds, we should probably also consider rssileds, as e.g. in DAP-1330.

Besides, I only just realized that for the A1 revision, there is no special OEM image format required, it's just the uimage :slightly_smiling_face: (this device seems to be based on TrendNet like other D-Link ramips devices, e.g. DIR-810L)

I will try flashing mine later, as soon as I get home.

When I use:

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0x480000>;
				read-only;
			};

It doesn't even find root partition:

[    6.761092] spi spi0.0: force spi mode3
[    6.769762] spi-nor spi0.0: mx25l6405d (8192 Kbytes)
[    6.779787] 7 fixed-partitions partitions found on MTD device spi0.0
[    6.792451] Creating 7 MTD partitions on "spi0.0":
[    6.802006] 0x000000000000-0x000000030000 : "u-boot"
[    6.812975] 0x000000030000-0x000000040000 : "u-boot-env"
[    6.824635] 0x000000040000-0x000000050000 : "factory"
[    6.835790] 0x000000050000-0x0000004e0000 : "firmware"
[    6.850428] 0x0000004e0000-0x0000004f0000 : "lang"
[    6.861104] 0x0000004f0000-0x0000005c0000 : "linux4b"
[    6.887629] 0x0000005c0000-0x000000800000 : "rootfsb"
[    6.938779] libphy: Fixed MDIO Bus: probed

maybe other variants ?

Maybe there is no explicit output from mtd when booting initramfs (as it shouldn't mount anything in the first place), I just went for trying to flash an image....

But so much for trying not to overwrite the recovery partition:

WARNING: Image file /home/sebastian/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/tmp/openwrt-ramips-mt7620-dlink_dap-1620-a1-squashfs-sysupgrade.bin is too big: 4981546 > 4784128

Building without LuCI, ath10k and IPv6 now, let's see if this could still be supported with this little flash...
I really wonder why they chose a full linux recovery here instead of uboot, this is usually only done with devices that have no ethernet...
Probably because they had trouble to implement initialisation of the gigabit phy in uboot!?

However there seems to be another recovery option in uboot, accessible when shorting the spi-nor data pins while it reads the image... (it printed some eth initialisation stuff to the serial console, but no luck accessing that at 192.168.0.50, not even with 100Base-T)

I don't think there is sense to keep recovry partition, I think uboot can survive without it, but still confused with mounting of rootfs.

Indeed, it will successfully detect the firmware partitions at 0x50000 during boot: :wink:

[    1.218799] spi spi0.0: force spi mode3
[    1.227490] spi-nor spi0.0: mx25l6405d (8192 Kbytes)
[    1.237510] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.250175] Creating 7 MTD partitions on "spi0.0":
[    1.259731] 0x000000000000-0x000000030000 : "u-boot"
[    1.270709] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.282379] 0x000000040000-0x000000050000 : "factory"
[    1.293543] 0x000000050000-0x0000004e0000 : "firmware"
[    1.307903] 2 uimage-fw partitions found on MTD device firmware
[    1.319768] Creating 2 MTD partitions on "firmware":
[    1.329676] 0x000000000000-0x0000001bb9b4 : "kernel"
[    1.340656] 0x0000001bb9b4-0x000000490000 : "rootfs"
[    1.351626] mtd: device 5 (rootfs) set to be root filesystem
[    1.364601] 1 squashfs-split partitions found on MTD device rootfs
[    1.377006] 0x0000003f9000-0x000000490000 : "rootfs_data"
[    1.388835] 0x0000004e0000-0x0000004f0000 : "lang"
[    1.399549] 0x0000004f0000-0x0000005c0000 : "linux4b"
[    1.410736] 0x0000005c0000-0x000000800000 : "rootfsb"

Curiously, the sysupgrade image format is the same as for DAP-1320 Rev. C (not officially supported due to lack of ethernet port):

  1. append string ffff (4 ascii 'f' bytes, i.e. 0x60606060) to the sysupgrade image
  2. generate md5sum of this salted image
  3. replace ffff with ascii md5 sum
  4. append string MT76XMT7620-RP-150116-NA
  5. flash via D-Link Web UI :slightly_smiling_face:

A Makefile rule for append-md5sum-ascii-salted can be found here, feel free to use this for your Pull Request:

We'd still have to make sure the user has a chance to revert back to the D-Link firmware if they want (for whatever reason), however if overwriting is the only way to have this device officially supported in terms of image size, the maintainers might probably agree to overwrite it.