* nandwrite problem
@ 2006-07-17 14:59 Davide CASCONE
2006-07-17 15:04 ` Josh Boyer
0 siblings, 1 reply; 8+ messages in thread
From: Davide CASCONE @ 2006-07-17 14:59 UTC (permalink / raw)
To: linux-mtd
I have a NAND device related to MTD block 5. The NAND device is correctly probing during the kernel boot phase.
If I run the following commands
#mkdir /dev/mtdblock/5 b 31 5
#mount -t jffs2 /dev/mtdblock/5 /nand/
the JFFS2 file system is correctly mounting on the /nand/ directory.
But, if I run the following command
#./nandwrite -j /dev/mtdblock/5 filesys.jffs2_nand
in order to copy a file system image on the NAND device, the system returns the following message:
MEMGETINFO: Inappropriate ioctl for device
Any suggestions to solve the problem?
Thanks in advance,
Davide
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: nandwrite problem
2006-07-17 14:59 Davide CASCONE
@ 2006-07-17 15:04 ` Josh Boyer
2006-07-17 17:01 ` Raj Kumar Yadav
0 siblings, 1 reply; 8+ messages in thread
From: Josh Boyer @ 2006-07-17 15:04 UTC (permalink / raw)
To: Davide CASCONE; +Cc: linux-mtd
On 7/17/06, Davide CASCONE <davide.cascone@st.com> wrote:
>
> I have a NAND device related to MTD block 5. The NAND device is correctly probing during the kernel boot phase.
> If I run the following commands
>
> #mkdir /dev/mtdblock/5 b 31 5
> #mount -t jffs2 /dev/mtdblock/5 /nand/
>
> the JFFS2 file system is correctly mounting on the /nand/ directory.
> But, if I run the following command
>
> #./nandwrite -j /dev/mtdblock/5 filesys.jffs2_nand
nandwrite needs a character device, not a block device. Use /dev/mtd5 instead.
josh
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: nandwrite problem
2006-07-17 15:04 ` Josh Boyer
@ 2006-07-17 17:01 ` Raj Kumar Yadav
2006-07-17 17:43 ` Josh Boyer
2006-07-17 18:10 ` David Woodhouse
0 siblings, 2 replies; 8+ messages in thread
From: Raj Kumar Yadav @ 2006-07-17 17:01 UTC (permalink / raw)
To: linux-mtd
Also for mtdblock/5 the character node will be mtd10 "mknod /dev/mtd10 c 90
10".
With mtd character interface every partition is accessed through pair of two
char device node.
First with read-write permission. Second with read-only permission.
It is like
/dev/mtdblock/0 b 31 0
/dev/mtd0 c 90 0 (Read-write)
/dev/mtd1 c 90 1 (read only)
/dev/mtdblock/1 b 31 1
/dev/mtd2 c 90 2 (Read-write)
/dev/mtd3 c 90 3 (read only)
...
/dev/mtdblock/5 b 31 5
/dev/mtd10 c 90 10 (Read-write)
/dev/mtd11 c 90 11 (read only)
Raj Kumar Yadav
-----Original Message-----
From: linux-mtd-bounces@lists.infradead.org
[mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Josh Boyer
Sent: Monday, July 17, 2006 8:35 PM
To: Davide CASCONE
Cc: linux-mtd@lists.infradead.org
Subject: Re: nandwrite problem
On 7/17/06, Davide CASCONE <davide.cascone@st.com> wrote:
>
> I have a NAND device related to MTD block 5. The NAND device is correctly
probing during the kernel boot phase.
> If I run the following commands
>
> #mkdir /dev/mtdblock/5 b 31 5
> #mount -t jffs2 /dev/mtdblock/5 /nand/
>
> the JFFS2 file system is correctly mounting on the /nand/ directory.
> But, if I run the following command
>
> #./nandwrite -j /dev/mtdblock/5 filesys.jffs2_nand
nandwrite needs a character device, not a block device. Use /dev/mtd5
instead.
josh
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: nandwrite problem
2006-07-17 17:01 ` Raj Kumar Yadav
@ 2006-07-17 17:43 ` Josh Boyer
2006-07-17 18:10 ` David Woodhouse
1 sibling, 0 replies; 8+ messages in thread
From: Josh Boyer @ 2006-07-17 17:43 UTC (permalink / raw)
To: Raj Kumar Yadav; +Cc: linux-mtd
On 7/17/06, Raj Kumar Yadav <ryadav@neomagic.com> wrote:
> Also for mtdblock/5 the character node will be mtd10 "mknod /dev/mtd10 c 90
> 10".
>
> With mtd character interface every partition is accessed through pair of two
> char device node.
> First with read-write permission. Second with read-only permission.
Quite right. I had forgotten that particular horrible detail. Thanks
for correcting me.
josh
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: nandwrite problem
2006-07-17 17:01 ` Raj Kumar Yadav
2006-07-17 17:43 ` Josh Boyer
@ 2006-07-17 18:10 ` David Woodhouse
1 sibling, 0 replies; 8+ messages in thread
From: David Woodhouse @ 2006-07-17 18:10 UTC (permalink / raw)
To: Raj Kumar Yadav; +Cc: linux-mtd
On Mon, 2006-07-17 at 22:31 +0530, Raj Kumar Yadav wrote:
> Also for mtdblock/5 the character node will be mtd10 "mknod /dev/mtd10 c 90
> 10".
>
> With mtd character interface every partition is accessed through pair of two
> char device node.
> First with read-write permission. Second with read-only permission.
>
> It is like
> /dev/mtdblock/0 b 31 0
> /dev/mtd0 c 90 0 (Read-write)
> /dev/mtd1 c 90 1 (read only)
>
> /dev/mtdblock/1 b 31 1
> /dev/mtd2 c 90 2 (Read-write)
> /dev/mtd3 c 90 3 (read only)
>
> ...
>
> /dev/mtdblock/5 b 31 5
> /dev/mtd10 c 90 10 (Read-write)
> /dev/mtd11 c 90 11 (read only)
This is incorrect. Your description of the minor numbers and the meaning
of the device is right, but you're using entirely bogus names. They
should be mtd0, mtd0ro, mtd1, mtd1r0, etc. The device node with major
90, minor 10 is supposed to be called '/dev/mtd5'. If you use MAKEDEV or
udev, or if you just bother to follow the documentation, this should be
correct.
Do not top-post.
--
dwmw2
^ permalink raw reply [flat|nested] 8+ messages in thread
* nandwrite problem
@ 2009-02-25 5:24 Sridhar C.R
0 siblings, 0 replies; 8+ messages in thread
From: Sridhar C.R @ 2009-02-25 5:24 UTC (permalink / raw)
To: linux-mtd
Hi,
I am using an 8Gbit ST Micro NAND flash. I am using the cross compiled mtd
utils (mtd-utils-05.07.23) for mips 64.
The flash eraseall is working. But when I try to write an image (jffs2 / any
other), I am getting the following error
# ./nandwrite -p /dev/mtd0 rootfs.jffs2
Writing data to block 0
pwrite: Input/output error
Data did not fit into device, due to bad blocks
: Illegal seek
The block 0 of this partition is a good block. This is verified by the boot
up info as well as the flash_eraseall utility.
Also the partition is large enough to hold the image in spite of few bad
blocks in the partition.
Can anybody have any ideas?
Thanks,
Sridhar
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments contained in it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* nandwrite problem
@ 2009-04-09 7:29 Donal Morrissey
[not found] ` <BAY131-W55A4C892E0412CE9650E0EE2830@phx.gbl>
0 siblings, 1 reply; 8+ messages in thread
From: Donal Morrissey @ 2009-04-09 7:29 UTC (permalink / raw)
To: linux-mtd
Hello All,
I'm having problems in using the nandwrite command for my cirius logic
EP9302 arm based processor card. I am able to load the images
correctly via redboot, but not via the nandwrite shell command.
I'm using redboot, kernel 2.6.8.1-crus2.0.8 and nandwrite v1.32.
Here is the redboot output:
---------------------------
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0x60000000 0x60000000 0x00040000 0x00000000
RedBoot config 0x60FC0000 0x60FC0000 0x00001000 0x00000000
FIS directory 0x60FE0000 0x60FE0000 0x00020000 0x00000000
config1 0x60040000 0x00800000 0x00020000 0x00000000
config2 0x60060000 0x00800000 0x00020000 0x00000000
ramdisk.gz 0x60080000 0x00800000 0x00400000 0x00800000
zImage 0x60480000 0x00080000 0x00140000 0x00080000
Here are the MTD Devices
------------------------
~ # cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "RedBoot"
mtd1: 00020000 00020000 "config1"
mtd2: 00020000 00020000 "config2"
mtd3: 00400000 00020000 "ramdisk.gz"
mtd4: 00140000 00020000 "zImage"
mtd5: 00a00000 00020000 "unallocated"
mtd6: 00001000 00020000 "RedBoot config"
mtd7: 00020000 00020000 "FIS directory"
I'm trying to update the ramdisk.gz which is located in /dev/mtd3:
~ # mtd_debug info /dev/mtd3
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CLEAR_BITS
mtd.size = 4194304 (4M)
mtd.erasesize = 131072 (128K)
mtd.oobblock = 0
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0
You can see that the oobblock and oobsize are 0! When I try to run the
nandwrite command I get the following:
~ # nandwrite /dev/mtd3 ramRamdisk.gz
Unknown flash (not normal NAND)
Having looked at the nandwrite command source code, this problem is
caused by the oobblock and oobsize members of the mtf info being 0!
Does anyone know why the values are incorrect or how to get around this issue?
Best Regards,
Donal
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: nandwrite problem
[not found] ` <BAY131-W55A4C892E0412CE9650E0EE2830@phx.gbl>
@ 2009-04-09 20:27 ` Donal Morrissey
0 siblings, 0 replies; 8+ messages in thread
From: Donal Morrissey @ 2009-04-09 20:27 UTC (permalink / raw)
To: saravanan chanemouganandam; +Cc: linux-mtd
Hi Saravanan,
Looks like that was my problem.
Thank you for your help!
Donal
2009/4/9 saravanan chanemouganandam <saravanan_sprt@hotmail.com>:
> Hello,
>
> It seems you are using NOR type flash from mtd.type = MTD_NORFLASH and you
> are trying to use
> nandwrite to flash your image.
>
> Try using mtd-utils to flash ramdisk.gz try something like
>
> mtd -e ramdisk.gz write ramRamdisk.gz ramdisk.gz
> or
> mtd erase /dev/mtd3
> cat ramRamdisk.gz > /dev/mtd3
>
> hope this helps
>
>
>
>
>
>> Date: Thu, 9 Apr 2009 08:29:37 +0100
>> Subject: nandwrite problem
>> From: donal.morrissey@gmail.com
>> To: linux-mtd@lists.infradead.org
>>
>> Hello All,
>> I'm having problems in using the nandwrite command for my cirius logic
>> EP9302 arm based processor card. I am able to load the images
>> correctly via redboot, but not via the nandwrite shell command.
>>
>> I'm using redboot, kernel 2.6.8.1-crus2.0.8 and nandwrite v1.32.
>>
>> Here is the redboot output:
>> ---------------------------
>> RedBoot> fis list
>> Name FLASH addr Mem addr Length Entry point
>> RedBoot 0x60000000 0x60000000 0x00040000 0x00000000
>> RedBoot config 0x60FC0000 0x60FC0000 0x00001000 0x00000000
>> FIS directory 0x60FE0000 0x60FE0000 0x00020000 0x00000000
>> config1 0x60040000 0x00800000 0x00020000 0x00000000
>> config2 0x60060000 0x00800000 0x00020000 0x00000000
>> ramdisk.gz 0x60080000 0x00800000 0x00400000 0x00800000
>> zImage 0x60480000 0x00080000 0x00140000 0x00080000
>>
>> Here are the MTD Devices
>> ------------------------
>> ~ # cat /proc/mtd
>> dev: size erasesize name
>> mtd0: 00040000 00020000 "RedBoot"
>> mtd1: 00020000 00020000 "config1"
>> mtd2: 00020000 00020000 "config2"
>> mtd3: 00400000 00020000 "ramdisk.gz"
>> mtd4: 00140000 00020000 "zImage"
>> mtd5: 00a00000 00020000 "unallocated"
>> mtd6: 00001000 00020000 "RedBoot config"
>> mtd7: 00020000 00020000 "FIS directory"
>>
>> I'm trying to update the ramdisk.gz which is located in /dev/mtd3:
>>
>> ~ # mtd_debug info /dev/mtd3
>> mtd.type = MTD_NORFLASH
>> mtd.flags = MTD_CLEAR_BITS
>> mtd.size = 4194304 (4M)
>> mtd.erasesize = 131072 (128K)
>> mtd.oobblock = 0
>> mtd.oobsize = 0
>> mtd.ecctype = MTD_ECC_NONE
>> regions = 0
>>
>> You can see that the oobblock and oobsize are 0! When I try to run the
>> nandwrite command I get the following:
>>
>> ~ # nandwrite /dev/mtd3 ramRamdisk.gz
>> Unknown flash (not normal NAND)
>>
>> Having looked at the nandwrite command source code, this problem is
>> caused by the oobblock and oobsize members of the mtf info being 0!
>>
>> Does anyone know why the values are incorrect or how to get around this
>> issue?
>>
>> Best Regards,
>> Donal
>>
>> ______________________________________________________
>> Linux MTD discussion mailing list
>> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
> ________________________________
> Twice the fun— Share photos while you chat with Windows Live Messenger.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-04-09 20:27 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-25 5:24 nandwrite problem Sridhar C.R
-- strict thread matches above, loose matches on Subject: below --
2009-04-09 7:29 Donal Morrissey
[not found] ` <BAY131-W55A4C892E0412CE9650E0EE2830@phx.gbl>
2009-04-09 20:27 ` Donal Morrissey
2006-07-17 14:59 Davide CASCONE
2006-07-17 15:04 ` Josh Boyer
2006-07-17 17:01 ` Raj Kumar Yadav
2006-07-17 17:43 ` Josh Boyer
2006-07-17 18:10 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox