* [U-Boot] Relocation
@ 2014-03-14 13:38 mahsmak
2014-03-14 14:47 ` Albert ARIBAUD
0 siblings, 1 reply; 6+ messages in thread
From: mahsmak @ 2014-03-14 13:38 UTC (permalink / raw)
To: u-boot
Hi,
Can anyone please explain how relocation address is calculated in uboot ?
Also, I want to know whether relocation will happen or not when uboot is
running from RAM already? If yes, then can it be disabled ?
Thank you,
--
View this message in context: http://u-boot.10912.n7.nabble.com/Relocation-tp175974.html
Sent from the U-Boot mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] Relocation
2014-03-14 13:38 [U-Boot] Relocation mahsmak
@ 2014-03-14 14:47 ` Albert ARIBAUD
2014-03-17 2:29 ` TigerLiu at via-alliance.com
0 siblings, 1 reply; 6+ messages in thread
From: Albert ARIBAUD @ 2014-03-14 14:47 UTC (permalink / raw)
To: u-boot
Hi mahsmak,
On Fri, 14 Mar 2014 06:38:34 -0700 (PDT), mahsmak
<kshamim.pk@gmail.com> wrote:
> Hi,
>
> Can anyone please explain how relocation address is calculated in uboot ?
U-Boot tries to relocate itself as high in RAM as possible so that the
lower area is available to e.g. the Linux kernel it will chainload.
Therefore, the usual process is that U-Boot first reserves whatever
amount of memory it needs at end of RAM, then relocates itself just
below that.
> Also, I want to know whether relocation will happen or not when uboot is
> running from RAM already? If yes, then can it be disabled ?
Relocation will always happen, and there is no provision for avoiding
it.
> Thank you,
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] Relocation
2014-03-14 14:47 ` Albert ARIBAUD
@ 2014-03-17 2:29 ` TigerLiu at via-alliance.com
2014-03-17 6:23 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: TigerLiu at via-alliance.com @ 2014-03-17 2:29 UTC (permalink / raw)
To: u-boot
Hi, Albert:
>Relocation will always happen, and there is no provision for avoiding
>it.
I have ever tried to del these code in crt0.S :
ldr sp, [r8, #GD_START_ADDR_SP] /* r8 =
gd->start_addr_sp */
bic sp, sp, #7 /* 8-byte alignment for ABI compliance
*/
ldr r8, [r8, #GD_BD] /* r8 = gd->bd */
sub r8, r8, #GD_SIZE /* new GD is below bd */
/// tricky code : insure to return here after running
relocate_code.
adr lr, here
ldr r0, [r8, #GD_RELOC_OFF] /* lr =
gd->start_addr_sp */
add lr, lr, r0
ldr r0, [r8, #GD_RELOCADDR] /* r0 = gd->relocaddr */
/// start.S implement this function.
b relocate_code
Then no relocation, it seemed OK.
Best wishes,
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] Relocation
2014-03-17 2:29 ` TigerLiu at via-alliance.com
@ 2014-03-17 6:23 ` Wolfgang Denk
2014-03-17 8:08 ` TigerLiu at via-alliance.com
0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2014-03-17 6:23 UTC (permalink / raw)
To: u-boot
Dear TigerLiu at via-alliance.com,
In message <FE7ADED5C2218B4786C09CD97DC4C49FE20D1B@exchbj02.viatech.com.bj> you wrote:
>
> >Relocation will always happen, and there is no provision for avoiding
> >it.
...
> Then no relocation, it seemed OK.
You used the correct phrase: it seemed. Except that you broke a
number of really important things. If you do not understand what
rlocation is needed for, then please gop back and read it in the
archives. This has been discussed many times before.
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
Houston, Tranquillity Base here. The Eagle has landed.
-- Neil Armstrong
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] Relocation
2014-03-17 6:23 ` Wolfgang Denk
@ 2014-03-17 8:08 ` TigerLiu at via-alliance.com
2014-03-17 13:12 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: TigerLiu at via-alliance.com @ 2014-03-17 8:08 UTC (permalink / raw)
To: u-boot
Hi, Denk:
>You used the correct phrase: it seemed. Except that you broke a
>number of really important things. If you do not understand what
>rlocation is needed for, then please gop back and read it in the
>archives. This has been discussed many times before.
For example:
Most ARM SOC platform has BL1 code(Boot Stage 1) before U-boot.
So, usually BL1 code could load U-boot.bin to DRAM's dedicated location.
So, U-boot need not be relocated again in this case.
Best wishes,
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] Relocation
2014-03-17 8:08 ` TigerLiu at via-alliance.com
@ 2014-03-17 13:12 ` Wolfgang Denk
0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2014-03-17 13:12 UTC (permalink / raw)
To: u-boot
Dear TigerLiu at via-alliance.com,
In message <FE7ADED5C2218B4786C09CD97DC4C49FE20DA6@exchbj02.viatech.com.bj> you wrote:
>
> >You used the correct phrase: it seemed. Except that you broke a
> >number of really important things. If you do not understand what
> >rlocation is needed for, then please gop back and read it in the
> >archives. This has been discussed many times before.
>
> For example:
> Most ARM SOC platform has BL1 code(Boot Stage 1) before U-boot.
> So, usually BL1 code could load U-boot.bin to DRAM's dedicated location.
No, it cannot, as the target address depends on a lot of things,
including (depending on your config options) contents of some
environment variables which may even change from one boot to the next,
so the target address is not know in advance.
> So, U-boot need not be relocated again in this case.
Yes, it does. All this has been explained again and again in the
past, and I really would like to ask you to read this in the archives
instead of trying to reanimate this dead horse for the N+1th time.
Thanks.
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
The past is not dead. In fact, it's not even past. - William Faulkner
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-03-17 13:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14 13:38 [U-Boot] Relocation mahsmak
2014-03-14 14:47 ` Albert ARIBAUD
2014-03-17 2:29 ` TigerLiu at via-alliance.com
2014-03-17 6:23 ` Wolfgang Denk
2014-03-17 8:08 ` TigerLiu at via-alliance.com
2014-03-17 13:12 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox