mtd

H Hartley Sweeten hartleys at visionengravers.com
Fri Jan 28 12:27:43 EST 2011


On Friday, January 28, 2011 10:05 AM, hong zhang wrote:
>
> root at ti8168-evm:~# cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00040000 00001000 "U-Boot"
> mtd1: 00002000 00001000 "U-Boot Env"
> mtd2: 00280000 00001000 "Kernel"
> mtd3: 0013e000 00001000 "File System"
> mtd4: 00260000 00020000 "U-Boot"
> mtd5: 00020000 00020000 "U-Boot Env"
> mtd6: 00440000 00020000 "Kernel"
> mtd7: 0c820000 00020000 "File System"
> mtd8: 03120000 00020000 "Reserved"
>
> File System sits in mtd3 and mtd7. But only one of them can be used. In
> my case mtd7 is used when SPI is enabled or mtd3 is used w/o SPI. I do
> not know why.

It looks like your spi device is getting processed by the mtd subsystem
before your actual flash device.  But both devices have the same partition
layout (and names) which is confusing you.

In the information shown above, mtd[0-3] all have an erasesize of 4KB.
These are probably associated with your spi device.  The remaining ones
all have an erasesize of 128KB so these are probably your flash device.

If you look are your boot messages you will probably be able to verify
this.  Look for something like: Creating <x> MTD partitions on "<name>".

The simplest solution would probably be changing the registration order
of the spi and flash devices in your platform init code.  That way the
flash partitions will always be first and the spi partitions, when enabled,
will come after.

Regards,
Hartley


More information about the linux-arm mailing list