Supporting Totolink A3? (MT7628/64MB/8M AC1200)

So I have this Totolink A3 device, and wanted to try and load a LEDE firmware on it.

Seems there is very little information about the brand, device comes from AliExpress Web update rejected the images from https://downloads.lede-project.org/releases/17.01.4/targets/ramips/mt7688/ and the totolink bootloader's tftp update rejected even the original images as well as the LEDE images.

The device also has U-Boot 1.1.3 which isn't locked. So I guess this is where my quest begins - what do I put in google to find out how to back up the existing flash and try to boot a kernel and get the bootlog? This is new territory for me, and my google fu was weak.

Is md.b 0xBC040000 0x007C0000 the correct uboot command to dump the flash to serial? If not, is it possible to determine the flash address from the available output, and what do I look for?
(I'm not too worried about wrecking the device as it slipped past me it didn't have gigabit network to go with the AC1200 wifi, so it was pointless to use as a dumb bridge, and it has been replaced.)

OEM U-boot:

[04020D08][04020C0D]
DDR Calibration DQS reg = 00008789


U-Boot 1.1.3 (May 31 2016 - 09:57:25)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb8000
flash manufacture id: c8, device id 40 17
find flash: GD25Q64B
*** Warning - bad CRC, using default environment

============================================ 
Ralink UBoot Version: 4.3.0.0
-------------------------------------------- 
ASIC 7628_MP (Port5<->None)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:May 31 2016  Time:09:57:25
============================================ 
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768 

 ##### The CPU freq = 575 MHZ #### 
 estimate memory size =64 Mbytes
RESET MT7628 PHY!!!!!!GPIO_MODE -> 54050404
GPIO_MODE -> 55054411
RT2880_REG_PIODIR -> 00000000

Please choose the operation: (t:tftp server/b(boot now)/f(flash test)) 
0 

MAC Address: f4:28:53:7c:21:c0

   
4: System Enter Boot Command Line Interface.

U-Boot 1.1.3 (May 31 2016 - 09:57:25)
MT7628 # printenv

bootcmd=tftp
bootdelay=2
baudrate=57600
ethaddr="00:AA:BB:CC:DD:10"
ipaddr=10.10.10.123
serverip=10.10.10.3
stdin=serial
stdout=serial
stderr=serial

Environment size: 149/4092 bytes
MT7628 # 

Full OEM bootlog:

[04020D08][04020C0E]
DDR Calibration DQS reg = 00008889
U-Boot 1.1.3 (May 31 2016 - 09:57:25)
Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb8000
flash manufacture id: c8, device id 40 17
find flash: GD25Q64B
*** Warning - bad CRC, using default environment
============================================ 
Ralink UBoot Version: 4.3.0.0
-------------------------------------------- 
ASIC 7628_MP (Port5<->None)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:May 31 2016  Time:09:57:25
============================================ 
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768 
 ##### The CPU freq = 575 MHZ #### 
 estimate memory size =64 Mbytes
RESET MT7628 PHY!!!!!!GPIO_MODE -> 54050404
GPIO_MODE -> 55054411
RT2880_REG_PIODIR -> 00000000
Please choose the operation: (t:tftp server/b(boot now)/f(flash test)) 
10 
3: System Boot system code via Flash.
## Booting image at bc040000 ...
   Image Name:   za3
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    3507509 Bytes =  3.3 MB
   Load Address: 80000000
   Entry Point:  8000c150
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c150) ...
## Giving linux memsize in MB, 64
Starting kernel ...
LINUX started...
 THIS IS ASIC
Linux version 2.6.36 (mt7621@ski) (gcc version 4.6.3 (Buildroot 2012.11.1) ) #188 Thu Feb 23 17:26:54 KST 2017
 The CPU feqenuce set to 575 MHz
 MIPS CPU sleep mode enabled.
