All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] u-boot as second stage boot loader
  2004-09-21 10:42 [U-Boot-Users] u-boot as second stage boot loader Z.N.
@ 2004-09-21  9:59 ` Wolfgang Denk
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2004-09-21  9:59 UTC (permalink / raw)
  To: u-boot

In message <1095763351.12961.9.camel@dual> you wrote:
> 
> I've got an at 91 rm 9200 based board with a 2MB _SERIAL_ flash
> connected to it. Since the flash is serial, it is not mapped to memory,
> and the board cannot boot from it. However, the first 16kbyte of this
> serial flash gets copied into the 16kbyte SRAM of the processor. Now I
> have a small boot loader loaded into the SRAM which initializes the
> SDRAM, can load pages from the serial flash, talk on the serial
> line,etc.
> 
> The next step would be to load u-boot as a second stage boot loader,
> however how can someone do this?

Just use the pre-loader as supplied  by  Atmel  with  the  at91rm9200
development kit.

Don't reinvent the wheel. Use the existing code.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
I've got a bad feeling about this.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] u-boot as second stage boot loader
@ 2004-09-21 10:42 Z.N.
  2004-09-21  9:59 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Z.N. @ 2004-09-21 10:42 UTC (permalink / raw)
  To: u-boot

Hi!

I've got an at 91 rm 9200 based board with a 2MB _SERIAL_ flash
connected to it. Since the flash is serial, it is not mapped to memory,
and the board cannot boot from it. However, the first 16kbyte of this
serial flash gets copied into the 16kbyte SRAM of the processor. Now I
have a small boot loader loaded into the SRAM which initializes the
SDRAM, can load pages from the serial flash, talk on the serial
line,etc.

The next step would be to load u-boot as a second stage boot loader,
however how can someone do this?

The memory configuration is like this:
0x0-0x4000 processor SRAM
0x4000-0x8000 processor ROM
0x20000000-0x21000000 SDRAM

As it can be seen, the SRAM is too small for the 80-90kbyte u-boot
image... What is the solution? Maybe i could take the u-boot image
apart, and copy the code before relocation into the sram and the code
after relocation into SDRAM and then make a "mov r5,#0;mov pc,r5"?

Any help is appreciated!
Regards,
Zo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] u-boot as second stage boot loader
@ 2004-09-21  9:16 Friedrich, Lars
  0 siblings, 0 replies; 3+ messages in thread
From: Friedrich, Lars @ 2004-09-21  9:16 UTC (permalink / raw)
  To: u-boot

> The next step would be to load u-boot as a second stage boot loader,
> however how can someone do this?
[...]
> As it can be seen, the SRAM is too small for the 80-90kbyte u-boot
> image... What is the solution? Maybe i could take the u-boot image
> apart, and copy the code before relocation into the sram and the code
> after relocation into SDRAM and then make a "mov r5,#0;mov pc,r5"?

In the 16kbyte flash area you put an universal first stage bootloader.
This bootloader should not have any knowledge about _what_ it will start.
It should only:
- prepare the hardware to retrieve data from the flash device
- copy contents from the flash device to ram
- jump to a defined address in ram
(- maybe init the serial and do some output for debugging purposes)

So the first stage bootloader will need four things:
1) the start of data to copy
2) the destination in ram to copy it to
3) the amount of data to copy
4) the address to set the pc after copy, maybe the same as 2)

As a start, these values can be hardcoded into the first stage bootloader. Later
you might consider putting these values into the u-boot image (in other words:
in a defined area on the flash), so you will never have to touch the first stage
bootloader again if the second stage bootloader changes.

The first stage bootloader copies U-Boot completely into the ram and U-Boot should
be able to recognize that it is executed from ram already and not do any relocation
itself.

Regards,
Lars Friedrich

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-21 10:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-21 10:42 [U-Boot-Users] u-boot as second stage boot loader Z.N.
2004-09-21  9:59 ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2004-09-21  9:16 Friedrich, Lars

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.