OpenWrt Forum Archive

Topic: ImageBuilder w/ custom MTD layout or rootfs= option

The content of this topic has been archived on 27 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am almost able to get OpenWrt running on an Edimax BR-6478AC V2. I have 15.05.01 kernel booting OK but can not mount root "/".

[    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.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)

I have download ImageBuilder and build a custom image for mt7620A that boots, but I can not find how to modify the MTD layout or set a kernel boot option roofs=1f03.

Any help much appreciated!

You miss at least 2 partitons: kernel and rootfs (usually, there will even be rootfs_data, but that is determined automatically by scanning through rootfs). These 2 partitions are located within the firmware partition, size and position are passed over using the boot options. You need to post the full bootlog for more help.

I have created a new target profile using ImageBuilder and have created the same partition layout as the original firmware reported, so "Kernel" and "RootFS" are now at the same addresses as before (is this correct?).

Passing the root=1f05 points to the same RootFS as before, but I am now getting a new JFFS2 error. From the output of the "make image" it looks like it only creates a squashfs. There is a boot option "rootfstype=squashfs,jffs2" that I can not find in the sources to remove, even after grep'ing.

So I am not sure if there truly is a jffs2 filesystem or squashfs at RootFS.

Anyone familiar with the following jffs2 boot errors?

## 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:    1179598 Bytes =  1.1 MB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:70054 len:11ffce 
   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) ) #1 Sun Jan 31 14:11:59 CET 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-6478AC V2
[    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 root=1f05 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: 61228K/65536K available (2622K kernel code, 129K rwdata, 528K rodata, 168K init, 190K bss, 4308K 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] 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: mx25l6405d (8192 Kbytes)
[    0.920000] 6 ofpart partitions found on MTD device spi32766.0
[    0.930000] Creating 6 MTD partitions on "spi32766.0":
[    0.940000] 0x000000000000-0x000000030000 : "u-boot"
[    0.950000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.960000] 0x000000040000-0x000000050000 : "factory"
[    0.980000] 0x000000050000-0x000000070000 : "Cimage"
[    0.990000] 0x000000070000-0x000000190000 : "Kernel"
[    1.000000] 0x000000190000-0x0000007e0000 : "RootFS"
[    1.010000] ralink_soc_eth 10100000.ethernet: generated random MAC address d2:9b:0f:9d:66:ab
[    1.030000] libphy: mdio: probed
[    1.040000] ralink_soc_eth 10100000.ethernet: connected port 4 to PHY at mdio-bus:04 [uid=03a2940d, driver=Generic PHY]
[    1.060000] ralink_soc_eth 10100000.ethernet: loaded mt7620 driver
[    1.070000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[    1.090000] rt2880_wdt 10000120.watchdog: Initialized
[    1.100000] TCP: cubic registered
[    1.110000] NET: Registered protocol family 17
[    1.110000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    1.140000] Bridge firewalling registered
[    1.150000] 8021q: 802.1Q VLAN Support v1.8
[    1.160000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0xc291 instead
^@^@^@^@^@^@^@^@[    1.180000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x492c instead
^@^@^@^@^@^@^@^@[    1.200000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0x34d8 instead
^@^@^@^@^@^@^@^@[    1.230000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0x7b5b instead
^@^@^@^@^@^@^@^@[    1.250000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x8851 instead
^@^@^@^@^@^@^@^@[    1.270000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0xedb3 instead
^@^@^@^@^@^@^@^@[    1.290000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0x94be instead
^@^@^@^@^@^@^@^@[    1.310000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x301d instead

Is there any way to confirm what partitions of what sizes are built into the image before flashing? How can I confirm that the MTD partitions I create use the same addresses as the original firmware, or that proper filesystems exist at the address I expect?

Should I just calculate the size of the new kernel and set the RootFS MTD address to be the next block in the firmware after the kernel? Will the kernel partition automatically pad its size to the start of the RootFS partition set in the ImageBuilder profile .dts ?

With the original firmware there was a final partition called "Freespace" that used that last 20,000 blocks, I have not created it, is this ok?

After many attempts I am almost ready to give up. I just can not get rootfs to mount, or to find a valid filesystem. The kernel is about 1.1MB and I have tried allowing 1.3MB even 2M and still it can not find a valid rootfs after the kernel.

I need to know exactly where the rootfs starts within the ImageBuilder image that is built, so I know the MTD address matches the size and location of the rootfs.

Otherwise I am not what else to do next.

Starting kernel ...

[    0.000000] Linux version 3.18.23 (buildbot@builder1) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r476
[    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-6478AC V2
[    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 root=1f05 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: 61228K/65536K available (2622K kernel code, 129K rwdata, 528K rodata, 168K init, 190K bs)
[    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: mx25l6405d (8192 Kbytes)
[    0.920000] 6 ofpart partitions found on MTD device spi32766.0
[    0.930000] Creating 6 MTD partitions on "spi32766.0":
[    0.940000] 0x000000000000-0x000000030000 : "u-boot"
[    0.950000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.960000] 0x000000040000-0x000000050000 : "factory"
[    0.980000] 0x000000050000-0x000000070000 : "cimage"
[    0.990000] 0x000000070000-0x000000800000 : "firmware"
[    1.090000] 0x000000270000-0x000000800000 : "rootfs"
[    1.100000] mtd: device 5 (rootfs) set to be root filesystem
[    1.110000] mtdsplit: no squashfs found in "rootfs"
[    1.120000] mtdsplit: no squashfs found in "spi32766.0"
[    1.130000] ralink_soc_eth 10100000.ethernet: generated random MAC address e2:01:b2:fc:7e:53
[    1.150000] libphy: mdio: probed
[    1.160000] ralink_soc_eth 10100000.ethernet: connected port 4 to PHY at mdio-bus:04 [uid=03a2940d, driver=G]
[    1.180000] ralink_soc_eth 10100000.ethernet: loaded mt7620 driver
[    1.190000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[    1.210000] rt2880_wdt 10000120.watchdog: Initialized
[    1.220000] TCP: cubic registered
[    1.220000] NET: Registered protocol family 17
[    1.230000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to loa.
[    1.260000] Bridge firewalling registered
[    1.270000] 8021q: 802.1Q VLAN Support v1.8
[    1.280000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x4a73 instead
[    1.300000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0xc7a0 instead
[    1.320000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0xebf4 instead
[    1.340000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0xfc30 instead
[    1.360000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0xc2e1 instead

I have had a closer look into it and would guess, that it would be better to start over properly. That said, checkout the sources of trunk and make the appropriate changes in the way of this added device.
Also check the history of each changed file, in case things have been reworked lately. You may even use LEDE instead, as it has seen more maintenance, lately.
The ramips architecture is also using DeviceTree for configuration, which means my previous comment about using boot options is obsolete.

Hi this is your layout

0x000000000000-0x000000030000 : "uboot"
0x000000030000-0x000000040000 : "uboot-env"
0x000000040000-0x000000050000 : "factory"
0x000000050000-0x000000070000 : "cimage"
0x000000070000-0x000000800000 : "firmware"

kernel and rootfs layout are calculated during boot.
To more precise OpenWRT uses kernel+squashfs in one partition
and recalculate other partition sizes.
firmware = kernel + rootfs
overlay (rootfs_data) after firmware

In the previous post you see a link pointing to the DTS file
which has only 4 partitions.

MBS wrote:

I have had a closer look into it and would guess, that it would be better to start over properly. That said, checkout the sources of trunk and make the appropriate changes in the way of this added device.

I have repeated the above steps and have a new target profile called BR-6478AC-V2, I had only half done this step before. The build is much more cleaner, and the edimax tool now also builds a factory-ready image. Image grew from 3.1M to 3.9M.

I have defined the "firmware" MTD partition in target/linux/ramips/dts/BR-6478AC-V2.dts from the start of the kernel 0x070000, to the end of the flash device (8M). I did hope the kernel would find the rootfs automatically during boot, but I seem to be stuck with the same error.

Without rootfs= boot option

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 Edimax BR-6478AC V2
[    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=000426ce
[    0.000000] Readback ErrCtl register=000426ce
[    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: mx25l6405d (8192 Kbytes)
[    0.920000] 5 ofpart partitions found on MTD device spi32766.0
[    0.930000] Creating 5 MTD partitions on "spi32766.0":
[    0.940000] 0x000000000000-0x000000030000 : "u-boot"
[    0.950000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.960000] 0x000000040000-0x000000050000 : "factory"
[    0.980000] 0x000000050000-0x000000070000 : "cimage"
[    0.990000] 0x000000070000-0x000000800000 : "firmware"
[    1.090000] ralink_soc_eth 10100000.ethernet: generated random MAC address 16:fb:74:1a:3a:8f
[    1.110000] libphy: mdio: probed
[    1.110000] 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.160000] rt2880_wdt 10000120.watchdog: Initialized
[    1.170000] 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.220000] 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             128 mtdblock3  (driver?)
[    1.310000] 1f04            7744 mtdblock4  (driver?)
[    1.320000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.320000] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

With rootfs=1f04 (firmware partition address, where else?)

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 Edimax BR-6478AC V2
[    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 root=1f04 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=000426c8
[    0.000000] Readback ErrCtl register=000426c8
[    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: mx25l6405d (8192 Kbytes)
[    0.920000] 5 ofpart partitions found on MTD device spi32766.0
[    0.930000] Creating 5 MTD partitions on "spi32766.0":
[    0.940000] 0x000000000000-0x000000030000 : "u-boot"
[    0.950000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.960000] 0x000000040000-0x000000050000 : "factory"
[    0.980000] 0x000000050000-0x000000070000 : "cimage"
[    0.990000] 0x000000070000-0x000000800000 : "firmware"
[    1.090000] ralink_soc_eth 10100000.ethernet: generated random MAC address ae:a6:36:91:60:36
[    1.110000] libphy: mdio: probed
[    1.110000] 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.160000] rt2880_wdt 10000120.watchdog: Initialized
[    1.170000] 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.220000] 8021q: 802.1Q VLAN Support v1.8
[    1.240000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x5343 instead
[    1.260000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0x4e52 instead
[    1.280000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0xce0e instead
[    1.300000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x0527 instead
[    1.310000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0xed1f instead
[    1.330000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0xc357 instead
[    1.350000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x1200 instead
[    1.370000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x0080 instead
[    1.390000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000028: 0x0080 instead
[    1.410000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000002c: 0x2fae instead
[    1.430000] jffs2: Further such events for this erase block will not be printed

target/linux/ramips/dts/BR-6478AC-V2.dts

/dts-v1/;

/include/ "mt7620a.dtsi"

/ {
    compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
    model = "Edimax BR-6478AC V2";

    chosen {
                //bootargs = "console=ttyS0,57600 console=ttyS1,57600n8 root=1f05";
                //bootargs = "console=ttyS0,57600 root=1f05 rootfstype=squashfs";
                bootargs = "console=ttyS0,57600 root=1f04";
        };

    palmbus@10000000 {
        spi@b00 {
            status = "okay";

            m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "mx25l6405d";
                reg = <0 0>;
                linux,modalias = "m25p80", "mx25l6405d";
                spi-max-frequency = <10000000>;

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

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

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

                partition@50000 {
                    label = "cimage";
                    reg = <0x50000 0x20000>;
                    read-only;
                };

                //partition@170000 {
                //    reg = <0x00270000 0x00590000>;
                //    label = "rootfs";
                //};

                partition@70000 {
                                reg = <0x00070000 0x00790000>;
                                label = "firmware";
                };


            };
        };
               // uart@500 { // edimax ttyS0
               //         compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
               //         reg = <0x500 0x100>;
               //         resets = <&rstctrl 12>;
               //         reset-names = "uart";
               //         interrupt-parent = <&intc>;
               //         interrupts = <5>;
               //         reg-shift = <2>;
               //         //status = "enabled";
               // };
               //uartlite@c00 { // edimax ttyS1
               //         compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
               //         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 {
                ralink,group = "i2c", "uartf";
                ralink,function = "gpio";
            };
        };
    };

    ethernet@10100000 {
        status = "okay";

        pinctrl-names = "default";
        pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;

        ralink,port-map = "llllw";

        port@4 {
            status = "okay";
            phy-mode = "rgmii";
            phy-handle = <&phy4>;
        };

        port@5 {
            status = "okay";
            phy-mode = "rgmii";
            phy-handle = <&phy5>;
        };

        mdio-bus {
            status = "okay";

            phy4: ethernet-phy@4 {
                reg = <4>;
                phy-mode = "rgmii";
            };

            phy5: ethernet-phy@5 {
                reg = <5>;
                phy-mode = "rgmii";
            };
        };
    };

    gsw@10110000 {
        ralink,port4 = "gmac";
    };

    sdhci@10130000 {
        status = "okay";
    };

    pcie@10140000 {
        status = "okay";
    };

    gpio-leds {
        compatible = "gpio-leds";
        power {
            label = "br-6478ac-v2:white:power";
            gpios = <&gpio1 15 1>;
        };
        wlan {
            label = "br-6478ac-v2:blue:wlan";
            gpios = <&gpio3 0 1>;
        };
    };


    gpio-keys-polled {
        compatible = "gpio-keys";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <20>;
        s2 {
            label = "S2";
            gpios = <&gpio0 1 1>;
            linux,code = <0x100>;
        };
        s3 {
            label = "S3";
            gpios = <&gpio0 2 1>;
            linux,code = <0x101>;
        };
    };

    ehci@101c0000 {
        status = "okay";
    };

    ohci@101c1000 {
        status = "okay";
    };
};

Once again, any help will be most greatly appreciated.

elektroman wrote:

Hi this is your layout

0x000000000000-0x000000030000 : "uboot"
0x000000030000-0x000000040000 : "uboot-env"
0x000000040000-0x000000050000 : "factory"
0x000000050000-0x000000070000 : "cimage"
0x000000070000-0x000000800000 : "firmware"

kernel and rootfs layout are calculated during boot.
To more precise OpenWRT uses kernel+squashfs in one partition
and recalculate other partition sizes.
firmware = kernel + rootfs
overlay (rootfs_data) after firmware

In the previous post you see a link pointing to the DTS file
which has only 4 partitions.

I have added the 5th "firmware" partition as you mentioned above.

So if I flash the OpenWrt combined image into firmware, U-boot happily finds the kernel within the "firmware" partition and boots the kernel, but the kernel can not find any rootfs after that.

Should there be a rootfs= kernel option? If this is automatic I presume not?

Is the rootfstype=squashfs,jffs2 a problem? I thought the kernel looks for squashfs first and mounts read-only then later remounts as jffs2 - so why is this kernel seeking a jffs2 block during boot and not a squashfs block?

I am definitely confused at this point.

rmurch wrote:

Should there be a rootfs= kernel option? If this is automatic I presume not?

Is the rootfstype=squashfs,jffs2 a problem? I thought the kernel looks for squashfs first and mounts read-only then later remounts as jffs2 - so why is this kernel seeking a jffs2 block during boot and not a squashfs block?

I am definitely confused at this point.

For what the kernel is looking "it depends".

If you provide root= the kernel looks for the root partition.

If not the (hopefully) embedded/attached initramfs will do it's magic
Look into 'packages/base-files'

Please remove the root parameter

elektroman wrote:

Look into 'packages/base-files'

Please remove the root parameter

I have removed the root= parameter, and have tried about 50x different combinations of MTD partition layouts and all result in 1 of 2 jffs2 errors as posted previously.

I have also downloaded the full git source build and completely built openwrt from scratch, with a kernel I only built in squashfs and fuse support, still gives error rootfs errors, but admittedly its a stock profile with no extra MTD partitions defined, but the fact jffs2 is in the kernel again has made me move back to the ImageBuilder for 15.05.01.

console output for git build:

## 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.14
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1258298 Bytes =  1.2 MB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:70054 len:13333a 
   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.14 (rohbags@wx2.lan) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 49926) ) #1 Mon Aug 29 07: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 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=000400d2
[    0.000000] Readback ErrCtl register=000400d2
[    0.000000] Memory: 60836K/65536K available (2831K kernel code, 137K rwdata, 692K rodata, 172K init, 195K bss, 4700)
[    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.080596] pid_max: default: 32768 minimum: 301
[    0.089913] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.102936] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.123068] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.142718] pinctrl core: initialized pinctrl subsystem
[    0.153721] NET: Registered protocol family 16
[    0.648338] PCI host bridge /pcie@10140000 ranges:
[    0.657728]  MEM 0x0000000020000000..0x000000002fffffff
[    0.668103]   IO 0x0000000010160000..0x000000001016ffff
[    0.686680] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.697706] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.710758] PCI host bridge to bus 0000:00
[    0.718762] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.732468] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.744206] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.757705] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.773934] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.790536] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.803582] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.817403] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.830904] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.845268] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.858779] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.873327] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.887669] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.897524] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.911035] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.925421] pci 0000:00:00.0: card - bus=0x0, slot = 0x0 irq=0
[    0.937003] pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[    0.949630] clocksource: Switched to clocksource systick
[    0.961649] NET: Registered protocol family 2
[    0.971117] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.984894] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.997484] TCP: Hash tables configured (established 1024 bind 1024)
[    1.010209] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.021740] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.034486] NET: Registered protocol family 1
[    1.043614] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    1.056460] futex hash table entries: 256 (order: -1, 3072 bytes)
[    1.087144] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.098674] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.120913] io scheduler noop registered
[    1.128561] io scheduler deadline registered (default)
[    1.139067] ralink-usb-phy usbphy: invalid resource
[    1.149342] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.165689] console [ttyS0] disabled
[    1.172731] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    1.192409] console [ttyS0] enabled
[    1.192409] console [ttyS0] enabled
[    1.206227] bootconsole [early0] disabled
[    1.206227] bootconsole [early0] disabled
[    1.228487] spi spi0.0: force spi mode3
[    1.236756] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    1.246550] 4 ofpart partitions found on MTD device spi0.0
[    1.257485] Creating 4 MTD partitions on "spi0.0":
[    1.267043] 0x000000000000-0x000000030000 : "u-boot"
[    1.278744] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.291266] 0x000000040000-0x000000050000 : "factory"
[    1.303219] 0x000000050000-0x000000800000 : "firmware"
[    1.381690] mtk_soc_eth 10100000.ethernet: generated random MAC address 2e:bc:00:95:d3:6e
[    1.398200] libphy: mdio: probed
[    1.405646] mtk_soc_eth 10100000.ethernet: connected port 4 to PHY at mdio-bus:04 [uid=03a2940d, driver=Generic PHY]
[    1.426783] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    1.439373] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.456450] rt2880_wdt 10000120.watchdog: Initialized
[    1.468110] NET: Registered protocol family 10
[    1.480780] NET: Registered protocol family 17
[    1.489790] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_ne.
[    1.514948] 8021q: 802.1Q VLAN Support v1.8
[    1.526487] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.541462] Please append a correct "root=" boot option; here are the available partitions:
[    1.558126] 1f00             192 mtdblock0  (driver?)
[    1.568204] 1f01              64 mtdblock1  (driver?)
[    1.578281] 1f02              64 mtdblock2  (driver?)
[    1.588357] 1f03            7872 mtdblock3  (driver?)
[    1.598433] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.617402] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   81.229594] random: nonblocking pool is initialized

Have dug through all of the ImageBuilder sources and can find nothing to help.

rmurch wrote:

I have removed the root= parameter, and have tried about 50x different combinations of MTD partition layouts and all result in 1 of 2 jffs2 errors as posted previously.

jffs2 errors are from scanning for the 'magic' which are not found, because some error in wrong rootfs partition. End of (wrong) partition

rmurch wrote:

I have also downloaded the full git source build and completely built openwrt from scratch, with a kernel I only built in squashfs and fuse support, still gives error rootfs errors, but admittedly its a stock profile with no extra MTD partitions defined, but the fact jffs2 is in the kernel again has made me move back to the ImageBuilder for 15.05.01.

You have to use the git sources.
You can't use imagebuilder ...

rmurch wrote:

Have dug through all of the ImageBuilder sources and can find nothing to help.

You have some errors in DTS ->Boardname
maybe missing setup bits (led, switch, net)

And some other thing :
you have no SD card reader, so remove it from DTS.

So please use git, is fairly simple to add another "remotes" "branches"
;-)
I need some time to check what's wrong/missing

I have checked out the latest git sources and am now working only with that. I have also cleaned up the DTS file but it is still incomplete (only 2 out 4 led's defined, etc). But my focus is just on getting the kernel to mount a rootfs so I can finally get a shell on this device and own it!

A patch file of changes made so far:

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 460253c..9ffa456 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -74,6 +74,10 @@ bc2)
 br-6425)
     set_wifi_led "$board:orange:wlan"
     ;;
+br-6478ac-v2)
+    ucidef_set_led_default "power" "POWER" "$board:white:power" "1"
+    set_wifi_led "$board:blue:wlan"
+    ;;
 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 6157d87..ba30ea4 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -113,6 +113,7 @@ ramips_setup_interfaces()
     atp-52b|\
     awm002-evb|\
     awm003-evb|\
+    br-6478ac-v2 |\
     c50|\
     dir-645|\
     dir-860l-b1|\
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 0c5abb2..6c318d5 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -33,6 +33,9 @@ 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/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 10139d7..e974fca 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -76,6 +76,9 @@ ramips_board_detect() {
     *"BR-6475nD")
         name="br-6475nd"
         ;;
+    *"Edimax BR-6478AC V2")
+        name="br-6478ac-v2"
+        ;;
     *"Broadway")
         name="broadway"
         ;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index e3bea00..3d81c73 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -176,6 +176,7 @@ platform_check_image() {
         }
         return 0
         ;;
+    br-6478ac-v2 |\
     br-6475nd)
         [ "$magic" != "43535953" ] && {
             echo "Invalid image type."
diff --git a/target/linux/ramips/dts/BR-6478AC-V2.dts b/target/linux/ramips/dts/BR-6478AC-V2.dts
new file mode 100644
index 0000000..08d5fb9
--- /dev/null
+++ b/target/linux/ramips/dts/BR-6478AC-V2.dts
@@ -0,0 +1,167 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+    compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
+    model = "Edimax BR-6478AC V2";
+
+    chosen {
+                //bootargs = "console=ttyS0,57600 console=ttyS1,57600n8 root=1f05";
+                //bootargs = "console=ttyS0,57600 root=1f05 rootfstype=squashfs";
+                bootargs = "console=ttyS0,57600";
+        };
+
+    palmbus@10000000 {
+        spi@b00 {
+            status = "okay";
+            m25p80@0 {
+                #address-cells = <1>;
+                #size-cells = <1>;
+                compatible = "mx25l6405d";
+                reg = <0 0>;
+                linux,modalias = "m25p80", "mx25l6405d";
+                spi-max-frequency = <10000000>;
+                partition@0 {
+                    label = "u-boot";
+                    reg = <0x0 0x30000>;
+                    read-only;
+                };
+                partition@30000 {
+                    label = "u-boot-env";
+                    reg = <0x30000 0x10000>;
+                    read-only;
+                };
+                factory: partition@40000 {
+                    label = "factory";
+                    reg = <0x40000 0x10000>;
+                    read-only;
+                };
+                partition@50000 {
+                    label = "cimage";
+                    reg = <0x50000 0x20000>;
+                    read-only;
+                };
+
+                partition@70000 {
+                                reg = <0x00070000 0x00130000>;
+                                label = "kernel";
+                };
+                partition@1A0000 {
+                    reg = <0x001A0000 0x00320000>;
+                    label = "rootfs";
+                };
+                partition2@70000 {
+                                reg = <0x00070000 0x00790000>;
+                                label = "firmware";
+                };
+
+
+            };
+        };
+               // uart@500 { // edimax ttyS0
+               //         compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+               //         reg = <0x500 0x100>;
+               //         resets = <&rstctrl 12>;
+               //         reset-names = "uart";
+               //         interrupt-parent = <&intc>;
+               //         interrupts = <5>;
+               //         reg-shift = <2>;
+               //         //status = "enabled";
+               // };
+               //uartlite@c00 { // edimax ttyS1
+               //         compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+               //         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 {
+                ralink,group = "i2c", "uartf";
+                ralink,function = "gpio";
+            };
+        };
+    };
+
+    ethernet@10100000 {
+        status = "okay";
+        pinctrl-names = "default";
+        pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+        ralink,port-map = "llllw";
+        port@4 {
+            status = "okay";
+            phy-mode = "rgmii";
+            phy-handle = <&phy4>;
+        };
+        port@5 {
+            status = "okay";
+            phy-mode = "rgmii";
+            phy-handle = <&phy5>;
+        };
+        mdio-bus {
+            status = "okay";
+            phy4: ethernet-phy@4 {
+                reg = <4>;
+                phy-mode = "rgmii";
+            };
+            phy5: ethernet-phy@5 {
+                reg = <5>;
+                phy-mode = "rgmii";
+            };
+        };
+    };
+
+    gsw@10110000 {
+        ralink,port4 = "gmac";
+    };
+
+    pcie@10140000 {
+        status = "okay";
+    };
+
+    gpio-leds {
+        compatible = "gpio-leds";
+        power {
+            label = "br-6478ac-v2:white:power";
+            gpios = <&gpio1 15 1>;
+        };
+        wlan {
+            label = "br-6478ac-v2:blue:wlan";
+            gpios = <&gpio3 0 1>;
+        };
+    };
+
+    gpio-keys-polled {
+        compatible = "gpio-keys";
+        #address-cells = <1>;
+        #size-cells = <0>;
+        poll-interval = <20>;
+        s2 {
+            label = "S2";
+            gpios = <&gpio0 1 1>;
+            linux,code = <0x100>;
+        };
+        s3 {
+            label = "S3";
+            gpios = <&gpio0 2 1>;
+            linux,code = <0x101>;
+        };
+    };
+
+    ehci@101c0000 {
+        status = "okay";
+    };
+
+    ohci@101c1000 {
+        status = "okay";
+    };
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 52dde67..61521f9 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -252,8 +252,27 @@ ifeq ($(SUBTARGET),rt3883)
 include rt3883.mk
 endif
 
+
+# sign an image to make it work with edimax tftp recovery
+define BuildFirmware/Edimax/squashfs
+        $(call BuildFirmware/OF,$(1),$(2),$(3),$(4))
+        if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+                mkedimaximg -i $(call sysupname,$(1),$(2)) \
+                        -o $(call imgname,$(1),$(2))-factory.bin \
+                        -s $(5) -m $(6) -f $(7) -S $(8); \
+        fi
+endef
+BuildFirmware/Edimax/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+
+br6478acv2_mtd_size=5832704
+Image/Build/Profile/BR-6478AC-V2=$(call BuildFirmware/Edimax/$(1),$(1),br6478ac-v2,BR-6478AC-V2, $(br6478acv2_mtd_size), CSYS, RN68, 0x70000, 0x1100000)
+
+
 ifeq ($(SUBTARGET),mt7620)
 include mt7620.mk
+define Image/Build/Profile/Default
+    $(call Image/Build/Profile/BR-6478AC-V2,$(1))
+endef
 endif
 
 ifeq ($(SUBTARGET),mt7621)
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index b1afb82..90d8a64 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -169,6 +169,15 @@ define Device/mt7620a
 endef
 TARGET_DEVICES += mt7620a
 
+define Device/br-6478ac-v2
+  DTS := BR-6478AC-V2
+  IMAGE_SIZE := $(ralink_default_fw_size_8M)
+  DEVICE_TITLE := Edimax BR-6478-AC V2
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76
+endef
+TARGET_DEVICES += br-6478ac-v2
+
+
 define Device/mt7620a_mt7610e
   DTS := MT7620a_MT7610e
   IMAGE_SIZE := $(ralink_default_fw_size_8M)

Am repeatedly stuck with no rootfs found, or jffs2 errors, or if I create a "rootfs" MTD partition it automatically detects it at boot but fails to find a squashfs on it.

I have tried pointing "rootfs" to the exact byte after the kernel, as well as making "kernel" partition larger than the actual kernel (so no overlap) and starting "rootfs" way after the kernel, as well as ending "rootfs" before the end of the flash to allow space to create a "rootfs_data" at boot up, but all fail.

I have also tried creating a "freespace" MTD partition of the final 20000 addresses as in the stock firmware but that makes no difference (as some NOR flash chips have trouble as the end of the address space, I thought maybe this was one).

Can anyone please browse through the above patch and see if they notice any mistakes or areas of concern?

Is there anything else I can do to confirm the address of the "rootfs" MTD partition being created is correct? Can I somehow read the image before flashing to confirm the locations/addresses of the kernel and squashfs.root/rootfs ?

PS: I will update the other current post on porting the Edimax BR-6478AC-V2 when I finally get a success or failure result, or can move on from this MTD layout issue to whatever maybe next.

elektroman wrote:

So please use git, is fairly simple to add another "remotes" "branches"
;-)
I need some time to check what's wrong/missing

rmurch wrote:

I have checked out the latest git sources and am now working only with that. I have also cleaned up the DTS file but it is still incomplete (only 2 out 4 led's defined, etc). But my focus is just on getting the kernel to mount a rootfs so I can finally get a shell on this device and own it!

I know
But you are not the keen thinker, I hope this spelling is correct ;-)

Please do this in your local git

git remote add elektroman git://github.com/ulli-kroll/openwrt.git
git checkout -b Edimax elektroman/do-work/Edimax

The first will add my repository and the second will checkout my working branch.
There is maybe some error in the partition number for kernel/rootfs
I must check some other targets.

For the leds and keys, they may be defined but not tested ...

The other thing the "stock" firmware update thing is also missing, due the damn CSYS header ...
But I can build a initramfs image ..

EDIT
you must do
make clean
rm -Rf staging_dir/ tmp/ build_dir/ bin
do see the new profile for the Edimax router in mt7620 ;-)

(Last edited by elektroman on 29 Aug 2016, 18:04)

rmurch wrote:
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 460253c..9ffa456 100755
diff --git a/target/linux/ramips/dts/BR-6478AC-V2.dts b/target/linux/ramips/dts/BR-6478AC-V2.dts
new file mode 100644
index 0000000..08d5fb9
--- /dev/null
+++ b/target/linux/ramips/dts/BR-6478AC-V2.dts
@@ -0,0 +1,167 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+    compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
+    model = "Edimax BR-6478AC V2";
+
+    chosen {
+                //bootargs = "console=ttyS0,57600 console=ttyS1,57600n8 root=1f05";
+                //bootargs = "console=ttyS0,57600 root=1f05 rootfstype=squashfs";
+                bootargs = "console=ttyS0,57600";
+        };
+
+    palmbus@10000000 {
+        spi@b00 {
+            status = "okay";
+            m25p80@0 {
+                #address-cells = <1>;
+                #size-cells = <1>;
+                compatible = "mx25l6405d";

Use the regular compatible = "jedec,spi-nor"

rmurch wrote:
+                reg = <0 0>;
+                linux,modalias = "m25p80", "mx25l6405d";
+                spi-max-frequency = <10000000>;
+                partition@0 {
+                    label = "u-boot";
+                    reg = <0x0 0x30000>;
+                    read-only;
+                };
+                partition@30000 {
+                    label = "u-boot-env";
+                    reg = <0x30000 0x10000>;
+                    read-only;
+                };
+                factory: partition@40000 {
+                    label = "factory";
+                    reg = <0x40000 0x10000>;
+                    read-only;
+                };
+                partition@50000 {
+                    label = "cimage";
+                    reg = <0x50000 0x20000>;
+                    read-only;
+                };
+
+                partition@70000 {
+                                reg = <0x00070000 0x00130000>;
+                                label = "kernel";
+                };
+                partition@1A0000 {
+                    reg = <0x001A0000 0x00320000>;
+                    label = "rootfs";
+                };

Go without those two partitions "kernel" and "rootfs". Kernel will be allocated dynamically according to its size. Just defining "firmware" is fine.

rmurch wrote:
+                partition2@70000 {
+                                reg = <0x00070000 0x00790000>;
+                                label = "firmware";
+                };
+
+
+            };
+        };
+               // uart@500 { // edimax ttyS0
+               //         compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+               //         reg = <0x500 0x100>;
+               //         resets = <&rstctrl 12>;
+               //         reset-names = "uart";
+               //         interrupt-parent = <&intc>;
+               //         interrupts = <5>;
+               //         reg-shift = <2>;
+               //         //status = "enabled";
+               // };
+               //uartlite@c00 { // edimax ttyS1
+               //         compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+               //         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 {
+                ralink,group = "i2c", "uartf";
+                ralink,function = "gpio";
+            };
+        };
+    };
+
+    ethernet@10100000 {
+        status = "okay";
+        pinctrl-names = "default";
+        pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+        ralink,port-map = "llllw";
+        port@4 {
+            status = "okay";
+            phy-mode = "rgmii";
+            phy-handle = <&phy4>;
+        };
+        port@5 {
+            status = "okay";
+            phy-mode = "rgmii";
+            phy-handle = <&phy5>;
+        };
+        mdio-bus {
+            status = "okay";
+            phy4: ethernet-phy@4 {
+                reg = <4>;
+                phy-mode = "rgmii";
+            };
+            phy5: ethernet-phy@5 {
+                reg = <5>;
+                phy-mode = "rgmii";
+            };
+        };
+    };
+
+    gsw@10110000 {
+        ralink,port4 = "gmac";
+    };
+
+    pcie@10140000 {
+        status = "okay";
+    };
+
+    gpio-leds {
+        compatible = "gpio-leds";
+        power {
+            label = "br-6478ac-v2:white:power";
+            gpios = <&gpio1 15 1>;
+        };
+        wlan {
+            label = "br-6478ac-v2:blue:wlan";
+            gpios = <&gpio3 0 1>;
+        };
+    };
+
+    gpio-keys-polled {
+        compatible = "gpio-keys";
+        #address-cells = <1>;
+        #size-cells = <0>;
+        poll-interval = <20>;
+        s2 {
+            label = "S2";
+            gpios = <&gpio0 1 1>;
+            linux,code = <0x100>;
+        };
+        s3 {
+            label = "S3";
+            gpios = <&gpio0 2 1>;
+            linux,code = <0x101>;
+        };
+    };
+
+    ehci@101c0000 {
+        status = "okay";
+    };
+
+    ohci@101c1000 {
+        status = "okay";
+    };
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 52dde67..61521f9 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -252,8 +252,27 @@ ifeq ($(SUBTARGET),rt3883)
 include rt3883.mk
 endif
 
+
+# sign an image to make it work with edimax tftp recovery
+define BuildFirmware/Edimax/squashfs
+        $(call BuildFirmware/OF,$(1),$(2),$(3),$(4))
+        if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+                mkedimaximg -i $(call sysupname,$(1),$(2)) \
+                        -o $(call imgname,$(1),$(2))-factory.bin \
+                        -s $(5) -m $(6) -f $(7) -S $(8); \
+        fi
+endef
+BuildFirmware/Edimax/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+
+br6478acv2_mtd_size=5832704

That should be 0x790000, so 7929856 looks more appropriate.

rmurch wrote:
+Image/Build/Profile/BR-6478AC-V2=$(call BuildFirmware/Edimax/$(1),$(1),br6478ac-v2,BR-6478AC-V2, $(br6478acv2_mtd_size), CSYS, RN68, 0x70000, 0x1100000)
+
+
 ifeq ($(SUBTARGET),mt7620)
 include mt7620.mk
+define Image/Build/Profile/Default
+    $(call Image/Build/Profile/BR-6478AC-V2,$(1))
+endef
 endif
 
 ifeq ($(SUBTARGET),mt7621)
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index b1afb82..90d8a64 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -169,6 +169,15 @@ define Device/mt7620a
 endef
 TARGET_DEVICES += mt7620a
 
