On 3/26/07, Erwin Authried <[EMAIL PROTECTED]> wrote:
Am Montag, den 26.03.2007, 10:54 +0800 schrieb Yue Han:
> Hi Mr. Li,
> I'm using uclinxu-2.4.19 which doesn't has the flash_tools cmd(include
> flash_eraseall mkfs.jffs2 .etc). So I made them out of
> mtd-snapshot-20040730.tar.bz2.
>
> Unfortunately, I got the error what I mentioned before.
>
> In the light of your prompt, I dig into mtdchar.c and
> flash_eraseall.c,
> I used printk to trace the bug and found it DO jump from mtd_ioctl().
>
> I find the function mtd_open() and mtd_ioctl() implemented like this:
...
>
> So, I pin the problem on the function mtd_ioctl() 's parameter
> doesn't match.
> But when I check other uclinux-dist who has flash_tools, I saw the
> same implement and call method.
>
> Ohh..I have no clue to fix it again, please give me some hint.
> Thank you!
>
The ioctcl calls are correct. I think that the problem comes from using
different mtd kernel header files when you build flash_eraseall. Using
an old kernel like 2.4.19 is rather bad, I think there were a lot of
bugs fixed in MTD since.
Erwin is right. Look at the running result,
=========
# ./flash_eraseall /dev/mtd2
MTD_open
MTD_ioctl
MTD_ioctl
Invalid ioctl 80084d0b (MEMGETINFO = 40204d01)
./flash_eraseall /dev/mtd2: MTD get bad block failed: Inappropriate
ioctl for device
=========
That means the parameter passed into mtd_ioctl is 80084d0b,
but MEMGETINFO = 40204d01, the two value doesn't match.
I think it's caused by the different header files.
ELDK from www.denx.de seems to support mips. Go to see if something is
useful for you.
And another choice is try to erase your flash by bootloader. If you
are using u-boot, you just have to erase the partition by a single
"erase" command.
-Aubrey
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev