Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
9 years ago

mtd: partition "JFFS2 Filesystem" doesn't end on an erase block -- force read-only

Hello everybody

I am trying to boot linux with mmu kernel from rocket boards (http://rocketboards.org/foswiki/documentation/niosiilinuxusermanual)

in a ARRIA V GX STARTER KIT .

I can boot linux with filesystem from ram and looking at initialization i see a error mounting the filesystem

(mtd: partition "JFFS2 Filesystem" doesn't end on an erase block -- force read-only)

why this is happening?

U-Boot 2013.01.01-00121-g32c1d91-dirty (Mar 09 2016 - 11:43:09)
CPU   : Nios-II
SYSID : 00001234, Fri Mar 04 21:14:35 2016
BOARD : ARRIA V
ERROR: too many flash sectors
*** Warning - bad CRC, using default environment
Net:   No ethernet found.
Hit any key to stop autoboot:  0# # Booting kernel from Legacy Image at d6000000 ...
   Image Name:   Linux-3.10.31-ltsi-05131-g55fdf0
   Image Type:   NIOS II Linux Kernel Image (gzip compressed)
   Data Size:    3384377 Bytes = 3.2 MiB
   Load Address: d0000000
   Entry Point:  d0000000
   Verifying Checksum ... OK# # Flattened Device Tree blob at d5000000
   Booting using the fdt blob at 0xd5000000
   Uncompressing Kernel Image ... OK
Linux version 3.10.31-ltsi-05131-g55fdf0e-dirty (franz@franz-vpcpu-alloc: s0 r0
d32768 u32768 alloc=1*32768
pcpu-alloc:  0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyJ0,115200 root=/dev/mtdblock0 rootfstype=jffs2 r
w
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Sorting __ex_table...
Memory available: 250024k/7573k RAM (1567k kernel code, 6006k data)
NR_IRQS:64 nr_irqs:64 0
Calibrating delay loop... 72.70 BogoMIPS (lpj=36352)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
devtmpfs: initialized
bio: create slab <bio-0> at 0
Switching to clocksource timer
jffs2: version 2.2. (NAND) -® 2001-2006 Red Hat, Inc.
msgmni has been set to 488
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
ttyJ0 at MMIO 0x8000058 (irq = 1) is a Altera JTAG UART
console  enabled, bootconsole disabled
console  enabled, bootconsole disabled
loop: module loaded
0.flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000089 Chi
p ID 0x008963
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
Using auto-unlock on power-up/resume
cfi_cmdset_0001: Erase suspend on write enabled
erase region 0: offset=0x0,size=0x8000,blocks=4
erase region 1: offset=0x20000,size=0x20000,blocks=1023
1 ofpart partitions found on MTD device 0.flash
Creating 1 MTD partitions on "0.flash":
0x000006000000-0x000007fdffff : "JFFS2 Filesystem"
mtd: partition "JFFS2 Filesystem" doesn't end on an erase block -- force read-on
ly
mousedev: PS/2 mouse device common for all mice
Freeing unused kernel memory: 5536K (d0189000 - d06f1000)
Starting logging: OK
Initializing random number generator... done.
Starting network...
ip: socket: Function not implemented
ip: socket: Function not implemented
Welcome to Nios II
nios2 login: root
login: root login on 'ttyJ0'#  ls#  ls#  cd ..#  ls
?[1;34mbin?[0m      ?[1;34mhome?[0m     ?[1;36mlib32?[0m    ?[1;34mmnt?[0m
?[1;34mroot?[0m     ?[1;34msys?[0m      ?[1;34mvar?[0m
?[1;34mdev?[0m      ?[1;32minit?[0m     ?[1;36mlinuxrc?[0m  ?[1;34mopt?[0m
?[1;36mrun?[0m      ?[1;34mtmp?[0m
?[1;34metc?[0m      ?[1;34mlib?[0m      ?[1;34mmedia?[0m    ?[1;34mproc?[0m
?[1;34msbin?[0m     ?[1;34musr?[0m# 

and why these strange characters are appearing? "?[1;34mhome?[0m"

when i try to boot filesystem from cfi i have a error and the system crash........

could someone please help me?

thank you....

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I suspect this problem is caused by PAGE SIZE and ERASE BLOCK SIZE building rootfs

    I am using a 1-Gb CFI-compatible synchronous flash, 16-bit data memory interface. PN PC28F00AP30BF

    at u-boot i try flinfo and get

    ARRIA V GX# > flinfo
    Bank#  1: CFI conformant flash (16 x 16)  Size: 128 MB in 1024 Sectors
      Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x8963
      Erase timeout: 4096 ms, write timeout: 2 ms
      Buffer write timeout: 500 ms, buffer size: 1024 bytes
      Sector Start Addresses:
      E0000000   RO   E0008000   RO   E0010000   RO   E0018000   RO   E0020000   RO
      E0040000   RO   E0060000   RO   E0080000   RO   E00A0000   RO   E00C0000   RO
      E00E0000   RO   E0100000   RO   E0120000   RO   E0140000   RO   E0160000   RO
      E0180000   RO   E01A0000   RO   E01C0000   RO   E01E0000   RO   E0200000   RO
      E0220000   RO   E0240000   RO   E0260000   RO   E0280000   RO   E02A0000   RO
      E02C0000   RO   E02E0000   RO   E0300000   RO   E0320000   RO   E0340000   RO
      E0360000   RO   E0380000   RO   E03A0000   RO   E03C0000   RO   E03E0000   RO
      E0400000   RO   E0420000   RO   E0440000   RO   E0460000   RO   E0480000   RO
      E04A0000   RO   E04C0000   RO   E04E0000   RO   E0500000   RO   E0520000   RO
      E0540000   RO   E0560000   RO   E0580000   RO   E05A0000   RO   E05C0000   RO
      E05E0000   RO   E0600000   RO   E0620000   RO   E0640000   RO   E0660000   RO
      E0680000   RO   E06A0000   RO   E06C0000   RO   E06E0000   RO   E0700000   RO
      E0720000   RO   E0740000   RO   E0760000   RO   E0780000   RO   E07A0000   RO
      E07C0000   RO   E07E0000   RO   E0800000   RO   E0820000   RO   E0840000   RO
      E0860000   RO   E0880000   RO   E08A0000   RO   E08C0000   RO   E08E0000   RO
      E0900000   RO   E0920000   RO   E0940000   RO   E0960000   RO   E0980000   RO
      E09A0000   RO   E09C0000   RO   E09E0000   RO   E0A00000   RO   E0A20000   RO
      E0A40000   RO   E0A60000   RO   E0A80000   RO   E0AA0000   RO   E0AC0000   RO
      E0AE0000   RO   E0B00000   RO   E0B20000   RO   E0B40000   RO   E0B60000   RO
      E0B80000   RO   E0BA0000   RO   E0BC0000   RO   E0BE0000   RO   E0C00000   RO
      E0C20000   RO   E0C40000   RO   E0C60000   RO   E0C80000   RO   E0CA0000   RO
      E0CC0000   RO   E0CE0000   RO   E0D00000   RO   E0D20000   RO   E0D40000   RO
      E0D60000   RO   E0D80000   RO   E0DA0000   RO   E0DC0000   RO   E0DE0000   RO
      E0E00000   RO   E0E20000   RO   E0E40000   RO   E0E60000   RO   E0E80000   RO
      E0EA0000   RO   E0EC0000   RO   E0EE0000   RO   E0F00000   RO   E0F20000   RO
    

    i calculate the erase block => (size/sectors) * 1024 * 1024 = (128/1024) * 1024 * 1024 = 131072 bytes (0x20000)

    but i dont know calculate the page size

    please can someone tell me if my suspicions are correct?

    if yes how i can calculate the true page size and erase block size??

    lets go guys, help me please!!!!!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hello guys.....good news......

    i have sucess booting from flash .........

    the problem was the size of reserved memory for filesystem ......need to have size multiple of size of filesystem......