CPU revision is: 00019655 (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=
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=0000000f
Readback ErrCtl register=0000000f
Memory: 60460k/65536k available (3222k kernel code, 5016k reserved, 815k data, 160k init, 0k highmem)
NR_IRQS:128
console [ttyS1] enabled
Calibrating delay loop... 381.95 BogoMIPS (lpj=763904)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
RALINK_GPIOMODE = 55054411 
RALINK_GPIOMODE = 55044411 
***** Xtal 25MHz *****
start PCIe register access
RALINK_RSTCTRL = 2400000
RALINK_CLKCFG1 = fdbfffc0
*************** MT7628 PCIe RC mode *************
PCIE0 enabled
Port 0 N_FTS = 1b105000
init_rt2880pci done
bio: create slab <bio-0> at 0
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
-->  ipconflict proc OK !!!!!!!!!! 
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
squashfs: version 4.0 (2009/01/31) Phillip Lougher
msgmni has been set to 118
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Ralink gpio driver initialized
Serial: 8250/16550 driver, 2 ports, IRQ sharing enabled
serial8250: ttyS0 at MMIO 0x10000d00 (irq = 21) is a 16550A
serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
brd: module loaded
flash manufacture id: c8, device id 40 17
GD25Q64B(c8 40170000) (8192 Kbytes)
mtd .name = raspi, .size = 0x00800000 (8M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
Creating 7 MTD partitions on "raspi":
0x000000040000-0x000000800000 : "Firmware"
0x000000000000-0x000000020000 : "Bootloader"
0x000000020000-0x000000030000 : "Config"
0x000000030000-0x000000040000 : "Factory"
0x000000040000-0x000000196575 : "Kernel"
mtd: partition "Kernel" doesn't end on an erase block -- force read-only
0x000000196575-0x000001000000 : "RootFS"
mtd: partition "RootFS" extends beyond the end of device "raspi" -- size truncated to 0x669a8b
mtd: partition "RootFS" doesn't start on an erase block boundary -- force read-only
0x000000040000-0x000001000000 : "Kernel_RootFS"
mtd: partition "Kernel_RootFS" extends beyond the end of device "raspi" -- size truncated to 0x7c0000
rdm_major = 253
GMAC1_MAC_ADRH -- : 0x0000000c
GMAC1_MAC_ADRL -- : 0x4347d329
Ralink APSoC Ethernet Driver Initilization. v3.1  256 rx/tx descriptors allocated, mtu = 1500!
GMAC1_MAC_ADRH -- : 0x0000000c
GMAC1_MAC_ADRL -- : 0x4347d329
PROC INIT OK!
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
PPP MPPE Compression module registered
NET: Registered protocol family 24
=== pAd = c0003000, size = 1458368 ===
<-- RTMPAllocTxRxRingMemory, Status=0, ErrorValue=0x
<-- RTMPAllocAdapterBlock, Status=0
RtmpChipOpsHook(492): Not support for HIF_MT yet!
mt7628_init()-->
mt7628_init(FW(8a00), HW(8a01), CHIPID(7628))
e2.bin mt7628_init(1135)::(2), pChipCap->fw_len(63888)
mt_bcn_buf_init(218): Not support for HIF_MT yet!
<--mt7628_init()
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (944 buckets, 3776 max)
NETDETECT target register
ip_nat_bnet: Trying to register for port 6112
ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Linux
TCP cubic registered
Twin IP Module Init
--> Init Smart QoS Monitor
NET: Registered protocol family 17
L2TP core driver, V2.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
SQUASHFS error: Xattrs in filesystem, these will be ignored
VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
Freeing unused kernel memory: 160k freed
Checking System Requirements *******************************************
DRAM SIZE  : Requirement->64 Mbytes / Mounted->64 Mbytes -----------> [OK]
FLASH SIZE : Requirement->4 Mbytes / Mounted->8 Mbytes -----------> [OK] Bigger Flash memory is used.
alias:za3 version:9.990
Restore Config ( 8522 bytes )
Init LED ->[ Blinking ]
switch reg write offset=14, value=405555
switch reg write offset=50, value=2001
switch reg write offset=98, value=7f3f
switch reg write offset=e4, value=3f
switch reg write offset=40, value=1002
switch reg write offset=44, value=1001
switch reg write offset=48, value=1001
switch reg write offset=70, value=ffff417e
Bridge Init
PinCode : 12514625
Regulated Power for 149 Channel -> 100
device apclii0 is not a slave of br0
PinCode : 12514625
Regulated Power for 5 Channel -> 100
device apcli0 is not a slave of br0
2.4GHz UUID => len:37 / 28802880-2880-1880-a880-f428537c21c0
5GHz UUID => len:37 / 28802880-2880-1880-a880-f428537c21c0
=================================================================
press magic key to change default setting ...
  LAN MAC : F4:28:53:7C:21:C0
  WAN MAC : F4:28:53:7C:21:C1
iptables: No chain/target/match by that name
==> Restart AUTO Negotiation for all ports
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
Restart HTTPD
Kill httpdkillall: httpd: no process killed
Start httpdkillall: pptpd: no process killed
PPTP Server Start!!
insmod: /lib/modules/2.6.36: No such file or directory
insmod: ppp_mppe.ko: module not found
iptables: Bad rule (does a matching rule exist in that chain?)
iptables: Bad rule (does a matching rule exist in that chain?)
iptables: Bad rule (does a matching rule exist in that chain?)
iptables: Bad rule (does a matching rule exist in that chain?)
iptables: Bad rule (does a matching rule exist in that chain?)
iptables: Bad rule (does a matching rule exist in that chain?)
SIGNAL -> Config Update signal progress
SIGNAL -> WAN ip changed
ez_ipupdate callback --> time_elapsed: 0
iptables: Bad rule (does a matching rule exist in that chain?)
Led Silent Callback
Turn ON All LED
switch reg write offset=a4, value=5
switch reg write offset=a8, value=5
switch reg write offset=ac, value=5
switch reg write offset=b0, value=5
switch reg write offset=b4, value=5
Dynamic Channel Search for ra0 is OFF
Dynamic Channel Search for rai0 is OFF
8021x Start by WAN IP CHANGED Callback
killall: rt2860apd: no process killed
killall: rtinicapd: no process killed
iptables: Bad rule (does a matching rule exist in that chain?)
iptables: Bad rule (does a matching rule exist in that chain?)
signalling Update
SIGNAL -> Config Update signal progress
Check DHCP PID Elapsed Time: 1
SIGNAL -> WAN ip changed
Reaped 306
ez_ipupdate callback --> time_elapsed: 45
Reaped 382
Led Silent Callback
Turn ON All LED
switch reg write offset=a4, value=5
switch reg write offset=a8, value=5
switch reg write offset=ac, value=5
switch reg write offset=b0, value=5
switch reg write offset=b4, value=5
Dynamic Channel Search for ra0 is OFF
Dynamic Channel Search for rai0 is OFF
8021x Start by WAN IP CHANGED Callback
killall: rt2860apd: no process killed
killall: rtinicapd: no process killed
iptables: Bad rule (does a matching rule exist in that chain?)
signalling Update
SIGNAL -> Config Update signal progress
[DHCPC:Check IP] : Check WAN IP : 10.10.0.109 , 255.255.255.0 
[DHCPC:Check IP] : Same network 
Check DHCP PID Elapsed Time: 1
SIGNAL -> WAN ip changed
Reaped 384
ez_ipupdate callback --> time_elapsed: 25
iptables: Bad rule (does a matching rule exist in that chain?)
Led Silent Callback
Turn ON All LED
switch reg write offset=a4, value=5
switch reg write offset=a8, value=5
switch reg write offset=ac, value=5
switch reg write offset=b0, value=5
switch reg write offset=b4, value=5
Dynamic Channel Search for ra0 is OFF
Dynamic Channel Search for rai0 is OFF
8021x Start by WAN IP CHANGED Callback
killall: rt2860apd: no process killed
killall: rtinicapd: no process killed

For those logs, I would say its very similar to the latest TP-Link MT7628 models (like TL-WR840N v4 or WR841Nv13) or the Mercury Mac1200 v2.

I would start with a RAM based image instead of starting to flash directly. If the RAM image boots properly (with maybe some minor fault like, wrong GPIO for switches/leds etc), then I would start flashing the device and continue from there.

Since @pepe2k added support for the TP-links, you could ask him for some pointers about modifying the .DTS for your router.

Thanks for you comment! I spent some time last night working out how to tftp an image to ram and boot it, but only got to the point where the kernel panics because it doesn't have a root device. I'll look at getting a bootargs from the TP link devices you mentioned.

Does the MT7628 not use an initramfs or is it just not being built along with the full images?

On the bright side, I'm leaning towards having RAM at 0x80000000 - 0x83FFFFFF and flash at 0xBC000000 - 0xBC7FFFFF being correct.

LEDE kernel bootlog (via tftpboot):

[04010D08][04010C0E]
DDR Calibration DQS reg = 00008788

U-Boot 1.1.3 (May 31 2016 - 09:57:25)
Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb8000
flash manufacture id: c8, device id 40 17
find flash: GD25Q64B
============================================ 
Ralink UBoot Version: 4.3.0.0
-------------------------------------------- 
ASIC 7628_MP (Port5<->None)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:May 31 2016  Time:09:57:25
============================================ 
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768 
 ##### The CPU freq = 575 MHZ #### 
 estimate memory size =64 Mbytes
RESET MT7628 PHY!!!!!!GPIO_MODE -> 54050404
GPIO_MODE -> 55054411
RT2880_REG_PIODIR -> 00000000
Please choose the operation: (t:tftp server/b(boot now)/f(flash test)) 
 0 
MAC Address: f4:28:53:7c:21:c0
   
4: System Enter Boot Command Line Interface.
U-Boot 1.1.3 (May 31 2016 - 09:57:25)
MT7628 # setenv autoload no
MT7628 # tftp 0x80a00000 sysupgrade.bin
 netboot_common, argc= 3 
 NetTxPacket = 0x83FE6F40 
 KSEG1ADDR(NetTxPacket) = 0xA3FE6F40 
 NetLoop,call eth_halt ! 
 NetLoop,call eth_init ! 
Trying Eth0 (10/100-M)
 Waitting for RX_DMA_BUSY status Start... done

 ETH_STATE_ACTIVE!! 
TFTP from server 10.10.10.3; our IP address is 10.10.10.123
Filename 'sysupgrade.bin'.
 TIMEOUT_COUNT=10,Load address: 0x80a00000
Loading: *Got ARP REPLY, set server/gtwy eth addr (00:0c:29:61:fc:ef)
Got it
#################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ##########################################
done
Bytes transferred = 3539112 (3600a8 hex)
NetBootFileXferSize= 003600a8
MT7628 # bootm 0x80a00000
## Booting image at 80a00000 ...
   Image Name:   MIPS LEDE Linux-4.4.92
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1213637 Bytes =  1.2 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, 64
Starting kernel ...
[    0.000000] Linux version 4.4.92 (buildbot@builds-02.infra.lede-project.org) (gcc version 5.4.0 (LEDE GCC 5.4.0 r3101-bce140e) ) #0 Mon Oct 16 11:22:18 2017
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is Mediatek MT7628AN evaluation board
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    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] 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] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: console=ttyS0,57600 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=0000000b
[    0.000000] Readback ErrCtl register=0000000b
[    0.000000] Memory: 28476K/32768K available (3017K kernel code, 147K rwdata, 384K rodata, 156K init, 200K bss, 4292K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] intc: using register map from devicetree
[    0.000000] CPU Clock: 575MHz
[    0.000000] clocksource_probe: no matching clocksources found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6647862422 ns
[    0.000011] sched_clock: 32 bits at 287MHz, resolution 3ns, wraps every 7469508094ns
[    0.015358] Calibrating delay loop... 380.92 BogoMIPS (lpj=1904640)
[    0.080480] pid_max: default: 32768 minimum: 301
[    0.089740] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.102688] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.122482] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.141865] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.153936] pinctrl core: initialized pinctrl subsystem
[    0.165507] NET: Registered protocol family 16
[    0.176987] rt2880-pinmux pinctrl: invalid group "jtag" for function "gpio"
[    0.192115] Can't analyze schedule() prologue at 8000acdc
[    0.215370] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.226463] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.237472] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.249846] clocksource: Switched to clocksource MIPS
[    0.261028] NET: Registered protocol family 2
[    0.270619] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.284327] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.296839] TCP: Hash tables configured (established 1024 bind 1024)
[    0.309486] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.320946] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.333565] NET: Registered protocol family 1
[    0.347229] Crashlog allocated RAM at address 0x1f00000
[    0.374360] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.385815] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.407754] io scheduler noop registered
[    0.415425] io scheduler deadline registered (default)
[    0.426345] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.442451] console [ttyS0] disabled
[    0.449413] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.467343] console [ttyS0] enabled
[    0.467343] console [ttyS0] enabled
[    0.481034] bootconsole [early0] disabled
[    0.481034] bootconsole [early0] disabled
[    0.498305] spi-mt7621 10000b00.spi: sys_freq: 191666666
[    0.514728] m25p80 spi32766.0: using chunked io (size=32)
[    0.525491] m25p80 spi32766.0: gd25q64 (8192 Kbytes)
[    0.535358] 4 ofpart partitions found on MTD device spi32766.0
[    0.546907] Creating 4 MTD partitions on "spi32766.0":
[    0.557092] 0x000000000000-0x000000030000 : "u-boot"
[    0.568714] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.581254] 0x000000040000-0x000000050000 : "factory"
[    0.593205] 0x000000050000-0x000000800000 : "firmware"
[    0.652152] rt3050-esw 10110000.esw: link changed 0x00
[    0.663079] mtk_soc_eth 10100000.ethernet: generated random MAC address 86:53:c5:e5:6c:b7
[    0.680187] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.697069] mt7621_wdt 10000120.watchdog: Initialized
[    0.708501] NET: Registered protocol family 10
[    0.720867] NET: Registered protocol family 17
[    0.729740] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    0.754759] 8021q: 802.1Q VLAN Support v1.8
[    0.765941] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.780828] Please append a correct "root=" boot option; here are the available partitions:
[    0.797381] 1f00             192 mtdblock0  (driver?)
[    0.807394] 1f01              64 mtdblock1  (driver?)
[    0.817404] 1f02              64 mtdblock2  (driver?)
[    0.827413] 1f03            7872 mtdblock3  (driver?)
[    0.837420] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.854741] Rebooting in 1 seconds..

