Adding support for Sercomm's NA502

Hello,

This board was shipped by Sercomm to the company i'm currently working at for development purposes, however it came preinstalled with an older (customized) OpenWrt version (Chaos Calmer if i'm not mistaken).
Since we really need Node.js running on it, i have to find a way to upgrade to OpenWrt 18.

Sercomm provided us with a confidential documentation of the board that was helpful enough to get most of OpenWrt 18 running on it - unfortunately i'm not sure whether i can disclose that documentation.

CPU: MT7621S
NAND Flash: 128Mbytes
DDR3 RAM: 256 Mbytes
Wifi 2.4GHz: MT7602E (via PCIe 1)
Wifi 5.0Ghz: MT7663E (via PCIe 0)
Bluetooth: MT7663E (via USB)

I made a lot of progress since yesterday and i'm happy that i got the two Wi-Fi chips (MT7603E & MT7662E) up and running. I've mapped the LEDs to the GPIO pins, same for the GPIO buttons, it's almost ready, except one thing.
The build process generates a squashfs-sysupgrade image and a initramfs-kernel and as expected, the initramfs-kernel runs just fine, however i need the configurations to persist over a reboot so i flashed the squashfs-sysupgrade and here's where the troubles started.

I've pasted the bootstrap process log starting from the kernel's effective bootstrap to the point it panics.
It seems it complaints about some magic number that's not being found by the JFFS2 system.
Am i missing a driver or the image i flashed was not packed the right way?

openwrt/target/linux/ramips/mt7621.mk: https://pastebin.com/uDEchAPA

root@OpenWrt:/# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00080000 00020000 "uboot"
mtd1: 00080000 00020000 "config"
mtd2: 00040000 00020000 "factory"
mtd3: 02940000 00020000 "rootfs"
mtd4: 00100000 00020000 "user_storage"
mtd5: 01000000 00020000 "data"
mtd6: 03200000 00020000 "storage"
mtd7: 013c0000 00020000 "backup"

Thank you!

[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] MIPS: machine is sercomm,na502
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] VPE topology {2} total 2
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000]   HighMem  empty
[    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] random: get_random_bytes called from start_kernel+0x90/0x4a4 with crng_init=0
[    0.000000] percpu: Embedded 14 pages/cpu @81090000 s26704 r8192 d22448 u57344
[    0.000000] Built 1 zonelists, 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=00050030
[    0.000000] Readback ErrCtl register=00050030
[    0.000000] Memory: 58464K/65536K available (4499K kernel code, 228K rwdata, 1000K rodata, 276K init, 275K bss, 7072K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 256
[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
[    0.000009] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
[    0.015484] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[    0.087788] pid_max: default: 32768 minimum: 301
[    0.097078] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.110094] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.125596] Hierarchical SRCU implementation.
[    0.134825] smp: Bringing up secondary CPUs ...
[    0.144407] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.144420] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.144433] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.144563] CPU1 revision is: 0001992f (MIPS 1004Kc)
[    0.204326] Synchronize counters for CPU 1: done.
[    0.263981] smp: Brought up 1 node, 2 CPUs
[    0.275456] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.294922] futex hash table entries: 512 (order: 2, 16384 bytes)
[    0.307135] pinctrl core: initialized pinctrl subsystem
[    0.318750] NET: Registered protocol family 16
[    0.339523] pull PCIe RST: RALINK_RSTCTRL = 0
[    0.648431] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.658494] ***** Xtal 40MHz *****
[    0.665224] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.675433] Port 0 N_FTS = 1b102800
[    0.682331] Port 1 N_FTS = 1b105000
[    0.689258] Port 2 N_FTS = 1b105000
[    1.847615] PCIE0 no card, disable it(RST&CLK)
[    1.856307]  -> 10207f2
[    1.861125] PCIE1 enabled
[    1.866321] PCIE2 enabled
[    1.871507] PCI host bridge /pcie@1e140000 ranges:
[    1.881026]  MEM 0x0000000060000000..0x000000006fffffff
[    1.891392]   IO 0x000000001e160000..0x000000001e16ffff
[    1.901751] PCI coherence region base: 0xbfbf8000, mask/settings: 0x60000000
[    1.927342] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.938616] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.950022] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.962480] i2c-mt7621 1e000900.i2c: clock 100KHz, re-start not support
[    1.976076] PCI host bridge to bus 0000:00
[    1.984086] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    1.997738] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    2.009488] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    2.022970] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    2.040960] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    2.053984] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.067806] pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
[    2.080930] pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.094760] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    2.108241] pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x601fffff pref]
[    2.122579] pci 0000:00:01.0: BAR 8: assigned [mem 0x60200000-0x602fffff]
[    2.136060] pci 0000:00:00.0: BAR 1: assigned [mem 0x60300000-0x6030ffff]
[    2.149548] pci 0000:00:01.0: BAR 1: assigned [mem 0x60310000-0x6031ffff]
[    2.163024] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff 64bit]
[    2.177542] pci 0000:01:00.0: BAR 6: assigned [mem 0x60100000-0x6010ffff pref]
[    2.191874] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.201711] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    2.215206] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
[    2.229551] pci 0000:02:00.0: BAR 0: assigned [mem 0x60200000-0x602fffff]
[    2.243021] pci 0000:00:01.0: PCI bridge to [bus 02]
[    2.252860] pci 0000:00:01.0:   bridge window [mem 0x60200000-0x602fffff]
[    2.268397] clocksource: Switched to clocksource GIC
[    2.279701] NET: Registered protocol family 2
[    2.289038] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    2.302770] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    2.315372] TCP: Hash tables configured (established 1024 bind 1024)
[    2.328092] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    2.339593] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    2.352229] NET: Registered protocol family 1
[    2.598346] 4 CPUs re-calibrate udelay(lpj = 2924544)
[    2.609475] Crashlog allocated RAM at address 0x3f00000
[    2.620203] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    2.641253] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.652754] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.675960] io scheduler noop registered
[    2.683822] io scheduler deadline registered (default)
[    2.695106] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    2.709249] console [ttyS0] disabled
[    2.716260] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 14, base_baud = 3125000) is a 16550A
[    2.734251] console [ttyS0] enabled
[    2.734251] console [ttyS0] enabled
[    2.748024] bootconsole [early0] disabled
[    2.748024] bootconsole [early0] disabled
[    2.765055] cacheinfo: Unable to detect cache hierarchy for CPU 0
**[    2.778070] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error**
**[    2.792092] Enable NFI Clock**
**[    2.797810] # MTK NAND # : Use HW ECC**
**[    2.805126] Device not found, ID: c2f1**
**[    2.812584] Not Support this Device! **
**[    2.820049] chip_mode=00000001**
**[    2.826113] Support this Device in MTK table! c2f1 **
**[    2.836000] [NAND]select ecc bit:4, sparesize :64 spare_per_sector=16**
**[    2.848874] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1**
**[    2.861523] nand: Macronix NAND 128MiB 3,3V 8-bit**
**[    2.870887] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64**
**[    2.885973] Scanning device for bad blocks**
**[    3.088467] Bad eraseblock 824 at 0x000006700000**
**[    3.144612] 8 fixed-partitions partitions found on MTD device MT7621-NAND**
**[    3.158123] Creating 8 MTD partitions on "MT7621-NAND":**
**[    3.168534] 0x000000000000-0x000000080000 : "uboot"**
**[    3.179350] 0x000000080000-0x000000100000 : "config"**
**[    3.190322] 0x000000100000-0x000000140000 : "factory"**
**[    3.201420] 0x000000140000-0x000002a80000 : "rootfs"**
**[    3.212622] mtd: device 3 (rootfs) set to be root filesystem**
**[    3.224501] mtdsplit: no squashfs found in "rootfs"**
**[    3.234255] 0x000002940000-0x000002a40000 : "user_storage"**
**[    3.246210] 0x000002a40000-0x000003a40000 : "data"**
**[    3.256970] 0x000003a40000-0x000006c40000 : "storage"**
**[    3.268496] 0x000006c40000-0x000008000000 : "backup"**
[    3.279578] [mtk_nand] probe successfully!
[    3.288459] Signature matched and data read!
[    3.296942] load_fact_bbt success 1023
[    3.305165] libphy: Fixed MDIO Bus: probed
[    3.380953] libphy: mdio: probed
[    4.787006] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
[    4.799517] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 17
[    4.818818] NET: Registered protocol family 10
[    4.828993] Segment Routing with IPv6
[    4.836351] NET: Registered protocol family 17
[    4.845270] 8021q: 802.1Q VLAN Support v1.8
[    4.856738] UBI error: no valid UBI magic found inside mtd5
[    4.867916] hctosys: unable to open rtc device (rtc0)
**[    4.880862] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x0527 instead**
**[    4.899838] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x08fb instead**
**[    4.918715] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0xb25b instead**
**[    4.937589] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0x1d00 instead**
**[    4.956474] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x0080 instead**
**[    4.975349] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x0080 instead**
**[    4.994224] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0xcaa9 instead**
**[    5.013105] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x0505 instead**
**[    5.031981] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x494d instead**
**[    5.050856] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x4f20 instead**
[ .................. ]
[   13.680164] jffs2: Old JFFS2 bitmask found at 0x00405798
[   13.690735] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[   13.725402] jffs2: Empty flash at 0x004107ec ends at 0x00411000
[   13.754331] jffs2: Empty flash at 0x00411004 ends at 0x00412000
[   13.782134] jffs2: Empty flash at 0x00412004 ends at 0x00414000
[   13.809063] jffs2_scan_eraseblock(): End of filesystem marker found at 0x420000
[   13.823937] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
[   13.840735] jffs2: empty_blocks 297, bad_blocks 0, c->nr_blocks 330
[   13.853332] VFS: Cannot open root device "(null)" or unknown-block(31,3): error -5
[   13.868437] Please append a correct "root=" boot option; here are the available partitions:
[   13.885080] 1f00             512 mtdblock0 
[   13.885087]  (driver?)
[   13.898090] 1f01             512 mtdblock1 
[   13.898095]  (driver?)
[   13.911121] 1f02             256 mtdblock2 
[   13.911126]  (driver?)
[   13.924132] 1f03           42240 mtdblock3 
[   13.924138]  (driver?)
[   13.937137] 1f04            1024 mtdblock4 
[   13.937142]  (driver?)
[   13.950163] 1f05           16384 mtdblock5 
[   13.950168]  (driver?)
[   13.963174] 1f06           51200 mtdblock6 
[   13.963179]  (driver?)
[   13.976177] 1f07           20224 mtdblock7 
[   13.976182]  (driver?)
[   13.989202] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)
[   14.010001] Rebooting in 1 seconds..

Similar to: Upgrading to newer a newer version of OpenWrt

Ok, so i changed the name of the 'rootfs' partition to 'firmware' and now it seems i don't get any jffs2 errors; however, i'm getting these strange SquashFS errors and i still can't fully boot OpenWrt.

At first i thought it might be because of the NAND flash that probably got tired of being reflashed over and over again for the last 48 hours, however, i tried it on a "fresh" device and the errors persist.

   [    7.197952] init: - preinit -
> [    7.649378] SQUASHFS error: xz decompression failed, data probably corrupt
> [    7.663089] SQUASHFS error: squashfs_read_data failed to read block 0x1abdde
> [    7.677139] SQUASHFS error: Unable to read fragment cache entry [1abdde]
> [    7.690484] SQUASHFS error: Unable to read page, block 1abdde, size 16a80
... many more such lines ...

Full log here.

[    0.000000] Linux version 4.14.72 (cristian@Olympus) (gcc version 8.2.0 (OpenWrt GCC 8.2.0 r8210-031c31ccdb)) #0 SMP Mon Oct 1 11:36:17 2018
[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] MIPS: machine is sercomm,na502
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 10000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] VPE topology {2} total 2
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x90/0x4a4 with crng_init=0
[    0.000000] percpu: Embedded 14 pages/cpu @81210000 s26704 r8192 d22448 u57344
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Writing ErrCtl register=00000834
[    0.000000] Readback ErrCtl register=00000834
[    0.000000] Memory: 253388K/262144K available (4499K kernel code, 228K rwdata, 1000K rodata, 276K init, 275K bss, 8756K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 256
[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
[    0.000009] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
[    0.015484] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[    0.087787] pid_max: default: 32768 minimum: 301
[    0.097079] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.110093] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.125600] Hierarchical SRCU implementation.
[    0.134825] smp: Bringing up secondary CPUs ...
[    0.156263] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.156275] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.156289] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.156419] CPU1 revision is: 0001992f (MIPS 1004Kc)
[    0.204331] Synchronize counters for CPU 1: done.
[    0.263987] smp: Brought up 1 node, 2 CPUs
[    0.275456] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.294923] futex hash table entries: 512 (order: 2, 16384 bytes)
[    0.307134] pinctrl core: initialized pinctrl subsystem
[    0.318746] NET: Registered protocol family 16
[    0.339471] pull PCIe RST: RALINK_RSTCTRL = 0
[    0.648383] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.658446] ***** Xtal 40MHz *****
[    0.665176] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.675386] Port 0 N_FTS = 1b102800
[    0.682283] Port 1 N_FTS = 1b105000
[    0.689210] Port 2 N_FTS = 1b105000
[    1.847568] PCIE0 no card, disable it(RST&CLK)
[    1.856260]  -> 10207f2
[    1.861079] PCIE1 enabled
[    1.866274] PCIE2 enabled
[    1.871460] PCI host bridge /pcie@1e140000 ranges:
[    1.880979]  MEM 0x0000000060000000..0x000000006fffffff
[    1.891345]   IO 0x000000001e160000..0x000000001e16ffff
[    1.901704] PCI coherence region base: 0xbfbf8000, mask/settings: 0x60000000
[    1.927312] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.938587] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.949804] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.962237] i2c-mt7621 1e000900.i2c: clock 100KHz, re-start not support
[    1.975838] PCI host bridge to bus 0000:00
[    1.983850] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    1.997503] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    2.009253] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    2.022741] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    2.040758] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    2.053781] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.067604] pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
[    2.080727] pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.094558] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    2.108040] pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x601fffff pref]
[    2.122376] pci 0000:00:01.0: BAR 8: assigned [mem 0x60200000-0x602fffff]
[    2.135857] pci 0000:00:00.0: BAR 1: assigned [mem 0x60300000-0x6030ffff]
[    2.149347] pci 0000:00:01.0: BAR 1: assigned [mem 0x60310000-0x6031ffff]
[    2.162825] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff 64bit]
[    2.177339] pci 0000:01:00.0: BAR 6: assigned [mem 0x60100000-0x6010ffff pref]
[    2.191672] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.201508] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    2.215000] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
[    2.229350] pci 0000:02:00.0: BAR 0: assigned [mem 0x60200000-0x602fffff]
[    2.242818] pci 0000:00:01.0: PCI bridge to [bus 02]
[    2.252657] pci 0000:00:01.0:   bridge window [mem 0x60200000-0x602fffff]
[    2.267627] clocksource: Switched to clocksource GIC
[    2.278902] NET: Registered protocol family 2
[    2.288527] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    2.302274] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[    2.315058] TCP: Hash tables configured (established 2048 bind 2048)
[    2.327776] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    2.339271] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    2.351909] NET: Registered protocol family 1
[    2.597583] 4 CPUs re-calibrate udelay(lpj = 2924544)
[    2.608700] Crashlog allocated RAM at address 0x3f00000
[    2.619495] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[    2.640614] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.652145] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.675183] io scheduler noop registered
[    2.682916] io scheduler deadline registered (default)
[    2.694026] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    2.708174] console [ttyS0] disabled
[    2.715189] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 14, base_baud = 3125000) is a 16550A
[    2.733176] console [ttyS0] enabled
[    2.733176] console [ttyS0] enabled
[    2.746952] bootconsole [early0] disabled
[    2.746952] bootconsole [early0] disabled
[    2.763516] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    2.776497] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error
[    2.790590] Enable NFI Clock
[    2.796308] # MTK NAND # : Use HW ECC
[    2.803619] Device not found, ID: c2f1
[    2.811077] Not Support this Device! 
[    2.818547] chip_mode=00000001
[    2.824611] Support this Device in MTK table! c2f1 
[    2.834497] [NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
[    2.847369] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1
[    2.860018] nand: Macronix NAND 128MiB 3,3V 8-bit
[    2.869387] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    2.884468] Scanning device for bad blocks
[    3.131569] 8 fixed-partitions partitions found on MTD device MT7621-NAND
[    3.145081] Creating 8 MTD partitions on "MT7621-NAND":
[    3.155495] 0x000000000000-0x000000080000 : "uboot"
[    3.166317] 0x000000080000-0x000000100000 : "config"
[    3.177277] 0x000000100000-0x000000140000 : "factory"
[    3.188459] 0x000000140000-0x000002a80000 : "firmware"
[    3.764564] 2 uimage-fw partitions found on MTD device firmware
[    3.776382] 0x000000140000-0x000000312a05 : "kernel"
[    3.787341] 0x000000312a05-0x000002a80000 : "rootfs"
[    3.798619] mtd: device 5 (rootfs) set to be root filesystem
[    3.809938] 1 squashfs-split partitions found on MTD device rootfs
[    3.822253] 0x000000580000-0x000002a80000 : "rootfs_data"
[    3.834326] 0x000002940000-0x000002a40000 : "user_storage"
[    3.846307] 0x000002a40000-0x000003a40000 : "data"
[    3.857043] 0x000003a40000-0x000006c40000 : "storage"
[    3.868601] 0x000006c40000-0x000008000000 : "backup"
[    3.879716] [mtk_nand] probe successfully!
[    3.888590] Signature matched and data read!
[    3.897071] load_fact_bbt success 1023
[    3.905332] libphy: Fixed MDIO Bus: probed
[    3.980177] libphy: mdio: probed
[    5.386314] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
[    5.398845] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 17
[    5.418116] NET: Registered protocol family 10
[    5.428336] Segment Routing with IPv6
[    5.435694] NET: Registered protocol family 17
[    5.444618] 8021q: 802.1Q VLAN Support v1.8
[    5.456232] UBI error: no valid UBI magic found inside mtd8
[    5.467403] hctosys: unable to open rtc device (rtc0)
[    5.479081] random: fast init done
[    5.490546] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    5.505280] Freeing unused kernel memory: 276K
[    5.514156] This architecture does not have kernel memory protection.
[    5.960436] init: Console is alive
[    5.967405] init: - watchdog -
[    6.463871] mtk_soc_eth 1e100000.ethernet eth0: port 4 link up
[    6.753830] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.853979] usbcore: registered new interface driver usbfs
[    6.865048] usbcore: registered new interface driver hub
[    6.875784] usbcore: registered new device driver usb
[    6.893843] SCSI subsystem initialized
[    6.923299] xhci-mtk 1e1c0000.xhci: 1e1c0000.xhci supply vbus not found, using dummy regulator
[    6.940619] xhci-mtk 1e1c0000.xhci: 1e1c0000.xhci supply vusb33 not found, using dummy regulator
[    6.958300] xhci-mtk 1e1c0000.xhci: xHCI Host Controller
[    6.968920] xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 1
[    6.987780] xhci-mtk 1e1c0000.xhci: hcc params 0x01401198 hci version 0x96 quirks 0x00210010
[    7.004711] xhci-mtk 1e1c0000.xhci: irq 16, io mem 0x1e1c0000
[    7.017180] hub 1-0:1.0: USB hub found
[    7.024841] hub 1-0:1.0: 2 ports detected
[    7.033474] xhci-mtk 1e1c0000.xhci: xHCI Host Controller
[    7.044151] xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 2
[    7.059076] xhci-mtk 1e1c0000.xhci: Host supports USB 3.0  SuperSpeed
[    7.072334] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    7.089373] hub 2-0:1.0: USB hub found
[    7.096913] hub 2-0:1.0: 1 port detected
[    7.171781] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.197952] init: - preinit -
[    7.649378] SQUASHFS error: xz decompression failed, data probably corrupt
[    7.663089] SQUASHFS error: squashfs_read_data failed to read block 0x1abdde
[    7.677139] SQUASHFS error: Unable to read fragment cache entry [1abdde]
[    7.690484] SQUASHFS error: Unable to read page, block 1abdde, size 16a80
[    7.704033] SQUASHFS error: Unable to read fragment cache entry [1abdde]
[    7.717373] SQUASHFS error: Unable to read page, block 1abdde, size 16a80
[    7.730906] SQUASHFS error: Unable to read fragment cache entry [1abdde]
[    7.744247] SQUASHFS error: Unable to read page, block 1abdde, size 16a80
[    7.757781] SQUASHFS error: Unable to read fragment cache entry [1abdde]
[    7.771121] SQUASHFS error: Unable to read page, block 1abdde, size 16a80
[    7.784654] SQUASHFS error: Unable to read fragment cache entry [1abdde]
[    7.797997] SQUASHFS error: Unable to read page, block 1abdde, size 16a80
[    7.812014] init: Failed to start plugd: I/O error
[    8.428514] SQUASHFS error: xz decompression failed, data probably corrupt
[    8.442222] SQUASHFS error: squashfs_read_data failed to read block 0x6e
[    8.456590] SQUASHFS error: xz decompression failed, data probably corrupt
[    8.470276] SQUASHFS error: squashfs_read_data failed to read block 0x6e
[    8.484066] init: Failed to start preinit: I/O error
[    8.495078] SQUASHFS error: Unable to read fragment cache entry [1abdde]
[    8.508484] SQUASHFS error: Unable to read page, block 1abdde, size 16a80
[    8.727623] usb 1-2: new high-speed USB device number 2 using xhci-mtk

Did you ever get to the bottom of this?

Hi any update? Have you succeded in running 18 on it?

Yes, i eventually made it to work.
I had to disable the sdhci in the DTS file as it was most likely interfering with the nand thus causing the annoying troubles.

I was something quite simple, a stupid mistake from my side! :slight_smile:

1 Like

Sounds great,

are you able to share/commit the related files?

Give me a few hours and i'll pack you the required files.

Hi cristian sorry to bother you, have you managed to pack the necessary files? Have a nice day!

Hey do u know the serial pinouts for the NA502 is it GND- RX-Unsued -TX

Hi Cristian,

by the chance you are still floating around. Would you mind to share the related files, especially the DTS file? I am currently in the same situation and am struggeling with the DTS. Hopefully you are still around here.

Cheers,
Michael

I revive this old topic, because I received a (branded) NA502 today. I didn't even power it on yet, but does anybody here have something for me to start with, DTS or other details?
My ultimate goal would be to bring up Zigbee and ZWave, but I fear that this will be a long process.

It wasn't too difficult to get the basics running, ZWave and ZigBee are working via ser2net (only communication tested, I don't have any ZigBee devices). I haven't investigated Bluetooth, but for now it's not detected by the driver.

The only real problem I'm facing is the dual-firmware design of my device: I could not figure out what triggers booting of the other image!? Also, I don't know if all branded NA502 have the same firmware layout - mine is A1 Smart Home NA502-EU v1.

You can track my progress here: https://github.com/andyboeh/openwrt/tree/sercomm_na502

Just a short fyi: Support for this is now in Snapshot and will be released with OpenWrt 21.02.

FYI - OpenWrt 21.02.0 support is available now.

Please open new topics for any remaining questions.

Thanks! :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.