OpenWrt Forum Archive

Topic: Wzr-hp-ag300h + Jffs2

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

Hi there,

I recently built a vanilla OpenWRT firmware (clean pull from svn, select the appropriate firmware, build, no changing default packages, etc) and tried to flash it to the WZR-HP-AG300H.  The SquashFS version worked great, but the JFFS2 gives errors.  We have used JFFS2 in the past and prefer this for a few reasons, so was wondering if anyone could point me in the right direction to get the JFFS2 version working for this router?  The error messages are below.  Thanks!

BUFFALO U-BOOT Ver 1.00
  == CPU:680MHz, DDR:340MHz, AHB:170MHz ==
AP96 (ar7100) U-boot 0.0.1
DRAM:  128 MB
Top of RAM usable for U-Boot at: 84000000
Reserving 265k for U-Boot at: 83fbc000
Reserving 192k for malloc() at: 83f8c000
Reserving 44 Bytes for Board Info at: 83f8bfd4
Reserving 36 Bytes for Global Data at: 83f8bfb0
Reserving 128k for boot params() at: 83f6bfb0
Stack Pointer at: 83f6bf98
Now running in RAM - U-Boot at: 83fbc000
flash bank #0 found 16 MB flash [W25Q128BV, blk:0x10000, sectors:256]
flash bank #1 found 16 MB flash [W25Q128BV, blk:0x10000, sectors:256]
Flash: 32 MB
In:    serial
Out:   serial
Err:   serial
Memory Test
uboot use  83F6BFB0 - 84000000
Memory Test start(80000000) end(83F00000) size(03F00000)

Pattern 55555555  Writing...            Reading...
Pattern AAAAAAAA  Writing...            Reading...
Pattern 00000000  Writing...            Reading...
Memory Test start(84000000) end(88000000) size(04000000)

Pattern 55555555  Writing...            Reading...
Pattern AAAAAAAA  Writing...            Reading...
Pattern 00000000  Writing...            Reading...
Memory Test OK
### buf_ver=[1.00] U-Boot Ver.=[1.00]
### build_date(env)=[Jun  1 2010 - 13:48:44] build_date(bin)=[Jun  1 2010 - 13:48:44]
ag7100_enet_initialize...
Reading MAC Address from ENV(0x83f8c2fd)
Port 0, Neg Success
Port 1, Neg Success
Port 2, Neg Success
Port 3, Neg Success
eth0: Phy Specific Status=0010
eth0: Phy Specific Status=0010
eth0: Phy Specific Status=0010
eth0: Phy Specific Status=0010;eth0: 02:aa:bb:cc:dd:20
eth0 up
Reading MAC Address from ENV(0x83f8c2fd)
Port 4, Neg Success
eth1: Phy Specific Status=0010
eth1: 02:aa:bb:cc:dd:21
eth1 up
eth0  02:AA:BB:CC:DD:20
, eth1  02:AA:BB:CC:DD:21


enet0 port0 up
pll reg 0x18050010: 0x110000  
tftp server(receive) go, waiting:4[sec]
Load address: 0x84000000
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     $$$$$$$$$$$$$$$$
tftp server done
Bytes transferred = 3407908 (340024 hex)

Airstation Public header
Recv fw image [3407876] bytes, now writing...

flash-addr 0xBF060000 - 0xBF3AFFFF
search sector 0xbf060000 - 0xbf3affff
BANK #1 (6 : 58)
  000  PPPP.Poooooooooooooooooooooooooo
  032  ooooooooooooooooooooooooooo.....
  064  ................................
  096  ................................
  128  ................................
  160  ................................
  192  ................................
  224  ................................
BANK #2 (-1 : -1)
  000  ................................
  032  ................................
  064  ................................
  096  ................................
  128  ................................
  160  ................................
  192  ................................
  224  ................................

First 0x6 last 0x3a sector size 0x10000
   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58
Erased 53 sectors
Copy to Flash... 
 Copy 3407876 byte to Flash...
write data: 84000020 --> bf060000  (len:340004)
done
change bootargs
console=ttyS0,115200 root=31:03 rootfstype=jffs2 init=/sbin/init mtdparts=ar7100-nor0:256k(u-boot),64k(u-boot-env),1152k@384k(uImage),6592k@1536k(rootfs),64k@320k(ART),64k@8128k(properties),8192k@8192k(flash1),16384k@16384k(flash2) mem=128M
## Booting image at bf060000 ...
   Image Name:   MIPS OpenWrt Linux-2.6.39.4
   Created:      2011-12-24  18:25:29 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    872909 Bytes = 852.5 kB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... crc32_fw: bf060040 - bf13520c (len:000d51cd) calc...
crc32_fw: range1 bf060040 - bf13520c
OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...

[    0.000000] Linux version 2.6.39.4 (pandora@phbuild) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Sat Dec 24 11:25:13 MST 2011
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7161 rev 2
[    0.000000] Clocks: CPU:680.000MHz, DDR:340.000MHz, AHB:170.000MHz, Ref:40.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_node_map[1] active 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=WZR-HP-AG300H console=ttyS0,115200 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: 126820k/131072k available (2015k kernel code, 4252k reserved, 391k data, 188k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:80
[    0.000000] Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
[    0.060000] pid_max: default: 32768 minimum: 301
[    0.060000] Mount-cache hash table entries: 512
[    0.070000] NET: Registered protocol family 16
[    0.070000] MIPS: machine is Buffalo WZR-HP-AG300H
[    2.670000] registering PCI controller with io_map_base unset
[    2.680000] bio: create slab <bio-0> at 0
[    2.680000] pci 0000:00:11.0: fixup device configuration
[    2.690000] pci 0000:00:12.0: fixup device configuration
[    2.690000] pci 0000:00:11.0: BAR 0: assigned [mem 0x10000000-0x1000ffff]
[    2.700000] pci 0000:00:11.0: BAR 0: set to [mem 0x10000000-0x1000ffff] (PCI address [0x10000000-0x1000ffff])
[    2.700000] pci 0000:00:12.0: BAR 0: assigned [mem 0x10010000-0x1001ffff]
[    2.710000] pci 0000:00:12.0: BAR 0: set to [mem 0x10010000-0x1001ffff] (PCI address [0x10010000-0x1001ffff])
[    2.710000] PCI: mapping irq 72 to pin1@0000:00:11.0
[    2.720000] PCI: mapping irq 73 to pin1@0000:00:12.0
[    2.720000] Switching to clocksource MIPS
[    2.730000] NET: Registered protocol family 2
[    2.730000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    2.730000] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    2.740000] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    2.740000] TCP: Hash tables configured (established 4096 bind 4096)
[    2.750000] TCP reno registered
[    2.750000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    2.760000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    2.760000] NET: Registered protocol family 1
[    2.780000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.780000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.790000] msgmni has been set to 247
[    2.800000] io scheduler noop registered
[    2.800000] io scheduler deadline registered (default)
[    2.810000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    2.830000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    2.840000] console [ttyS0] enabled, bootconsole disabled
[    2.840000] console [ttyS0] enabled, bootconsole disabled
[    2.850000] Atheros AR71xx SPI Controller driver version 0.2.4
[    2.860000] m25p80 spi0.0: found w25q128, expected m25p80
[    2.870000] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    2.870000] m25p80 spi0.1: found w25q128, expected m25p80
[    2.880000] m25p80 spi0.1: w25q128 (16384 Kbytes)
[    2.880000] Concatenating MTD devices:
[    2.890000] (0): "spi0.0"
[    2.890000] (1): "spi0.1"
[    2.890000] into device "flash"
[    2.890000] Creating 7 MTD partitions on "flash":
[    2.900000] 0x000000000000-0x000000040000 : "u-boot"
[    2.910000] 0x000000040000-0x000000050000 : "u-boot-env"
[    2.910000] 0x000000050000-0x000000060000 : "art"
[    2.920000] 0x000000060000-0x000000160000 : "kernel"
[    2.930000] 0x000000160000-0x000001ff0000 : "rootfs"
[    2.930000] mtd: partition "rootfs" set to be root filesystem
[    2.940000] split_squashfs: no squashfs found in "flash"
[    2.940000] 0x000001ff0000-0x000002000000 : "user_property"
[    2.950000] 0x000000060000-0x000001ff0000 : "firmware"
[    3.350000] ag71xx_mdio: probed
[    3.350000] eth0: Atheros AG71xx at 0xb9000000, irq 4
[    3.870000] eth0: AR8316 switch driver attached.
[    3.890000] ar8316: Using port 4 as switch port
[    9.940000] eth1: Atheros AG71xx at 0xba000000, irq 5
[   10.480000] ar8316: Using port 4 as PHY
[   16.580000] Atheros AR71xx hardware watchdog driver version 0.1.0
[   16.580000] TCP westwood registered
[   16.590000] NET: Registered protocol family 17
[   16.590000] 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
[   16.600000] All bugs added by David S. Miller <davem@redhat.com>
[   16.690000] Node at 0x0000fc50 with length 0x000008d5 would run over the end of the erase block
[   16.690000] Perhaps the file system was created with the wrong erase size?
[   16.700000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc58: 0xeb3e instead
[   16.710000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc6c: 0x0006 instead
[   16.720000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc70: 0x4ef6 instead
[   16.730000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc74: 0x4ef6 instead
[   16.740000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc78: 0x4ef6 instead
[   16.740000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc7c: 0x0001 instead
[   16.750000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc88: 0x0800 instead
[   16.760000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc8c: 0x0358 instead
[   16.770000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc90: 0xc886 instead
[   16.780000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000fc94: 0x0057 instead
[   16.790000] Further such events for this erase block will not be printed
[   16.800000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010000: 0x1835 instead
[   16.810000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010004: 0x3545 instead
[   16.810000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010008: 0xfeae instead
[   16.820000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0001000c: 0x095f instead
[   16.830000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010010: 0xf953 instead
[   16.840000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010014: 0x378b instead
[   16.850000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010018: 0x4c31 instead
[   16.860000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0001001c: 0xf98b instead
[   16.870000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010020: 0x7e01 instead
[   16.880000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010024: 0x80d6 instead
[   16.890000] Further such events for this erase block will not be printed
[   17.030000] Node at 0x0002f7ec with length 0x00000968 would run over the end of the erase block
[   17.040000] Perhaps the file system was created with the wrong erase size?
...
...
[   22.600000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb1c: 0x58bf instead
[   22.610000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb30: 0x000c instead
[   22.620000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb34: 0x4ef6 instead
[   22.630000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb38: 0x4ef6 instead
[   22.640000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb3c: 0x4ef6 instead
[   22.650000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb40: 0x000a instead
[   22.660000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb4c: 0x0800 instead
[   22.670000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb50: 0x9820 instead
[   22.670000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb54: 0xd90f instead
[   22.680000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0022fb58: 0x0037 instead
[   22.690000] Further such events for this erase block will not be printed
[   22.700000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00230000: 0x2e32 instead
[   22.710000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00230004: 0xcc00 instead
[   22.720000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00230008: 0xaba8 instead
[   22.730000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0023000c: 0xe5f9 instead
[   22.730000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00230010: 0x230d instead
[   22.740000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00230014: 0xb157 instead
[   22.750000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00230018: 0xfdb6 instead
[   22.760000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0023001c: 0x8350 instead
[   22.770000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00230020: 0x49c7 instead
[   22.780000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00230024: 0x447c instead
[   22.790000] Further such events for this erase block will not be printed
[   22.870000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x240000
[   22.880000] jffs2_build_filesystem(): unlocking the mtd device... done.
[   22.890000] jffs2_build_filesystem(): erasing all blocks after the end marker... done.
[  108.190000] JFFS2 notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  108.210000] VFS: Mounted root (jffs2 filesystem) readonly on device 31:6.
[  108.220000] Freeing unused kernel memory: 188k freed
[  108.750000] JFFS2 warning: (1) jffs2_do_read_inode_internal: Truncating ino #226 to 84116 bytes failed because it only had 81920 bytes to start with!
[  108.770000] Kernel panic - not syncing: Attempted to kill init!

(Last edited by slthomason on 27 Dec 2011, 06:38)

A little more research - the board seems to be powered by 2 WINBOND 25Q128BVFG flash chips.  So it seems to be a configuration of 16MBx2 = 32 MB.  Does that help in deciphering what needs to change to get the JFFS2 version working?

Bump.  Any ideas out there?

[   16.690000] Node at 0x0000fc50 with length 0x000008d5 would run over the end of the erase block
[   16.690000] Perhaps the file system was created with the wrong erase size?

Hints right at the issue. You need a JFFS2 image built for a different block size.

Sorry - the obvious question now - how do I change the block size?

Thanks!

I suppose by editing target/linux/ar71xx/image/Makefile

Awesome.  That did the trick!  I changed the block size to the 64k and it worked!

Thanks!

The discussion might have continued from here.