LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-07-2014, 05:54 PM   #1
david_8274
Member
 
Registered: Jun 2013
Location: California
Distribution: Ubuntu, Fedora
Posts: 75

Rep: Reputation: Disabled
How to create partitions in NAND flash


Hi,

When I go into U-boot and execute the mtdparts command on the board I am working on, I got the following partition information:

MaximASP (EEKv3.4.x)> mtdparts
device nand0 <maximasp_nand.0>, # parts = 9
#: name size offset mask_flags
0: u-boot 0x00200000 0x00000000 1
1: env0 0x00080000 0x00200000 1
2: env1 0x00080000 0x00280000 1
3: kernel0 0x00400000 0x00300000 0
4: kernel1 0x00400000 0x00700000 0
5: kernel2 0x00500000 0x00b00000 0
6: root0 0x06400000 0x01000000 0
7: root1 0x06400000 0x07400000 0
8: other 0x12800000 0x0d800000 0


My question is, how were those partition created in the first place? And how do i manipulate them (resize, add/remove a partition. ext.)

Thanks,
Dave Xu
 
Old 01-08-2014, 12:25 PM   #2
prabhuraj
LQ Newbie
 
Registered: Aug 2011
Posts: 26

Rep: Reputation: Disabled
The NAND flash partitions can be created in the board file. For eg arch/arm/mach-omap2/board-omap3beagle.c for beagleboard in the kernel source code. Sometimes, a small code can be executed just after basic initial boot to set up the partitions. Fortunately, you can define your own partitions without having to modify the kernel sources.
As an example, for omap2, you can try this on bootloader shell;
mtdparts=omap2-nand.0:128k(X-Loader)ro,256k(U-Boot)ro,128k(Environment),4m(Kernel)ro,32m(RootFS)ro,-(Data).
Here nand.o is nand driver file.

The above command may vary slightly depending on the target device you are working on. These sizes must be multiple of erase blocks which can be found on /sys/class/mtd/mtdx/erasesize.
You can create a flash file system like jffs2, ubifs etc depending on your requirement and each of the file system has its own commands to read info, erase, write.
Following link provides more insight into this discussion.
http://www.linux-mtd.infradead.org/faq/general.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I setup NAND partitions for a s3c6410 CPU? Aglets Linux - General 0 10-19-2010 01:00 PM
Nand flash boot Roger03 Programming 1 04-03-2010 05:19 AM
R/W from nand flash linux_newbie79 Linux - Newbie 3 08-19-2009 08:35 AM
nand flash: need help jier Programming 0 05-03-2006 11:05 PM
Create software RAID partitions first, then create filesystem partitions on top of th stefanlasiewski Linux - Software 1 04-28-2004 04:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration