1/* SPDX-License-Identifier: GPL-2.0-or-later */ 2 3/* 4 * Early initialization code for aarch64 (a.k.a. armv8) 5 */ 6 7#include <arch/asm.h> 8 9ENTRY(_start) 10 /* Setup CPU. */ 11 bl arm64_init_cpu 12 13 /* Get code positions. */ 14 ldr x1, =_flash 15 ldr x0, =_bootblock 16 17 /* Calculate bootblock size. */ 18 ldr x2, =_ebootblock 19 sub x2, x2, x0 20 21 /* Call memcpy in arch/arm64/memcpy.S */ 22 bl memcpy 23 dmb sy 24 25 /* Calculate relocation offset between bootblock in flash and in DRAM. */ 26 ldr x0, =_flash 27 ldr x1, =_bootblock 28 sub x1, x1, x0 29 30 /* Jump to main() in DRAM. */ 31 adr x0, main 32 add x0, x0, x1 33 blr x0 34ENDPROC(_start) 35