Intel flash that powers up locked

Konstantin Kletschke lists at ku-gbr.de
Thu Jun 2 07:52:39 EDT 2005


Am 2005-06-02 12:46 +0200 schrieb Thomas Gleixner:

> Maybe it helps if you read the code of the invoked function
> (cfi_varsize_frob).

Ok, I took a closer look into cfi_varsize_frob() trying to understand,
if ofs should be 0 (beginning of partition) or address (physical address
of beginning of partition).

What I found out is, that mtd->numeraseregions contains 0 which is the
problem and causes the Oops regardless with which ofs the funtion is
called.

Creating 5 MTD partitions on "scb9328_flash":             
0x00000000-0x00020000 : "U-boot"             
0x00020000-0x00040000 : "U-boot_env"
cfi_intelext_unlock: lock status before, ofs=0x00000000, len=0x00020000
KONSTI mtd->numeraseregions: 0x0                                       
KONSTI first: 0xffffffff        
KONSTI adr:  0x0

Is the output of

int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob,
                                     loff_t ofs, size_t len, void *thunk)
{

...
	i = 0;

        printk("KONSTI mtd->numeraseregions: 0x%x\n", mtd->numeraseregions);

        while (i < mtd->numeraseregions && ofs >= regions[i].offset)
               i++;
        i--;

//      if (ofs & (regions[i].erasesize-1))
//              return -EINVAL;

        /* Remember the erase region we start on */
        first = i;
        printk("KONSTI first: 0x%x\n", first);

The while loop is not entered because 0 is NOT < 0 and 0 is 
decremented by one.
Acessing regions[-1].erasesize gives the Oops, is that correct?

So why is mtd->numeraseregions 0 in my setup and what should be in it (I 
mean in speaking words).

regards, Konsti

-- 
GPG KeyID EF62FCEF
Fingerprint: 13C9 B16B 9844 EC15 CC2E  A080 1E69 3FDA EF62 FCEF




More information about the linux-mtd mailing list