Skip to contentSkip to conversation

Help! Omap730 ext2 file system problem?

DISCUSSION [email protected] 1 participant 1 message Mar 21, 2006

lore
Share & tools
lore
#0 lore raw

hi.

I meet a strange problem. my system uses omap730 and 32M Intel Nor flash. the rootfs is ext2 file system on flash MTD, when I opened a file to write and save,
always save flash is error, the mtdblock debug info is below:

"mtdblock: erase of region [0x0, 0x20000] on "rootfs" failed
end_request: I/O error, dev mtdblock3, sector 2174 "

from above detail trace, the error of return is -EROFS, the return is from "do_erase_oneblock" function in file "cfi_cmdset_0001.c".

The point of return from here:

static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
unsigned long adr, int len, void *thunk)

{
      .....
     /* We've broken this before. It doesn't hurt to be safe */
     map_write(map, CMD(0x70), adr);
     chip->state = FL_STATUS;
     status = map_read(map, adr);

     /* check for errors */
     if (map_word_bitsset(map, status, CMD(0x3a))) {
          unsigned long chipstatus = MERGESTATUS(status);

          /* Reset the error bits */
          map_write(map, CMD(0x50), adr);
          map_write(map, CMD(0x70), adr);
          xip_enable(map, chip, adr);

          if ((chipstatus & 0x30) == 0x30) {
               printk(KERN_ERR "%s: block erase error: (bad command
sequence, status 0x%lx)\n", map->name, chipstatus);
               ret = -EINVAL;
          } else if (chipstatus & 0x02) {
               /* Protection bit set */
               ret = -EROFS;                 //=================return
error from here.
          } else if (chipstatus & 0x8) {
               /* Voltage */
               printk(KERN_ERR "%s: block erase error: (bad VPP)\n",
map->name);
               ret = -EIO;
          } else if (chipstatus & 0x20 && retries--) {
               printk(KERN_DEBUG "block erase failed at 0x%08lx: status
0x%lx. Retrying...\n", adr, chipstatus);
               timeo = jiffies + HZ;
               put_chip(map, chip, adr);
               spin_unlock(chip->mutex);
               goto retry;
          } else {
               printk(KERN_ERR "%s: block erase failed at 0x%08lx (status
0x%lx)\n", map->name, adr, chipstatus);
               ret = -EIO;
          }
}

But the rootfs is writeable in my system. the file part log of setup is below:

omapflash.0: Found 1 x16 devices at 0x0 in 16-bit bank
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 Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled Creating 4 MTD partitions on "omapflash.0":
0x00000000-0x00020000 : "bootloader" 0x00020000-0x00040000 : "params" 0x00040000-0x00240000 : "kernel" 0x00240000-0x02000000 : "rootfs"

Here is my nor_partitions set.the root partition is write able.

static struct mtd_partition nor_partitions[] = {
     /* bootloader (U-Boot, etc) in first sector */
     {
           .name         = "bootloader",
           .offset       = 0,
           .size         = SZ_128K,
           .mask_flags   = MTD_WRITEABLE, /* force read-only */
     },
     /* bootloader params in the next sector */
     {
           .name         = "params",
           .offset       = MTDPART_OFS_APPEND,
           .size         = SZ_128K,
           .mask_flags   = 0,
     },
     /* kernel */
     {
           .name         = "kernel",
           .offset       = MTDPART_OFS_APPEND,
           .size         = SZ_2M,
           .mask_flags   = 0
     },
     /* rest of flash is a file system */
     {
           .name         = "rootfs",
           .offset       = MTDPART_OFS_APPEND,
           .size         = MTDPART_SIZ_FULL,
           .mask_flags   = 0
     },
};

Please help me and give me some comment!

Best regards.

######################################################
Andy Kang
Lenovo Mobile Limited R&D Center,Shanghai Branch 9F,No.696 Songtao Rd.,Pudong High-Tech,Shanghai Tel:+86-21-50504500-8437
------------------------------------------------------