hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/arch/arm64/mm/ioremap.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Based on arch/arm/mm/ioremap.c
34 *
....@@ -6,28 +7,16 @@
67 * Hacked to allow all architectures to build, and various cleanups
78 * by Russell King
89 * Copyright (C) 2012 ARM Ltd.
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2 as
12
- * published by the Free Software Foundation.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2110 */
2211
2312 #include <linux/export.h>
2413 #include <linux/mm.h>
2514 #include <linux/vmalloc.h>
2615 #include <linux/io.h>
16
+#include <linux/memblock.h>
2717
2818 #include <asm/fixmap.h>
2919 #include <asm/tlbflush.h>
30
-#include <asm/pgalloc.h>
3120
3221 static void __iomem *__ioremap_caller(phys_addr_t phys_addr, size_t size,
3322 pgprot_t prot, void *caller)
....@@ -80,7 +69,7 @@
8069 }
8170 EXPORT_SYMBOL(__ioremap);
8271
83
-void __iounmap(volatile void __iomem *io_addr)
72
+void iounmap(volatile void __iomem *io_addr)
8473 {
8574 unsigned long addr = (unsigned long)io_addr & PAGE_MASK;
8675
....@@ -91,7 +80,7 @@
9180 if (is_vmalloc_addr((void *)addr))
9281 vunmap((void *)addr);
9382 }
94
-EXPORT_SYMBOL(__iounmap);
83
+EXPORT_SYMBOL(iounmap);
9584
9685 void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
9786 {
....@@ -111,3 +100,11 @@
111100 {
112101 early_ioremap_setup();
113102 }
103
+
104
+bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size,
105
+ unsigned long flags)
106
+{
107
+ unsigned long pfn = PHYS_PFN(offset);
108
+
109
+ return memblock_is_map_memory(pfn);
110
+}