* How to build an image for whole flash
@ 2005-08-25 3:21 JohnsonCheng
2005-08-25 7:28 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: JohnsonCheng @ 2005-08-25 3:21 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 415 bytes --]
Dear All,
My flash is 16M that is mapping on 0xFF000000-0xFFFFFFFF.
mtd0: 0xFF000000-0xFF1FFFFF Kernel
mtd1: 0xFF200000-0xFF9FFFFF RootFS
mtd2: 0xFFA00000-0xFFAFFFFF Config
mtd3: 0xFFF00000-0xFFFFFFFF U-Boot
Now I can build an image for mtd device, for example, dd if=/dev/mtd0
of=kernel.img.
But I don't know how to build a image for whole flash ?
Thanks,
Johnson Cheng
[-- Attachment #2: Type: text/html, Size: 4066 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to build an image for whole flash
2005-08-25 3:21 How to build an image for whole flash JohnsonCheng
@ 2005-08-25 7:28 ` Wolfgang Denk
2005-08-25 10:00 ` JohnsonCheng
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2005-08-25 7:28 UTC (permalink / raw)
To: JohnsonCheng; +Cc: linuxppc-embedded
In message <20050825032128.D90A368110@ozlabs.org> you wrote:
>
> My flash is 16M that is mapping on 0xFF000000-0xFFFFFFFF.
> mtd0: 0xFF000000-0xFF1FFFFF Kernel
> mtd1: 0xFF200000-0xFF9FFFFF RootFS
> mtd2: 0xFFA00000-0xFFAFFFFF Config
> mtd3: 0xFFF00000-0xFFFFFFFF U-Boot
>
> Now I can build an image for mtd device, for example, dd if=/dev/mtd0
> of=kernel.img.
If you want to copy the image to flash, you got the parameters wrong,
i. e. you must use
dd if=kernel.img of=/dev/mtd0
(after erasing /dev/mtd0, of course); and using some bs= option may
speed up the prcedure a bit, too.
> But I don't know how to build a image for whole flash ?
What do you mean "for the whole flash"? If you cant to combine the 4
images into one big blob you can do so by (1) padding the images to
the full size of each partition; this can be done using appropriate
"bs=", "count=" and "conv=sync" parameters to dd; and (2)
concatenating the images using "cat".
But this is a prtty inefficient way, and you will also have to change
your MTD partitioning to provide a big partition which covers the
whole flash.
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
Some people march to the beat of a different drummer. And some people
tango!
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: How to build an image for whole flash
2005-08-25 7:28 ` Wolfgang Denk
@ 2005-08-25 10:00 ` JohnsonCheng
0 siblings, 0 replies; 3+ messages in thread
From: JohnsonCheng @ 2005-08-25 10:00 UTC (permalink / raw)
To: wd; +Cc: linuxppc-embedded
Yes. I add a MTD partition which include whole flash as following:
mtd0: 0xFF000000-0xFF1FFFFF Kernel
mtd1: 0xFF200000-0xFF9FFFFF RootFS
mtd2: 0xFFA00000-0xFFAFFFFF Config
mtd3: 0xFFF00000-0xFFFFFFFF U-Boot
mtd4: 0xFF000000-0xFFFFFFFF Flash
then "dd if=/dev/mtd4 of=flash.img".
Bu t I think it's not a good idea.
Thanks,
Johnson Cheng
-----Original Message-----
From: wd@denx.de [mailto:wd@denx.de]
Sent: Thursday, August 25, 2005 3:29 PM
To: JohnsonCheng
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: How to build an image for whole flash
In message <20050825032128.D90A368110@ozlabs.org> you wrote:
>
> My flash is 16M that is mapping on 0xFF000000-0xFFFFFFFF.
> mtd0: 0xFF000000-0xFF1FFFFF Kernel
> mtd1: 0xFF200000-0xFF9FFFFF RootFS
> mtd2: 0xFFA00000-0xFFAFFFFF Config
> mtd3: 0xFFF00000-0xFFFFFFFF U-Boot
>
> Now I can build an image for mtd device, for example, dd if=/dev/mtd0
> of=kernel.img.
If you want to copy the image to flash, you got the parameters wrong,
i. e. you must use
dd if=kernel.img of=/dev/mtd0
(after erasing /dev/mtd0, of course); and using some bs= option may
speed up the prcedure a bit, too.
> But I don't know how to build a image for whole flash ?
What do you mean "for the whole flash"? If you cant to combine the 4
images into one big blob you can do so by (1) padding the images to
the full size of each partition; this can be done using appropriate
"bs=", "count=" and "conv=sync" parameters to dd; and (2)
concatenating the images using "cat".
But this is a prtty inefficient way, and you will also have to change
your MTD partitioning to provide a big partition which covers the
whole flash.
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
Some people march to the beat of a different drummer. And some people
tango!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-08-25 10:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-25 3:21 How to build an image for whole flash JohnsonCheng
2005-08-25 7:28 ` Wolfgang Denk
2005-08-25 10:00 ` JohnsonCheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).