Flash Chip on Asus RT-AC51U

Ok
After change work.
RAM-256Kb Clock/4

U-Boot 1.1.3 (Nov  4 2020 - 17:39:25)

Board: MediaTek APSoC DRAM: 32 MB
enable ephy clock...done. SSC disabled.
MediaTek SPI flash driver, SPI clock: 24MHz
spi device id: ef 40 18 0 0 (40180000)
find flash: W25Q128FV
*** Warning - bad CRC, using default environment

============================================
MediaTek U-Boot Version: 5.0.1.0-6
--------------------------------------------
ASIC 7620_MP (Port5<->None)
DRAM component: 256 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 32 MBytes
Flash component: SPI Flash
Date:Nov  4 2020  Time:17:39:25
============================================
icache: sets:512, ways:4, linesz:32, total:65536
dcache: sets:256, ways:4, linesz:32, total:32768

 #### The CPU freq = 290 MHZ ####
 estimate memory size = 32 Mbytes

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: Enter boot command line interface.
   5: Load system code then write to Flash via USB Storage.
   9: Load U-Boot code then write to Flash via TFTP.

You choosed 3

 0


3: System Boot system code via Flash.
## Checking image at bc050000 ...
Bad Magic Number,FFFFFFFF

## Enter to Rescue Mode (image error) ##

 NetTxPacket = 0x81FB4000

 KSEG1ADDR(NetTxPacket) = 0xA1FB4000

 NetLoop,call eth_halt !

 NetLoop,call eth_init !
Trying eth2

 ETH_STATE_ACTIVE!!

Our IP address is:(192.168.1.1)
Wait for TFTP request...
D D

clock/3 work

Clock/2 and 28 multi ratio Work.

But seems TFTP not work.

TFTP not work, but aftger some enabling, http work

Trying, via http, with your files, do not work.
fullflash-asus.bin 16.384Kb
fullflash-padavan.bin 16.384Kb

Can you give me only fimware, without uboot ?

         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #######################################
         #############################

HTTP upload is done! Upgrading...


****************************
*    FIRMWARE UPGRADING    *
* DO NOT POWER OFF DEVICE! *
****************************

Abort: image size larger than 16449536!

*** ERROR: HTTP ugrade failed!

Tftp recovery works but this uboot start tftp server on router side so you need start tftp client on computer side. In file readme:

                             FEATURES

1. Press and hold the RESET button on Power-On: switch to Recovery mode. Use TFTP
   client or ASUS Firmware Restoration (device IP-address is 192.168.1.1). Also support
   Recovery from USB storage (not for all devices).
2. Press and hold the WPS button on Power-On: perform erase 'Config' partition (U-Boot
   Env & NVRAM) and self-reboot.

These files aren't intended for uboot recovery. Only for direct flashing with external programmer.
To get firmware see this message

Tanks Serge.
I'll try

About wifi map.
Can you give me it, and method for joint with uboot ?

But about 5ghz
I have not MT7610 chip on board.
I want to use USB key with MT7610
Can be same map and build ?

I have downloaded bin file.
Now uboot.bin is 159605 Byte (Need 196605byte)
MT7620_AP_2T2R-4L_internal_LNA_internal_PA_V15.bin is 512 byte (need 65535byte)
MT7610E-V10-FEM.bin is 512 byte (need 65535byte)

I have to add byte after, and add map, then add byte, then copy map ?

Padvan firmware, right upload, but do not work.

Maybe RAM do not Enought ?
I was wrong to put only 256Mbit, I do not know if I can change, is BGA.

You can overwrite any part of full flash dump (e.g. fullflash-asus.bin) with command:

  1. uboot (uboot.bin is your compiled uboot image file):
dd if=uboot.bin of=fullflash-asus.bin bs=1 seek=0 conv=notrunc
  1. Wifi calibration data (0x40000 = 262144):
dd if=MT7620_AP_2T2R-4L_internal_LNA_internal_PA_V15.bin of=fullflash-asus.bin bs=1 seek=262144 conv=notrunc

and so on.
If no mt7610e don't add MT7610E-V10-FEM.bin. If you use usb mt7610u no need MT7610E-V10-FEM.bin too.

I don't understand what you mean but see above method.

As you can see in bootlog:

MediaTek SoC: MT7620A, RevID: 0206, RAM: DDR2, XTAL: 20MHz
CPU/OCP/SYS frequency: 600/200/200 MHz
CPU revision is: 00019650 (MIPS 24KEc)
Determined physical RAM map:
 memory: 04000000 @ 00000000 (usable)

padavan firmware was compiled with incompatible settings (frequencies and memory). At least you need to recompile padavan firmware with your parameters.
BTW padavan and asus firmware don't support usb wifi adapters.
Usb wifi adapter may be used in openwrt.
Can you try this openwrt image for test?

After 200 seconds the LED stops flashing and the console never starts.
I thought only uboot would define the clock setup and memory.

[    4.499732] 8021q: adding VLAN 0 to HW filter on device eth0
[    4.526723] random: procd: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    5.840670] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[    5.884774] urandom-seed: Seed file not found (/etc/urandom.seed)
[    6.016752] procd: - early -
[    6.022709] procd: - watchdog -
[    6.492834] procd: - watchdog -
[    6.499510] procd: - ubus -
[    6.708446] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.800718] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.814086] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.828002] procd: - init -
Please press Enter to activate this console.
[    7.683696] kmodloader: loading kernel modules from /etc/modules.d/*
[    7.890276] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    7.922879] Loading modules backported from Linux version v4.19.120-0-gfdc072324f3c
[    7.938214] Backport generated by backports.git v4.19.120-1-0-g60c3a249
[    7.986319] ip_tables: (C) 2000-2006 Netfilter Core Team
[    8.022532] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[    8.171633] xt_time: kernel timezone is -0000
[    8.224981] urngd: jent-rng init failed, err: 2
[    8.273711] PPP generic driver version 2.4.2
[    8.285188] NET: Registered protocol family 24
[    8.322761] ieee80211 phy0: rt2x00lib_request_eeprom_file: Info - Loading EEPROM data from 'soc_wmac.eeprom'.
[    8.343680] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[    8.359170] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 7620 detected
[    8.383918] kmodloader: done loading kernel modules from /etc/modules.d/*
[   45.456380] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   45.504185] jffs2_build_filesystem(): unlocking the mtd device...
[   45.504262] done.
[   45.520446] jffs2_build_filesystem(): erasing all blocks after the end marker...
[   46.017313] 8021q: adding VLAN 0 to HW filter on device eth0
[   46.129706] br-lan: port 1(eth0.1) entered blocking state
[   46.140570] br-lan: port 1(eth0.1) entered disabled state
[   46.151733] device eth0.1 entered promiscuous mode
[   46.161331] device eth0 entered promiscuous mode
[   46.297599] br-lan: port 1(eth0.1) entered blocking state
[   46.308434] br-lan: port 1(eth0.1) entered forwarding state
[   46.319788] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   47.043773] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  124.753345] random: crng init done
[  124.760135] random: 6 urandom warning(s) missed due to ratelimiting
[  193.620696] done.
[  193.624613] jffs2: notice: (1201) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  193.868806] overlayfs: upper fs does not support tmpfile.

openwrt first boot take long time because of making new flash filesystem.

Padavan firmware is highly optimized. It allow to change clocks too.
memory size can be forced in any kernel config.
I see that no start of bootlog. What is your uboot tty console speed? 115200 or 57600? I can correct linux kernel console speed to match speed of uboot.

Yesterday I redid uboot to 115200 because padvan was 57600
Today 115200 not math openwrt.
I have to put adapter after boot or crash terminal.
If it need I rebuild uboot for 57600, but what is for ??

I want see all bootlog.
I've rebuilt openwrt with console speed 115200. Pls reload and reflash.

This firts boot.
Now i send you secondo boot.
Consolle do not start.

Done!
HTTP ugrade is done! Rebooting...



U-Boot 1.1.3 (Nov  5 2020 - 12:05:10)

Board: MediaTek APSoC DRAM: 32 MB
enable ephy clock...done. SSC disabled.
******************************
Software System Reset Occurred
******************************
MediaTek SPI flash driver, SPI clock: 46MHz
spi device id: ef 40 18 0 0 (40180000)
find flash: W25Q128FV
*** Warning - bad CRC, using default environment

============================================
MediaTek U-Boot Version: 5.0.1.0-6
--------------------------------------------
ASIC 7620_MP (Port5<->None)
DRAM component: 256 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 32 MBytes
Flash component: SPI Flash
Date:Nov  5 2020  Time:12:05:10
============================================
icache: sets:512, ways:4, linesz:32, total:65536
dcache: sets:256, ways:4, linesz:32, total:32768

 #### The CPU freq = 560 MHZ ####
 estimate memory size = 32 Mbytes

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: Enter boot command line interface.
   5: Load system code then write to Flash via USB Storage.
   9: Load U-Boot code then write to Flash via TFTP.

You choosed 3

 0


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

Starting kernel ...

[    0.000000] Linux version 4.14.180 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11063-85e04e9f46)) #0 Sat May 16 18:32:20 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] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Noname Board
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    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-0x0000000001ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] random: get_random_bytes called from 0x80481740 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Writing ErrCtl register=00026771
[    0.000000] Readback ErrCtl register=00026771
[    0.000000] Memory: 26320K/32768K available (3916K kernel code, 187K rwdata, 500K rodata, 1212K init, 215K bss, 6448K 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] CPU Clock: 560MHz
[    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: 6825930166 ns
[    0.000012] sched_clock: 32 bits at 280MHz, resolution 3ns, wraps every 7669584382ns
[    0.007598] Calibrating delay loop... 371.09 BogoMIPS (lpj=1855488)
[    0.073526] pid_max: default: 32768 minimum: 301
[    0.078258] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.084645] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097783] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.107336] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.113316] pinctrl core: initialized pinctrl subsystem
[    0.119675] NET: Registered protocol family 16
[    0.146182] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.151639] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.157963] rt2880_gpio 10000688.gpio: registering 1 gpios
[    0.163305] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[    0.173770] clocksource: Switched to clocksource systick
[    0.180085] NET: Registered protocol family 2
[    0.185357] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.192084] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.198316] TCP: Hash tables configured (established 1024 bind 1024)
[    0.204603] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.210232] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.216640] NET: Registered protocol family 1
[    0.223565] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    0.230299] Crashlog allocated RAM at address 0x1f00000
[    0.237122] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    0.249413] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.255064] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.275188] io scheduler noop registered
[    0.278936] io scheduler deadline registered (default)
[    0.284892] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.294002] console [ttyS0] disabled
[    0.297453] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.307108] console [ttyS0] enabled
[    0.307108] console [ttyS0] enabled
[    0.314144] bootconsole [early0] disabled
[    0.314144] bootconsole [early0] disabled
[    0.330313] spi spi0.0: force spi mode3
[    0.344082] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.348938] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.355448] Creating 4 MTD partitions on "spi0.0":
[    0.360352] 0x000000000000-0x000000030000 : "u-boot"
[    0.366382] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.372698] 0x000000040000-0x000000050000 : "factory"
[    0.378821] 0x000000050000-0x000001000000 : "firmware"
[    0.387800] 2 uimage-fw partitions found on MTD device firmware
[    0.393920] Creating 2 MTD partitions on "firmware":
[    0.399000] 0x000000000000-0x00000017e1f8 : "kernel"
[    0.405009] 0x00000017e1f8-0x000000fb0000 : "rootfs"
[    0.410893] mtd: device 5 (rootfs) set to be root filesystem
[    0.418239] 1 squashfs-split partitions found on MTD device rootfs
[    0.424627] 0x0000003da000-0x000000fb0000 : "rootfs_data"
[    0.431890] libphy: Fixed MDIO Bus: probed
[    0.444950] gsw: setting port4 to ephy mode
[    0.449271] mtk_soc_eth 10100000.ethernet eth0 (uninitialized): port 4 link up (100Mbps/Full duplex)
[    0.458720] mtk_soc_eth 10100000.ethernet: generated random MAC address 5e:f9:ba:24:41:3f
[    0.467186] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    0.474008] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.482971] rt2880_wdt 10000120.watchdog: Initialized
[    0.489574] NET: Registered protocol family 10
[    0.498312] Segment Routing with IPv6
[    0.502172] NET: Registered protocol family 17
[    0.506844] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    0.520089] 8021q: 802.1Q VLAN Support v1.8
[    0.534164] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    0.548022] Freeing unused kernel memory: 1212K
[    0.552645] This architecture does not have kernel memory protection.
[    1.580161] init: Console is alive
[    1.583983] init: - watchdog -
[    2.243772] random: fast init done
[    2.783067] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.880313] usbcore: registered new interface driver usbfs
[    2.886091] usbcore: registered new interface driver hub
[    2.891638] usbcore: registered new device driver usb
[    2.902838] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.911331] ehci-platform: EHCI generic platform driver
[    2.927055] phy phy-usbphy.0: remote usb device wakeup disabled
[    2.933103] phy phy-usbphy.0: UTMI 16bit 30MHz
[    2.937674] ehci-platform 101c0000.ehci: EHCI Host Controller
[    2.943580] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[    2.951814] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[    2.967066] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[    2.974517] hub 1-0:1.0: USB hub found
[    2.978826] hub 1-0:1.0: 1 port detected
[    2.986181] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    2.994182] ohci-platform: OHCI generic platform driver
[    2.999891] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[    3.006859] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[    3.015100] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[    3.048892] hub 2-0:1.0: USB hub found
[    3.053192] hub 2-0:1.0: 1 port detected
[    3.061324] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    3.072940] init: - preinit -
[    4.186899] 8021q: adding VLAN 0 to HW filter on device eth0
[    4.208274] random: procd: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    5.515558] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[    5.552874] urandom-seed: Seed file not found (/etc/urandom.seed)
[    5.678780] procd: - early -
[    5.681850] procd: - watchdog -
[    6.149377] procd: - watchdog -
[    6.152944] procd: - ubus -
[    6.359314] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.445434] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.452558] random: ubusd: uninitialized urandom read (4 bytes read)
[    6.460225] procd: - init -
Please press Enter to activate this console.
[    7.317758] kmodloader: loading kernel modules from /etc/modules.d/*
[    7.510836] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    7.537187] Loading modules backported from Linux version v4.19.120-0-gfdc072324f3c
[    7.545091] Backport generated by backports.git v4.19.120-1-0-g60c3a249
[    7.570667] ip_tables: (C) 2000-2006 Netfilter Core Team
[    7.596882] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[    7.738415] xt_time: kernel timezone is -0000
[    7.853809] PPP generic driver version 2.4.2
[    7.869009] NET: Registered protocol family 24
[    7.894903] urngd: jent-rng init failed, err: 2
[    7.915889] ieee80211 phy0: rt2x00lib_request_eeprom_file: Info - Loading EEPROM data from 'soc_wmac.eeprom'.
[    7.927072] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[    7.935073] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 7620 detected
[    7.958256] kmodloader: done loading kernel modules from /etc/modules.d/*
[   60.846188] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   60.868570] jffs2_build_filesystem(): unlocking the mtd device...
[   60.868648] done.
[   60.876923] jffs2_build_filesystem(): erasing all blocks after the end marker...
[   61.264357] 8021q: adding VLAN 0 to HW filter on device eth0
[   61.330936] br-lan: port 1(eth0.1) entered blocking state
[   61.336464] br-lan: port 1(eth0.1) entered disabled state
[   61.342457] device eth0.1 entered promiscuous mode
[   61.347353] device eth0 entered promiscuous mode
[   61.438259] br-lan: port 1(eth0.1) entered blocking state
[   61.443787] br-lan: port 1(eth0.1) entered forwarding state
[   61.449770] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   62.350425] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  124.887672] random: crng init done
[  124.891165] random: 6 urandom warning(s) missed due to ratelimiting
[  207.405894] done.
[  207.407946] jffs2: notice: (1202) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  207.637560] overlayfs: upper fs does not support tmpfile.

I have type enter after
Please press Enter to activate this console.

And it stops at 50 seconds.
I do not know if cause is typing key
Maybe 50 seconds is full boot

Bootlog looks Ok.
I've rebuilt openwrt with decreased spi flash speed.
Pls reload and reflash.

Yes, spi flash is on wire and socket.
Not on pcb for now.
Tomorrow i try.
Thanks

image