[Solved] - Cannot install on SR3200 Kuwfi

Hello Folks
I have tryed to install using Serial Console the firmware to these device, as oriented from https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=c198ca682c187e61730119134e1dde75da2e7a16, but without success. We have fail on JFFS partition, as follows:

U-Boot 1.1.4 (Jul  4 2017 - 14:15:29)

ap152 - Dragonfly 1.0DRAM:
sri
ath_ddr_initial_config(278): (ddr2 init)
ath_sys_frequency: cpu 775 ddr 650 ahb 258
Tap values = (0xf, 0xf, 0xf, 0xf)
128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 201k for U-Boot at: 87fcc000
Reserving 192k for malloc() at: 87f9c000
Reserving 44 Bytes for Board Info at: 87f9bfd4
Reserving 36 Bytes for Global Data at: 87f9bfb0
Reserving 128k for boot params() at: 87f7bfb0
Stack Pointer at: 87f7bf98
Now running in RAM - U-Boot at: 87fcc000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
No valid address in Flash. Using fixed address
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
eth0 up
eth0
Setting 0x181162c0 to 0x8102100
Hit any key to stop autoboot:  0
ath> tftp 0x80060000 openwrt-19.07.7-ar71xx-generic-sr3200-squashfs-sysupgrade.bin
Trying eth0
dup 1 speed 1000
Using eth0 device
TFTP from server 192.168.0.141; our IP address is 192.168.0.144
Filename 'openwrt-19.07.7-ar71xx-generic-sr3200-squashfs-sysupgrade.bin'.
Load address: 0x80060000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #######################################
done
Bytes transferred = 4521988 (450004 hex)
ath> erase 0x9f050000 +$filesize
Erasing flash...
First 0x5 last 0x4a sector size 0x10000
  74
Erased 70 sectors
ath>
Erasing flash...
First 0x5 last 0x4a sector size 0x10000
  74
Erased 70 sectors
ath> cp.b $fileaddr 0x9f050000 $filesize
Copy to Flash... write addr: 9f050000
done
ath> setenv bootcmd "bootm 0x9fe80000 || bootm 0x9f050000"
ath>

At here, all OK. But when I try to boot new kernel
U-Boot 1.1.4 (Jul  4 2017 - 14:15:29)

ap152 - Dragonfly 1.0DRAM:
sri
ath_ddr_initial_config(278): (ddr2 init)
ath_sys_frequency: cpu 775 ddr 650 ahb 258
Tap values = (0xf, 0xf, 0xf, 0xf)
128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 201k for U-Boot at: 87fcc000
Reserving 192k for malloc() at: 87f9c000
Reserving 44 Bytes for Board Info at: 87f9bfd4
Reserving 36 Bytes for Global Data at: 87f9bfb0
Reserving 128k for boot params() at: 87f7bfb0
Stack Pointer at: 87f7bf98
Now running in RAM - U-Boot at: 87fcc000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16MB, sector count = 256
Flash: 16 MB
In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
No valid address in Flash. Using fixed address
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
eth0 up
eth0
Setting 0x181162c0 to 0x8102100
Hit any key to stop autoboot:  0
## Booting image at 9fe80000 ...
   Image Name:   MIPS OpenWrt Linux-3.3.8
   Created:      2017-07-04   6:25:19 UTC
   Image Type:   MIPS Linux Multi-File Image (lzma compressed)
   Data Size:    1275757 Bytes =  1.2 MB
   Load Address: 80060000
   Entry Point:  80060000
   Contents:
   Image 0:  1275749 Bytes =  1.2 MB
   Verifying Checksum at 0x9fe80040 ...OK
   Uncompressing Multi-File Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...

[    0.000000] Linux version 3.3.8 (yangyi@ubuntu) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #7 Wed Jun 21 15:22:45 CST 2017
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019750 (MIPS 74Kc)
[    0.000000] SoC: Qualcomm Atheros QCA956X rev 0
[    0.000000] Clocks: CPU:775.000MHz, DDR:650.000MHz, AHB:258.333MHz, Ref:25.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00008000
[    0.000000] Movable zone start PFN for each node
[    0.000000] Early memory PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00008000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line:  board=AP152 console=ttyS0,115200 mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),14528k(rootfs),1472k(kernel),64k(art),16000k@0x50000(firmware) rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 125616k/131072k available (2746k kernel code, 5456k reserved, 711k data, 228k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:83
[    0.000000] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.060000] pid_max: default: 32768 minimum: 301
[    0.060000] Mount-cache hash table entries: 512
[    0.060000] Performance counters: mips/74K PMU enabled, 4 32-bit counters available to each CPU, irq 13
[    0.070000] Initialized recycle list for cpu 0.
[    0.080000] NET: Registered protocol family 16
[    0.080000] gpiochip_add: registered GPIOs 0 to 22 on device: ath79
[    0.090000] MIPS: machine is Qualcomm Atheros AP152 reference board
[    0.100000] registering PCI controller with io_map_base unset
[    0.310000] bio: create slab <bio-0> at 0
[    0.310000] PCI host bridge to bus 0000:00
[    0.320000] pci_bus 0000:00: root bus resource [mem 0x12000000-0x13ffffff]
[    0.320000] pci_bus 0000:00: root bus resource [io  0x0001]
[    0.330000] pci 0000:00:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
[    0.330000] pci 0000:00:00.0: BAR 6: assigned [mem 0x12200000-0x1220ffff pref]
[    0.340000] pci 0000:00:00.0: using irq 40 for pin 1
[    0.340000] Switching to clocksource MIPS
[    0.350000] NET: Registered protocol family 2
[    0.350000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.350000] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    0.360000] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.360000] TCP: Hash tables configured (established 4096 bind 4096)
[    0.370000] TCP reno registered
[    0.370000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.380000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.380000] NET: Registered protocol family 1
[    0.400000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.400000] NTFS driver 2.1.30 [Flags: R/W].
[    0.410000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.420000] msgmni has been set to 245
[    0.420000] io scheduler noop registered
[    0.430000] io scheduler deadline registered (default)
[    0.430000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.460000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    0.460000] console [ttyS0] enabled, bootconsole disabled
[    0.460000] console [ttyS0] enabled, bootconsole disabled
[    0.480000] m25p80 spi0.0: found w25q128, expected m25p80
[    0.480000] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.490000] 6 cmdlinepart partitions found on MTD device spi0.0
[    0.490000] Creating 6 MTD partitions on "spi0.0":
[    0.500000] 0x000000000000-0x000000040000 : "u-boot"
[    0.510000] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.510000] 0x000000050000-0x000000e80000 : "rootfs"
[    0.520000] mtd: partition "rootfs" set to be root filesystem
[    0.520000] split_squashfs: no squashfs found in "spi0.0"
[    0.530000] 0x000000e80000-0x000000ff0000 : "kernel"
[    0.540000] 0x000000ff0000-0x000001000000 : "art"
[    0.540000] 0x000000050000-0x000000ff0000 : "firmware"
[    0.690000] ag71xx_mdio: probed
[    0.690000] eth0: Atheros AG71xx at 0xb9000000, irq 4
[    1.270000] eth0: Atheros AR8327 switch driver attached.
[    2.490000] ag71xx ag71xx.0: eth0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd036, driver=Atheros AR8216/AR8236/AR8316]
[    2.500000] GACT probability on
[    2.500000] Mirror/redirect action on
[    2.510000] netem: version 1.3
[    2.510000] u32 classifier
[    2.510000]     Performance counters on
[    2.520000]     input device check on
[    2.520000]     Actions configured
[    2.520000] Netfilter messages via NETLINK v0.30.
[    2.530000] nf_conntrack version 0.5.0 (1962 buckets, 7848 max)
[    2.530000] ctnetlink v0.93: registering with nfnetlink.
[    2.540000] ip_tables: (C) 2000-2006 Netfilter Core Team
[    2.550000] TCP cubic registered
[    2.550000] NET: Registered protocol family 17
[    2.550000] Bridge firewalling registered
[    2.560000] Ebtables v2.0 registered
[    2.560000] 8021q: 802.1Q VLAN Support v1.8
[    2.570000] ### of_selftest(): No testcase data in device tree; not running tests
[    2.580000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x2705 instead
[    2.590000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x8fa2 instead
[    2.590000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0x602a instead
[    2.600000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0x0018 instead
[    2.610000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x8006 instead
[    2.620000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x8006 instead
[    2.630000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0xcab2 instead
[    2.640000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x0505 instead
[    2.650000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x4d49 instead
[    2.660000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x204f instead
[    2.670000] Further such events for this erase block will not be printed
[    2.680000] Old JFFS2 bitmask found at 0x00000450
[    2.680000] You cannot use older JFFS2 filesystems with newer kernels
,,,
[   12.210000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00440024: 0x5da0 instead
[   12.220000] Further such events for this erase block will not be printed
[   12.260000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x450000
[   12.270000] Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
[   12.280000] empty_blocks 158, bad_blocks 0, c->nr_blocks 227
[   12.290000] VFS: Cannot open root device "(null)" or unknown-block(31,2)
[   12.290000] Please append a correct "root=" boot option; here are the available partitions:
[   12.300000] 1f00             256 mtdblock0  (driver?)
[   12.310000] 1f01              64 mtdblock1  (driver?)
[   12.310000] 1f02           14528 mtdblock2  (driver?)
[   12.320000] 1f03            1472 mtdblock3  (driver?)
[   12.320000] 1f04              64 mtdblock4  (driver?)
[   12.330000] 1f05           16000 mtdblock5  (driver?)
[   12.330000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)

How part I'm doing some mistake?

Thanks for clarification

What version of openwrt did you install ?

You wrote the openwrt image at 0x9f050000, but it's booting 9fe80000 because of
setenv bootcmd "bootm 0x9fe80000 || bootm 0x9f050000.

try swapping the bootms around, or remove the 1st one.

Issue this in U-Boot:

erase 0x9fe80000 +0x10000

This will erase first 64 KB sector at the 0x9fe80000 address and make the old firmware unbootable, resulting in OpenWrt loading. Also, don't forget that the support was added for a generic YunCore model, not Kuwfi, I have no idea whether they are the same.

@pepe2k Any special reason why one wouldn't want to simply overwrite the old FW ?

Old firmware is split into two parts in this order: rootfs, then kernel. We don't want this order as it limits size of the kernel (partitioning is static, not dynamic).

When the OpenWrt boots up, it will erase the old firmware and create rootfs_data there.

1 Like

thank your for the explanation.

To be more precise, the bootcm in the commit message should be bootm 0x9f050000 || bootm 0x9fe80000, that's a mistake, my bad. This way, the U-Boot will first try to load firmware at lower address (and if there is OpenWrt, start it), then higher (old firmware).

1 Like

Work likes a charm!!! Thanks a lot!
These routers are the same. The sellers only put your name and resell the items.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.