Partitioning SPI NOR flash

cancel
Showing results for 
Search instead for 
Did you mean: 

Partitioning SPI NOR flash

Jump to solution
1,811 Views
pt
Senior Contributor I

Hi

I want to partition N25Q128 SPI nor flash. I don't know how to do that.

If anyone aware of it,then please help me to partition the spi flash as mtd0,mtd1,and mtd2.

Board : MCIMX28EVK

Linux Kernel version :2.6.35

Linux BSP : L2.6.35_1.1.0_130130_source

SPI flash : N25Q128

I need to store bootloader,uImage and rootfs in spi.

Regards

Pt A R

Labels (2)
0 Kudos
1 Solution
357 Views
victorien
Contributor IV

Hi,

With bootloader do you use ? u-boot or barebox ?

On linux, to add partition on this memory you have to do something like that on mx28evk.c :

#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)

static struct mtd_partition mx28evk_flash_part[] = {

    {

    .name = "bootloader",

    .offset = 0,

    .size = 2 * 1024 * 1024},

    //.mask_flags = MTD_WRITEABLE}, /* read only partition */

    {

    .name = "env",

    .offset = MTDPART_OFS_NXTBLK,

    .size = MTDPART_SIZ_FULL},

    //.mask_flags = MTD_WRITEABLE}, /* read only partition */

};

static struct flash_platform_data mx28_spi_flash_data = {

    .name = "m25p80",

    .parts = mx28evk_flash_part,

    .nr_parts = ARRAY_SIZE(mx28evk_flash_part),

    .type = "m25p32",

};

#endif

View solution in original post

0 Kudos
1 Reply
358 Views
victorien
Contributor IV

Hi,

With bootloader do you use ? u-boot or barebox ?

On linux, to add partition on this memory you have to do something like that on mx28evk.c :

#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)

static struct mtd_partition mx28evk_flash_part[] = {

    {

    .name = "bootloader",

    .offset = 0,

    .size = 2 * 1024 * 1024},

    //.mask_flags = MTD_WRITEABLE}, /* read only partition */

    {

    .name = "env",

    .offset = MTDPART_OFS_NXTBLK,

    .size = MTDPART_SIZ_FULL},

    //.mask_flags = MTD_WRITEABLE}, /* read only partition */

};

static struct flash_platform_data mx28_spi_flash_data = {

    .name = "m25p80",

    .parts = mx28evk_flash_part,

    .nr_parts = ARRAY_SIZE(mx28evk_flash_part),

    .type = "m25p32",

};

#endif

View solution in original post

0 Kudos