]> git.sur5r.net Git - u-boot/commitdiff
ARMv8: get new GD address from gd->new_gd directly
authorzijun_hu <zijun_hu@htc.com>
Fri, 22 Sep 2017 06:39:13 +0000 (14:39 +0800)
committerTom Rini <trini@konsulko.com>
Sun, 8 Oct 2017 20:19:56 +0000 (16:19 -0400)
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: zijun_hu <zijun_hu@htc.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/arm/lib/crt0_64.S
lib/asm-offsets.c

index 62fad452b2127b0f07c416ab085005246f18c424..9c46c93ca4c5857b9b62d431a7d214ee96754717 100644 (file)
@@ -95,8 +95,7 @@ ENTRY(_main)
  */
        ldr     x0, [x18, #GD_START_ADDR_SP]    /* x0 <- gd->start_addr_sp */
        bic     sp, x0, #0xf    /* 16-byte alignment for ABI compliance */
-       ldr     x18, [x18, #GD_BD]              /* x18 <- gd->bd */
-       sub     x18, x18, #GD_SIZE              /* new GD is below bd */
+       ldr     x18, [x18, #GD_NEW_GD]          /* x18 <- gd->new_gd */
 
        adr     lr, relocation_return
        ldr     x9, [x18, #GD_RELOC_OFF]        /* x9 <- gd->reloc_off */
index b04f7c6297598b51372eeb586a112b1db83cfae5..f4f1bb8ffd5a54fe102a281e718888f6ea6c62d9 100644 (file)
@@ -38,5 +38,7 @@ int main(void)
 
        DEFINE(GD_START_ADDR_SP, offsetof(struct global_data, start_addr_sp));
 
+       DEFINE(GD_NEW_GD, offsetof(struct global_data, new_gd));
+
        return 0;
 }