OpenWrt Forum Archive

Topic: Edimax BR-6478AC V2 - MT7620A

The content of this topic has been archived between 10 Apr 2018 and 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am trying my hardest to install OpenWrt on a Edimax BR-6478AC V2 which does NOT have the Realtek SoC, but a supported MediaTek MT7620A with 2.4ghz plus a MT7612EN 5ghz radio.

I have been able to hack a serial port connection, and have also been able to get the unit into tftp server mode and can upload original firmware ok. I am trying openwrt-15.05.1-ramips-mt7620-uImage.bin with a modified header to trick the device into thinking its an original "CSYS RN68" format file. I am stuck with a correct CRC value but with a 0x00000000 value I can trick the device into flashing openwrt but only the first 14 bytes are written to flash before reboot.

I have downloaded a copy of the full GPL source code for the stock 1.09 firmware and fedora 8 as required to mod the firmware.

Can anyone help with how to get a correct crc/len value for the Edimax CSYS format, the original seems to be file size minus 20 bytes but same format does not work on openwrt .bin's.

Some snippets below.


U-Boot 1.1.3 (Feb 24 2015 - 13:04:02)                                                     
                                                                                         
Board: Ralink APSoC DRAM:  64 MB                                                         
relocate_code Pointer at: 83fb4000                                                       
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.2.0
--------------------------------------------
ASIC 7620_MP (Port5<->GigaSW)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Feb 24 2015  Time:13:04:02
============================================
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
#Reset_MT7530

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.
   5: Load ucos code to SDRAM via TFTP Client.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.

You choosed 3

0
   
3: System Boot system code via Flash.
## Booting image at bc070000 ...
raspi_read: from:70000 len:40
Magic number at 0xBC070000
raspi_read: from:70014 len:40
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    6836140 Bytes =  6.5 MB
   Load Address: 80000000
   Entry Point:  8000c2f0
raspi_read: from:70054 len:684fac
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c2f0) ...
## Giving linux memsize in MB, 64

Starting kernel ...


LINUX started...

THIS IS ASIC
Linux version 2.6.36 (root@localhost.localdomain) (gcc version 3.4.2) #1 Thu Sep 10 14:51:59 CST 2015


*******************

MX25L6405D(c2 2017c220) (8192 Kbytes)
mtd .name = raspi, .size = 0x00800000 (0M) .erasesize = 0x00000008 (0K) .numeraseregions = 65536
Creating 8 MTD partitions on "raspi":
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000070000 : "Cimage"
0x000000070000-0x000000190000 : "Kernel"
0x000000190000-0x0000007e0000 : "RootFS"
0x000000070000-0x0000007e0000 : "Uimage"
0x0000007e0000-0x000000800000 : "FreeSpace"

***********************

init started: BusyBox v1.15.2 (2015-09-10 14:24:40 CST)
starting pid 24, tty '': '/etc/rc.sh'
cannot run '/etc/rc.sh': No such file or directory

starting pid 25, tty '': '-/bin/sh' console.
Algorithmics/MIPS FPU Emulator v1.5


BusyBox v1.15.2 (2015-09-10 14:24:40 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

************************

>>> Loading 2.4G Wireless Driver
>>> Loading rt2860v2_ap
rt2860v2_ap: module license 'unspecified' taints kernel.

******

>>> Loading 5G Wireless Driver
>>> Loading rlt_wifi
register rt2860

*********

U-Boot 1.1.3 (Feb 24 2015 - 13:04:02)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb4000
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.2.0
--------------------------------------------
ASIC 7620_MP (Port5<->GigaSW)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Feb 24 2015  Time:13:04:02
============================================
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
#Reset_MT7530

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.
   5: Load ucos code to SDRAM via TFTP Client.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.

raspi_read: from:40028 len:6

   
5: System Load Boot Loader | F/W  then write to Flash via TFTP Client.
Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N)
Please Input new ones /or Ctrl-C to discard
        Input device IP (192.168.2.81)  Input server IP (192.168.2.89)  Input Linux Kernel filename ()
netboot_common, argc= 3

NetTxPacket = 0x83FE6180

KSEG1ADDR(NetTxPacket) = 0xA3FE6180

NetLoop,call eth_halt !

NetLoop,call eth_init !
Trying Eth0 (10/100-M)

Waitting for RX_DMA_BUSY status Start... done


ETH_STATE_ACTIVE!!
(NetLoop 408) bd->bi_enetaddr = 00:00:aa:bb:cc:dd
(NetLoop 409) NetOurEther = 00:00:aa:bb:cc:dd
Select server or client model: 1/2
server model start
SERVER IP address : 192.168.1.6 port:69
Load address: 0x80a00000
Loading: checksum bad
Got ARP REQUEST, return our IP
Peer IP:192.168.1.220
Got ARP REPLY, set server/gtwy eth addr (bc:5f:f4:fa:03:8d)
Got it
Peer IP:192.168.1.220
#################################################################
         #################################################################
         #################################################################
         ####################################
done
Bytes transferred = 1177850 (11f8fa hex)
NetBootFileXferSize= 0011f8fa

****************Parse Head**************
signature=CSYS startAddr=0x01100000 burnAddr=0x00070000 nmodTag=RN68 len=0x00000000

****************CheckSume**************
CheckSum ok!
****************Start Upgrade Kernel**************
raspi_erase_write: offs:70000, count:14
raspi_read: from:70000 len:10000
raspi_erase: offs:70000 len:10000
.
raspi_write: to:70000 len:10000
.
raspi_read: from:70000 len:10000
Done!
## Booting image at bc070000 ...
raspi_read: from:70000 len:40
Magic number at 0xBC070000
raspi_read: from:70014 len:40
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    6836140 Bytes =  6.5 MB
   Load Address: 80000000
   Entry Point:  8000c2f0
raspi_read: from:70054 len:684fac
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c2f0) ...
## Giving linux memsize in MB, 64

Starting kernel ...


LINUX started...

THIS IS ASIC
Linux version 2.6.36 (root@localhost.localdomain) (gcc version 3.4.2) #1 Thu Sep 10 14:51:59 CST 2015

Just to give some more detail, I am able to get the device into TFTP server mode by holding down the reset button while turning the power on.

To trick the stock firmware into accepting the openwrt bin I have removed the first 32 bytes from the openwrt-mt7620 file to make it an old .TRX. I then removed the first 32 bytes from the original Edimax firmware and added it to the start of the openwrt bin file. I basically swapped the headers. This is working as far as being accepted, but the checksum fails. I am using a hex editor to change the CRC/LEN values in the bin file before attempting to tftp it each time, but it always fails.

If I set the crc value to all 0x00 then the openwrt bin file passes the edimax checksum test but does not flash the complete file, only the first 14 bytes. I do not know why.

The original firmware appears as such during tftp:

5: System Load Boot Loader | F/W  then write to Flash via TFTP Client.
Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N)
Please Input new ones /or Ctrl-C to discard
        Input device IP (192.168.2.81)  Input server IP (192.168.2.89)  Input Linux Kernel filename ()
netboot_common, argc= 3
Select server or client model: 1/2
server model start
SERVER IP address : 192.168.1.6 port:69
Load address: 0x80a00000
Got ARP REQUEST, return our IP
Peer IP:192.168.1.220
Got ARP REPLY, set server/gtwy eth addr (bc:5f:f4:fa:03:8d)
Got it
Peer IP:192.168.1.220
done
Bytes transferred = 6836226 (685002 hex)
NetBootFileXferSize= 00685002

****************Parse Head**************
signature=CSYS startAddr=0x01100000 burnAddr=0x00070000 nmodTag=RN68 len=0x00684fee

****************CheckSume**************
CheckSum ok!
****************Start Upgrade Kernel**************
raspi_erase_write: offs:70000, count:685002
raspi_erase: offs:70000 len:680000
........................................................................................................
raspi_write: to:70000 len:680000
........................................................................................................
raspi_read: from:70000 len:10000
raspi_read: from:80000 len:10000
raspi_read: from:90000 len:10000 ....etc etc


As you can see the CRC value in the bin file is 0x00684fee which is 6836206 in decimal, the file size is only 20 bytes more at 6836226 which in hex is 0x00685002 - you can see those numbers match up.

With the OpenWrt binary file I am trying it is 1177850 in size, if I try to set the crc value to 1177830 it fails. I did not think the Edimax checksum would be as simple as filesize-20. Can anyone offer any clues or help?

What is the best way to get this crap stock Edimax firmware to allow OpenWrt to install?

To my knowledge somewhere in the OpenWRT sources is an tool to create CSYS headers ...

Thanks elektoman, I will be digging through sources tomorrow and hope to find this magical tool.

I can confirm that with some manipulating of the header file with a hex editor it is possible to flash the device. I have now bricked the device as it can find its kernel but I can easily de-brick it via tftp upload of original firmware.

There are also 4 bytes at the end of the image file which must contain a correct CRC, another trick I found it to set it to 0x00 and upload and via serial console the BR6478AC will spit out an error with the correct CRC value it expects, then hex edit those correct CRC values into the last 4 byutes of the image file and tftp again and the flashing will work fine.

So I think we are 99% there to a new OpenWrt AC1200 router smile


Attempting to boot with OpenWrt 15.05.01:

3: System Boot system code via Flash.
## Booting image at bc070000 ...
raspi_read: from:70000 len:40
Magic number at 0xBC070000
raspi_read: from:70014 len:40
Bad Header Checksum


Compared with a correct boot:

3: System Boot system code via Flash.
## Booting image at bc070000 ...
raspi_read: from:70000 len:40
Magic number at 0xBC070000
raspi_read: from:70014 len:40
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    6836140 Bytes =  6.5 MB
   Load Address: 80000000
   Entry Point:  8000c2f0
raspi_read: from:70054 len:684fac
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c2f0) ...
## Giving linux memsize in MB, 64

Starting kernel ...

**************************

From what I can gather I need to modify the OpenWrt image to match the partitions and addresses of the filesystem on the BR6478AC, is this correct?

Are there any Wrt hackers with more experience who can help with this?

rmurch wrote:

Thanks elektoman, I will be digging through sources tomorrow and hope to find this magical tool.

git grep csys

is your friend

rmurch wrote:

I can confirm that with some manipulating of the header file with a hex editor it is possible to flash the device. I have now bricked the device as it can find its kernel but I can easily de-brick it via tftp upload of original firmware.

With bricking is *your* fault,
But looking at the mtd layout it seams to be some sort of double flash image is available.
Look image names.
But I can have been mistaken ...

The other thing
I use at the beginning initramfs for testing devices ...

rmurch wrote:

So I think we are 99% there to a new OpenWrt AC1200 router smile

pictures ??
wiki ??
specs ??

The my knowledge MT7621 ?? 80211ac is working in vanilla OpenWRT with some drawbacks ... speed maybe

rmurch wrote:

From what I can gather I need to modify the OpenWrt image to match the partitions and addresses of the filesystem on the BR6478AC, is this correct?

Are there any Wrt hackers with more experience who can help with this?

You need the MTD layout as seen via kernel.
The best thing is to sort the partitions via address.

For adaopting OpenWRT you need a similar platform.
Xioami (I think use the same SoC) but with fast ethernet.

The CSYS tool I found seems to be for the TP-Link, I am not sure if Edimax use the 'magic number' feature. I tried it and it corrupted an image, plus I think I need the correct addressing in the stock header to make sure flash writing starts at 0x007000. At the moment I am happy to modify the header manually hex-editing now that I have figured it's format out.

Yep the bricking is my fault, I kinda knew it would happen anyway and its an easy fix. You are correct the MTD layout needs to be sorted out, I have found this from booting the stock kernel:

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 8 MTD partitions on "raspi":
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000070000 : "Cimage"
0x000000070000-0x000000190000 : "Kernel"
0x000000190000-0x0000007e0000 : "RootFS"
0x000000070000-0x0000007e0000 : "Uimage"
0x0000007e0000-0x000000800000 : "FreeSpace"


It looks like the stock Edimax firmware checks the first 4 bytes of the image (after the 20 byte header) and expects to see the image file size, it reads this as "MIPS", the first 4 bytes of the OpenWrt kernel name in the image (the string "MIPS Linux Kernel Image"). So I either need to insert another 4 bytes in between the header and image to suit the Edimax firmware and correct the filesize and CRC to suit, OR I need to take more/less than 32 bytes off the OpenWrt bin before inserting the Edimax header in front.

I also noticed the overlap but the original boot does that too:

raspi_read: from:70000 len:40
raspi_read: from:70014 len:40
raspi_read: from:70054 len:684fac

The above 3x flash reads then kernel boots OK. I would expect the first LEN to be only 14, or the second read address to start at 0x70040, but thats how it boots straight out of the box.

I started a new wikidevi page the other night and uploaded a few images of the pcb and what specs I can gather:
wikidevi.com/wiki/Edimax_BR-6478AC_v2


At the moment I am just focusing on trying to get a kernel to boot from 0x07000, and will worry about the rest later. Worse case scenario will be 2.6.x with proprietary Realtek drivers for the 11ac radio chipset I guess.

BOOT SUCCESS!

The problem was I was removing the 32 byte header from the openwrt bin image before adding the Edimax CSYS header. It needs both. Basically just take the first 20 bytes from the Edimax firmware and modify the last 4 bytes to the file size of the openwrt image, and edit the last 4 bytes of the image to 0x00. Attempt to flash and watch the serial console for the error message with the expected CRC value, then edit the last 4 bytes of the image to correct CRC and re-flash and will work OK.

I used openwrt-15.05.01-ramips-mt7620-mt7620a-squashfs-sysupgrade.bin and the kernel boots ok but can not find rootfs (needs an root= boot option).

Full console output below:

U-Boot 1.1.3 (Feb 24 2015 - 13:04:02)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb4000
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.2.0
-------------------------------------------- 
ASIC 7620_MP (Port5<->GigaSW)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Feb 24 2015  Time:13:04:02
============================================ 
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
#Reset_MT7530

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.
   5: Load ucos code to SDRAM via TFTP Client. 
   7: Load Boot Loader code then write to Flash via Serial. 
   9: Load Boot Loader code then write to Flash via TFTP. 

raspi_read: from:40028 len:6 

   
5: System Load Boot Loader | F/W  then write to Flash via TFTP Client. 
 Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N)
 Please Input new ones /or Ctrl-C to discard
        Input device IP (192.168.2.81)  Input server IP (192.168.2.89)  Input Linux Kernel filename () 
 netboot_common, argc= 3 

 NetTxPacket = 0x83FE6180 

 KSEG1ADDR(NetTxPacket) = 0xA3FE6180 

 NetLoop,call eth_halt ! 

 NetLoop,call eth_init ! 
Trying Eth0 (10/100-M)

 Waitting for RX_DMA_BUSY status Start... done


 ETH_STATE_ACTIVE!! 
(NetLoop 408) bd->bi_enetaddr = 00:00:aa:bb:cc:dd
(NetLoop 409) NetOurEther = 00:00:aa:bb:cc:dd
Select server or client model: 1/2
server model start
SERVER IP address : 192.168.1.6 port:69
Load address: 0x80a00000
Loading: checksum bad
Got ARP REQUEST, return our IP
Peer IP:192.168.1.220
Got ARP REPLY, set server/gtwy eth addr (bc:5f:f4:fa:03:8d)
Got it
Peer IP:192.168.1.220
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##
done
Bytes transferred = 3670040 (380018 hex)
NetBootFileXferSize= 00380018

****************Parse Head**************
signature=CSYS startAddr=0x01100000 burnAddr=0x00070000 nmodTag=RN68 len=0x00380004 

****************CheckSume**************
CheckSum ok!
****************Start Upgrade Kernel**************
raspi_erase_write: offs:70000, count:380018
raspi_erase: offs:70000 len:380000
........................................................
raspi_write: to:70000 len:380000 
........................................................
raspi_read: from:70000 len:10000 
raspi_read: from:80000 len:10000 
raspi_read: from:90000 len:10000 
raspi_read: from:a0000 len:10000 
raspi_read: from:b0000 len:10000 
raspi_read: from:c0000 len:10000 
raspi_read: from:d0000 len:10000 
raspi_read: from:e0000 len:10000 
raspi_read: from:f0000 len:10000 
raspi_read: from:100000 len:10000 
raspi_read: from:110000 len:10000 
raspi_read: from:120000 len:10000 
raspi_read: from:130000 len:10000 
raspi_read: from:140000 len:10000 
raspi_read: from:150000 len:10000 
raspi_read: from:160000 len:10000 
raspi_read: from:170000 len:10000 
raspi_read: from:180000 len:10000 
raspi_read: from:190000 len:10000 
raspi_read: from:1a0000 len:10000 
raspi_read: from:1b0000 len:10000 
raspi_read: from:1c0000 len:10000 
raspi_read: from:1d0000 len:10000 
raspi_read: from:1e0000 len:10000 
raspi_read: from:1f0000 len:10000 
raspi_read: from:200000 len:10000 
raspi_read: from:210000 len:10000 
raspi_read: from:220000 len:10000 
raspi_read: from:230000 len:10000 
raspi_read: from:240000 len:10000 
raspi_read: from:250000 len:10000 
raspi_read: from:260000 len:10000 
raspi_read: from:270000 len:10000 
raspi_read: from:280000 len:10000 
raspi_read: from:290000 len:10000 
raspi_read: from:2a0000 len:10000 
raspi_read: from:2b0000 len:10000 
raspi_read: from:2c0000 len:10000 
raspi_read: from:2d0000 len:10000 
raspi_read: from:2e0000 len:10000 
raspi_read: from:2f0000 len:10000 
raspi_read: from:300000 len:10000 
raspi_read: from:310000 len:10000 
raspi_read: from:320000 len:10000 
raspi_read: from:330000 len:10000 
raspi_read: from:340000 len:10000 
raspi_read: from:350000 len:10000 
raspi_read: from:360000 len:10000 
raspi_read: from:370000 len:10000 
raspi_read: from:380000 len:10000 
raspi_read: from:390000 len:10000 
raspi_read: from:3a0000 len:10000 
raspi_read: from:3b0000 len:10000 
raspi_read: from:3c0000 len:10000 
raspi_read: from:3d0000 len:10000 
raspi_read: from:3e0000 len:10000 
raspi_read: from:3f0000 len:10000 
raspi_erase: offs:3f0000 len:10000
.
raspi_write: to:3f0000 len:10000 
.
raspi_read: from:3f0000 len:10000 
Done!
## Booting image at bc070000 ...
raspi_read: from:70000 len:40 
Magic number at 0xBC070000 
raspi_read: from:70014 len:40 
   Image Name:   MIPS OpenWrt Linux-3.18.23
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1179580 Bytes =  1.1 MB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:70054 len:11ffbc 
   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 3.18.23 (buildbot@builder1) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r47269) ) 6
[    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 Ralink MT7620a + MT7610e evaluation board
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x03ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x03ffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x03ffffff]
[    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: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=000426ec
[    0.000000] Readback ErrCtl register=000426ec
[    0.000000] Memory: 61228K/65536K available (2622K kernel code, 129K rwdata, 528K rodata, 168K init, 190K bss, 4308)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] CPU Clock: 580MHz
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.010000] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.080000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090000] pinctrl core: initialized pinctrl subsystem
[    0.100000] NET: Registered protocol family 16
[    0.430000] PCI host bridge /pcie@10140000 ranges:
[    0.440000]  MEM 0x0000000020000000..0x000000002fffffff
[    0.450000]   IO 0x0000000010160000..0x000000001016ffff
[    0.460000] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.470000] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.480000] PCI host bridge to bus 0000:00
[    0.480000] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.490000] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.500000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.510000] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.520000] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.530000] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.540000] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.550000] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.560000] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.570000] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.580000] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.590000] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.590000] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.600000] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.610000] pci 0000:00:00.0: card - bus=0x0, slot = 0x0 irq=0
[    0.620000] pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[    0.630000] Switched to clocksource systick
[    0.640000] NET: Registered protocol family 2
[    0.640000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.660000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.670000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.680000] TCP: reno registered
[    0.690000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.700000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.710000] NET: Registered protocol family 1
[    0.720000] rt-timer 10000100.timer: maximum frequency is 2441Hz
[    0.740000] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.760000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.770000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.790000] msgmni has been set to 119
[    0.800000] io scheduler noop registered
[    0.800000] io scheduler deadline registered (default)
[    0.820000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.830000] console [ttyS0] disabled
[    0.840000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a 16550A
[    0.860000] console [ttyS0] enabled
[    0.860000] console [ttyS0] enabled
[    0.870000] bootconsole [early0] disabled
[    0.870000] bootconsole [early0] disabled
[    0.910000] m25p80 spi32766.0: found mx25l6405d, expected en25q64
[    0.920000] m25p80 spi32766.0: mx25l6405d (8192 Kbytes)
[    0.930000] 4 ofpart partitions found on MTD device spi32766.0
[    0.940000] Creating 4 MTD partitions on "spi32766.0":
[    0.950000] 0x000000000000-0x000000030000 : "u-boot"
[    0.960000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.980000] 0x000000040000-0x000000050000 : "factory"
[    0.990000] 0x000000050000-0x000000800000 : "firmware"
[    1.090000] ralink_soc_eth 10100000.ethernet: generated random MAC address b6:8a:03:08:fa:9d
[    1.110000] libphy: mdio: probed
[    1.120000] ralink_soc_eth 10100000.ethernet: connected port 4 to PHY at mdio-bus:04 [uid=03a2940d, driver=Generic ]
[    1.140000] ralink_soc_eth 10100000.ethernet: loaded mt7620 driver
[    1.150000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[    1.170000] rt2880_wdt 10000120.watchdog: Initialized
[    1.180000] TCP: cubic registered
[    1.180000] NET: Registered protocol family 17
[    1.190000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_ne.
[    1.220000] Bridge firewalling registered
[    1.230000] 8021q: 802.1Q VLAN Support v1.8
[    1.240000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.250000] Please append a correct "root=" boot option; here are the available partitions:
[    1.270000] 1f00             192 mtdblock0  (driver?)
[    1.280000] 1f01              64 mtdblock1  (driver?)
[    1.290000] 1f02              64 mtdblock2  (driver?)
[    1.300000] 1f03            7872 mtdblock3  (driver?)
[    1.310000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.310000] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   82.680000] random: nonblocking pool is initialized

After dealing with a slightly-resolved issue with finding a rootfs in the squashfs I was able to get a initramfs rootfs to mount and complete a boot to finally get a shell. See here: https://forum.openwrt.org/viewtopic.php?id=67215

Strange issue with the UART resolved, while it is a 3.3v port, with pin 1: (+)3.3v, 2: Rx, 3: GND, 4:Tx I found the Rx input needed a +5v uart signal for the console to work properly. Have now swapped out the 3.3v usb-uart to a 5v usb-uart and all is good.

Using Elektroman's git repo I am slowly making some progress with exposing the hardware.

Boot log:

U-Boot 1.1.3 (Feb 24 2015 - 13:04:02)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb4000
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.2.0
-------------------------------------------- 
ASIC 7620_MP (Port5<->GigaSW)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Feb 24 2015  Time:13:04:02
============================================ 
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
#Reset_MT7530

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.
   5: Load ucos code to SDRAM via TFTP Client. 
   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 bc070000 ...
raspi_read: from:70000 len:40 
Magic number at 0xBC070000 
raspi_read: from:70014 len:40 
   Image Name:   MIPS OpenWrt Linux-4.4.7
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    2834526 Bytes =  2.7 MB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:70054 len:2b405e 
   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.7 (rohbags@wx2.lan) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 r49395) ) #22 Tue Aug 30 06:19:30 UTC 2016
[    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 Edimax BR-6478ACV2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    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] 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: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=000626c0
[    0.000000] Readback ErrCtl register=000626c0
[    0.000000] Memory: 59496K/65536K available (2620K kernel code, 124K rwdata, 660K rodata, 1772K init, 189K bss, 6040K reserved, 0K cma-r)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    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.000012] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015456] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.080611] pid_max: default: 32768 minimum: 301
[    0.089925] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.102944] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.123300] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.142919] pinctrl core: initialized pinctrl subsystem
[    0.153889] NET: Registered protocol family 16
[    0.426450] PCI host bridge /pcie@10140000 ranges:
[    0.435836]  MEM 0x0000000020000000..0x000000002fffffff
[    0.446210]   IO 0x0000000010160000..0x000000001016ffff
[    0.464696] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.475719] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.488777] PCI host bridge to bus 0000:00
[    0.496778] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.510482] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.522218] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.535722] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.552696] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.565744] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.579557] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.593058] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.607422] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.620932] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.635479] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.649826] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.659684] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.673192] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.687565] pci 0000:00:00.0: card - bus=0x0, slot = 0x0 irq=0
[    0.699154] pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[    0.711736] clocksource: Switched to clocksource systick
[    0.723690] NET: Registered protocol family 2
[    0.733151] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.746925] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.759514] TCP: Hash tables configured (established 1024 bind 1024)
[    0.772242] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.783778] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.796500] NET: Registered protocol family 1
[    3.151421] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    3.164314] futex hash table entries: 256 (order: -1, 3072 bytes)
[    3.192381] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    3.203896] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    3.226113] io scheduler noop registered
[    3.233827] io scheduler deadline registered (default)
[    3.244230] ralink-usb-phy usbphy: invalid resource
[    3.254504] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    3.270725] console [ttyS0] disabled
[    3.277765] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    3.297440] console [ttyS0] enabled
[    3.297440] console [ttyS0] enabled
[    3.311262] bootconsole [early0] disabled
[    3.311262] bootconsole [early0] disabled
[    3.334180] spi spi0.0: force spi mode3
[    3.342378] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    3.352169] 5 ofpart partitions found on MTD device spi0.0
[    3.363103] Creating 5 MTD partitions on "spi0.0":
[    3.372655] 0x000000000000-0x000000030000 : "u-boot"
[    3.384372] 0x000000030000-0x000000040000 : "u-boot-env"
[    3.396911] 0x000000040000-0x000000050000 : "factory"
[    3.408884] 0x000000050000-0x000000070000 : "cimage"
[    3.420651] 0x000000070000-0x000000800000 : "firmware"
[    3.498369] libphy: mdio: probed
[    3.508889] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[    3.523699] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    3.546412] mtk_soc_eth 10100000.ethernet: loaded mt7530 driver
[    3.558967] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    3.576029] rt2880_wdt 10000120.watchdog: Initialized
[    3.586815] NET: Registered protocol family 17
[    3.595805] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need t.
[    3.620959] 8021q: 802.1Q VLAN Support v1.8
[    3.642784] Freeing unused kernel memory: 1772K (80355000 - 80510000)
[    3.668623] init: Console is alive
[    3.675695] init: - watchdog -
[    3.703515] Error: Driver 'gpio-keys' is already registered, aborting...
[    3.718482] Error: Driver 'gpio-keys-polled' is already registered, aborting...
[    3.736370] init: - preinit -
[    3.867944] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[    3.884138] 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
4
[    4.172773] mtk_soc_eth 10100000.ethernet eth0: port 5 link down
[    4.193332] procd: - early -
[    4.199898] procd: - watchdog -
[    4.403805] procd: - ubus -
[    4.421706] random: ubusd urandom read with 9 bits of entropy available
[    4.436858] procd: - init -
Please press Enter to activate this console.
[    4.942794] Loading modules backported from Linux version v4.4-rc5-1913-gc8fdf68
[    4.957603] Backport generated by backports.git backports-20151218-0-g2f58d9d
[    5.016436] mt76x2e 0000:01:00.0: ASIC revision: 76120044
[    5.032024] ROM patch already applied
[    5.040201] Firmware Version: 0.0.00
[    5.047373] Build: 1
[    5.051722] Build Time: 201507311614____
[    5.064773] Firmware running!
[    5.102078] i2c /dev entries driver
[    5.125204] Error: Driver 'gpio-keys' is already registered, aborting...
[    5.168333] Error: Driver 'gpio-keys-polled' is already registered, aborting...
[    5.190014] nf_conntrack version 0.5.0 (957 buckets, 3828 max)
[    5.252985] xt_time: kernel timezone is -0000
[    5.263950] Error: Driver 'gpio-keys' is already registered, aborting...
[    5.280031] Error: Driver 'gpio-keys-polled' is already registered, aborting...
[    5.297920] ip_tables: (C) 2000-2006 Netfilter Core Team
[    5.339308] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 5390, rev 0500 detected
[    5.354834] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 7620 detected
[    5.427873] Error: Driver 'gpio-keys' is already registered, aborting...
[    5.444003] Error: Driver 'gpio-keys-polled' is already registered, aborting...
[    5.463043] Error: Driver 'gpio-keys' is already registered, aborting...
[    5.479357] Error: Driver 'gpio-keys-polled' is already registered, aborting...
[   10.696246] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[   10.712024] 8021q: adding VLAN 0 to HW filter on device eth0
[   10.791009] device eth0.1 entered promiscuous mode
[   10.800651] device eth0 entered promiscuous mode
[   10.859551] br-lan: port 1(eth0.1) entered forwarding state
[   10.870768] br-lan: port 1(eth0.1) entered forwarding state
[   12.865207] br-lan: port 1(eth0.1) entered forwarding state



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

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 DESIGNATED DRIVER (Bleeding Edge, r49395)
 -----------------------------------------------------
  * 2 oz. Orange Juice         Combine all juices in a
  * 2 oz. Pineapple Juice      tall glass filled with
  * 2 oz. Grapefruit Juice     ice, stir well.
  * 2 oz. Cranberry Juice
 -----------------------------------------------------
root@OpenWrt:/# 

cat /proc/cpuinfo

root@OpenWrt:/# cat /proc/cpuinfo 
system type             : MediaTek MT7620A ver:2 eco:6
machine                 : Edimax BR-6478ACV2
processor               : 0
cpu model               : MIPS 24KEc V5.0
BogoMIPS                : 385.84
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

lsmod

root@OpenWrt:/# lsmod
cfg80211              215619  4 rt2x00lib
compat                  1080  4 rt2800soc
crc_ccitt               1035  1 rt2800lib
crc_itu_t               1035  0 
eeprom_93cx6            2282  1 rt2800pci
gpio_button_hotplug     6128  0 
i2c_core               18650  2 i2c_ralink
i2c_dev                 3872  0 
i2c_ralink              2912  0 
input_core             24934  1 input_polldev
input_polldev           2421  0 
ip_tables               9485  4 iptable_nat
ipt_MASQUERADE           688  1 
ipt_REJECT               944  2 
iptable_filter           720  1 
iptable_mangle           912  1 
iptable_nat              784  1 
iptable_raw              688  0 
leds_gpio               2832  0 
mac80211              389306  7 rt2800lib
mt76                   15702  2 mt7603e
mt7603e                27900  0 
mt76x2e                34204  0 
nf_conntrack           47961  8 nf_nat_ipv4
nf_conntrack_ipv4       4784 11 
nf_conntrack_rtcache    2160  0 
nf_defrag_ipv4           886  1 nf_conntrack_ipv4
nf_log_common           2447  1 nf_log_ipv4
nf_log_ipv4             3312  0 
nf_nat                  9115  4 nf_nat_ipv4
nf_nat_ipv4             3729  1 iptable_nat
nf_nat_masquerade_ipv4    1404  1 ipt_MASQUERADE
nf_nat_redirect          987  1 xt_REDIRECT
nf_reject_ipv4          2115  1 ipt_REJECT
rt2800lib              91504  3 rt2800soc
rt2800mmio              6434  2 rt2800soc
rt2800pci               4064  0 
rt2800soc               2496  0 
rt2x00lib              34799  7 rt2800soc
rt2x00mmio              2000  3 rt2800soc
rt2x00pci               1554  1 rt2800pci
rt2x00soc               1202  1 rt2800soc
x_tables               10901 21 iptable_raw
xt_CT                   2448  0 
xt_LOG                   720  0 
xt_REDIRECT              688  0 
xt_TCPMSS               2096  1 
xt_comment               528 26 
xt_conntrack            2192 10 
xt_id                    528 62 
xt_limit                1040  1 
xt_mac                   656  0 
xt_mark                  688  0 
xt_multiport            1168  0 
xt_nat                  1168  0 
xt_state                 720  0 
xt_tcpudp               1776  5 
xt_time                 1648  0 

ifconfig

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:0C:43:76:20:77  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:0C:43:76:20:77  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:10159 (9.9 KiB)
          Interrupt:5 

eth0.1    Link encap:Ethernet  HWaddr 00:0C:43:76:20:77  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:92 (92.0 B)

