Re: Linux Kernel MTD question

9 messages, 5 authors, 2005-08-25 · open the first message on its own page

Re: Linux Kernel MTD question

From: Wolfgang Denk <hidden>
Date: 2005-08-22 13:07:19

In message [off-list ref] you wrote:
How can I put the Environment variables or configurations in
0x00060000-0x00080000, or put User Data in 0x005C0000-0x1000000?
Use U-boot command? Or....
It is up to you to define a memory map for your flash  device(s)  and
create  appropriate partitions for this map in Linux (and probably in
U-Boot, too, using the new "mtdparts" command).

Then you can use standard commands in U-Boot (erase, cp) and in Linux
(erase_all, cp) to store any data you likein your flash.

It is *your* design. *You* must create it.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.

RE: Linux Kernel MTD question

From: JohnsonCheng <hidden>
Date: 2005-08-23 03:11:36

Yes. You are right. It's design by myself.
But I meet a problem. If I have three configuration files, A.conf, B.conf
and C.conf, then I hope save them in one of partitions of MTD,
0x005C0000-0x10000000.
Two questions:
1. How to build these configuration files into an image for U-boot with
mkimage?
2. In kernel, how to get these data? I use "mount /dev/mtd4 /mnt", but it
failed by block device required.

Thanks,
Johnson Cheng

-----Original Message-----
From: wd@denx.de [mailto:wd@denx.de] 
Sent: Monday, August 22, 2005 9:07 PM
To: JohnsonCheng
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Linux Kernel MTD question 

In message [off-list ref] you wrote:
How can I put the Environment variables or configurations in
0x00060000-0x00080000, or put User Data in 0x005C0000-0x1000000?
Use U-boot command? Or....
It is up to you to define a memory map for your flash  device(s)  and
create  appropriate partitions for this map in Linux (and probably in
U-Boot, too, using the new "mtdparts" command).

Then you can use standard commands in U-Boot (erase, cp) and in Linux
(erase_all, cp) to store any data you likein your flash.

It is *your* design. *You* must create it.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.

RE: Linux Kernel MTD question

From: Robert P. J. Day <hidden>
Date: 2005-08-23 05:13:27

On Sat, 23 Jul 2005, JohnsonCheng wrote:
Yes. You are right. It's design by myself.
But I meet a problem. If I have three configuration files, A.conf, B.conf
and C.conf, then I hope save them in one of partitions of MTD,
0x005C0000-0x10000000.
Two questions:
1. How to build these configuration files into an image for U-boot with
mkimage?
2. In kernel, how to get these data? I use "mount /dev/mtd4 /mnt", but it
failed by block device required.
for this second issue, you might try mounting the block device, which
is probably called /dev/mtdblock4 or something similar.

rday

RE: Linux Kernel MTD question

From: JohnsonCheng <hidden>
Date: 2005-08-23 05:27:36

When I want to turn on MTD with TQM8XXL, I can't find it in kernel 2.6.12.3.
I use "MTD\Mapping drivers for chip access\CFI Flash device in physical
memory map", it seems only one partition can be used.


Thanks,
Johnson Cheng


-----Original Message-----
From: linuxppc-embedded-bounces@ozlabs.org
[mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Wolfgang Denk
Sent: Monday, August 22, 2005 9:07 PM
To: JohnsonCheng
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Linux Kernel MTD question 

In message [off-list ref] you wrote:
How can I put the Environment variables or configurations in
0x00060000-0x00080000, or put User Data in 0x005C0000-0x1000000?
Use U-boot command? Or....
It is up to you to define a memory map for your flash  device(s)  and
create  appropriate partitions for this map in Linux (and probably in
U-Boot, too, using the new "mtdparts" command).

Then you can use standard commands in U-Boot (erase, cp) and in Linux
(erase_all, cp) to store any data you likein your flash.

It is *your* design. *You* must create it.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

RE: Linux Kernel MTD question

From: JohnsonCheng <hidden>
Date: 2005-08-23 05:32:09

It doesn't work, too. 
Error message: Invalid argument.

Thanks,
Johnson Cheng

-----Original Message-----
From: linuxppc-embedded-bounces@ozlabs.org
[mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Robert P. J. Day
Sent: Tuesday, August 23, 2005 11:24 AM
To: JohnsonCheng
Cc: linuxppc-embedded@ozlabs.org
Subject: RE: Linux Kernel MTD question 

On Sat, 23 Jul 2005, JohnsonCheng wrote:
Yes. You are right. It's design by myself.
But I meet a problem. If I have three configuration files, A.conf, B.conf
and C.conf, then I hope save them in one of partitions of MTD,
0x005C0000-0x10000000.
Two questions:
1. How to build these configuration files into an image for U-boot with
mkimage?
2. In kernel, how to get these data? I use "mount /dev/mtd4 /mnt", but it
failed by block device required.
for this second issue, you might try mounting the block device, which
is probably called /dev/mtdblock4 or something similar.

rday
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Re: Linux Kernel MTD question

From: Ricardo Scop <hidden>
Date: 2005-08-23 19:10:31

Hi Johnson,

On Tuesday 23 August 2005 02:31, JohnsonCheng wrote:
It doesn't work, too.
Error message: Invalid argument.
Well, do you have an mtdblock4 entry in /dev?

Also, you should specify your filesystem type to mount, like in:

mount -t jffs2 /dev/mtdblock4 /mnt

BTW, -t jffs2 is just an example.

HTH,

-Scop.

RE: Linux Kernel MTD question

From: JohnsonCheng <hidden>
Date: 2005-08-24 05:03:04

Dear Ricardo and Wolfgang,

Very thanks for your kindly support.
I am sorry I made a mistake.
Before you mount /dev/mtdblock4, you have to use mke2fs to format it.
Now I think my MTD function is almost ready, except write.
When I run "dd if=/dev/mtd1 of=kernel.img", it's OK.
But when I run "dd if=kernel.img of=/dev/mtd1", it's failed. No error
message printed, and the process time is shortly, cause Bad CRC.

Thanks,
Johnson Cheng

-----Original Message-----
From: linuxppc-embedded-bounces@ozlabs.org
[mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Ricardo Scop
Sent: Wednesday, August 24, 2005 3:17 AM
To: JohnsonCheng; 'Robert P. J. Day'
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Linux Kernel MTD question

Hi Johnson,

On Tuesday 23 August 2005 02:31, JohnsonCheng wrote:
It doesn't work, too.
Error message: Invalid argument.
Well, do you have an mtdblock4 entry in /dev?

Also, you should specify your filesystem type to mount, like in:

mount -t jffs2 /dev/mtdblock4 /mnt

BTW, -t jffs2 is just an example.

HTH,

-Scop.

_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Re: Linux Kernel MTD question

From: Alex Zeffertt <hidden>
Date: 2005-08-24 08:50:11

Before doing a write to /dev/mtd1 try running 
~# eraseall /dev/mtd1

(eraseall is from the mtd-utils package.)

Alex


On Wed, 24 Aug 2005 13:02:31 +0800
"JohnsonCheng" [off-list ref] wrote:
Dear Ricardo and Wolfgang,

Very thanks for your kindly support.
I am sorry I made a mistake.
Before you mount /dev/mtdblock4, you have to use mke2fs to format it.
Now I think my MTD function is almost ready, except write.
When I run "dd if=/dev/mtd1 of=kernel.img", it's OK.
But when I run "dd if=kernel.img of=/dev/mtd1", it's failed. No error
message printed, and the process time is shortly, cause Bad CRC.

Thanks,
Johnson Cheng

-----Original Message-----
From: linuxppc-embedded-bounces@ozlabs.org
[mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Ricardo Scop
Sent: Wednesday, August 24, 2005 3:17 AM
To: JohnsonCheng; 'Robert P. J. Day'
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Linux Kernel MTD question

Hi Johnson,

On Tuesday 23 August 2005 02:31, JohnsonCheng wrote:
quoted
It doesn't work, too.
Error message: Invalid argument.
Well, do you have an mtdblock4 entry in /dev?

Also, you should specify your filesystem type to mount, like in:

mount -t jffs2 /dev/mtdblock4 /mnt

BTW, -t jffs2 is just an example.

HTH,

-Scop.

_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

RE: Linux Kernel MTD question

From: JohnsonCheng <hidden>
Date: 2005-08-25 02:59:56

Good idea. It works well.
The latest version of mtd utility for erase flash is flash_eraseall.

Thank you very much,
Johnson Cheng

-----Original Message-----
From: Alex Zeffertt [mailto:ajz@cambridgebroadband.com] 
Sent: Wednesday, August 24, 2005 4:50 PM
To: JohnsonCheng
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Linux Kernel MTD question

Before doing a write to /dev/mtd1 try running 
~# eraseall /dev/mtd1

(eraseall is from the mtd-utils package.)

Alex


On Wed, 24 Aug 2005 13:02:31 +0800
"JohnsonCheng" [off-list ref] wrote:
Dear Ricardo and Wolfgang,

Very thanks for your kindly support.
I am sorry I made a mistake.
Before you mount /dev/mtdblock4, you have to use mke2fs to format it.
Now I think my MTD function is almost ready, except write.
When I run "dd if=/dev/mtd1 of=kernel.img", it's OK.
But when I run "dd if=kernel.img of=/dev/mtd1", it's failed. No error
message printed, and the process time is shortly, cause Bad CRC.

Thanks,
Johnson Cheng

-----Original Message-----
From: linuxppc-embedded-bounces@ozlabs.org
[mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Ricardo Scop
Sent: Wednesday, August 24, 2005 3:17 AM
To: JohnsonCheng; 'Robert P. J. Day'
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Linux Kernel MTD question

Hi Johnson,

On Tuesday 23 August 2005 02:31, JohnsonCheng wrote:
quoted
It doesn't work, too.
Error message: Invalid argument.
Well, do you have an mtdblock4 entry in /dev?

Also, you should specify your filesystem type to mount, like in:

mount -t jffs2 /dev/mtdblock4 /mnt

BTW, -t jffs2 is just an example.

HTH,

-Scop.

_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help