arm64: dts: rk3368-android: reserve memory for drm-logo
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / mm / mmu.c
index d89ad9a992dc2131684880d824b54cde9c660c59..1cab2703f5a87e7074dbdbe8c932ff2317cf4bfe 100644 (file)
@@ -438,6 +438,8 @@ static void __init map_mem(pgd_t *pgd)
 
                if (start >= end)
                        break;
+               if (memblock_is_nomap(reg))
+                       continue;
 
                __map_memblock(pgd, start, end);
        }
@@ -748,9 +750,9 @@ void *__init __fixmap_remap_fdt(phys_addr_t dt_phys, int *size, pgprot_t prot)
        /*
         * Check whether the physical FDT address is set and meets the minimum
         * alignment requirement. Since we are relying on MIN_FDT_ALIGN to be
-        * at least 8 bytes so that we can always access the size field of the
-        * FDT header after mapping the first chunk, double check here if that
-        * is indeed the case.
+        * at least 8 bytes so that we can always access the magic and size
+        * fields of the FDT header after mapping the first chunk, double check
+        * here if that is indeed the case.
         */
        BUILD_BUG_ON(MIN_FDT_ALIGN < 8);
        if (!dt_phys || dt_phys % MIN_FDT_ALIGN)
@@ -778,7 +780,7 @@ void *__init __fixmap_remap_fdt(phys_addr_t dt_phys, int *size, pgprot_t prot)
        create_mapping_noalloc(round_down(dt_phys, SWAPPER_BLOCK_SIZE),
                        dt_virt_base, SWAPPER_BLOCK_SIZE, prot);
 
-       if (fdt_check_header(dt_virt) != 0)
+       if (fdt_magic(dt_virt) != FDT_MAGIC)
                return NULL;
 
        *size = fdt_totalsize(dt_virt);