diff options
Diffstat (limited to 'arch/mips/mm/ioremap64.c')
-rw-r--r-- | arch/mips/mm/ioremap64.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/mips/mm/ioremap64.c b/arch/mips/mm/ioremap64.c new file mode 100644 index 000000000..15e7820d6 --- /dev/null +++ b/arch/mips/mm/ioremap64.c | |||
@@ -0,0 +1,23 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | #include <linux/io.h> | ||
3 | #include <ioremap.h> | ||
4 | |||
5 | void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size, | ||
6 | unsigned long prot_val) | ||
7 | { | ||
8 | unsigned long flags = prot_val & _CACHE_MASK; | ||
9 | u64 base = (flags == _CACHE_UNCACHED ? IO_BASE : UNCAC_BASE); | ||
10 | void __iomem *addr; | ||
11 | |||
12 | addr = plat_ioremap(offset, size, flags); | ||
13 | if (!addr) | ||
14 | addr = (void __iomem *)(unsigned long)(base + offset); | ||
15 | return addr; | ||
16 | } | ||
17 | EXPORT_SYMBOL(ioremap_prot); | ||
18 | |||
19 | void iounmap(const volatile void __iomem *addr) | ||
20 | { | ||
21 | plat_iounmap(addr); | ||
22 | } | ||
23 | EXPORT_SYMBOL(iounmap); | ||