1 /* SPDX-License-Identifier: GPL-2.0 */
3 * relocate_kernel.S - put the kernel image in place to boot
6 #include <linux/linkage.h>
7 #include <asm/assembler.h>
10 .align 3 /* not needed for this code, but keeps fncpy() happy */
12 ENTRY(relocate_new_kernel)
14 ldr r0,kexec_indirection_page
15 ldr r1,kexec_start_address
18 * If there is no indirection page (we are doing crashdumps)
19 * skip any relocation.
24 0: /* top, read another word for the indirection page */
27 /* Is it a destination page. Put destination address to r4 */
33 /* Is it an indirection page */
59 /* Jump to relocated kernel */
62 ldr r1,kexec_mach_type
63 ldr r2,kexec_boot_atags
69 .globl kexec_start_address
73 .globl kexec_indirection_page
74 kexec_indirection_page:
77 .globl kexec_mach_type
81 /* phy addr of the atags for the new kernel */
82 .globl kexec_boot_atags
86 ENDPROC(relocate_new_kernel)
88 relocate_new_kernel_end:
90 .globl relocate_new_kernel_size
91 relocate_new_kernel_size:
92 .long relocate_new_kernel_end - relocate_new_kernel