+define Device/br-6478ac-v2
+  DTS := BR-6478AC-V2
+  IMAGE_SIZE := $(ralink_default_fw_size_8M)

I think this should be the same 0x790000 as above.

rmurch wrote:
+  DEVICE_TITLE := Edimax BR-6478-AC V2
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76
+endef
+TARGET_DEVICES += br-6478ac-v2
+
+
 define Device/mt7620a_mt7610e
   DTS := MT7620a_MT7610e
   IMAGE_SIZE := $(ralink_default_fw_size_8M)

Is there anything else I can do to confirm the address of the "rootfs" MTD partition being created is correct? Can I somehow read the image before flashing to confirm the locations/addresses of the kernel and squashfs.root/rootfs ?

When building, using "make V=s" gives very verbose output, in the end even of the image packaging process. Have a look.

I made the changes that you both suggested, and we got a few steps closer. I added the code to make the Edimax header so I got a "-factory.bin" but was getting the same errors:

Starting kernel ...

[    0.000000] Linux version 4.4.7 (rohbags@wx2.lan) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 r49395) ) #15 Tue Aug 30 056
[    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=000400d2
[    0.000000] Readback ErrCtl register=000400d2
[    0.000000] Memory: 61096K/65536K available (2620K kernel code, 124K rwdata, 660K rodata, 172K init, 189K bss, 4440)
[    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.015454] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.080596] pid_max: default: 32768 minimum: 301
[    0.089908] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.102929] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.123277] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.142894] pinctrl core: initialized pinctrl subsystem
[    0.153861] NET: Registered protocol family 16
[    0.648479] PCI host bridge /pcie@10140000 ranges:
[    0.657864]  MEM 0x0000000020000000..0x000000002fffffff
[    0.668239]   IO 0x0000000010160000..0x000000001016ffff
[    0.686717] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.697740] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.710801] PCI host bridge to bus 0000:00
[    0.718802] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.732505] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.744242] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.757746] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.773985] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.790561] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.803601] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.817421] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.830923] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.845287] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.858796] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.873343] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.887690] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.897548] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.911056] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.925439] pci 0000:00:00.0: card - bus=0x0, slot = 0x0 irq=0
[    0.937020] pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[    0.949601] clocksource: Switched to clocksource systick
[    0.961538] NET: Registered protocol family 2
[    0.970999] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.984772] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.997362] TCP: Hash tables configured (established 1024 bind 1024)
[    1.010091] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.021622] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.034346] NET: Registered protocol family 1
[    1.043462] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    1.056324] futex hash table entries: 256 (order: -1, 3072 bytes)
[    1.088223] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.099746] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.122048] io scheduler noop registered
[    1.129761] io scheduler deadline registered (default)
[    1.140165] ralink-usb-phy usbphy: invalid resource
[    1.150453] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.166667] console [ttyS0] disabled
[    1.173707] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    1.193382] console [ttyS0] enabled
[    1.193382] console [ttyS0] enabled
[    1.207203] bootconsole [early0] disabled
[    1.207203] bootconsole [early0] disabled
[    1.230077] spi spi0.0: force spi mode3
[    1.238230] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    1.248039] 5 ofpart partitions found on MTD device spi0.0
[    1.258972] Creating 5 MTD partitions on "spi0.0":
[    1.268524] 0x000000000000-0x000000030000 : "u-boot"
[    1.280314] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.292832] 0x000000040000-0x000000050000 : "factory"
[    1.304799] 0x000000050000-0x000000070000 : "cimage"
[    1.316572] 0x000000070000-0x000000800000 : "firmware"
[    1.394246] libphy: mdio: probed
[    1.404737] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[    1.419565] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    1.442266] mtk_soc_eth 10100000.ethernet: loaded mt7530 driver
[    1.454831] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.471907] rt2880_wdt 10000120.watchdog: Initialized
[    1.482706] NET: Registered protocol family 17
[    1.491695] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_ne.
[    1.516851] 8021q: 802.1Q VLAN Support v1.8
[    1.529394] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.544377] Please append a correct "root=" boot option; here are the available partitions:
[    1.561032] 1f00             192 mtdblock0  (driver?)
[    1.571110] 1f01              64 mtdblock1  (driver?)
[    1.581183] 1f02              64 mtdblock2  (driver?)
[    1.591258] 1f03             128 mtdblock3  (driver?)
[    1.601340] 1f04            7744 mtdblock4  (driver?)
[    1.611413] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.630368] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I noticed that no matter what I tweaked I could not get a initramfs-factory build, so I did the following:

[rohbags@wx2 openwrt]$ cat bin/ramips/openwrt-ramips-mt7620-br6478ac-v2-initramfs-uImage.bin bin/ramips/openwrt-ramips-mt7620-root.squashfs > bin/ramips/openwrt-ramips-mt7620-br6478ac-v2-initramfs-sysupgrade.bin

[rohbags@wx2 openwrt]$ staging_dir/host/bin/mkedimaximg -i bin/ramips/openwrt-ramips-mt7620-br6478ac-v2-initramfs-sysupgrade.bin -o bin/ramips/openwrt-ramips-mt7620-br6478ac-v2-initramfs-factory.bin -s CSYS -m RN68 -f 0x70000 -S 0x1100000

[rohbags@wx2 openwrt]$ tftp -m binary 192.168.1.6 -c put openwrt-ramips-mt7620-br6478ac-v2-initramfs-factory.bin

and amazingly I got this:

## 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 066
[    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=000626cc
[    0.000000] Readback ErrCtl register=000626cc
[    0.000000] Memory: 59496K/65536K available (2620K kernel code, 124K rwdata, 660K rodata, 1772K init, 189K bss, 604)
[    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.142918] pinctrl core: initialized pinctrl subsystem
[    0.153888] NET: Registered protocol family 16
[    0.648494] PCI host bridge /pcie@10140000 ranges:
[    0.657879]  MEM 0x0000000020000000..0x000000002fffffff
[    0.668254]   IO 0x0000000010160000..0x000000001016ffff
[    0.686740] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.697764] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.710822] PCI host bridge to bus 0000:00
[    0.718822] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.732526] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.744263] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.757766] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.774007] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.790587] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.803628] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.817447] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.830949] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.845313] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.858822] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.873368] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.887716] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.897574] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.911082] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.925465] pci 0000:00:00.0: card - bus=0x0, slot = 0x0 irq=0
[    0.937046] pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[    0.949627] clocksource: Switched to clocksource systick
[    0.961580] NET: Registered protocol family 2
[    0.971041] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.984813] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.997403] TCP: Hash tables configured (established 1024 bind 1024)
[    1.010130] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.021662] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.034387] NET: Registered protocol family 1
[    3.389875] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    3.402717] futex hash table entries: 256 (order: -1, 3072 bytes)
[    3.430792] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    3.442309] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    3.464522] io scheduler noop registered
[    3.472235] io scheduler deadline registered (default)
[    3.482637] ralink-usb-phy usbphy: invalid resource
[    3.492911] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    3.509131] console [ttyS0] disabled
[    3.516178] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    3.535846] console [ttyS0] enabled
[    3.535846] console [ttyS0] enabled
[    3.549666] bootconsole [early0] disabled
[    3.549666] bootconsole [early0] disabled
[    3.572579] spi spi0.0: force spi mode3
[    3.580778] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    3.590569] 5 ofpart partitions found on MTD device spi0.0
[    3.601501] Creating 5 MTD partitions on "spi0.0":
[    3.611054] 0x000000000000-0x000000030000 : "u-boot"
[    3.622764] 0x000000030000-0x000000040000 : "u-boot-env"
[    3.635301] 0x000000040000-0x000000050000 : "factory"
[    3.647272] 0x000000050000-0x000000070000 : "cimage"
[    3.659038] 0x000000070000-0x000000800000 : "firmware"
[    3.736739] libphy: mdio: probed
[    3.747258] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[    3.762068] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    3.784777] mtk_soc_eth 10100000.ethernet: loaded mt7530 driver
[    3.797333] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    3.814395] rt2880_wdt 10000120.watchdog: Initialized
[    3.825180] NET: Registered protocol family 17
[    3.834169] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_ne.
[    3.859326] 8021q: 802.1Q VLAN Support v1.8
[    3.881146] Freeing unused kernel memory: 1772K (80355000 - 80510000)
[    3.906837] init: Console is alive
[    3.913908] init: - watchdog -
[    3.941595] Error: Driver 'gpio-keys' is already registered, aborting...
[    3.956553] Error: Driver 'gpio-keys-polled' is already registered, aborting...
[    3.974455] init: - preinit -
[    4.106022] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (1000Mbps/Full duplex)
[    4.122219] 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.354365] random: procd urandom read with 8 bits of entropy available
- failsafe button reset was pressed -
- failsafe -
Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQD2ICledf48LqiXcnFhCNojoA8lJKebI11D4i1qpITcFp7ERzaAUk9YBsdyiac7xX5YHJUb4dztBj+cKj)
Fingerprint: md5 c5:ac:9b:33:63:7d:12:a4:e6:3a:f1:a7:39:49:f4:13


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

ash: can't access tty; job control turned off
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| 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
 -----------------------------------------------------
================= FAILSAFE MODE active ================
special commands:
* firstboot          reset settings to factory defaults
* mount_root     mount root-partition with config files

after mount_root:
* passwd                         change root's password
* /etc/config               directory with config files

for more help see:
http://wiki.openwrt.org/doc/howto/generic.failsafe
=======================================================

root@(none):/#

Thank you very much gentleman for your help thus far, I am off to have a beer on the strength of that.

Still more issues to over come, as this uart port looks to be output only so I can use the shell, but the stock firmware loaded 2x serial82550 ports ttyS0 and ttyS1 (0x500 and 0xc00) so I need to sort that out first. Will update the other "Edimax BR-6478AC V2" post with this result and other issues as I face them.

@all
updated in git

thanks guys.

Can some check this on real hw. I don't have this router.
@rmurch

for serial I will look, I think there is some misconfiguration in DTS

elektroman wrote:

@all
updated in git

Which repo is updated? I checked out both openwrt-truck and do-work/Edimax but could not find it sad

elektroman wrote:

for serial I will look, I think there is some misconfiguration in DTS

I have been trying to use "uartf_pins" or "spi_pins" for the uart@500 with no luck, "spi_pins" seems to crash the kernel on boot into a infinite loop right after CPU revision and before MIPS board type detection.

Not sure what is going on with uartlite@c00, with the Rx pin disconnected I get random garbage on the console, meaning the pin is floating and expecting an input (so it *is* the input pin, and the uart *is* bi-directional). Once I connect the usb-uart Tx pin to the MT7620a-uartlite Rx pin the garbage stops and the console is clean, but it acts as a uni-directional uart port, openwrt seems to receive no data on its uartlite pin.

Damn, pushed to hidden repo, now online
To track and merge

git checkout Edimax
git branch -u elektroman/do-work/Edimax
git merge

for serial again I must check.
This is the correct line from one of you previous posts here

[    0.840000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a 16550A

and this is the wrong one

[    3.516178] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103

Next update for this board
DTB was not added at the end

0x70000 , 0x1100000, it's same as dts file. why it's OK as follows? What is changed?

[rohbags@wx2 openwrt]$ cat bin/ramips/openwrt-ramips-mt7620-br6478ac-v2-initramfs-uImage.bin bin/ramips/openwrt-ramips-mt7620-root.squashfs > bin/ramips/openwrt-ramips-mt7620-br6478ac-v2-initramfs-sysupgrade.bin

[rohbags@wx2 openwrt]$ staging_dir/host/bin/mkedimaximg -i bin/ramips/openwrt-ramips-mt7620-br6478ac-v2-initramfs-sysupgrade.bin -o bin/ramips/openwrt-ramips-mt7620-br6478ac-v2-initramfs-factory.bin -s CSYS -m RN68 -f 0x70000 -S 0x1100000

[rohbags@wx2 openwrt]$ tftp -m binary 192.168.1.6 -c put openwrt-ramips-mt7620-br6478ac-v2-initramfs-factory.bin

The discussion might have continued from here.