eth0.2    Link encap:Ethernet  HWaddr 00:0C:43:76:20:78  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:8892 (8.6 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:60 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:4920 (4.8 KiB)  TX bytes:4920 (4.8 KiB)

iw list

root@OpenWrt:/# iw list
Wiphy phy1
        max # scan SSIDs: 4
        max scan IEs length: 2257 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * WDS
                 * monitor
                 * mesh point
        Band 1:
                Capabilities: 0x2f2
                        HT20/HT40
                        Static SM Power Save
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 2-streams
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 2 usec (0x04)
                HT RX MCS rate indexes supported: 0-15, 32
                TX unequal modulation not supported
                HT TX Max spatial streams: 2
                HT TX MCS rate indexes supported may differ
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                        * 2467 MHz [12] (20.0 dBm) (no IR)
                        * 2472 MHz [13] (20.0 dBm) (no IR)
                        * 2484 MHz [14] (20.0 dBm) (no IR)
        valid interface combinations:
                 * #{ managed, AP, mesh point } <= 8,
                   total <= 8, #channels <= 1
        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
Wiphy phy0
        max # scan SSIDs: 4
        max scan IEs length: 2243 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * mesh point
        Band 1:
                Capabilities: 0x1f3
                        RX LDPC
                        HT20/HT40
                        Static SM Power Save
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT TX/RX MCS rate indexes supported: 0-15
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                        * 2467 MHz [12] (20.0 dBm) (no IR)
                        * 2472 MHz [13] (20.0 dBm) (no IR)
                        * 2484 MHz [14] (20.0 dBm) (no IR)
        Band 2:
                Capabilities: 0x1f3
                        RX LDPC
                        HT20/HT40
                        Static SM Power Save
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT TX/RX MCS rate indexes supported: 0-15
                VHT Capabilities (0x000001b0):
                        Max MPDU length: 3895
                        Supported Channel Width: neither 160 nor 80+80
                        RX LDPC
                        short GI (80 MHz)
                        TX STBC
                VHT RX MCS set:
                        1 streams: MCS 0-9
                        2 streams: MCS 0-9
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT RX highest supported: 0 Mbps
                VHT TX MCS set:
                        1 streams: MCS 0-9
                        2 streams: MCS 0-9
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT TX highest supported: 0 Mbps
                Frequencies:
                        * 5180 MHz [36] (20.0 dBm)
                        * 5200 MHz [40] (20.0 dBm)
                        * 5220 MHz [44] (20.0 dBm)
                        * 5240 MHz [48] (20.0 dBm)
                        * 5260 MHz [52] (20.0 dBm) (no IR, radar detection)
                        * 5280 MHz [56] (20.0 dBm) (no IR, radar detection)
                        * 5300 MHz [60] (20.0 dBm) (no IR, radar detection)
                        * 5320 MHz [64] (20.0 dBm) (no IR, radar detection)
                        * 5500 MHz [100] (20.0 dBm) (no IR, radar detection)
                        * 5520 MHz [104] (20.0 dBm) (no IR, radar detection)
                        * 5540 MHz [108] (20.0 dBm) (no IR, radar detection)
                        * 5560 MHz [112] (20.0 dBm) (no IR, radar detection)
                        * 5580 MHz [116] (20.0 dBm) (no IR, radar detection)
                        * 5600 MHz [120] (20.0 dBm) (no IR, radar detection)
                        * 5620 MHz [124] (20.0 dBm) (no IR, radar detection)
                        * 5640 MHz [128] (20.0 dBm) (no IR, radar detection)
                        * 5660 MHz [132] (20.0 dBm) (no IR, radar detection)
                        * 5680 MHz [136] (20.0 dBm) (no IR, radar detection)
                        * 5700 MHz [140] (20.0 dBm) (no IR, radar detection)
                        * 5745 MHz [149] (20.0 dBm) (no IR)
                        * 5765 MHz [153] (20.0 dBm) (no IR)
                        * 5785 MHz [157] (20.0 dBm) (no IR)
                        * 5805 MHz [161] (20.0 dBm) (no IR)
                        * 5825 MHz [165] (20.0 dBm) (no IR)
        valid interface combinations:
                 * #{ IBSS } <= 1, #{ managed, AP, mesh point } <= 8,
                   total <= 8, #channels <= 1, STA/AP BI must match
        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        Device supports VHT-IBSS.

iwinfo

root@OpenWrt:/# iwinfo
wlan0     ESSID: unknown
          Access Point: 00:00:00:00:00:00
          Mode: Client  Channel: unknown (unknown)
          Tx-Power: unknown  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11bgnac
          Hardware: 14C3:7662 14C3:7662 [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy0

wlan1     ESSID: unknown
          Access Point: 00:00:00:00:00:00
          Mode: Client  Channel: unknown (unknown)
          Tx-Power: unknown  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11bgn
          Hardware: unknown [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy1

ls dev

root@OpenWrt:/# ls /dev/
console             mtd3ro              pts                 ttyS3
cpu_dma_latency     mtd4                random              ttyS4
full                mtd4ro              shm                 ttyS5
kmsg                mtdblock0           tty                 ttyS6
log                 mtdblock1           ttyS0               ttyS7
memory_bandwidth    mtdblock2           ttyS1               ttyS8
mtd0                mtdblock3           ttyS10              ttyS9
mtd0ro              mtdblock4           ttyS11              urandom
mtd1                network_latency     ttyS12              watchdog
mtd1ro              network_throughput  ttyS13              watchdog0
mtd2                null                ttyS14              zero
mtd2ro              port                ttyS15
mtd3                ptmx                ttyS2

I have not been able to bring any network interface up yet, ethernet does not seem to receive any packets at all via wan or lan, and while the 2.4ghz radio seems to be operating and detecting networks fine, the 5ghz radio crashes the kernel on bringing up:

root@OpenWrt:/# ifconfig wlan0 up
ifconfig: SIOCSIFFLAGS: Address not available
root@OpenWrt:/# ifconfig wlan1 up
[   63.748375] ------------[ cut here ]------------
[   63.757655] WARNING: CPU: 0 PID: 1036 at compat-wireless-2016-01-10/drivers/net/wireless/ralink/rt2x00/rt2800lib.c:408 rt2800_vco_calibr)
[   63.787467] phy1: invalid EEPROM word 208
[   63.795455] Modules linked in: iptable_nat rt2800soc rt2800pci rt2800mmio rt2800lib nf_nat_ipv4 nf_conntrack_ipv4 iptable_raw iptable_mag
[   63.913578] CPU: 0 PID: 1036 Comm: ifconfig Not tainted 4.4.7 #22
[   63.925721] Stack : 802fd3e8 00000000 00000001 80340000 8396d180 8033c043 802df07c 0000040c
          8051342c 839a0b5c 82de9400 00000001 ffffffff 8004991c 802e44b8 80340000
          00000003 839a0b5c 802e28bc 83895afc ffffffff 800478d4 00000002 00000000
          00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          ...
[   63.996587] Call Trace:
[   64.001478] [<80013f1c>] show_stack+0x50/0x84
[   64.010193] [<800247ac>] warn_slowpath_common+0xa0/0xd0
[   64.020623] [<80024808>] warn_slowpath_fmt+0x2c/0x38
[   64.030535] [<82ea3760>] rt2800_vco_calibration+0x2d4/0x3c8 [rt2800lib]
[   64.043743] [<82ea382c>] rt2800_vco_calibration+0x3a0/0x3c8 [rt2800lib]
[   64.056949] [<82eabc34>] rt2800_gain_calibration+0x1aac/0x1e18 [rt2800lib]
[   64.070659] 
[   64.073620] ---[ end trace 1d55dd6915f221fb ]---

Hi
without changes ??

normally 3.3 volt is needed, why you need 5 volt is strange.
Normally 5 volt will kill your board
-> don't use "red" wire with the four wire UART-TTL cable

network (wired):
I would check wire/ethernet first.
disable/unload wireless drivers rt76* rt28*

build firmware with tcpdump supprt (in network packages)
so you will see in/outgoing packets in console
i.e.
tcpdump -i br-lan

network (wireless):
check one one wifi device at a time.
The error log in the kernel is from the older 2.4GHz band

Here is some warning
phy1: invalid EEPROM

did you overwritten some parts in the flash ?

wlan0 is your 2.4/5GHz device and wlan1 2.4GHz device. are you sure networks detected are actually on 2.4GHz ?

Regarding non working ethernet, you should check the switch configuration and br-lan settings.

Hi, sorry about the delay in responding. I seem to have broken something somewhere but still have the older binary image I first got a shell with....

elektroman wrote:

Hi
without changes ??

I should have pushed up sooner, have 2/4 LEDs working and found a phillips rtc, but somewhere somehow I broke the failsafe boot, askconsole or getty or somewhere in between. If I disable failsafe I can boot right through preinit, init, and procd finishes, but no shell, no "press enter to activate console". I have even tried manually editing the inittab to launch a getty or agetty shell but nothing. Re-enabling failsafe causes boot to hang during preinit. This has me completely stumped for about 4 or 5 days now.

elektroman wrote:

normally 3.3 volt is needed, why you need 5 volt is strange.
Normally 5 volt will kill your board
-> don't use "red" wire with the four wire UART-TTL cable

I know strange eh? I have left it turned on and running for several days on end with the uart powered up and no probs. I have not looked into this further, it may just need a 3.3v pull up resistor on the board or maybe the usb-uart adapter I have is dodgy (ebay chinese-cheapy), but its working. Only ground, tx and rx connected, no +5v fed to the board.

elektroman wrote:

Here is some warning
phy1: invalid EEPROM
did you overwritten some parts in the flash ?

Again still stuck here, I am only using initram kernels about 3.7MB in total, so yes parts of the flash are not being blanked or overwritten - could this be the problem? Should the image binary be a perfect 7.2mb to fill all the flash space? Still can not get kernel to autodetect a squashfs and stuck with initram only. I have been digging through the Edimax GPL source and see some scripts that pad the image filesize out, and notice they calculate rootfs position in flash and manually point to that address with some bash script magic during image build. Is it possible this flash chip does not support auto-detecting rootfs?

anarchy99 wrote:

wlan0 is your 2.4/5GHz device and wlan1 2.4GHz device. are you sure networks detected are actually on 2.4GHz ?

Using the older working image I have, I  again testing this today. wlan0 is the 2.4/5ghz radio, and wlan1 the 2.4 only. wlan0 refuses to be brought up, while wlan1 spits a kernel crash on bring up but seems to work fine after that.

I can confirm it is the 2.4ghz only radio  (wlan1) that is detecting local 2.4ghz networks. Below is my home wlan (Home300n) and a ESP8266 sitting on the desk behind me:

root@OpenWrt:~# iw wlan0 info
Interface wlan0
    ifindex 3
    wdev 0x1
    addr fd:ff:ff:ff:ff:ff
    type managed
    wiphy 0
    txpower 0.00 dBm
root@OpenWrt:~# iw wlan1 info
Interface wlan1
    ifindex 4
    wdev 0x100000001
    addr 74:da:38:68:45:c6
    type managed
    wiphy 1
    txpower 20.00 dBm
root@OpenWrt:~# iwinfo
wlan0     ESSID: unknown
          Access Point: 00:00:00:00:00:00
          Mode: Client  Channel: unknown (unknown)
          Tx-Power: unknown  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11bgnac
          Hardware: 14C3:7662 14C3:7662 [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy0

wlan1     ESSID: unknown
          Access Point: 00:00:00:00:00:00
          Mode: Client  Channel: unknown (unknown)
          Tx-Power: 20 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11bgn
          Hardware: unknown [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy1
root@OpenWrt:~# ifconfig wlan1 up
root@OpenWrt:~# ifconfig wlan0 up
ifconfig: SIOCSIFFLAGS: Address not available
root@OpenWrt:~# iw wlan0 scan
command failed: Network is down (-127)
root@OpenWrt:~# iw wlan1 scan
BSS 30:b5:c2:be:93:fe(on wlan1)
    TSF: 473035264694 usec (5d, 11:23:55)
    freq: 2412
    beacon interval: 100 TUs
    capability: ESS (0x0011)
    signal: -80.00 dBm
    last seen: 1240 ms ago
    Information elements from Probe Response frame:
    SSID: Home300n
    RSN:     * Version: 1
         * Group cipher: CCMP
         * Pairwise ciphers: CCMP
         * Authentication suites: PSK
         * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
    HT capabilities:
        Capabilities: 0x11ee
            HT20/HT40
            SM Power Save disabled
            RX HT20 SGI
            RX HT40 SGI
            TX STBC
            RX STBC 1-stream
            Max AMSDU length: 3839 bytes
            DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 4 usec (0x05)
        HT RX MCS rate indexes supported: 0-15, 32
        HT TX MCS rate indexes are undefined
    HT operation:
         * primary channel: 1
         * secondary channel offset: above
         * STA channel width: any
BSS 5e:cf:7f:81:16:d0(on wlan1)
    TSF: 792502389283 usec (9d, 04:08:22)
    freq: 2412
    beacon interval: 100 TUs
    capability: ESS (0x0001)
    signal: -50.00 dBm
    last seen: 1220 ms ago
    Information elements from Probe Response frame:
    SSID: ESP_8116D0

MBS wrote:

Regarding non working ethernet, you should check the switch configuration and br-lan settings.

Thanks for that handy tip - i basically followed that link and disabled the vlan, and eth0 began to suddenly receive packets and is working fine, and can remotely ssh ok now too.

It seems to detect two switches, but switch1 seems to be working fine, and I tested each switch port and it auto detect the cable link up/down ok.

This command brought the ethernet (eth0) up and working:

root@OpenWrt:/# swconfig dev switch1 set enable_vlan 0
root@OpenWrt:/# swconfig list
Found: switch0 - mt7620
Found: switch1 - mt7530
root@OpenWrt:/# swconfig dev switch0 show
Global attributes:
        enable_vlan: 0
Port 0:
        pvid: 1
        link: port:0 link:down
Port 1:
        pvid: 1
        link: port:1 link:down
Port 2:
        pvid: 1
        link: port:2 link:down
Port 3:
        pvid: 1
        link: port:3 link:down
Port 4:
        pvid: 1
        link: port:4 link:down
Port 5:
        pvid: 1
        link: port:5 link:up speed:1000baseT full-duplex 
Port 6:
        pvid: 1
        link: port:6 link:up speed:1000baseT full-duplex 
Port 7:
        pvid: 1
        link: port:7 link:down
root@OpenWrt:/# swconfig dev switch1 show
Global attributes:
        enable_vlan: 0
Port 0:
        pvid: 0
        link: port:0 link:down
Port 1:
        pvid: 0
        link: port:1 link:down
Port 2:
        pvid: 0
        link: port:2 link:down
Port 3:
        pvid: 0
        link: port:3 link:down
Port 4:
        pvid: 0
        link: port:4 link:up speed:100baseT full-duplex 
Port 5:
        pvid: 0
        link: port:5 link:down
Port 6:
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex 
Port 7:
        pvid: 0
        link: port:7 link:down

Port 0 is WAN, port1 is LAN4, port2 is LAN3, port3 is LAN2 and port4 is LAN1.

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:0C:43:76:20:77  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:0C:43:76:20:77  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:151 errors:0 dropped:8 overruns:0 frame:0
          TX packets:437 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:30498 (29.7 KiB)  TX bytes:148753 (145.2 KiB)
          Interrupt:5 

eth0.1    Link encap:Ethernet  HWaddr 00:0C:43:76:20:77  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:506 (506.0 B)

eth0.2    Link encap:Ethernet  HWaddr 00:0C:43:76:20:78  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:425 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:145350 (141.9 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:772 errors:0 dropped:0 overruns:0 frame:0
          TX packets:772 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:63304 (61.8 KiB)  TX bytes:63304 (61.8 KiB)
root@OpenWrt:/# ping 192.168.1.220
PING 192.168.1.220 (192.168.1.220): 56 data bytes
^C
--- 192.168.1.220 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss
root@OpenWrt:/# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:43:76:20:77  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:214 errors:0 dropped:8 overruns:0 frame:0
          TX packets:468 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:34544 (33.7 KiB)  TX bytes:154617 (150.9 KiB)
          Interrupt:5 

root@OpenWrt:/# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

root@OpenWrt:/# route del -net 192.168.1.0/24 dev br-lan
root@OpenWrt:/# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

root@OpenWrt:/# ping 192.168.1.220
PING 192.168.1.220 (192.168.1.220): 56 data bytes
64 bytes from 192.168.1.220: seq=0 ttl=64 time=3.140 ms
64 bytes from 192.168.1.220: seq=1 ttl=64 time=0.920 ms
64 bytes from 192.168.1.220: seq=2 ttl=64 time=1.640 ms
64 bytes from 192.168.1.220: seq=3 ttl=64 time=1.360 ms
64 bytes from 192.168.1.220: seq=4 ttl=64 time=1.140 ms
^C
--- 192.168.1.220 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.920/1.640/3.140 ms

Right now the biggest issue (apart from the broken failsafe/askconsole/getty) is being stuck editing /etc/ from source before building an initramfs kernel trying to get a console. Gets back to the root problem of not being able to use a squashfs and not being able to point to rootfs= the same way the factory edimax kernel did.


elektroman would you like me to upload the code I have now even though it is broken? Or prefer to waiting until I fix this broken failsafe/askconsole issue first?

Also a bit of hardware hacking info, I have been tracing the pcb tracks thinking half of the LED sockets are not pinned up - but surprise surprise I have found a total of 9 SMD LED pads along the front top of the board, 4 of these are used now, 5 free. Plus another 18 LEDs/GPIO connected to through-hole mounted double LED sockets (2x vertical stacked).

So a grand total of 27 GPIO's connected to LED solder pads, 5 free SMD pads and 18 free through-hole pads.

I also see 2x pull-down jumper pins that are open, floating at around 1.8v they come direct from the MT7620, I have not attempted to pull them to ground to test what they do.

There is also a pad for a 2nd and 3rd USB port at the rear left of the board, as well as a 2nd push button/key input, so another GPIO available here.

Also found 4x jumper pins directly behind the middle switch port, seems to share 4 pins of the ethernet port. I wonder if this is somehow the 2nd serial port, as I am yet to find those pins. But the Edimax firmware definitely used both ttyS0 and ttyS1 as the boot console in the kernel command line.

It is a sad day indeed when Edimax's GPL release compiles and builds easier and cleaner than the DD OpenWrt release. I brought two of these routers and when flipping one into bridge mode the root of the web gui changes into a single page useless piece of crap. I just wanted a shell to run mrtg or similar or to turn snmpd on.

I understand its the bleeding edge trunk with a lot of new tech in it, but I can hardly find any documentation on the new procd, dont know if it needs inittab or not or just optional, seems to conflict with syslogd but needs it, and for some reason when I get inittab working with procd I manually setup getty on ttyS0 as a VT100 but it never spawns on the console, if I deliberately give wrong values in the inittab line I see getty errors on boot up, so when its quiet it must be working ok - but no console? I know it is probably just me but I am finding the new procd a big learning curve, and am only learning via trial and error, and reading source code.

Does procd need the new bootchartd? Using 'make menuconfig' directly under the new init tools in busybox it list "mesg" as a new feature which only "allows group access to write to tty, not everybody", I can find no other info on it, but tried toggling it on or off with different builds and makes no difference.

Something is stopping failsafe from outputing its message to the console, something is stopping init-askconsole from writing to the console, and even when getty fires up clean on ttyS0, there is no shell or any activity on the console.

Last night I rebuilt the edimax v1.09 firmware for the BR-6478AC_V2 and included net-snmp which worked out great, and the serial console now drops out into a shell when the boot is finished - sweet.

So I now have root access on a customised Edimax release, on a 2.6.x kernel with tainted realtek/mediatek factory drivers, so good speeds on 867mbps AC.

Again I have noticed bash scripts calculating kernel size and padding the image until fw addy 0x190000 which is the start of the rootfs partition, and a kernel command line pointing to 0x1f05 (rootfs, 0x190000). I think this needs to be done to get the openwrt image to mount its rootfs in squash not initram.

Is there any way I can dig out the now-working 9x LED's address being used? The factory image has extra /dev nodes for ABAND_LED and GBAND_LED, USB1_LED and USB2_LED, and WPS_LED. Simply echo "LED ON" or "LED OFF" to these nodes to use, easy.

Also can I dig out the gpio addy used for the single push button at rear? I have a feeling something to do with the LED defined in diag.sh & dts maybe whats stopping failsafe mode and then askconsole from running.

Is there anything else I can dig out of this running hacked up edimax firmware that might help the developers?

U-Boot 1.1.3 (Feb 24 2015 - 13:04:02)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb4000
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.2.0
-------------------------------------------- 
ASIC 7620_MP (Port5<->GigaSW)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Feb 24 2015  Time:13:04:02
============================================ 
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
#Reset_MT7530

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.
   5: Load ucos code to SDRAM via TFTP Client. 
   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 bc070000 ...
raspi_read: from:70000 len:40 
Magic number at 0xBC070000 
raspi_read: from:70014 len:40 
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    7204780 Bytes =  6.9 MB
   Load Address: 80000000
   Entry Point:  8000c2f0
raspi_read: from:70054 len:6defac 
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c2f0) ...
## Giving linux memsize in MB, 64

Starting kernel ...


LINUX started...

 THIS IS ASIC
Linux version 2.6.36 (root@wx2.lan) (gcc version 3.4.2) #3 Thu Sep 15 15:40:33 EST 2016

 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=1f05 console=ttyS0
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=0006bffe
Readback ErrCtl register=0006bffe
Memory: 61244k/65536k available (2598k kernel code, 4292k reserved, 655k data, 180k init, 0k highmem)
Hierarchical RCU implementation.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:128
Console: colour dummy device 80x25
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=0xe60000
MT7620 PPLL lock
PPLL_DRV =0x80080504
start PCIe register access
RALINK_RSTCTRL = 2400000
RALINK_CLKCFG1 = 75afffc0

*************** MT7620 PCIe RC mode *************
PCIE0 enabled
init_rt2880pci done
bio: create slab <bio-0> at 0
vgaarb: loaded
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
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 MIPS
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 Kernel WDG Timer Module
Load Ralink Timer0 Module
RT3xxx EHCI/OHCI init.
squashfs: version 4.0 (2009/01/31) Phillip Lougher
fuse init (API version 7.15)
msgmni has been set to 119
io scheduler noop registered (default)
Init GPIO Interrupt
***********Init LED Driver Finishing*****************
Ralink_gpio_init_irq 
LED & GPIO & LAN Status Driver LED_VERSION 
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 8 MTD partitions on "raspi":
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000070000 : "Cimage"
0x000000070000-0x000000190000 : "Kernel"
0x000000190000-0x0000007e0000 : "RootFS"
0x000000070000-0x0000007e0000 : "Uimage"
0x0000007e0000-0x000000800000 : "FreeSpace"
rdm_major = 240
SMACCR1 -- : 0x0000000c
SMACCR0 -- : 0x43762077
Ralink APSoC Ethernet Driver Initilization. v3.0  256 rx/tx descriptors allocated, mtu = 1500!
SMACCR1 -- : 0x0000000c
SMACCR0 -- : 0x43762077
PROC INIT OK!
PPP generic driver version 2.4.2
PPP BSD Compression module registered
NET: Registered protocol family 24
PPTP driver version 0.8.5
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
rt3xxx-ehci rt3xxx-ehci: Ralink EHCI Host Controller
rt3xxx-ehci rt3xxx-ehci: new USB bus registered, assigned bus number 1
rt3xxx-ehci rt3xxx-ehci: irq 18, io mem 0x101c0000
rt3xxx-ehci rt3xxx-ehci: USB 0.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
rt3xxx-ohci rt3xxx-ohci: RT3xxx OHCI Controller
rt3xxx-ohci rt3xxx-ohci: new USB bus registered, assigned bus number 2
rt3xxx-ohci rt3xxx-ohci: irq 18, io mem 0x101c1000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
i8042.c: i8042 controller self test timeout.
Trying to free nonexistent resource <0000000000000060-000000000000006f>
mice: PS/2 mouse device common for all mice
Ralink APSoC Hardware Watchdog Timer
u32 classifier
    Performance counters on
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (956 buckets, 3824 max)
ctnetlink v0.93: registering with nfnetlink.
matchsize=264
xt_time: kernel timezone is -0000
GRE over IPv4 demultiplexor driver
gre: can't add protocol
ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Linux
TCP cubic registered
NET: Registered protocol family 17
@@@@@@@@@@@@@@@@@@@@@    Begin creat a_g_isolation proc    @@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@    End of creat a_g_isolation proc   @@@@@@@@@@@@@@@@
L2TP core driver, V2.0
PPPoL2TP kernel driver, V2.0
L2TP IP encapsulation support (L2TPv3)
L2TP netlink interface
L2TP ethernet pseudowire support (L2TPv3)
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
Freeing unused kernel memory: 180k freed
init started: BusyBox v1.15.2 (2016-09-07 11:29:09 EST)
starting pid 24, tty '': '/etc/rc.sh'
cannot run '/etc/rc.sh': No such file or directory

starting pid 25, tty '': '-/bin/sh' console. 
Algorithmics/MIPS FPU Emulator v1.5


BusyBox v1.15.2 (2016-09-07 11:29:09 EST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

-/bin/sh: .: line 2: can't open '/web/FUNCTION_SCRIPT'
# 

Notice it detects the kernel image size as 6.9MB (7204780) via U-boot, but the kernel it built is only about 1.2MB, and a rootfs, it called AppImg about 5.5MB, and some padding in between. So it detects the entire image not just the kernel - is that how rootfs is working in squashfs?

With the openwrt builds, the non-initram kernel was about 1.7/1.9mb and rootfs.squash about 4mb. when built into a sysupgrade-factory image and flashed, when booting U-boot only detected the actual kernel size (1.7/1.9 etc) not the entire sysupgrade image size as it does with the Edimax firmware.

rmurch wrote:

Also found 4x jumper pins directly behind the middle switch port, seems to share 4 pins of the ethernet port. I wonder if this is somehow the 2nd serial port, as I am yet to find those pins. But the Edimax firmware definitely used both ttyS0 and ttyS1 as the boot console in the kernel command line.

For the ttyS* issue :
I saw recently on some mailinglist some patch from the OpenWRT/LEDE team to "work around". They know about this mix.
To simplify this they "detect" the real ttyS and use this. But the bootloader must setup the right ...

rmurch wrote:

elektroman would you like me to upload the code I have now even though it is broken? Or prefer to waiting until I fix this broken failsafe/askconsole issue first?

I don't know if you use github or other thing ...

You can setup (if you want) yourself an account and upload (via git) your repository. So you can "mess around" with your code.

Something you must/should understand :
branch master is (mostly) reserved to upstream.
create a new branch for hacking on your device.
Don't ever rebase your public branch for developing.
So my branch do-work/Edimax, will be sticked on
9b4650b3b92e6246b986ac9e3d7c2a80d66b805b

If *everything* is OK, this thing will cleaned up, one/two patches will 'live' and get upstream to OpenWRT/LEDE

I do accept patches via 'git format-patch' and 'git send-email'
normal lkml rules apply.

rmurch wrote:

I understand its the bleeding edge trunk with a lot of new tech in it,

...

Rest is removed, I do a simple understanding of the OpenWRT principles ...
First of all, I you do a "default" setup, all needed software is there. You don't have to understand procd/inittab and other things, this *all* is working.

You must understand that at some point in time, during boot, the "real" ttyS0/S1 is activated. So check this if no message after "fail safe" appears.

For gpio there is export in
/sys/class/gpio/

/me thinking about this hw ...

elektroman wrote:

For the ttyS* issue :
I saw recently on some mailinglist some patch from the OpenWRT/LEDE team to "work around". They know about this mix.
To simplify this they "detect" the real ttyS and use this. But the bootloader must setup the right ...

I think this is where the root of the issues are coming from. This morning I have created a new directory and a fresh clone of DD openwrt, and going back to scratch on these dual uarts.

Heavily digging through the Edimax source line by line to undo their kung-fu in regards to both the kernel/rootfs flash addresses issue and the two serial ports, as 16550A's.

Found this snippet inside the Edimax <kernel src>/image directory as "DoImage.sh", explains what they do to create the image. I have been making the image, then just cat'ing it and squashfs.rootfs into a new file, then adding the Edimax fw header (22 bytes). They pad the kernel out then cat it with the rootfs, then run a mkimage command to turn the entire kernel+rootfs into a boot-image file, opposite of what I was doing.

I am gong to try to manually create the kernel + rootfs fw partitions in the DTS the same as factory, and create just a non-initram kernel as before and a separate squashfs.root (or root.tar.gz then mksquashfs) and try to put the factory image together the same as the following code...

rm -rf linux.comp
rm -rf linux.comp.pad
rm -rf linux.comp.pad.appimg
rm -rf linux.comp.pad.appimg.mkimage
kernel_pad=0x11FFAC # 0x120000 - (64 mkimage_head) - (20 cvimg_head) = 0x11FFAC
kernel_address=80000000
kernel_entry=$(readelf -h vmlinux | grep "Entry" | awk '{print $4}')
${CROSS_COMPILE}objcopy -O binary -R .note -R .comment -S vmlinux linux
${TOOLS_DIR}/lzma-4.65/CPP/7zip/Compress/LZMA_Alone/lzma e linux linux.comp

if [ "$_ROOTFS_IN_FLASH_" = "y"  ]; then
  objcopy -I binary -O binary --pad-to=${kernel_pad} linux.comp linux.comp.pad
  cat linux.comp.pad appimg > linux.comp.pad.appimg
else # init ramfs
  mv  linux.comp linux.comp.pad.appimg
fi

${TOOLS_DIR}/mkimage/mkimage -A mips -O linux -T kernel -C lzma -a $kernel_address -e $kernel_entry -n "Linux Kernel Image" -d linux.comp.pad.appimg linux.comp.pad.appimg.mkimage

if [ "$_BOA_" = "y" ]; then
  ${BOA_DIR}/src/cvimg vmlinux linux.comp.pad.appimg.mkimage linux.bin 0x1100000 0x70000
else
  ${WEB_DIR}/LINUX/cvimg vmlinux linux.comp.pad.appimg.mkimage linux.bin 0x1100000 0x70000
fi

So we have a kernel that starts as 0x70000 and ends at 0x190000, giving it a space of 0x120000, or 1,179,648B. That code is saying take 1179648 - (64 mkimage header + 20 edimax image header = 84) = 1179564 = 0x11FFAC. [Note: the Edimax image header actually adds 22 bytes not 20, so huh?]. So if I take the openwrt-ramips-mt7620-br-6478ac-v2-uImage.bin and use objcopy --pad-to=1179564, then cat it with the openwrt-ramips-mt7620-root.squashfs into a new file, run mkimage as above, then finally run the OpenWrt staging_dir/host/bin/mkedimaximg tool and that *should* work.

Current kernel builds are about 1,250,xxx so will chop it down to under 1,179,xxx to test. But if working I should be able to redefine the end of kernel and start of rootfs mtd partitions in DTS to say 1.3MB or 1.5MB for example for a larger kernel. Once uart issue is sorted then kernel is really finished the rest is userspace to sort out, so upon final kernel build we should be able to round up kernel partition size to closest block or so and start the rootfs from there for a nice tight fit.

Some success with rootfs issues. Made these changes to the DTS:

                               partition@70000 {
                                        label = "kernel";
                                        reg = <0x70000 0x140000>;
                                };
                                partition@1B0000 {
                                        label = "rootfs";
                                        reg = <0x1B0000 0x650000>;
                                };

                        //      partition@70000 {
                                partition2@70000 {
                                        label = "firmware";
                                           reg = <0x70000 0x790000>;
                                };

and built an image this way:

[rohbags@wx2 ramips]$ objcopy -I binary -O binary --pad-to=1310636 /home/rohbags/OpenWrt-src/git-build/openwrt/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux-br6478ac-v2.bin.lzma openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad 
[rohbags@wx2 ramips]$ cat openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad openwrt-ramips-mt7620-root.squashfs > openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.rootfs
[rohbags@wx2 ramips]$ mkimage -A mips -O linux -T kernel -C lzma -a 0x80000000 -e 0x8000C2F0 -n "Linux Kernel Image" -d openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.rootfs openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.rootfs.mkimage
Image Name:   Linux Kernel Image
Created:      Sat Sep 17 14:34:53 2016
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    3538860 Bytes = 3455.92 kB = 3.37 MB
Load Address: 80000000
Entry Point:  8000c2f0
[rohbags@wx2 ramips]$ ../../staging_dir/host/bin/mkedimaximg -s CSYS -m RN68 -S 0x1100000 -f 0x70000 -i openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.rootfs.mkimage -o openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.rootfs.mkimage-factory.bin
[rohbags@wx2 ramips]$ tftp -m binary 192.168.1.6 -c put openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.rootfs.mkimage-factory.bin 

and got a success boot and mount of root as squashfs. Errors by jffs2 from the entire flash not being erased, but rootfs_data is automatically created now (in an non-erased section of flash, hence the errors).

## Booting image at bc070000 ...
raspi_read: from:70000 len:40 
Magic number at 0xBC070000 
raspi_read: from:70014 len:40 
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    3538860 Bytes =  3.4 MB
   Load Address: 80000000
   Entry Point:  8000c2f0
raspi_read: from:70054 len:35ffac 
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c2f0) ...
## Giving linux memsize in MB, 64

Starting kernel ...

[    0.000000] Linux version 4.4.7 (rohbags@wx2.lan) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 r49395) ) #129 Sat Sep 17 04:26:11 UTC 2016
[    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 Edimax BR-6478ACV2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    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] 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: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00014003
[    0.000000] Readback ErrCtl register=00014003
[    0.000000] Memory: 60832K/65536K available (2834K kernel code, 134K rwdata, 692K rodata, 172K init, 195K bss, 4704K 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: 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.015457] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.080603] pid_max: default: 32768 minimum: 301
[    0.089919] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.102936] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.119393] devtmpfs: initialized
[    0.130134] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.149737] pinctrl core: initialized pinctrl subsystem
[    0.160729] NET: Registered protocol family 16
[    0.650650] PCI host bridge /pcie@10140000 ranges:
[    0.660040]  MEM 0x0000000020000000..0x000000002fffffff
[    0.670411]   IO 0x0000000010160000..0x000000001016ffff
[    0.692639] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.703661] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.716679] PCI host bridge to bus 0000:00
[    0.724680] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.738379] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.750119] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.763619] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.779864] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.796443] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.809486] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.823305] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.836809] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.851172] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.864681] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.879226] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.893571] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.903429] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.916947] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.931317] pci 0000:00:00.0: card - bus=0x0, slot = 0x0 irq=0
[    0.942905] pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[    0.955508] clocksource: Switched to clocksource systick
[    0.971096] NET: Registered protocol family 2
[    0.980582] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.994361] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    1.006951] TCP: Hash tables configured (established 1024 bind 1024)
[    1.019673] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.031202] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.043915] NET: Registered protocol family 1
[    1.053036] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    1.065915] futex hash table entries: 256 (order: -1, 3072 bytes)
[    1.093873] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.105393] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.127476] io scheduler noop registered
[    1.135126] io scheduler deadline registered (default)
[    1.145646] ralink-usb-phy usbphy: invalid resource
[    1.156693] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.178449] console [ttyS0] disabled
[    1.185436] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a Palmchip BK-3103
[    1.205224] console [ttyS0] enabled
[    1.205224] console [ttyS0] enabled
[    1.218993] bootconsole [early0] disabled
[    1.218993] bootconsole [early0] disabled
[    1.238925] spi spi0.0: force spi mode3
[    1.247162] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    1.256966] 7 ofpart partitions found on MTD device spi0.0
[    1.267898] Creating 7 MTD partitions on "spi0.0":
[    1.277453] 0x000000000000-0x000000030000 : "u-boot"
[    1.289543] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.302409] 0x000000040000-0x000000050000 : "factory"
[    1.314780] 0x000000050000-0x000000070000 : "cimage"
[    1.326991] 0x000000070000-0x0000001b0000 : "kernel"
[    1.339144] 0x0000001b0000-0x000000800000 : "rootfs"
[    1.351275] mtd: device 5 (rootfs) set to be root filesystem
[    1.362751] 1 squashfs-split partitions found on MTD device rootfs
[    1.375080] 0x0000003c0000-0x000000800000 : "rootfs_data"
[    1.388113] 0x000000070000-0x000000800000 : "firmware"
[    1.404190] libphy: mdio: probed
[    1.415376] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[    1.430196] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    1.452918] mtk_soc_eth 10100000.ethernet: loaded mt7530 driver
[    1.465493] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.483523] rt2880_wdt 10000120.watchdog: Initialized
[    1.495243] NET: Registered protocol family 10
[    1.507365] NET: Registered protocol family 17
[    1.516380] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    1.541538] 8021q: 802.1Q VLAN Support v1.8
[    1.565568] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    1.580564] Freeing unused kernel memory: 172K (80395000 - 803c0000)
[    4.109205] init: Console is alive
[    4.116335] init: - watchdog -
[    5.954763] usbcore: registered new interface driver usbfs
[    5.965862] usbcore: registered new interface driver hub
[    5.976577] usbcore: registered new device driver usb
[    5.990172] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    6.004577] ehci-platform: EHCI generic platform driver
[    6.025341] phy phy-usbphy.0: remote usb device wakeup disabled
[    6.037147] phy phy-usbphy.0: UTMI 16bit 30MHz
[    6.046034] ehci-platform 101c0000.ehci: EHCI Host Controller
[    6.057532] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[    6.073430] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[    6.092629] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[    6.106374] hub 1-0:1.0: USB hub found
[    6.114246] hub 1-0:1.0: 1 port detected
[    6.123903] ehci-pci: EHCI PCI platform driver
[    6.135856] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    6.149610] ohci-platform: OHCI generic platform driver
[    6.160353] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[    6.173941] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[    6.189811] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[    6.224568] hub 2-0:1.0: USB hub found
[    6.232475] hub 2-0:1.0: 1 port detected
[    6.242010] ohci-pci: OHCI PCI platform driver
[    6.253223] leds-gpio: probe of gpio-leds failed with error -2
[    6.273561] gpio-keys-polled gpio-keys-polled: Failed to get gpio flags, error: -2
[    6.288737] gpio-keys-polled: probe of gpio-keys-polled failed with error -2
[    6.307159] init: - preinit -
[    7.419271] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[    7.435620] 8021q: adding VLAN 0 to HW filter on device eth0
[    8.663303] mount_root: loading kmods from internal overlay
[    9.540416] block: attempting to load /etc/config/fstab
[    9.551196] block: unable to load configuration (fstab: Entry not found)
[    9.564701] block: no usable configuration
[    9.573569] mount_root: no usable overlay filesystem found, using tmpfs overlay
[    9.608923] mtk_soc_eth 10100000.ethernet eth0: port 5 link down
[    9.630592] procd: - early -
[    9.636527] procd: - watchdog -
[   10.295385] procd: - ubus -
[   10.330595] random: ubusd urandom read with 19 bits of entropy available
[   10.345740] procd: - init -
[   11.096573] tun: Universal TUN/TAP device driver, 1.6
[   11.106710] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[   11.124957] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   11.147543] Loading modules backported from Linux version v4.4-rc5-1913-gc8fdf68
[   11.162353] Backport generated by backports.git backports-20151218-0-g2f58d9d
[   11.218830] mt76x2e 0000:01:00.0: ASIC revision: 76120044
[   11.236415] ROM patch already applied
[   11.245387] Firmware Version: 0.0.00
[   11.252507] Build: 1
[   11.256870] Build Time: 201507311614____
[   11.273763] Firmware running!
[   11.303454] i2c /dev entries driver
[   11.328151] fuse init (API version 7.23)
[   11.376249] ip_tables: (C) 2000-2006 Netfilter Core Team
[   11.393924] lib80211: common routines for IEEE802.11 drivers
[   11.419280] nf_conntrack version 0.5.0 (953 buckets, 3812 max)
[   11.485285] xt_time: kernel timezone is -0000
[   11.507536] PPP generic driver version 2.4.2
[   11.519338] NET: Registered protocol family 24
[   11.547312] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 5390, rev 0500 detected
[   11.562830] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 7620 detected
[   19.196349] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010000: 0xedd8 instead
[   19.236332] jffs2: Empty flash at 0x00010004 ends at 0x00010014
[   19.286350] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010014: 0xadde instead
[   19.677405] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030014: 0xadde instead
[   19.736325] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030018: 0x4a1d instead
[   19.786303] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003001c: 0x637a instead
[   19.846304] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030020: 0x40e4 instead
[   19.906301] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030024: 0x0be9 instead
[   19.966358] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030028: 0xa247 instead
[   20.029547] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003002c: 0x2f0d instead
[   20.060595] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[   20.076536] 8021q: adding VLAN 0 to HW filter on device eth0
[   20.116358] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030030: 0x0801 instead
[   20.185308] device eth0.1 entered promiscuous mode
[   20.194935] device eth0 entered promiscuous mode
[   20.218316] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030034: 0x250a instead
[   20.267427] br-lan: port 1(eth0.1) entered forwarding state
[   20.278635] br-lan: port 1(eth0.1) entered forwarding state
[   20.291301] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030038: 0x2ac1 instead
[   20.310517] jffs2: Further such events for this erase block will not be printed
[   21.237584] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040000: 0x2585 instead
[   21.292478] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040004: 0xcd96 instead
[   21.406376] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040008: 0x84ac instead
[   21.512889] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0004000c: 0xce31 instead
[   21.601514] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040010: 0x129f instead
[   21.666367] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040014: 0xd2d4 instead
[   21.720351] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040018: 0x4f52 instead
[   21.786403] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0004001c: 0xfaf9 instead
[   21.846372] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040020: 0x08c4 instead
[   21.896353] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040024: 0x4b3e instead
[   21.915273] jffs2: Further such events for this erase block will not be printed

and using jffs2 for the root filesystem give me:

[rohbags@wx2 ramips]$ cat openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad openwrt-ramips-mt7620-root.jffs2-64k > openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.jffs2
[rohbags@wx2 ramips]$ mkimage -A mips -O linux -T kernel -C lzma -a 0x80000000 -e 0x8000C2F0 -n "Linux Kernel Image" -d openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.jffs2 openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.jffs2.mkimage
Image Name:   Linux Kernel Image
Created:      Sat Sep 17 15:09:18 2016
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    4456364 Bytes = 4351.92 kB = 4.25 MB
Load Address: 80000000
Entry Point:  8000c2f0
[rohbags@wx2 ramips]$ ../../staging_dir/host/bin/mkedimaximg -s CSYS -m RN68 -S 0x1100000 -f 0x70000 -i openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.jffs2.mkimage -o openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.jffs2.mkimage-factory.bin
[rohbags@wx2 ramips]$ tftp -m binary 192.168.1.6 -c put openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.jffs2.mkimage-factory.bin 

on first boot it hung for about 24 seconds while jffs2 cleaned up the filesystem:

[    6.094479] jffs2_scan_eraseblock(): End of filesystem marker found at 0x2f0000
[    6.109098] jffs2_build_filesystem(): unlocking the mtd device... done.
[    6.122284] jffs2_build_filesystem(): erasing all blocks after the end marker... done.
[   30.683993] jffs2: notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   30.716291] VFS: Mounted root (jffs2 filesystem) readonly on device 31:5.
[   30.730773] Freeing unused kernel memory: 172K (80395000 - 803c0000)

and all other boot ups are clean:

## Booting image at bc070000 ...
raspi_read: from:70000 len:40 
Magic number at 0xBC070000 
raspi_read: from:70014 len:40 
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4456364 Bytes =  4.2 MB
   Load Address: 80000000
   Entry Point:  8000c2f0
raspi_read: from:70054 len:43ffac 
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 8000c2f0) ...
## Giving linux memsize in MB, 64

Starting kernel ...

[    0.000000] Linux version 4.4.7 (rohbags@wx2.lan) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 r49395) ) #129 Sat Sep 17 04:26:11 UTC 2016
[    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 Edimax BR-6478ACV2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    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] 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: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=000426cc
[    0.000000] Readback ErrCtl register=000426cc
[    0.000000] Memory: 60832K/65536K available (2834K kernel code, 134K rwdata, 692K rodata, 172K init, 195K bss, 4704K 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: 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.015456] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.080602] pid_max: default: 32768 minimum: 301
[    0.089918] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.102935] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.119392] devtmpfs: initialized
[    0.130133] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.149735] pinctrl core: initialized pinctrl subsystem
[    0.160728] NET: Registered protocol family 16
[    0.650649] PCI host bridge /pcie@10140000 ranges:
[    0.660039]  MEM 0x0000000020000000..0x000000002fffffff
[    0.670410]   IO 0x0000000010160000..0x000000001016ffff
[    0.692637] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.703660] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.716677] PCI host bridge to bus 0000:00
[    0.724679] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.738378] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.750118] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.763618] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.779862] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.796441] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.809484] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.823303] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.836807] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.851170] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.864679] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.879224] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.893569] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.903427] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.916944] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.931315] pci 0000:00:00.0: card - bus=0x0, slot = 0x0 irq=0
[    0.942902] pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[    0.955506] clocksource: Switched to clocksource systick
[    0.971094] NET: Registered protocol family 2
[    0.980578] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.994356] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    1.006947] TCP: Hash tables configured (established 1024 bind 1024)
[    1.019668] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.031198] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.043911] NET: Registered protocol family 1
[    1.053031] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    1.065911] futex hash table entries: 256 (order: -1, 3072 bytes)
[    1.093870] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.105390] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.127472] io scheduler noop registered
[    1.135122] io scheduler deadline registered (default)
[    1.145643] ralink-usb-phy usbphy: invalid resource
[    1.156693] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.178450] console [ttyS0] disabled
[    1.185437] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a Palmchip BK-3103
[    1.205224] console [ttyS0] enabled
[    1.205224] console [ttyS0] enabled
[    1.218995] bootconsole [early0] disabled
[    1.218995] bootconsole [early0] disabled
[    1.238927] spi spi0.0: force spi mode3
[    1.247164] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    1.256967] 7 ofpart partitions found on MTD device spi0.0
[    1.267900] Creating 7 MTD partitions on "spi0.0":
[    1.277455] 0x000000000000-0x000000030000 : "u-boot"
[    1.289545] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.302411] 0x000000040000-0x000000050000 : "factory"
[    1.314781] 0x000000050000-0x000000070000 : "cimage"
[    1.326990] 0x000000070000-0x0000001b0000 : "kernel"
[    1.339145] 0x0000001b0000-0x000000800000 : "rootfs"
[    1.351277] mtd: device 5 (rootfs) set to be root filesystem
[    1.362747] mtdsplit: no squashfs found in "rootfs"
[    1.372489] 0x000000070000-0x000000800000 : "firmware"
[    1.388779] libphy: mdio: probed
[    1.399895] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[    1.414711] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    1.437451] mtk_soc_eth 10100000.ethernet: loaded mt7530 driver
[    1.450039] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.468072] rt2880_wdt 10000120.watchdog: Initialized
[    1.479774] NET: Registered protocol family 10
[    1.491814] NET: Registered protocol family 17
[    1.500829] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    1.525987] 8021q: 802.1Q VLAN Support v1.8
[    6.127126] jffs2: notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[    6.159407] VFS: Mounted root (jffs2 filesystem) readonly on device 31:5.
[    6.173903] Freeing unused kernel memory: 172K (80395000 - 803c0000)
[    8.063304] init: Console is alive
[    8.075762] init: - watchdog -
[   10.642378] usbcore: registered new interface driver usbfs
[   10.653492] usbcore: registered new interface driver hub
[   10.664194] usbcore: registered new device driver usb
[   10.718879] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   10.733302] ehci-platform: EHCI generic platform driver
[   10.754086] phy phy-usbphy.0: remote usb device wakeup disabled
[   10.765893] phy phy-usbphy.0: UTMI 16bit 30MHz
[   10.774764] ehci-platform 101c0000.ehci: EHCI Host Controller
[   10.786253] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[   10.802156] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[   10.818446] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[   10.832233] hub 1-0:1.0: USB hub found
[   10.840098] hub 1-0:1.0: 1 port detected
[   10.849985] ehci-pci: EHCI PCI platform driver
[   10.889012] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[   10.902725] ohci-platform: OHCI generic platform driver
[   10.913477] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[   10.927069] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[   10.942972] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[   10.978663] hub 2-0:1.0: USB hub found
[   10.986580] hub 2-0:1.0: 1 port detected
[   10.996330] ohci-pci: OHCI PCI platform driver
[   11.007763] leds-gpio: probe of gpio-leds failed with error -2
[   11.059651] gpio-keys-polled gpio-keys-polled: Failed to get gpio flags, error: -2
[   11.074828] gpio-keys-polled: probe of gpio-keys-polled failed with error -2
[   11.093294] init: - preinit -
[   11.732270] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[   11.748609] 8021q: adding VLAN 0 to HW filter on device eth0
[   13.008006] mount_root: mounting /dev/root
[   13.039616] mount_root: loading kmods from internal overlay
[   13.888671] block: attempting to load /etc/config/fstab
[   13.914657] block: extroot: not configured
[   13.938222] mtk_soc_eth 10100000.ethernet eth0: port 5 link down
[   13.970523] procd: - early -
[   13.981336] procd: - watchdog -
[   14.449953] procd: - ubus -
[   14.592315] random: ubusd urandom read with 28 bits of entropy available
[   14.607779] procd: - init -
[   15.506795] tun: Universal TUN/TAP device driver, 1.6
[   15.516907] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[   15.549633] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   15.572018] Loading modules backported from Linux version v4.4-rc5-1913-gc8fdf68
[   15.586828] Backport generated by backports.git backports-20151218-0-g2f58d9d
[   16.431074] mt76x2e 0000:01:00.0: ASIC revision: 76120044
[   16.449256] ROM patch already applied
[   16.694820] Firmware Version: 0.0.00
[   16.701986] Build: 1
[   16.706328] Build Time: 201507311614____
[   16.726990] Firmware running!
[   16.859700] i2c /dev entries driver
[   16.988508] fuse init (API version 7.23)
[   17.017473] ip_tables: (C) 2000-2006 Netfilter Core Team
[   17.033726] lib80211: common routines for IEEE802.11 drivers
[   17.122805] nf_conntrack version 0.5.0 (953 buckets, 3812 max)
[   17.228647] xt_time: kernel timezone is -0000
[   17.271650] PPP generic driver version 2.4.2
[   17.283253] NET: Registered protocol family 24
[   17.412000] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 5390, rev 0500 detected
[   17.427521] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 7620 detected
[   24.125739] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[   24.141669] 8021q: adding VLAN 0 to HW filter on device eth0
[   24.198451] device eth0.1 entered promiscuous mode
[   24.208086] device eth0 entered promiscuous mode
[   24.237788] br-lan: port 1(eth0.1) entered forwarding state
[   24.248999] br-lan: port 1(eth0.1) entered forwarding state
[   25.861196] br-lan: port 1(eth0.1) entered forwarding state
[   43.789668] random: nonblocking pool is initialized

