forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/arch/arm/kernel/head.S
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * linux/arch/arm/kernel/head.S
34 *
....@@ -5,14 +6,11 @@
56 * Copyright (c) 2003 ARM Limited
67 * All Rights Reserved
78 *
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.
11
- *
129 * Kernel startup code for all 32-bit CPUs
1310 */
1411 #include <linux/linkage.h>
1512 #include <linux/init.h>
13
+#include <linux/pgtable.h>
1614
1715 #include <asm/assembler.h>
1816 #include <asm/cp15.h>
....@@ -21,7 +19,6 @@
2119 #include <asm/asm-offsets.h>
2220 #include <asm/memory.h>
2321 #include <asm/thread_info.h>
24
-#include <asm/pgtable.h>
2522
2623 #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING)
2724 #include CONFIG_DEBUG_LL_INCLUDE
....@@ -278,11 +275,10 @@
278275 * We map 2 sections in case the ATAGs/DTB crosses a section boundary.
279276 */
280277 mov r0, r2, lsr #SECTION_SHIFT
281
- movs r0, r0, lsl #SECTION_SHIFT
282
- subne r3, r0, r8
283
- addne r3, r3, #PAGE_OFFSET
284
- addne r3, r4, r3, lsr #(SECTION_SHIFT - PMD_ORDER)
285
- orrne r6, r7, r0
278
+ cmp r2, #0
279
+ ldrne r3, =FDT_FIXED_BASE >> (SECTION_SHIFT - PMD_ORDER)
280
+ addne r3, r3, r4
281
+ orrne r6, r7, r0, lsl #SECTION_SHIFT
286282 strne r6, [r3], #1 << PMD_ORDER
287283 addne r6, r6, #1 << SECTION_SHIFT
288284 strne r6, [r3]
....@@ -399,7 +395,7 @@
399395 ldmia r4, {r5, r7, r12} @ address to jump to after
400396 sub lr, r4, r5 @ mmu has been enabled
401397 add r3, r7, lr
402
- ldrd r4, [r3, #0] @ get secondary_data.pgdir
398
+ ldrd r4, r5, [r3, #0] @ get secondary_data.pgdir
403399 ARM_BE8(eor r4, r4, r5) @ Swap r5 and r4 in BE:
404400 ARM_BE8(eor r5, r4, r5) @ it can be done in 3 steps
405401 ARM_BE8(eor r4, r4, r5) @ without using a temp reg.