Of course it panics when you are using image that is not for that device.
You need to port LEDE to it,you cant just use some random image

Are you sure you are using the correct image type?? I mean: Target Image should be Ramdisk, not SquashFS.

Not sure at all, but I think you nudged me in the correct direction, thanks!

Will post the LEDE bootlog when I find more time to fiddle with this, forgot to capture it, but it gave me a usable shell and could back up the mtd partitions over ssh.

Another observation: the OEM partitions are different from the Lede bootlog you posted. This means that most likely you dumped the “wrong” partitions.

You need to (should) change the partition layout in the DTS file for the device you are using for testing.

Indeed! Sorted that out, thanks again!

[    3.329016] 4 ofpart partitions found on MTD device spi32766.0
[    3.340568] Creating 4 MTD partitions on "spi32766.0":
[    3.350754] 0x000000000000-0x000000020000 : "Bootloader"
[    3.363040] 0x000000020000-0x000000030000 : "Config"
[    3.374765] 0x000000030000-0x000000040000 : "Factory"
[    3.386724] 0x000000040000-0x000000800000 : "Firmware"

The next part is switches and leds; google led me to the old OpenWRT docs for testing gpio, and it didn't seem to have any effect on leds, nor read the switches.

The only LEDE page i stumbled on ( https://lede-project.org/docs/user-guide/led_configuration ) doesn't say much on how to determine what gpio the leds are on. The three leds for the network ports work, will get around to test wifi. Would be nice to have the switch for fail safe mode, but not that important. Any hints as to where I go looking for how to sort out the gpio stuff?

And last the ethernet switch config, not sure i understood the target/linux/ramips/base-files/etc/board.d/02_network file. Using swconfig dev rt305x show I determined that wan is switch port 0, lan2 is switch port 2, and lan1 is switch port 3 and the cpu is on switch port 6.

I tried adding

a3)
        ucidef_add_switch "switch0" \
                "0:wan" "2:lan" "3:lan" "6@eth0"
        ;;

but there are no vlans set up after booting the image:

root@LEDE:/# swconfig dev rt305x show
Global attributes:
        enable_vlan: 0
        alternate_vlan_disable: 0
        bc_storm_protect: 0
        led_frequency: 0
Port 0:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 46
        tr_bad: 0
        tr_good: 61
        pvid: 0
        link: port:0 link:up speed:100baseT full-duplex
Port 1:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:1 link:down
Port 2:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:2 link:down
Port 3:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 18
        tr_bad: 0
        tr_good: 46
        pvid: 0
        link: port:3 link:down
Port 4:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:4 link:down
Port 5:
        disable: 1
        doubletag: 1
        untag: 1
        led: ???
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:5 link:down
Port 6:
        disable: 0
        doubletag: 1
        untag: 1
        led: ???
        lan: ???
        recv_bad: ???
        recv_good: ???
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex
VLAN 0:
        ports: 0 1 2 3 4 5 6