[NAND] Are partitions persistent?

Mike Frysinger vapier.adi at gmail.com
Fri Jun 17 02:26:15 EDT 2011


On Thu, Jun 16, 2011 at 07:23, Gilles wrote:
>        I was wondering: Are partitions on NAND persistent, or is it up to
> the developer to make sure the images used to populate the different
> partitions are small enough to fit the partitions set in the NAND
> driver?
>
> For instance, this found through Google:
> =============
> static struct mtd_partition bfin_spi_flash_partitions[ ] = {
>    {
>        .name = "bootloader(spi)",
>        .size = 0x00040000,
>        .offset = 0,
>        .mask_flags = MTD_CAP_ROM
>    }, {
>        .name = "linux kernel(spi)",
>        .size = 0x180000,
>        .offset = MTDPART_OFS_APPEND,
> };
> =============
>
> Does it mean that, for instance, when using Uboot's nandwrite to
> update the bootloader above, it's up to me to make sure that the image
> is smaller than 0x40000 and Uboot will happily keep going and erase
> part of the linux kernel, or is the MTDPART_OFS_APPEND option
> precisely made to avoid this and trigger an error?

the kernel's concept of partitions really has nothing to do with
u-boot.  further, the layout you define in the kernel via platform
resources is static and always used exactly as declared regardless of
the content on there.

u-boot by default does not know any of partitions, only offsets and
lengths.  it is up to you to make sure the two concepts are kept in
line.
-mike



More information about the linux-mtd mailing list