Skip to content
Snippets Groups Projects
Commit 01a83599 authored by zijun_hu's avatar zijun_hu Committed by Tom Rini
Browse files

ARMv8: get new GD address from gd->new_gd directly


the new GD address is calculated via board data BD currently
it require the new GD area locates below BD tightly, so a strict
constraint is imposed on memory layout which maybe make special
platform unpleasant.

fix it by getting new GD address from gd->new_gd directly.

Signed-off-by: default avatarzijun_hu <zijun_hu@htc.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 0d3aaa35
No related branches found
No related tags found
No related merge requests found
...@@ -95,8 +95,7 @@ ENTRY(_main) ...@@ -95,8 +95,7 @@ ENTRY(_main)
*/ */
ldr x0, [x18, #GD_START_ADDR_SP] /* x0 <- gd->start_addr_sp */ ldr x0, [x18, #GD_START_ADDR_SP] /* x0 <- gd->start_addr_sp */
bic sp, x0, #0xf /* 16-byte alignment for ABI compliance */ bic sp, x0, #0xf /* 16-byte alignment for ABI compliance */
ldr x18, [x18, #GD_BD] /* x18 <- gd->bd */ ldr x18, [x18, #GD_NEW_GD] /* x18 <- gd->new_gd */
sub x18, x18, #GD_SIZE /* new GD is below bd */
adr lr, relocation_return adr lr, relocation_return
ldr x9, [x18, #GD_RELOC_OFF] /* x9 <- gd->reloc_off */ ldr x9, [x18, #GD_RELOC_OFF] /* x9 <- gd->reloc_off */
......
...@@ -38,5 +38,7 @@ int main(void) ...@@ -38,5 +38,7 @@ int main(void)
DEFINE(GD_START_ADDR_SP, offsetof(struct global_data, start_addr_sp)); DEFINE(GD_START_ADDR_SP, offsetof(struct global_data, start_addr_sp));
DEFINE(GD_NEW_GD, offsetof(struct global_data, new_gd));
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment