How to partition Nand flash with linux only? (no u-boot)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to partition Nand flash with linux only? (no u-boot)

3,369 Views
snan1z
Contributor I

Hi all,

 

i have to partition my 256MiB nand flash into three as kernel, rootfs and storage. i tried to do it with linux but nothing happened. then, i tried it with kernel command line with LTIB  in "Package List / using MDDR at bootstream";

 

noinitrd console=ttyAM0,115200 mtdparts=gpmi-nfc.0:32m(kernel),150m(rootfs),-(storage) root=/dev/mtdblock1 rootfstype=ubifs rw gpmi

 

Unfortunately, i failed again.please reply,

 

Regards,

Sinan

Labels (1)
0 Kudos
3 Replies

1,465 Views
snan1z
Contributor I

Thank you for your suggestions. I used ubi volumes, they seems good.

 

Regards,

Sinan

0 Kudos

1,465 Views
AhmetYUCE
Contributor II
Unfortunately -unlike some other uP's BSP's- iMX28 BSP doesn't use mx28evk.c for defining nand partitions, it's hardcoded into nand-flash driver of mx28. Can't say location off the top but it's in /drivers/mtd/... something, grep would find the file. The driver dives the partition into two section ~20MB for boot, and the rest (up to the end of nand whatever the actual size ) for general purpose usage. Coincidentally i've spent my last three days to find out how to divide and load image into a 256MB nand into boot, rfs (175MB) and data (49MB) which both section is in ubifs filesystem; generate images and trying to understand how to program. First of all, you don't need to create three partition, you can create two ubi volume in second MTD partition. This approach -which i've used it in my former project with Atmel's ARM9- keeps you away from touching mtd nand driver of mx28. You wont have to modify nand driver when you upgrade your kernel. All you have to do is create a single ubi image by following usual ubi procedures which contains two volumes inside than program image into secondary mtd partition. On your kernel command line giving your rootfs volumes parameters are enough. Regards Ahmet
0 Kudos

1,465 Views
VladanJovanovic
NXP Employee
NXP Employee

I think you'll have to add partition information for NAND in the board file in arch/arm/mach-mx28/mx28evk.c . As an example, you can see how it's done in arch/arm/mach-mx5/mx53_evk.c (mxc_nand_data, nand_flash_partitions,etc...).

Vladan

0 Kudos