Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / mips / mm / ioremap64.c
blob15e7820d6a5f4221bcf5e9a0d38c8354985ac6f0
1 // SPDX-License-Identifier: GPL-2.0-only
2 #include <linux/io.h>
3 #include <ioremap.h>
5 void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
6 unsigned long prot_val)
8 unsigned long flags = prot_val & _CACHE_MASK;
9 u64 base = (flags == _CACHE_UNCACHED ? IO_BASE : UNCAC_BASE);
10 void __iomem *addr;
12 addr = plat_ioremap(offset, size, flags);
13 if (!addr)
14 addr = (void __iomem *)(unsigned long)(base + offset);
15 return addr;
17 EXPORT_SYMBOL(ioremap_prot);
19 void iounmap(const volatile void __iomem *addr)
21 plat_iounmap(addr);
23 EXPORT_SYMBOL(iounmap);