forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/arch/arm64/kernel/relocate_kernel.S
....@@ -1,12 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * kexec for arm64
34 *
45 * Copyright (C) Linaro.
56 * Copyright (C) Huawei Futurewei Technologies.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #include <linux/kexec.h>
....@@ -29,26 +26,15 @@
2926 * control_code_page, a special page which has been set up to be preserved
3027 * during the copy operation.
3128 */
32
-ENTRY(arm64_relocate_new_kernel)
29
+SYM_CODE_START(arm64_relocate_new_kernel)
3330
3431 /* Setup the list loop variables. */
32
+ mov x18, x2 /* x18 = dtb address */
3533 mov x17, x1 /* x17 = kimage_start */
3634 mov x16, x0 /* x16 = kimage_head */
3735 raw_dcache_line_size x15, x0 /* x15 = dcache line size */
3836 mov x14, xzr /* x14 = entry ptr */
3937 mov x13, xzr /* x13 = copy dest */
40
-
41
- /* Clear the sctlr_el2 flags. */
42
- mrs x0, CurrentEL
43
- cmp x0, #CurrentEL_EL2
44
- b.ne 1f
45
- mrs x0, sctlr_el2
46
- ldr x1, =SCTLR_ELx_FLAGS
47
- bic x0, x0, x1
48
- pre_disable_mmu_workaround
49
- msr sctlr_el2, x0
50
- isb
51
-1:
5238
5339 /* Check if the new image needs relocation. */
5440 tbnz x16, IND_DONE_BIT, .Ldone
....@@ -107,15 +93,13 @@
10793 isb
10894
10995 /* Start new image. */
110
- mov x0, xzr
96
+ mov x0, x18
11197 mov x1, xzr
11298 mov x2, xzr
11399 mov x3, xzr
114100 br x17
115101
116
-ENDPROC(arm64_relocate_new_kernel)
117
-
118
-.ltorg
102
+SYM_CODE_END(arm64_relocate_new_kernel)
119103
120104 .align 3 /* To keep the 64-bit values below naturally aligned. */
121105