forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/arch/arm64/kernel/cpu-reset.S
....@@ -1,13 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * CPU reset routines
34 *
45 * Copyright (C) 2001 Deep Blue Solutions Ltd.
56 * Copyright (C) 2012 ARM Ltd.
67 * Copyright (C) 2015 Huawei Futurewei Technologies.
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/linkage.h>
....@@ -22,22 +19,23 @@
2219 * __cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2) - Helper for
2320 * cpu_soft_restart.
2421 *
25
- * @el2_switch: Flag to indicate a swich to EL2 is needed.
22
+ * @el2_switch: Flag to indicate a switch to EL2 is needed.
2623 * @entry: Location to jump to for soft reset.
27
- * arg0: First argument passed to @entry.
28
- * arg1: Second argument passed to @entry.
29
- * arg2: Third argument passed to @entry.
24
+ * arg0: First argument passed to @entry. (relocation list)
25
+ * arg1: Second argument passed to @entry.(physical kernel entry)
26
+ * arg2: Third argument passed to @entry. (physical dtb address)
3027 *
3128 * Put the CPU into the same state as it would be if it had been reset, and
3229 * branch to what would be the reset vector. It must be executed with the
3330 * flat identity mapping.
3431 */
35
-ENTRY(__cpu_soft_restart)
36
- /* Clear sctlr_el1 flags. */
37
- mrs x12, sctlr_el1
38
- ldr x13, =SCTLR_ELx_FLAGS
39
- bic x12, x12, x13
32
+SYM_CODE_START(__cpu_soft_restart)
33
+ mov_q x12, INIT_SCTLR_EL1_MMU_OFF
4034 pre_disable_mmu_workaround
35
+ /*
36
+ * either disable EL1&0 translation regime or disable EL2&0 translation
37
+ * regime if HCR_EL2.E2H == 1
38
+ */
4139 msr sctlr_el1, x12
4240 isb
4341
....@@ -50,6 +48,6 @@
5048 mov x1, x3 // arg1
5149 mov x2, x4 // arg2
5250 br x8
53
-ENDPROC(__cpu_soft_restart)
51
+SYM_CODE_END(__cpu_soft_restart)
5452
5553 .popsection