• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: mtdparts to reference "entire" NAND read-only  (Read 2027 times)
kveroneau
Newbie
*

Karma: 1
Posts: 12


View Profile
« on: September 26, 2010, 01:03:42 AM »

I am wanting to test something out, but I need to be-able to reference the entire NAND in the plug as a whole in Linux.

eg.  mtd0 = uboot+uImage+rootfs

But, I also want it to be available as read-only, just so I don't break anything.

What would I use as a mtdparts parameter for this?  Oh, and I won't be booting from NAND obviously while doing this.

Thanks!
Logged

marcus
Jr. Member
**

Karma: 5
Posts: 83


View Profile
« Reply #1 on: September 26, 2010, 09:53:52 AM »

I don't know about referencing the NAND as one device, but these are the notes I have made (copied from an earlier thread here, most likely)

JFFS2:
Code:
mkdir/mnt/block2
mount -t jffs2 /dev/mtdblock2 /mnt/block2 -o ro

UBIFS:

cat /proc/mtd

dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 1fb00000 00020000 "root"

ubiattach /dev/ubi_ctrl -m 2 -d 0
mount -t ubifs ubi0_0 /mnt/nand

OR
mount -t ubifs ubi0:rootfs /mnt/nand

umount ubi0_0
OR
umount ubi0:rootfs

(I'm not quite sure why I have the umount options listed, like I say, it was probably copied from somewhere else).
Logged

kveroneau
Newbie
*

Karma: 1
Posts: 12


View Profile
« Reply #2 on: September 26, 2010, 10:23:53 AM »

Thanks for your reply, but I was thinking more along the lines of:

setenv mtdpartitions 'mtdparts=nand_mtd:0x1fb00000@0x000000(fullnand)'

I need help with the offset: 0x000000 and help with the size: 0x1fb00000

I am not sure of the Sheeva Plug's internal NAND layout, I could only imagine that 0x000000 is the beginning of NAND.  However, I am not sure what to set the size to.

This would make an mtd0 device in Linux referenced as "fullnand" which contains the entire NAND.  A device a plan to dd to an external drive.

Hope this explains my question more.  Thanks.
Logged

kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« Reply #3 on: September 26, 2010, 05:30:52 PM »

The size would be 0x20000000 for the entire device.  0x20000000 = 512MB
« Last Edit: September 26, 2010, 05:33:48 PM by kilowatt » Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #4 on: September 27, 2010, 06:37:14 PM »

But, I also want it to be available as read-only, just so I don't break anything.

What would I use as a mtdparts parameter for this?
Based on other things here and the fact that I have:
Quote
mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)
in my uboot environment I'd suspect that:
Quote
mtdparts=nand_mtd:0x20000000@0(ro_nand)ro
would do it.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #5 on: September 27, 2010, 06:46:56 PM »

Although, having said what I did, I now see that what actually gets used is this setting:
Quote
mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)
to produce these mtd devices:
Quote
[plug]: cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00020000 "uImage"
mtd1: 1fb00000 00020000 "rootfs"
So perhaps you need orion_nand?  I presume the "ro" still works...
Logged

Pages: [1]
Print
Jump to: