* [U-Boot-Users] How to specify the size of bin?
@ 2008-05-16 3:26 甜瓜
2008-05-16 4:43 ` Stefan Roese
0 siblings, 1 reply; 7+ messages in thread
From: 甜瓜 @ 2008-05-16 3:26 UTC (permalink / raw)
To: u-boot
Howdy,
I know it is a newbie question. Any hint from you are welcome.
In default, u-boot 1.1.5, "make walut_config && make all" will
generate a 256KB bin.
The last 4 bytes of the bin is a jump instruction to the entry point
of u-boot.Is that right?
But my ppc405GP walnut board has 512KB flash for holding u-boot. I wonder how to
build a 512KB bin? Is there any OPTION/SETTING targeting this problem?
Anything else
I should take care?
Thank you!
---
ShenLei
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] How to specify the size of bin?
2008-05-16 3:26 [U-Boot-Users] How to specify the size of bin? 甜瓜
@ 2008-05-16 4:43 ` Stefan Roese
2008-05-16 5:31 ` 甜瓜
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Roese @ 2008-05-16 4:43 UTC (permalink / raw)
To: u-boot
On Friday 16 May 2008, ?? wrote:
> I know it is a newbie question. Any hint from you are welcome.
> In default, u-boot 1.1.5, "make walut_config && make all" will
> generate a 256KB bin.
> The last 4 bytes of the bin is a jump instruction to the entry point
> of u-boot.Is that right?
Yes, this is correct.
> But my ppc405GP walnut board has 512KB flash for holding u-boot.
All Walnut boards have 512k of NOR FLASH. Do you really have an original
IBM/AMCC Walnut or a different custom 405GP board?
> I wonder
> how to build a 512KB bin?
Generally this is possible. You need to change CONFIG_MONITOR_LEN &
CFG_MONITOR_BASE in include/configs/walnut.h. And TEXT_BASE in
board/amcc/walnut/config.mk.
> Is there any OPTION/SETTING targeting this
> problem? Anything else
> I should take care?
But please don't forget that the environment is also stored in the NOR FLASH.
And by changing the U-Boot size to 512k you leave no space for the
environment.
So why exactly do you want to change the U-Boot image size?
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] How to specify the size of bin?
2008-05-16 4:43 ` Stefan Roese
@ 2008-05-16 5:31 ` 甜瓜
2008-05-16 5:48 ` Wolfgang Denk
2008-05-16 6:01 ` Stefan Roese
0 siblings, 2 replies; 7+ messages in thread
From: 甜瓜 @ 2008-05-16 5:31 UTC (permalink / raw)
To: u-boot
2008/5/16 Stefan Roese <sr@denx.de>:
> On Friday 16 May 2008, ?? wrote:
>> I know it is a newbie question. Any hint from you are welcome.
>> In default, u-boot 1.1.5, "make walut_config && make all" will
>> generate a 256KB bin.
>> The last 4 bytes of the bin is a jump instruction to the entry point
>> of u-boot.Is that right?
>
> Yes, this is correct.
>
>> But my ppc405GP walnut board has 512KB flash for holding u-boot.
>
> All Walnut boards have 512k of NOR FLASH. Do you really have an original
> IBM/AMCC Walnut or a different custom 405GP board?
Yes, my board is a custom board DHT-Walut with 32MB SDRAM and
512k of boot flash AMD 29LV040B. Details are listed in:
http://elinux.org/DHT-Walnut
>> I wonder
>> how to build a 512KB bin?
>
> Generally this is possible. You need to change CONFIG_MONITOR_LEN &
> CFG_MONITOR_BASE in include/configs/walnut.h. And TEXT_BASE in
> board/amcc/walnut/config.mk.
Thank you very much. That's exact what I need!
>> Is there any OPTION/SETTING targeting this
>> problem? Anything else
>> I should take care?
>
> But please don't forget that the environment is also stored in the NOR FLASH.
> And by changing the U-Boot size to 512k you leave no space for the
> environment.
Do you mean that environment settings (eg: ip_addr, ethaddr...) are
stored sperately
from the bin? In my mind (with guess :p), env should be defined in bin
code or data
section, and it will be compiled together with other codes to form a single bin.
> So why exactly do you want to change the U-Boot image size?
Well. The reason is:
1. Both default config of u-boot and a DHT-Walut-patched config
generate 256KB bin,
but the flash on board is 512KB. So I think I should get a 512KB bin
for flash writing.
2. The contents in the flash on my board is totally corrupted by
accident. It means
the important last-4-bytes should be rewritten to a proper state.
3. Currenly, I have to use special hardware to write bin into flash.
Therefore 256KB bin
will only overwrite the first half. The last-4-bytes in the end of
flash is still the old value.
Booting will definitely fail.
> Best regards,
> Stefan
>
> =====================================================================
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
> =====================================================================
>
Thank you for your reply.
---
ShenLei
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] How to specify the size of bin?
2008-05-16 5:31 ` 甜瓜
@ 2008-05-16 5:48 ` Wolfgang Denk
2008-05-16 6:26 ` 甜瓜
2008-05-16 6:01 ` Stefan Roese
1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2008-05-16 5:48 UTC (permalink / raw)
To: u-boot
In message <cdb837ea0805152231w72340d28r4ee31ee5d4d51654@mail.gmail.com> you wrote:
> 1. Both default config of u-boot and a DHT-Walut-patched config
> generate 256KB bin,
> but the flash on board is 512KB. So I think I should get a 512KB bin
> for flash writing.
Why?
Do you think on devices with 128 MB flash memory we should have a
128MB U-Boot image?
Do you see any problem with having a U-Boot image that is smaller than
your flash device?
> 2. The contents in the flash on my board is totally corrupted by
> accident. It means
> the important last-4-bytes should be rewritten to a proper state.
Agreed.
> 3. Currenly, I have to use special hardware to write bin into flash.
> Therefore 256KB bin
> will only overwrite the first half. The last-4-bytes in the end of
> flash is still the old value.
That's your problem, tehn. Most people use a noremal JTAG debugger
which can prgram the image to any address in the flash.
You got to add 256k of ramdom data in front of the 256 k image, then
[memory filled with 0xFF recommended].
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Any sufficiently advanced technology is indistinguishable from magic.
- Arthur C. Clarke
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] How to specify the size of bin?
2008-05-16 5:31 ` 甜瓜
2008-05-16 5:48 ` Wolfgang Denk
@ 2008-05-16 6:01 ` Stefan Roese
1 sibling, 0 replies; 7+ messages in thread
From: Stefan Roese @ 2008-05-16 6:01 UTC (permalink / raw)
To: u-boot
On Friday 16 May 2008, ?? wrote:
> > All Walnut boards have 512k of NOR FLASH. Do you really have an original
> > IBM/AMCC Walnut or a different custom 405GP board?
>
> Yes, my board is a custom board DHT-Walut with 32MB SDRAM and
> 512k of boot flash AMD 29LV040B. Details are listed in:
> http://elinux.org/DHT-Walnut
OK.
> >> I wonder
> >> how to build a 512KB bin?
> >
> > Generally this is possible. You need to change CONFIG_MONITOR_LEN &
> > CFG_MONITOR_BASE in include/configs/walnut.h. And TEXT_BASE in
> > board/amcc/walnut/config.mk.
>
> Thank you very much. That's exact what I need!
Noooo! Please wait.
> >> Is there any OPTION/SETTING targeting this
> >> problem? Anything else
> >> I should take care?
> >
> > But please don't forget that the environment is also stored in the NOR
> > FLASH. And by changing the U-Boot size to 512k you leave no space for the
> > environment.
>
> Do you mean that environment settings (eg: ip_addr, ethaddr...) are
> stored sperately
> from the bin?
Most of the boards do it this way, yes.
> In my mind (with guess :p), env should be defined in bin
> code or data
> section, and it will be compiled together with other codes to form a single
> bin.
This can be done too. But its not the case on Walnut.
> > So why exactly do you want to change the U-Boot image size?
>
> Well. The reason is:
> 1. Both default config of u-boot and a DHT-Walut-patched config
> generate 256KB bin,
> but the flash on board is 512KB. So I think I should get a 512KB bin
> for flash writing.
No. You definitely don't need a 512k image for this setup. You just need to
flash the image at the "end" of the FLASH chip. So starting at 256k:
0...256k: Free and environment
256k...512k: U-Boot image
> 2. The contents in the flash on my board is totally corrupted by
> accident. It means
> the important last-4-bytes should be rewritten to a proper state.
> 3. Currenly, I have to use special hardware to write bin into flash.
> Therefore 256KB bin
> will only overwrite the first half. The last-4-bytes in the end of
> flash is still the old value.
> Booting will definitely fail.
See above. Don't increase the image size, but flash it with an offset of 256k.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] How to specify the size of bin?
2008-05-16 5:48 ` Wolfgang Denk
@ 2008-05-16 6:26 ` 甜瓜
2008-05-16 8:42 ` Wolfgang Denk
0 siblings, 1 reply; 7+ messages in thread
From: 甜瓜 @ 2008-05-16 6:26 UTC (permalink / raw)
To: u-boot
2008/5/16 Wolfgang Denk <wd@denx.de>:
> In message <cdb837ea0805152231w72340d28r4ee31ee5d4d51654@mail.gmail.com> you wrote:
>> 1. Both default config of u-boot and a DHT-Walut-patched config
>> generate 256KB bin,
>> but the flash on board is 512KB. So I think I should get a 512KB bin
>> for flash writing.
>
> Why?
>
> Do you think on devices with 128 MB flash memory we should have a
> 128MB U-Boot image?
>
> Do you see any problem with having a U-Boot image that is smaller than
> your flash device?
>
>> 2. The contents in the flash on my board is totally corrupted by
>> accident. It means
>> the important last-4-bytes should be rewritten to a proper state.
>
> Agreed.
>
>> 3. Currenly, I have to use special hardware to write bin into flash.
>> Therefore 256KB bin
>> will only overwrite the first half. The last-4-bytes in the end of
>> flash is still the old value.
>
> That's your problem, tehn. Most people use a noremal JTAG debugger
> which can prgram the image to any address in the flash.
>
> You got to add 256k of ramdom data in front of the 256 k image, then
> [memory filled with 0xFF recommended].
haha! Great minds seem alike. Actually, if no solution, I will try this method.
Well. As you mentioned, using JTAG we can put bin in any place of flash.
Does it means we should manually set the last-4-bytes? How to determine
the exact entry point of bin? I can only see the hex value of last-4-bytes, and
it definitely does not simply jump to the beginning of bin. It should jump to
some location like "start:" in, for example, start.asm. Therefore the JTAG
user should translate "jmp start+offset" to machine code by hand. Am I right?
Last, let me tell you why I cannot use JTAG. The recommend method by u-boot
is using BDI2000. But it is really expensive. I don't have enough money. hehe.
I have tried many home-made wiggler JTAG connectors with OCD commander, but
all failed. Finally I give up for finding low-cost PPC JTAG. Currently
I give the
precompiled bin to some one with special flash writer, and let them burn.
Best regards,
--
ShenLei
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] How to specify the size of bin?
2008-05-16 6:26 ` 甜瓜
@ 2008-05-16 8:42 ` Wolfgang Denk
0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2008-05-16 8:42 UTC (permalink / raw)
To: u-boot
In message <cdb837ea0805152326o58185f02g13d68a65f416c800@mail.gmail.com> you wrote:
>
> haha! Great minds seem alike. Actually, if no solution, I will try this method.
> Well. As you mentioned, using JTAG we can put bin in any place of flash.
> Does it means we should manually set the last-4-bytes? How to determine
Urgh. No, of course not. You just program the "u-boot.bin" image to
the last 256 kB of your flash memory, as Stefan already explained.
> Last, let me tell you why I cannot use JTAG. The recommend method by u-boot
> is using BDI2000. But it is really expensive. I don't have enough money. hehe.
> I have tried many home-made wiggler JTAG connectors with OCD commander, but
> all failed. Finally I give up for finding low-cost PPC JTAG. Currently
> I give the
> precompiled bin to some one with special flash writer, and let them burn.
You will reconsider buying a BDI3000 when you need a debugger...
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Wagner's music is better than it sounds." - Mark Twain
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-05-16 8:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-16 3:26 [U-Boot-Users] How to specify the size of bin? 甜瓜
2008-05-16 4:43 ` Stefan Roese
2008-05-16 5:31 ` 甜瓜
2008-05-16 5:48 ` Wolfgang Denk
2008-05-16 6:26 ` 甜瓜
2008-05-16 8:42 ` Wolfgang Denk
2008-05-16 6:01 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox