2010-08-24 05:42:12     flash_eraseall -j fails on BF518 board

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-08-24 05:42:12     flash_eraseall -j fails on BF518 board

Abhijit Bokil (INDIA)

Message: 92729   

 

flash_eraseall cmd works but flash_eraseall -j (format as jffs2) fails.

 

root:/> flash_unlock /dev/mtd3

root:/> flash_eraseall

flash_eraseall: no MTD device specified

Try `flash_eraseall --help' for more information.

root:/> flash_eraseall --help

Usage: flash_eraseall [OPTION] MTD_DEVICE

Erases all of the specified MTD device.

 

  -j, --jffs2    format the device for jffs2

  -q, --quiet    don't display progress messages

      --silent   same as --quiet

      --help     display this help and exit

      --version  output version information and exit

root:/> flash_eraseall -j /dev/mtd3

Erasing 64 Kibyte @ 0 --  0 % complete.

flash_eraseall: /dev/mtd3: MTD write failure: Read-only file system

Erasing 64 Kibyte @ 10000 -- 12 % complete.

flash_eraseall: /dev/mtd3: MTD write failure: Read-only file system

Erasing 64 Kibyte @ 20000 -- 25 % complete.

flash_eraseall: /dev/mtd3: MTD write failure: Read-only file system

Erasing 64 Kibyte @ 30000 -- 37 % complete.

flash_eraseall: /dev/mtd3: MTD write failure: Read-only file system

Erasing 64 Kibyte @ 40000 -- 50 % complete.

flash_eraseall: /dev/mtd3: MTD write failure: Read-only file system

Erasing 64 Kibyte @ 50000 -- 62 % complete.

flash_eraseall: /dev/mtd3: MTD write failure: Read-only file system

Erasing 64 Kibyte @ 60000 -- 75 % complete.

flash_eraseall: /dev/mtd3: MTD write failure: Read-only file system

Erasing 64 Kibyte @ 70000 -- 87 % complete.

flash_eraseall: /dev/mtd3: MTD write failure: Read-only file system

Erasing 64 Kibyte @ 80000 -- 100 % complete.

 

 

root:/> flash_eraseall /dev/mtd3  

Erasing 64 Kibyte @ 80000 -- 100 % complete.

QuoteReplyEditDelete

 

 

2010-08-24 12:22:32     Re: flash_eraseall -j fails on BF518 board

Mike Frysinger (UNITED STATES)

Message: 92732   

 

how exactly did you partition the device ?  post your exact settings.

 

QuoteReplyEditDelete

 

 

2010-08-25 02:50:39     Re: flash_eraseall -j fails on BF518 board

Abhijit Bokil (INDIA)

Message: 92747   

 

I passed cmdline partition arguments to the kernel. I have pasted the same below:

 

 

 

U-Boot 2008.10 (ADI-2009R1.1-rc1) (Aug 24 2010 - 13:44:45)

 

CPU:   ADSP bf516-0.1 (Detected Rev: 0.1) (parallel flash boot)

Board: Aeron Systems Woodraider Board

Clock: VCO: 400 MHz, Core: 400 MHz, System: 80 MHz

RAM:   32 MB

Flash:  4 MB

In:    serial

Out:   serial

Err:   serial

Net:   Blackfin EMAC

MAC:   02:2A:0B:59:B4:A7

gd: 01f3ff80

|-flags: 3

|-board_type: 0

|-baudrate: 115200

|-have_console: 1

|-ram_size: 0

|-reloc_off: 0

|-env_addr: 1f4000c

|-env_valid: 1

|-jt(01f420d0): 01faf22c

\-bd: 01f3ffa8

   |-bi_baudrate: 1c200

   |-bi_ip_addr: 4100000a

   |-bi_enetaddr: 2 2a b 59 b4 a7

   |-bi_boot_params: 0

   |-bi_memstart: 0

   |-bi_memsize: 2000000

   |-bi_flashstart: 20000000

   |-bi_flashsize: 400000

   \-bi_flashoffset: 0

Hit any key to stop autoboot:  5     4     3     2     1     0

## Booting kernel from Legacy Image at 20030000 ...

   Image Name:   Linux-2.6.28.10-ADI-2009R1.1

   Created:      2010-08-24   9:11:52 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    1019933 Bytes = 996 kB

   Load Address: 00001000

   Entry Point:  001c6a28

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 001c6a28

Linux version 2.6.28.10-ADI-2009R1.1 (root@anshuman.localdomain) (gcc version 4.1.2 (ADI svn)) #1 PREEMPT Tue Aug 24 14:41:44 IST 2010

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Board Memory: 32MB

Kernel Managed Memory: 32MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x00138e20

  rodata    = 0x00138e20-0x001924f0

  bss       = 0x00193000-0x001a5c88

  data      = 0x001a5c88-0x001ba000

    stack   = 0x001b8000-0x001ba000

  init      = 0x001ba000-0x001d8000

  available = 0x001d8000-0x01eff000

  DMA Zone  = 0x01f00000-0x02000000

Hardware Trace Active and Enabled

Boot Mode: 1

Blackfin support (C) 2004-2009 Analog Devices, Inc.

Compiled for ADSP-BF516 Rev 0.1

Blackfin Linux support by   blackfin.uclinux.org/

Processor Speed: 400 MHz core clock and 80 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

Data Cache Enabled for CPU0 (write-back)

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 7873

Kernel command line: mtdparts=physmap-flash.0:192k(u-boot)ro,1344k(kernel)ro,2048k(rootfs)ro,512k(appfs) root=/dev/mtdblock2 rootfstype=jffs2 ro clkin_hz=25000000 earlyprintk=serial,uart0,115200 console=ttyBF0,115200 ip=10.0.0.65:10.0.0.4:10.0.0.1:255.255.255.0:arn-bf516f:eth0:on

Configuring Blackfin Priority Driven Interrupts

PID hash table entries: 128 (order: 7, 512 bytes)

Console: colour dummy device 80x25

console [ttyBF0] enabled, bootconsole disabled

console [ttyBF0] enabled, bootconsole disabled

Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)

Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)

Memory available: 29560k/32768k RAM, (120k init code, 1247k kernel code, 517k data, 1024k dma, 296k reserved)

Calibrating delay loop... 796.67 BogoMIPS (lpj=1593344)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (15 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 32 KB (26 KB free)

net_namespace: 288 bytes

NET: Registered protocol family 16

Blackfin DMA Controller

ezbrd_init(): registering device resources

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 1024 (order: 1, 8192 bytes)

TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

TCP: Hash tables configured (established 1024 bind 1024)

TCP reno registered

NET: Registered protocol family 1

JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.

msgmni has been set to 57

io scheduler noop registered (default)

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 29) is a BFIN-UART

brd: module loaded

bfin_mii_bus: probed

bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:1f, irq=-1, mdc_clk=2500000Hz(mdc_div=15)@sclk=80MHz)

bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1

physmap platform flash device: 00400000 at 20000000

physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank

Intel/Sharp Extended Query Table at 0x0035

Using buffer write method

cfi_cmdset_0001: Erase suspend on write enabled

4 cmdlinepart partitions found on MTD device physmap-flash.0

Creating 4 MTD partitions on "physmap-flash.0":

0x00000000-0x00030000 : "u-boot"

0x00030000-0x00180000 : "kernel"

0x00180000-0x00380000 : "rootfs"

0x00380000-0x00400000 : "appfs"

bfin-spi bfin-spi.1: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc03400, dma channel@5

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

i2c /dev entries driver

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 1970-01-01 07:56:00 UTC (28560)

dma_alloc_init: dma_page @ 0x002c2000 - 256 pages at 0x01f00000

IP-Config: Complete:

     device=eth0, addr=10.0.0.65, mask=255.255.255.0, gw=10.0.0.1,

     host=arn-bf516f, domain=, nis-domain=(none),

     bootserver=10.0.0.4, rootserver=10.0.0.4, rootpath=

VFS: Mounted root (jffs2 filesystem) readonly.

Freeing unused kernel memory: 120k freed

[: not found

[: not found

[: not found

[: not found

[: not found

PHY: 0:1f - Link is Up - 10/Half

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            -   blackfin.uclinux.org/

\    YP"    `| 8P  `.          -   docs.blackfin.uclinux.org/

/     \.___.d|    .'           -   www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    -   www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.13.4 (2010-08-24 14:43:25 IST) built-in shell (msh)

Enter 'help' for a list of built-in commands.

 

root:/>

 

Earlier I had created a jffs2 file system and wrote it successfully into mtdblock3 while in u-boot using cp.b. Once linux boots, I am able to mount /dev/mtdblock3 successfully but again I get erase failed error.

 

root:/> mount -t jffs2 /dev/mtdblock3 /mnt/

root:/> Erase at 0x00030000 failed immediately: -EROFS. Is the sector locked?

Erase at 0x00020000 failed immediately: -EROFS. Is the sector locked?

Erase at 0x00010000 failed immediately: -EROFS. Is the sector locked?

Erase at 0x00070000 failed immediately: -EROFS. Is the sector locked?

Erase at 0x00060000 failed immediately: -EROFS. Is the sector locked?

Erase at 0x00050000 failed immediately: -EROFS. Is the sector locked?

Erase at 0x00040000 failed immediately: -EROFS. Is the sector locked?

QuoteReplyEditDelete

 

 

2010-08-25 03:00:21     Re: flash_eraseall -j fails on BF518 board

Mike Frysinger (UNITED STATES)

Message: 92748   

 

that kernel log seems to be OK.  what does /proc/mtd look like ?

QuoteReplyEditDelete

 

 

2010-08-26 02:01:38     Re: flash_eraseall -j fails on BF518 board

Abhijit Bokil (INDIA)

Message: 92779   

 

root:/> cat /proc/mtd

dev:    size   erasesize  name

mtd0: 00030000 00010000 "u-boot"

mtd1: 00150000 00010000 "kernel"

mtd2: 00200000 00010000 "rootfs"

mtd3: 00080000 00010000 "appfs"

mtd4: 00400000 00010000 "mtdram test device"

 

Could there be an issue with the erase size? Since the flash I'm using has 71 sectors (8 sectors of 4K and 63 sectors of 32K). The first 8 sectors have an erase size of 8KB and the remaining 63 have an erase size of 64KB.

QuoteReplyEditDelete

 

 

2010-08-26 02:28:22     Re: flash_eraseall -j fails on BF518 board

Mike Frysinger (UNITED STATES)

Message: 92780   

 

yes and no.  jffs2 must span a certain number of erase blocks, but i think 8 is enough.

 

after doing `flash_eraseall /dev/mtd3`, what do you read back out ?  is it all 0xff ?

 

what if you do `cat /dev/zero > /dev/mtdblock3` ?  do you read all zeros back out ?

 

how did you verify u-boot was able to read/write the flash correctly ?  if you erase all those sectors, then fill them all with junk (like starting at 0x0), then do a 'cmp.b', do you get the same answer ?

 

if all these things check out, then run `flash_info /dev/mtd3` and see what it has to say (before and after the flash_unlock).  and make sure under u-boot doing 'protect off all' shows all sectors as writable via 'flinfo'.

 

otherwise you can enable verbose debugging in the mtd layer in your kernel config.  then see what it spews out after attempting to flash_eraseall with the -j option.

Attachments

    Outcomes