Lines Matching refs:phys_addr
185 __ioremap_caller(resource_size_t phys_addr, unsigned long size, in __ioremap_caller() argument
190 const resource_size_t unaligned_phys_addr = phys_addr; in __ioremap_caller()
200 last_addr = phys_addr + size - 1; in __ioremap_caller()
201 if (!size || last_addr < phys_addr) in __ioremap_caller()
204 if (!phys_addr_valid(phys_addr)) { in __ioremap_caller()
206 (unsigned long long)phys_addr); in __ioremap_caller()
211 __ioremap_check_mem(phys_addr, size, &io_desc); in __ioremap_caller()
218 &phys_addr, &last_addr); in __ioremap_caller()
225 offset = phys_addr & ~PAGE_MASK; in __ioremap_caller()
226 phys_addr &= PAGE_MASK; in __ioremap_caller()
227 size = PAGE_ALIGN(last_addr+1) - phys_addr; in __ioremap_caller()
233 phys_addr &= PHYSICAL_PAGE_MASK; in __ioremap_caller()
235 retval = memtype_reserve(phys_addr, (u64)phys_addr + size, in __ioremap_caller()
243 if (!is_new_memtype_allowed(phys_addr, size, pcm, new_pcm)) { in __ioremap_caller()
246 (unsigned long long)phys_addr, in __ioremap_caller()
247 (unsigned long long)(phys_addr + size), in __ioremap_caller()
296 area->phys_addr = phys_addr; in __ioremap_caller()
299 if (memtype_kernel_map_sync(phys_addr, size, pcm)) in __ioremap_caller()
302 if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot)) in __ioremap_caller()
319 memtype_free(phys_addr, phys_addr + size); in __ioremap_caller()
344 void __iomem *ioremap(resource_size_t phys_addr, unsigned long size) in ioremap() argument
356 return __ioremap_caller(phys_addr, size, pcm, in ioremap()
385 void __iomem *ioremap_uc(resource_size_t phys_addr, unsigned long size) in ioremap_uc() argument
389 return __ioremap_caller(phys_addr, size, pcm, in ioremap_uc()
404 void __iomem *ioremap_wc(resource_size_t phys_addr, unsigned long size) in ioremap_wc() argument
406 return __ioremap_caller(phys_addr, size, _PAGE_CACHE_MODE_WC, in ioremap_wc()
421 void __iomem *ioremap_wt(resource_size_t phys_addr, unsigned long size) in ioremap_wt() argument
423 return __ioremap_caller(phys_addr, size, _PAGE_CACHE_MODE_WT, in ioremap_wt()
428 void __iomem *ioremap_encrypted(resource_size_t phys_addr, unsigned long size) in ioremap_encrypted() argument
430 return __ioremap_caller(phys_addr, size, _PAGE_CACHE_MODE_WB, in ioremap_encrypted()
435 void __iomem *ioremap_cache(resource_size_t phys_addr, unsigned long size) in ioremap_cache() argument
437 return __ioremap_caller(phys_addr, size, _PAGE_CACHE_MODE_WB, in ioremap_cache()
442 void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size, in ioremap_prot() argument
445 return __ioremap_caller(phys_addr, size, in ioremap_prot()
497 memtype_free(p->phys_addr, p->phys_addr + get_vm_area_size(p)); in iounmap()
543 static bool memremap_should_map_decrypted(resource_size_t phys_addr, in memremap_should_map_decrypted() argument
552 is_pmem = region_intersects(phys_addr, size, IORESOURCE_MEM, in memremap_should_map_decrypted()
562 switch (efi_mem_type(phys_addr)) { in memremap_should_map_decrypted()
564 if (efi_mem_attributes(phys_addr) & EFI_MEMORY_NV) in memremap_should_map_decrypted()
573 switch (e820__get_entry_type(phys_addr, phys_addr + size - 1)) { in memremap_should_map_decrypted()
596 static bool memremap_is_efi_data(resource_size_t phys_addr, in memremap_is_efi_data() argument
608 if (phys_addr == paddr) in memremap_is_efi_data()
614 if (phys_addr == paddr) in memremap_is_efi_data()
617 if (efi_is_table_address(phys_addr)) in memremap_is_efi_data()
620 switch (efi_mem_type(phys_addr)) { in memremap_is_efi_data()
635 static bool memremap_is_setup_data(resource_size_t phys_addr, in memremap_is_setup_data() argument
646 if (phys_addr == paddr) in memremap_is_setup_data()
659 if ((phys_addr > paddr) && in memremap_is_setup_data()
660 (phys_addr < (paddr + sizeof(struct setup_data) + len))) { in memremap_is_setup_data()
684 if ((phys_addr > paddr) && (phys_addr < (paddr + len))) in memremap_is_setup_data()
697 static bool __init early_memremap_is_setup_data(resource_size_t phys_addr, in early_memremap_is_setup_data() argument
708 if (phys_addr == paddr) in early_memremap_is_setup_data()
722 if ((phys_addr > paddr) && in early_memremap_is_setup_data()
723 (phys_addr < (paddr + sizeof(struct setup_data) + len))) { in early_memremap_is_setup_data()
747 if ((phys_addr > paddr) && (phys_addr < (paddr + len))) in early_memremap_is_setup_data()
761 bool arch_memremap_can_ram_remap(resource_size_t phys_addr, unsigned long size, in arch_memremap_can_ram_remap() argument
774 if (memremap_is_setup_data(phys_addr, size) || in arch_memremap_can_ram_remap()
775 memremap_is_efi_data(phys_addr, size)) in arch_memremap_can_ram_remap()
779 return !memremap_should_map_decrypted(phys_addr, size); in arch_memremap_can_ram_remap()
788 pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr, in early_memremap_pgprot_adjust() argument
800 if (early_memremap_is_setup_data(phys_addr, size) || in early_memremap_pgprot_adjust()
801 memremap_is_efi_data(phys_addr, size)) in early_memremap_pgprot_adjust()
805 if (encrypted_prot && memremap_should_map_decrypted(phys_addr, size)) in early_memremap_pgprot_adjust()
812 bool phys_mem_access_encrypted(unsigned long phys_addr, unsigned long size) in phys_mem_access_encrypted() argument
814 return arch_memremap_can_ram_remap(phys_addr, size, 0); in phys_mem_access_encrypted()
818 void __init *early_memremap_encrypted(resource_size_t phys_addr, in early_memremap_encrypted() argument
821 return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_ENC); in early_memremap_encrypted()
828 void __init *early_memremap_encrypted_wp(resource_size_t phys_addr, in early_memremap_encrypted_wp() argument
833 return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_ENC_WP); in early_memremap_encrypted_wp()
837 void __init *early_memremap_decrypted(resource_size_t phys_addr, in early_memremap_decrypted() argument
840 return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC); in early_memremap_decrypted()
847 void __init *early_memremap_decrypted_wp(resource_size_t phys_addr, in early_memremap_decrypted_wp() argument
852 return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC_WP); in early_memremap_decrypted_wp()