Forum Discussion

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

Intel Strataflash P30 and jffs2 problem

Hi

Does anyone here have any experience using Intel Strataflash P30 with Nios II?

We often get the following error when writing to a mounted jffs2 file system:

Node totlen on flash (0x00800080) != totlen from node ref (0x00000444)

The last value (444) changes, but the first value (0x00800080) is usually the same every time.

We sometimes see this warning too (status varies):

SR.4 or SR.5 bits set in buffer write (status b0). Clearing.

We have tried kernel versions 2.6.11, 2.6.16.11 and 2.6.16.27. Same problem on all these versions.

We have made our own mapping driver based on altera.c, and we have tried using "CFI Flash device in physical memory map" and parsed partition information from kernel command-line.

Bank width is 2 octets.

We have developed our own board with 32MB SDRAM, SMC91111 ethernet and Intel Strataflash P30 32MB flash.

We unlock the whole flash using flash_unlock utility before mounting the file system, since this flash chip powers up with all blocks locked.

Lately we have also seen some packet loss.

I hope someone have any ideas on how to solve this problem.

Regards,

Hein

1 Reply

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

    I found the answer myself in this mailing list:

    mtd/intel p30 flash problem on pxa255 (http://marc.theaimsgroup.com/?l=linux-arm-kernel&m=114833865503774&w=2)

    The problem was that there is a bug in some Intel P30 256Mbit engineering sample chips with id 0x8922.

    Here is a patch that fixes the problem:

    --- ../../../../linux-2.6.16.27-nios/drivers/mtd/chips/cfi_cmdset_0001.c        2006-07-17 15:58:58.000000000 +0200
    +++ cfi_cmdset_0001.c   2006-08-28 12:05:38.000000000 +0200
    @@ -181,6 +181,17 @@
     }
    # endif
    +static void fixup_intel_p30(struct mtd_info *mtd, void* param)
    +{
    +       struct map_info *map = mtd->priv;
    +       struct cfi_private *cfi = map->fldrv_priv;
    +       struct cfi_pri_intelext *extp = cfi->cmdset_priv;
    +
    +       printk(KERN_WARNING "cfi_cmdset_0001: Erasing "
    +                           "Bit 512 of Feature Set on this P30.\n");
    +       extp->FeatureSupport &= ~512;
    +}
    +
     static void fixup_st_m28w320ct(struct mtd_info *mtd, void* param)
     {
            struct map_info *map = mtd->priv;
    @@ -232,6 +243,7 @@
    # endif
            { CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct, NULL },
            { CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb, NULL },
    +       { CFI_MFR_ANY, 0x8922, /* 28F256P30 */ fixup_intel_p30, NULL },
            { 0, 0, NULL, NULL }
     };

    Hein