Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: how to add a partition in nandflash?
PostPosted: Tue Jul 26, 2011 12:02 pm 
Offline

Joined: Tue Jul 26, 2011 11:32 am
Posts: 8
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!


Top
 Profile  
 
 Post subject: Re: how to add a partition in nandflash?
PostPosted: Wed Jul 27, 2011 7:39 am 
Offline

Joined: Thu Jun 09, 2005 10:08 am
Posts: 2
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.


Top
 Profile  
 
 Post subject: Re: how to add a partition in nandflash?
PostPosted: Wed Jul 27, 2011 9:32 am 
Offline

Joined: Tue Jul 26, 2011 11:32 am
Posts: 8
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,


Top
 Profile  
 
 Post subject: Re: how to add a partition in nandflash?
PostPosted: Wed Jul 27, 2011 10:31 am 
Offline

Joined: Thu Jun 09, 2005 10:08 am
Posts: 2
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.


Top
 Profile  
 
 Post subject: Re: how to add a partition in nandflash?
PostPosted: Thu Jul 28, 2011 5:38 am 
Offline

Joined: Tue Jul 26, 2011 11:32 am
Posts: 8
Thanks,Andrej.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron