mtdparts kernel cmdline

Brijesh Singh brijesh.ksingh at gmail.com
Mon Jul 31 21:56:24 EDT 2006


Josh,

Thanks for your comment.

Yes i understand in first case physmap driver creates the requested
two partitions. But when i tried to ran "eraseall -j /dev/mtd1" to
create jffs2 filesystem. The utility erases the entire flash rather
than starting from 0x40000 offset.
Hence i suspected that its not picking up the correct starting offset.

To debug further i ran "mtd_debug" utility to verify the ambiguity
between partitions created by cmdline and physmap driver.

1) mtd_debug info /dev/mtd0 without kernelcmd
# mtd_debug info /dev/mtd0
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 33554432 (32M)
mtd.erasesize = 65536 (64K)
mtd.oobblock = 0
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 1

region[0].offset = 0x00000000
region[0].erasesize = 65536 (64K)
region[0].numblocks = 512
region[0].regionindex = 0

2) mtd_debug with kernel cmd

root~# mtd_debug info /dev/mtd0
       mtd.type = MTD_NORFLASH
      mtd.flags = MTD_ERASEABLE
       mtd.size = 262144 (256K)
        mtd.erasesize = 65536 (64K)
        mtd.oobblock = 0
        mtd.oobsize = 0
        mtd.ecctype = MTD_ECC_NONE
        regions = 0

# mtd_debug info /dev/mtd1
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 3145728 (3M)
mtd.erasesize = 65536 (64K)
mtd.oobblock = 0
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0


So the question is why kernel does not find "regions" field when
executed with cmdline argument ?

Thanks,
Brijesh

On 7/31/06, Josh Boyer <jwboyer at gmail.com> wrote:
> On 7/31/06, Brijesh Singh <brijesh.ksingh at gmail.com> wrote:
>
> > Can you give me a pointer on  why the "regions/offset/numblocks"
> > fields are blank when I use kernel cmdline parameter.
>
> You're using physmap to map the overall chip.  The default behavior of
> that mapping driver is to create partitions if they exist then return,
> which it does in your first case.  If no partitions are found, it will
> create a single MTD for the entire chip.  That is what you are seeing
> in the case where you do not specify any partitions on the command
> line.
>
> josh
>


-- 
Confusion is always the most honest response.




More information about the linux-mtd mailing list