forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/arm/mm/idmap.c
....@@ -3,11 +3,12 @@
33 #include <linux/kernel.h>
44 #include <linux/slab.h>
55 #include <linux/mm_types.h>
6
+#include <linux/pgtable.h>
67
78 #include <asm/cputype.h>
89 #include <asm/idmap.h>
10
+#include <asm/hwcap.h>
911 #include <asm/pgalloc.h>
10
-#include <asm/pgtable.h>
1112 #include <asm/sections.h>
1213 #include <asm/system_info.h>
1314
....@@ -67,7 +68,8 @@
6768 static void idmap_add_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
6869 unsigned long prot)
6970 {
70
- pud_t *pud = pud_offset(pgd, addr);
71
+ p4d_t *p4d = p4d_offset(pgd, addr);
72
+ pud_t *pud = pud_offset(p4d, addr);
7173 unsigned long next;
7274
7375 do {
....@@ -110,7 +112,8 @@
110112 __idmap_text_end, 0);
111113
112114 /* Flush L1 for the hardware to see this page table content */
113
- flush_cache_louis();
115
+ if (!(elf_hwcap & HWCAP_LPAE))
116
+ flush_cache_louis();
114117
115118 return 0;
116119 }