forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/arch/arm/mm/pv-fixup-asm.S
....@@ -1,18 +1,15 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2015 Russell King
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
74 *
85 * This assembly is required to safely remap the physical address space
96 * for Keystone 2
107 */
118 #include <linux/linkage.h>
9
+#include <linux/pgtable.h>
1210 #include <asm/asm-offsets.h>
1311 #include <asm/cp15.h>
1412 #include <asm/memory.h>
15
-#include <asm/pgtable.h>
1613
1714 .section ".idmap.text", "ax"
1815
....@@ -33,33 +30,33 @@
3330 add r7, r2, #0x1000
3431 add r6, r7, r6, lsr #SECTION_SHIFT - L2_ORDER
3532 add r7, r7, #PAGE_OFFSET >> (SECTION_SHIFT - L2_ORDER)
36
-1: ldrd r4, [r7]
33
+1: ldrd r4, r5, [r7]
3734 adds r4, r4, r0
3835 adc r5, r5, r1
39
- strd r4, [r7], #1 << L2_ORDER
36
+ strd r4, r5, [r7], #1 << L2_ORDER
4037 cmp r7, r6
4138 bls 1b
4239
4340 /* Update level 2 entries for the boot data */
4441 add r7, r2, #0x1000
45
- add r7, r7, r3, lsr #SECTION_SHIFT - L2_ORDER
46
- bic r7, r7, #(1 << L2_ORDER) - 1
47
- ldrd r4, [r7]
42
+ movw r3, #FDT_FIXED_BASE >> (SECTION_SHIFT - L2_ORDER)
43
+ add r7, r7, r3
44
+ ldrd r4, r5, [r7]
4845 adds r4, r4, r0
4946 adc r5, r5, r1
50
- strd r4, [r7], #1 << L2_ORDER
51
- ldrd r4, [r7]
47
+ strd r4, r5, [r7], #1 << L2_ORDER
48
+ ldrd r4, r5, [r7]
5249 adds r4, r4, r0
5350 adc r5, r5, r1
54
- strd r4, [r7]
51
+ strd r4, r5, [r7]
5552
5653 /* Update level 1 entries */
5754 mov r6, #4
5855 mov r7, r2
59
-2: ldrd r4, [r7]
56
+2: ldrd r4, r5, [r7]
6057 adds r4, r4, r0
6158 adc r5, r5, r1
62
- strd r4, [r7], #1 << L1_ORDER
59
+ strd r4, r5, [r7], #1 << L1_ORDER
6360 subs r6, r6, #1
6461 bne 2b
6562