All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] Re: how can I boot u-boot from 0x40000 in flash instead
@ 2005-07-15 15:09 Ray Zhao
  2005-07-15 16:50 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Ray Zhao @ 2005-07-15 15:09 UTC (permalink / raw)
  To: u-boot

Thanks for the answers. I apologize that I did not make it clear. 
My board is a PXA270, it will, of cause, boot from 0x0000. But our
customer has a tiny tiny boot loader which just generates some special
data and save it in flash. (So they reserved the flash blocks from the
0x0000 to 0x40000.) Then it make PXA270 jump to the 0x40000 and run
the real boot loader from there. We used blob and it works fine with
kernel 2.4. But I am porting the new Linux 2.6 to the board and I
decide to switch to u-boot. My understanding is that after the u-boot
get the control, ie, the CPU jump to the first instruct of the u-boot
code. u-boot will do some initialization on the CPU's cache to build a
simple C environment and then copy part of itself from the flash into
the cache and run from there to initial the memory controller etc. The
code then will copy all (or the rest) the u-boot from the flash to the
memory. My question is, in default, u-boot will copy itself from the
0x0000 (right?). How could I let it know that the u-boot is actually
locates in the 0x40000.
thanks,
Ray
> Ray Zhao wrote:
> My board need keep the first 0x40000 flash for special purpose. Is it
> easy to modify the u-boot to load itself from 0x40000 instead from the
> 0x0000? Any help is appreciated.
>
> Ray

> If your hardware supports it, probably.  Otherwise no.  Perhaps you
> could tell us what your hardware is?

>gvb

>It's not U-Boot code what  determines  the  boot  address,  but  your
>processor.  So  your  real  question  is if you can teach your CPU to
>start from a different reset vector. But sorry, we cannot answer this
>here.

>Best regards,

>Wolfgang Denk
-- 
---------------------------------------------------------------
Everything that has a beginning has an end.

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

* [U-Boot-Users] Re: how can I boot u-boot from 0x40000 in flash instead
  2005-07-15 15:09 [U-Boot-Users] Re: how can I boot u-boot from 0x40000 in flash instead Ray Zhao
@ 2005-07-15 16:50 ` Wolfgang Denk
  2005-07-15 18:29   ` Ray Zhao
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2005-07-15 16:50 UTC (permalink / raw)
  To: u-boot

In message <cd490d13050715080936a17fee@mail.gmail.com> you wrote:
>
> 0x0000 (right?). How could I let it know that the u-boot is actually
> locates in the 0x40000.

Change at least the linker script. Probaly you will need to  tweak  a
few other places as well.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Pull the wool over your own eyes!"                - J.R. "Bob" Dobbs

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

* [U-Boot-Users] Re: how can I boot u-boot from 0x40000 in flash instead
  2005-07-15 16:50 ` Wolfgang Denk
@ 2005-07-15 18:29   ` Ray Zhao
  2005-07-15 20:27     ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Ray Zhao @ 2005-07-15 18:29 UTC (permalink / raw)
  To: u-boot

Thanks. I am a newbie on u-boot. 
1. I changed the u-boot.lds in my board directory. in the line
.=0x00000000 I changed it to .=0x00040000
2. Could you please tell me where are the codes which COPY the code
from flash to the cache and sdram?

best regard

Ray

On 7/15/05, Wolfgang Denk <wd@denx.de> wrote:
> In message <cd490d13050715080936a17fee@mail.gmail.com> you wrote:
> >
> > 0x0000 (right?). How could I let it know that the u-boot is actually
> > locates in the 0x40000.
> 
> Change at least the linker script. Probaly you will need to  tweak  a
> few other places as well.
> 
> Best regards,
> 
> Wolfgang Denk
> 
> --
> Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> "Pull the wool over your own eyes!"                - J.R. "Bob" Dobbs
> 


-- 
---------------------------------------------------------------
Everything that has a beginning has an end.

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

* [U-Boot-Users] Re: how can I boot u-boot from 0x40000 in flash instead
  2005-07-15 18:29   ` Ray Zhao
@ 2005-07-15 20:27     ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2005-07-15 20:27 UTC (permalink / raw)
  To: u-boot

In message <cd490d13050715112919118c13@mail.gmail.com> you wrote:
> Thanks. I am a newbie on u-boot. 
> 1. I changed the u-boot.lds in my board directory. in the line
> .=0x00000000 I changed it to .=0x00040000

This will hardly be sufficient. Remember that U-Boot  expects  to  be
started  from  the  reset  vector,  which  it  will  also assume when
relocating, etc. Just  changing  the  address  is  not  sufficient  -
instead  you  will  have to create a "gap" where you rpoprietary boot
code fits in.

> 2. Could you please tell me where are the codes which COPY the code
> from flash to the cache and sdram?

I hope you will not continue to ask where  to  find  each  and  every
function.  You  are  supposed to have the knowledge and tools to find
your own way through the code. Tools like grep or ctags may help...

See function relocate_code() in cpu/*/start.S

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Where shall I begin, please your Majesty?" he asked. "Begin  at  the
beginning,"  the  King said, gravely, "and go on till you come to the
end: then stop."    - Alice's Adventures in Wonderland, Lewis Carroll

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

end of thread, other threads:[~2005-07-15 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-15 15:09 [U-Boot-Users] Re: how can I boot u-boot from 0x40000 in flash instead Ray Zhao
2005-07-15 16:50 ` Wolfgang Denk
2005-07-15 18:29   ` Ray Zhao
2005-07-15 20:27     ` Wolfgang Denk

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.