ioremap64.c 567 B

1234567891011121314151617181920212223
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. #include <linux/io.h>
  3. #include <ioremap.h>
  4. void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
  5. unsigned long prot_val)
  6. {
  7. unsigned long flags = prot_val & _CACHE_MASK;
  8. u64 base = (flags == _CACHE_UNCACHED ? IO_BASE : UNCAC_BASE);
  9. void __iomem *addr;
  10. addr = plat_ioremap(offset, size, flags);
  11. if (!addr)
  12. addr = (void __iomem *)(unsigned long)(base + offset);
  13. return addr;
  14. }
  15. EXPORT_SYMBOL(ioremap_prot);
  16. void iounmap(const volatile void __iomem *addr)
  17. {
  18. plat_iounmap(addr);
  19. }
  20. EXPORT_SYMBOL(iounmap);