Still no working console yet, but this is one major issue out of the way and now im just focusing on this damn magical uart.

Nice to see that progress. Did you consider to use LEDE? Many of the core developers of openwrt are now active there, with much more activity in the development progress. So, chances are that LEDE has already extinct some of the problems you are facing right now with serial port or GPIOs.

MBS wrote:

Nice to see that progress. Did you consider to use LEDE? Many of the core developers of openwrt are now active there, with much more activity in the development progress. So, chances are that LEDE has already extinct some of the problems you are facing right now with serial port or GPIOs.

Some Devs are updating OpenWRT and LEDE ..

elektroman wrote:

Some Devs are updating OpenWRT and LEDE ..

Probably. And some OpenWrt devs are backporting some of LEDEs changes into OpenWrt, too. But there is about ten times as much activity on LEDEs mailing list than on OpenWrts (no idea about github pull requests, though). So, clearly, it is worth to have a look at LEDE.

This seemingly magical uart port has been a pain in the A, but am very happy to report the root cause of this is found, and problem solved. I got to explain this one else you wont believe it......

I was messing around with the DTS changing the pinctl register maps for the uartlite and uartf(ull) and suddenly broke something and the failsafe message appeared and the askconsole appeared and a fully working shell again, see this snippet from bootlog:

[    5.085172] rt2880-pinmux pinctrl: pin 2 is not set to gpio mux
[    5.097039] rt2880-pinmux pinctrl: request() failed for pin 2
[    5.108497] rt2880-pinmux pinctrl: pin-2 (pio:2) status -22
[    5.119713] leds-gpio: probe of gpio-leds failed with error -2
[    5.139410] rt2880-pinmux pinctrl: pin 1 is not set to gpio mux
[    5.151273] rt2880-pinmux pinctrl: request() failed for pin 1
[    5.162740] rt2880-pinmux pinctrl: pin-1 (pio:1) status -22
[    5.173864] gpio-keys-polled gpio-keys-polled: Failed to get gpio flags, error: -2
[    5.188969] gpio-keys-polled: probe of gpio-keys-polled failed with error -2
[    5.207451] init: - preinit -
[    5.339641] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[    5.356015] 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
[    6.514198] mtk_soc_eth 10100000.ethernet eth0: port 5 link down
[    6.534721] procd: - early -
[    6.541206] procd: - watchdog -
[    6.945185] procd: - ubus -
[    6.972254] random: ubusd urandom read with 14 bits of entropy available
[    6.987234] procd: - init -
Please press Enter to activate this console.
[    7.618532] tun: Universal TUN/TAP device driver, 1.6
[    7.628669] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    7.646708] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    7.670209] Loading modules backported from Linux version v4.4-rc5-1913-gc8fdf68
[    7.685019] Backport generated by backports.git backports-20151218-0-g2f58d9d
[    7.740738] mt76x2e 0000:01:00.0: ASIC revision: 76120044
[    7.760498] ROM patch already applied
[    7.768614] Firmware Version: 0.0.00
[    7.775774] Build: 1
[    7.780125] Build Time: 201507311614____
[    7.797303] Firmware running!
[    7.826965] i2c /dev entries driver
[    7.851600] fuse init (API version 7.23)
[    7.897091] ip_tables: (C) 2000-2006 Netfilter Core Team
[    7.915179] lib80211: common routines for IEEE802.11 drivers
[    7.940572] nf_conntrack version 0.5.0 (953 buckets, 3812 max)
[    8.004388] xt_time: kernel timezone is -0000
[    8.026437] PPP generic driver version 2.4.2
[    8.038193] NET: Registered protocol family 24
[    8.066116] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 5390, rev 0500 detected
[    8.081639] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 7620 detected
[   13.905361] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[   13.921297] 8021q: adding VLAN 0 to HW filter on device eth0
[   14.042250] device eth0.1 entered promiscuous mode
[   14.051875] device eth0 entered promiscuous mode
[   14.130805] br-lan: port 1(eth0.1) entered forwarding state
[   14.142006] br-lan: port 1(eth0.1) entered forwarding state
[   16.139852] br-lan: port 1(eth0.1) entered forwarding state
[   39.914973] random: nonblocking pool is initialized



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

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 DESIGNATED DRIVER (Bleeding Edge, r49395)
 -----------------------------------------------------
  * 2 oz. Orange Juice         Combine all juices in a
  * 2 oz. Pineapple Juice      tall glass filled with
  * 2 oz. Grapefruit Juice     ice, stir well.
  * 2 oz. Cranberry Juice
 -----------------------------------------------------
root@OpenWrt:/# 

This is the first time I have seen a working shell in a couple of weeks - woohoo! IT'S THE GPIO'S!!

Changing the I/O address used in the leds and keys-polled fixed the issue. A lot more digging around in the original Edimax source found the correct i/o addys and was just a matter of figuring out what address matches what led or key.

Currently working with elektroman's do-work/Edimax branch. I think anonymous commits are disabled so I cant push this commit up, but here is the current patch.

Fixes:
* correct mtd partition addresses and rootfs mounted at boot now works.
* serial console fixed
* all 4 leds working correctly [via echo 1 > /sys/class/gpio/*/brightness]
* reset key and optional wps key inputs have correct gpio addresses and working as gpio-key-polled/input0
To do:
* code to automatically build padded kernel image to suit new partition addresses.
* switch configuration not working, no packets received on any ethernet port
* usb seems to be working fine, but no +5v power on port after u-boot (edimax source shows gpio19 as usb_reset_pin?)
* kernel crash on enabling 2.4ghz radio chipset (realtek)

[rohbags@wx2 openwrt]$ git status
# On branch Edimax
# Your branch is ahead of 'elektroman/do-work/Edimax' by 1 commit.
#   (use "git push" to publish your local commits)
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    0001-fixed-serial-console-fixed-gpio-leds-fixed-gpio-keys.patch
nothing added to commit but untracked files present (use "git add" to track)

0001-fixed-serial-console-fixed-gpio-leds-fixed-gpio-keys.patch

From 4a94e969149b8c0a9a9c5f41b58d6f21eaa1a785 Mon Sep 17 00:00:00 2001
From: "R.Murch" <rohan.murch@gmail.com>
Date: Thu, 22 Sep 2016 17:31:45 +1000
Subject: [PATCH] fixed serial console, fixed gpio-leds, fixed gpio-keys

---
 target/linux/ramips/base-files/etc/board.d/01_leds |   8 ++
 .../linux/ramips/base-files/etc/board.d/02_network |  14 ++-
 target/linux/ramips/base-files/etc/diag.sh         |   5 ++
 target/linux/ramips/dts/BR-6478AC-V2.dts           | 100 ++++++++++++++++-----
 4 files changed, 106 insertions(+), 21 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 47e1e6a..9f87062 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -73,6 +73,14 @@ bc2)
 br-6425)
     set_wifi_led "$board:orange:wlan"
     ;;
+
+br-6478ac-v2)
+    ucidef_set_led_default "power" "POWER" "$board:white:power" "1"
+    ucidef_set_led_default "wan" "WAN LED" "$board:blue:wan" "1"
+    set_wifi_led "$board:blue:wlan"
+    set_usb_led "$board:blue:usb"
+    ;;
+
 broadway)
     set_usb_led "$board:red:diskmounted"
     set_wifi_led "$board:red:wps_active"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 42833e8..2ff5faa 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -150,6 +150,14 @@ ramips_setup_interfaces()
         ucidef_add_switch "switch0" \
             "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
         ;;
+
+    br-6478ac-v2)
+    //    ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+        ucidef_set_interface_lan "eth0.1"
+        ucidef_add_switch "switch1" \
+            "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
+        ;;
+
     cf-wr800n|\
     ex2700)
         ucidef_add_switch "switch0" \
@@ -169,7 +177,6 @@ ramips_setup_interfaces()
     wrh-300cr)
         ucidef_set_interface_lan "eth0"
         ;;
-    br-6478ac-v2|\
     e1700|\
     mt7620a_mt7530)
         ucidef_add_switch "switch1" \
@@ -274,6 +281,11 @@ ramips_setup_macs()
         lan_mac=$(cat /sys/class/net/eth0/address)
         wan_mac=$(mtd_get_mac_binary devdata 7)
         ;;
+    br-6478ac-v2)
+        lan_mac=$(cat /sys/class/net/eth0/address)
+        wan_mac=$(cat /sys/class/net/eth0.2/address)
+        //wan_mac=$(mtd_get_mac_binary devdata 7)
+        ;;
     cy-swr1100|\
     dir-645)
         lan_mac=$(mtd_get_mac_ascii nvram lanmac)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index c638d16..b2e23a1 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -33,6 +33,11 @@ get_status_led() {
     xdxrn502j)
         status_led="$board:green:power"
         ;;
+
+    br-6478ac-v2)
+        status_led="$board:white:power"
+        ;;
+
     a5-v11|\
     cs-qr10|\
     d105|\
diff --git a/target/linux/ramips/dts/BR-6478AC-V2.dts b/target/linux/ramips/dts/BR-6478AC-V2.dts
index 0951b5a..6274b40 100644
--- a/target/linux/ramips/dts/BR-6478AC-V2.dts
+++ b/target/linux/ramips/dts/BR-6478AC-V2.dts
@@ -18,13 +18,18 @@
     model = "Edimax BR-6478ACV2";
 
     chosen {
-                bootargs = "console=ttyS0,57600";
+        bootargs = "console=ttyS0,57600";
     };
 
     palmbus@10000000 {
-            spi@b00 {
+        gpio1: gpio@638 {
+            status = "okay";
+        };
+        gpio2: gpio@660 {
+            status = "okay";
+        };
+        spi@b00 {
             status = "okay";
-
             m25p80@0 {
                 #address-cells = <1>;
                 #size-cells = <1>;
@@ -32,7 +37,6 @@
                 reg = <0 0>;
                 linux,modalias = "m25p80", "mx25l6405d";
                 spi-max-frequency = <10000000>;
-    
                 partition@0 {
                     label = "u-boot";
                     reg = <0x0 0x30000>;
@@ -56,15 +60,39 @@
                     reg = <0x50000 0x20000>;
                     read-only;
                 };
-    
+
                 partition@70000 {
+                    label = "kernel";
+                    reg = <0x70000 0x140000>;
+                };
+                partition@1B0000 {
+                    label = "rootfs";
+                    reg = <0x1B0000 0x650000>;
+                };
+                partition2@70000 {
                                     label = "firmware";
-                                    reg = <0x00070000 0x00790000>;
+                                    reg = <0x70000 0x790000>;
                 };
+
             };
         };
+
+        uartlite@c00 {
+            status = "okay";
+            compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a"; // palmchip bk-3103
+            reg = <0xc00 0x100>;
+            resets = <&rstctrl 19>;
+            reset-names = "uartl";
+            interrupt-parent = <&intc>;
+            interrupts = <12>;
+            reg-shift = <2>;
+            pinctrl-names = "default";
+            pinctrl-0 = <&uartlite_pins>;
+        };
+
     };
 
+
     pinctrl {
         state_default: pinctrl0 {
         gpio {
@@ -74,6 +102,16 @@
         };
     };
 
+
+    usbphy: usbphy {
+        compatible = "mediatek,mt7620-usbphy";
+        #phy-cells = <1>;
+    //    resets = <&rstctrl 22 &rstctrl 25>;
+        resets = <&rstctrl 22 &rstctrl 19>;
+        reset-names = "host", "device";
+    };
+
+
     ethernet@10100000 {
         status = "okay";
         mtd-mac-address = <&factory 0x28>;
@@ -130,50 +168,72 @@
         ralink,mtd-eeprom = <&factory 0>;
     };
     
+
     gpio-keys-polled {
         compatible = "gpio-keys-polled";
         #address-cells = <1>;
         #size-cells = <0>;
         poll-interval = <20>;
 
+        wps {
+            label = "wps";
+            gpios = <&gpio0 1 1>;
+        //    linux,code = <0x211>;
+            linux,code = <0x100>;
+        };
         reset {
             label = "reset";
-            gpios = <&gpio0 1 0>;
-            linux,code = <0x198>;
+            gpios = <&gpio0 12 1>;
+        //    linux,code = <0x198>;
+            linux,code = <0x101>;
         };
 
-        wps {
-            label = "wps";
-            gpios = <&gpio0 2 0>;
-            linux,code = <0x211>;
-        };
     };
 
+
     gpio-leds {
         compatible = "gpio-leds";
-
         power {
-            label = "br-6478ac-v2:green:power";
-            gpios = <&gpio0 10 1>;
+            label = "br-6478ac-v2:white:power";
+            gpios = <&gpio0 11 1>; // edimax wps
         };
-
         wan {
-            label = "br-6478ac-v2:green:wps";
-            gpios = <&gpio0 12 1>;
+            label = "br-6478ac-v2:blue:wan";
+            gpios = <&gpio0 7 1>; // edimax power
+        };
+        wlan {
+            label = "br-6478ac-v2:blue:wlan";
+            gpios = <&gpio0 10 1>; // edimax wireless_aband
         };
+        usb {
+            label = "br-6478ac-v2:blue:usb";
+            gpios = <&gpio0 14 1>; // edimax wireless_gband
+        };
+        //wifi { // unused smd led pad on pcb
+        //    label = "br-6478ac-v2:blue:wifi";
+        //    gpios = <&gpio1 1 1>; // edimax wireless, gpio25
+        //};
+
     };
 
+
     pcie@10140000 {
         status = "okay";
     };
 
     ehci@101c0000 {
         status = "okay";
+        interrupt-parent = <&intc>;
+        interrupts = <18>;
+    //    interrupts = <34>;
     };
 
     ohci@101c1000 {
         status = "okay";
+        interrupt-parent = <&intc>;
+        interrupts = <18>;
+    //    interrupts = <26>;
+    //    interrupts = <34>;
     };
 };
 
-    
-- 
1.8.3.1

Finally a friendly warning to other devs who get caught like this, ** incorrect gpio address values defined in the DTS for gpio-leds and gpio-keys-polled can cause failsafe/askconsole to break ** and even manually firing off getty to ttyS0 will quietly die. I think somehow failsafe was hanging or locking ttyS0 and causing all other processes using ttyS0 to silently do nothing as if ttyS0 == /dev/null! But amongst all of that mess the kernel boot messages will output to ttyS0 perfectly fine, just to cause more confusion.

Using the above patch to build a kernel, this is the method I use to then pad the kernel out and add the squash root to match the correct mtd partition address for rootfs, then add the Edimax header and upload the image.

[rohbags@wx2 ramips]$ pwd
/home/rohbags/OpenWrt-src/git-build/openwrt/bin/ramips
[rohbags@wx2 ramips]$ objcopy -I binary -O binary --pad-to=1310636 /home/rohbags/OpenWrt-src/git-build/openwrt/build_dir/target-mipsel_24kec+dsp_musl-1.1.14/linux-ramips_mt7620/vmlinux-br6478ac-v2.bin.lzma openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad
[rohbags@wx2 ramips]$ cat openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad openwrt-ramips-mt7620-root.squashfs > openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.squash
[rohbags@wx2 ramips]$ mkimage -A mips -O linux -T kernel -C lzma -a 0x80000000 -e 0x8000C2F0 -n "Linux Kernel Image" -d openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.squash openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.squash.mkimage
Image Name:   Linux Kernel Image
Created:      Thu Sep 22 12:29:09 2016
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    3669932 Bytes = 3583.92 kB = 3.50 MB
Load Address: 80000000
Entry Point:  8000c2f0
[rohbags@wx2 ramips]$ ../../staging_dir/host/bin/mkedimaximg -s CSYS -m RN68 -S 0x1100000 -f 0x70000 -i openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.squash.mkimage -o openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.squash.mkimage-factory.bin
[rohbags@wx2 ramips]$ tftp -m binary 192.168.1.6 -c put openwrt-ramips-mt7620-br-6478ac-v2-vmlinux.pad.squash.mkimage-factory.bin 
[rohbags@wx2 ramips]$ 

fixed ethernet gigabit switch, vlans and wan ports

From acf9064a7461f9848b25cb0cf178fa5c87c40c76 Mon Sep 17 00:00:00 2001
From: "R.Murch" <rohan.murch@gmail.com>
Date: Fri, 23 Sep 2016 16:11:19 +1000
Subject: [PATCH] fixed ethernet switch, vlan and wan ports

---
 target/linux/ramips/base-files/etc/board.d/02_network |  2 +-
 target/linux/ramips/dts/BR-6478AC-V2.dts              | 13 +++++--------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 2ff5faa..006b877 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -153,7 +153,7 @@ ramips_setup_interfaces()
 
     br-6478ac-v2)
     //    ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-        ucidef_set_interface_lan "eth0.1"
+    //    ucidef_set_interface_lan "eth0.1"
         ucidef_add_switch "switch1" \
             "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
         ;;
diff --git a/target/linux/ramips/dts/BR-6478AC-V2.dts b/target/linux/ramips/dts/BR-6478AC-V2.dts
index 6274b40..3aa5af7 100644
--- a/target/linux/ramips/dts/BR-6478AC-V2.dts
+++ b/target/linux/ramips/dts/BR-6478AC-V2.dts
@@ -106,8 +106,8 @@
     usbphy: usbphy {
         compatible = "mediatek,mt7620-usbphy";
         #phy-cells = <1>;
-    //    resets = <&rstctrl 22 &rstctrl 25>;
-        resets = <&rstctrl 22 &rstctrl 19>;
+        resets = <&rstctrl 22 &rstctrl 25>;
+    //    resets = <&rstctrl 22 &rstctrl 19>;
         reset-names = "host", "device";
     };
 
@@ -117,6 +117,8 @@
         mtd-mac-address = <&factory 0x28>;
         pinctrl-names = "default";
         pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+    //    mediatek,portmap = "llllw";
+        mediatek,portmap = "wllll";
 
         port@5 {
             status = "okay";
@@ -126,32 +128,26 @@
 
         mdio-bus {
             status = "okay";
-
             phy0: ethernet-phy@0 {
                 reg = <0>;
                 phy-mode = "rgmii";
             };
-
             phy1: ethernet-phy@1 {
                 reg = <1>;
                 phy-mode = "rgmii";
             };
-
             phy2: ethernet-phy@2 {
                 reg = <2>;
                 phy-mode = "rgmii";
             };
-
             phy3: ethernet-phy@3 {
                 reg = <3>;
                 phy-mode = "rgmii";
             };
-
             phy4: ethernet-phy@4 {
                 reg = <4>;
                 phy-mode = "rgmii";
             };
-
             phy1f: ethernet-phy@1f {
                 reg = <0x1f>;
                 phy-mode = "rgmii";
@@ -166,6 +162,7 @@
 
     wmac@10180000 {
         ralink,mtd-eeprom = <&factory 0>;
+    //    ralink,eeprom = "soc_wmac.eeprom";
     };
     
 
-- 
1.8.3.1