forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/arch/powerpc/mm/init_32.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * PowerPC version
34 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
....@@ -9,12 +10,6 @@
910 *
1011 * Derived from "arch/i386/mm/init.c"
1112 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
12
- *
13
- * This program is free software; you can redistribute it and/or
14
- * modify it under the terms of the GNU General Public License
15
- * as published by the Free Software Foundation; either version
16
- * 2 of the License, or (at your option) any later version.
17
- *
1813 */
1914
2015 #include <linux/module.h>
....@@ -34,10 +29,8 @@
3429 #include <linux/slab.h>
3530 #include <linux/hugetlb.h>
3631
37
-#include <asm/pgalloc.h>
3832 #include <asm/prom.h>
3933 #include <asm/io.h>
40
-#include <asm/pgtable.h>
4134 #include <asm/mmu.h>
4235 #include <asm/smp.h>
4336 #include <asm/machdep.h>
....@@ -45,8 +38,10 @@
4538 #include <asm/tlb.h>
4639 #include <asm/sections.h>
4740 #include <asm/hugetlb.h>
41
+#include <asm/kup.h>
42
+#include <asm/kasan.h>
4843
49
-#include "mmu_decl.h"
44
+#include <mm/mmu_decl.h>
5045
5146 #if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL)
5247 /* The amount of lowmem must be within 0xF0000000 - KERNELBASE. */
....@@ -58,11 +53,6 @@
5853
5954 phys_addr_t total_memory;
6055 phys_addr_t total_lowmem;
61
-
62
-phys_addr_t memstart_addr = (phys_addr_t)~0ull;
63
-EXPORT_SYMBOL(memstart_addr);
64
-phys_addr_t kernstart_addr;
65
-EXPORT_SYMBOL(kernstart_addr);
6656
6757 #ifdef CONFIG_RELOCATABLE
6858 /* Used in __va()/__pa() */
....@@ -104,16 +94,14 @@
10494 if (strstr(boot_command_line, "noltlbs")) {
10595 __map_without_ltlbs = 1;
10696 }
107
- if (debug_pagealloc_enabled()) {
108
- __map_without_bats = 1;
97
+ if (IS_ENABLED(CONFIG_PPC_8xx))
98
+ return;
99
+
100
+ if (debug_pagealloc_enabled())
109101 __map_without_ltlbs = 1;
110
- }
111
-#ifdef CONFIG_STRICT_KERNEL_RWX
112
- if (rodata_enabled) {
113
- __map_without_bats = 1;
102
+
103
+ if (strict_kernel_rwx_enabled())
114104 __map_without_ltlbs = 1;
115
- }
116
-#endif
117105 }
118106
119107 /*
....@@ -182,6 +170,10 @@
182170 btext_unmap();
183171 #endif
184172
173
+ kasan_mmu_init();
174
+
175
+ setup_kup();
176
+
185177 /* Shortly after that, the entire linear mapping will be available */
186178 memblock_set_current_limit(lowmem_end_addr);
187179 }