[U-Boot] Creating partitions on NAND flash

Hi All,
I would like to partition the NAND flash on a canyonlands board. As per my understanding, the partitioning is done using the "add_mtd_partitions" function in the file "drivers/mtd/mtdpart.c".
I also understand that the information about a partition is stored in the structure : "struct mtd_partition" . I could not find out where this structure is getting populated in the u-boot code.
Could somebody point out the file in which these partitions are created? I am also interested in knowing the file in which the different start / end addresses for these partitions are defined.
On DaVinci EVM's I have found something like this when the u-boot comes up :
Creating 5 MTD partitions on "nand_davinci.0": 0x00000000-0x00060000 : "bootloader" 0x00060000-0x00200000 : "params" 0x00200000-0x00400000 : "kernel" 0x00400000-0x01800000 : "filesystem" 0x01800000-0x02000000 : "data"
My aim is to add more such partitions on the NAND flash on my board. Any information regarding partitioning the flash is highly appreciated.
Thanks in advance.
Regards, Afzal Nadirshah

Dear Afzal Nadirshah,
In message 174230991E95D743B0C91DF471EF44E8434F1C5787@MTW02MSG02.mindtree.com you wrote:
I would like to partition the NAND flash on a canyonlands board. As per my understanding, the partitioning is done using the "add_mtd_partitions" function in the file "drivers/mtd/mtdpart.c".
Look at the "mtdparts" command.
I also understand that the information about a partition is stored in the structure : "struct mtd_partition" . I could not find out where this structure is getting populated in the u-boot code.
How about trying something like "grep -lr mtd_partition *" ?
My aim is to add more such partitions on the NAND flash on my board. Any information regarding partitioning the flash is highly appreciated.
Reading the documentation is usually pretty helpful.
I really recommend it.
See for example http://www.denx.de/wiki/DULG/UBootCmdGroupFlash#UBootCmdFlMtdparts and http://www.denx.de/wiki/view/DULG/BootTimeConfigurationOfMTDPartitions
Also, you should definitely look into UBI support if you're using this on NAND flash.
Best regards,
Wolfgang Denk

Hi Wolfgang, Thanks for the suggestions. I went through some of the documents. I found that the partitions and their offsets and partition names are provided in the .dts file. I hope I have understood it right.
Regards, Afzal Nadirshah
-----Original Message----- From: Wolfgang Denk [mailto:wd@denx.de] Sent: Friday, March 06, 2009 5:37 PM To: Afzal Nadirshah Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] Creating partitions on NAND flash
Dear Afzal Nadirshah,
In message 174230991E95D743B0C91DF471EF44E8434F1C5787@MTW02MSG02.mindtree.com you wrote:
I would like to partition the NAND flash on a canyonlands board. As per my understanding, the partitioning is done using the "add_mtd_partitions" function in the file "drivers/mtd/mtdpart.c".
Look at the "mtdparts" command.
I also understand that the information about a partition is stored in the structure : "struct mtd_partition" . I could not find out where this structure is getting populated in the u-boot code.
How about trying something like "grep -lr mtd_partition *" ?
My aim is to add more such partitions on the NAND flash on my board. Any information regarding partitioning the flash is highly appreciated.
Reading the documentation is usually pretty helpful.
I really recommend it.
See for example http://www.denx.de/wiki/DULG/UBootCmdGroupFlash#UBootCmdFlMtdparts and http://www.denx.de/wiki/view/DULG/BootTimeConfigurationOfMTDPartitions
Also, you should definitely look into UBI support if you're using this on NAND flash.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Worlds may change, galaxies disintegrate, but a woman always remains a woman. -- Kirk, "The Conscience of the King", stardate 2818.9
participants (2)
-
Afzal Nadirshah
-
Wolfgang Denk