| Welcome to AT91SAM Community Forum http://www.at91.com/samphpbb/ |
|
| how to add a partition in nandflash? http://www.at91.com/samphpbb/viewtopic.php?f=12&t=20299 |
Page 1 of 1 |
| Author: | bluetooth [ Tue Jul 26, 2011 12:02 pm ] |
| Post subject: | how to add a partition in nandflash? |
hi all: i'm using atmel 9g20 ,nandflash,uboot and linux 2.6.x kernel. now,there are 3 partitions in nandflash,i want to add a partition, but i don't know if need to modify the uboot source code? if need, which c file need be changed? I think the kernel code must be changed,but i also don't know which c file need be re-design? Please give me a hint! Thanks for your help! |
|
| Author: | Andrej [ Wed Jul 27, 2011 7:39 am ] |
| Post subject: | Re: how to add a partition in nandflash? |
Add new NAND flash partition to struct mtd_partition __initdata ek_nand_partition[] in kernel file: arch/arm/mach-at91/board-sam9g20ek.c and change size for partitions. Example: /* * NAND flash */ static struct mtd_partition __initdata ek_nand_partition[] = { { .name = "Bootstrap", .offset = 0, .size = 4 * SZ_1M, }, { .name = "Partition 1", .offset = MTDPART_OFS_NXTBLK, .size = 60 * SZ_1M, }, { .name = "Partition 2", .offset = MTDPART_OFS_NXTBLK, .size = 30 * SZ_1M, // change partition size }, // add new partition: { .name = "Partition 3", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, }, }; A. |
|
| Author: | bluetooth [ Wed Jul 27, 2011 9:32 am ] |
| Post subject: | Re: how to add a partition in nandflash? |
I got it. Thanks,Andrej. I have 2 questions: (1) how to set the nand partition type? for examples, I want to config the "Partition 1" as yaffs type and "Partition 2" as jffs2 type, I'm able to use the mount command for loading them.But the static struct mtd_partition __initdata ek_nand_partition[] array hasn't partition type column, how to do this? (2)How to format the nandflash partition? for example,"partition 2" is a jffs2 filesystem,before using it ,need i format it(/dev/mtdblock2)? As if format NTFS partiton of harddisk. Thanks, |
|
| Author: | Andrej [ Wed Jul 27, 2011 10:31 am ] |
| Post subject: | Re: how to add a partition in nandflash? |
For jffs2 file system try to use flash_erase command with -j option. link: http://processors.wiki.ti.com/index.php ... e_to_Flash A. |
|
| Author: | bluetooth [ Thu Jul 28, 2011 5:38 am ] |
| Post subject: | Re: how to add a partition in nandflash? |
Thanks,Andrej. |
|
| Page 1 of 1 | All times are UTC + 1 hour [ DST ] |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|



Forum