Merge tag 'docs-5.15' of git://git.lwn.net/linux
[linux-2.6-microblaze.git] / arch / arm64 / kernel / acpi.c
index f385172..1c9c2f7 100644 (file)
@@ -273,7 +273,8 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
        return __pgprot(PROT_DEVICE_nGnRnE);
 }
 
-void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
+static void __iomem *__acpi_os_ioremap(acpi_physical_address phys,
+                                      acpi_size size, bool memory)
 {
        efi_memory_desc_t *md, *region = NULL;
        pgprot_t prot;
@@ -299,9 +300,11 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
         * It is fine for AML to remap regions that are not represented in the
         * EFI memory map at all, as it only describes normal memory, and MMIO
         * regions that require a virtual mapping to make them accessible to
-        * the EFI runtime services.
+        * the EFI runtime services. Determine the region default
+        * attributes by checking the requested memory semantics.
         */
-       prot = __pgprot(PROT_DEVICE_nGnRnE);
+       prot = memory ? __pgprot(PROT_NORMAL_NC) :
+                       __pgprot(PROT_DEVICE_nGnRnE);
        if (region) {
                switch (region->type) {
                case EFI_LOADER_CODE:
@@ -361,6 +364,16 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
        return __ioremap(phys, size, prot);
 }
 
+void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
+{
+       return __acpi_os_ioremap(phys, size, false);
+}
+
+void __iomem *acpi_os_memmap(acpi_physical_address phys, acpi_size size)
+{
+       return __acpi_os_ioremap(phys, size, true);
+}
+
 /*
  * Claim Synchronous External Aborts as a firmware first notification.
  *