arm64: mm: Implement 4 levels of translation tables
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / mm / ioremap.c
index 69000efa015ea2da1278e0811ddd231d00296302..d5e969e7b576cf447398e843c2b334f1f1d14fcf 100644 (file)
@@ -104,9 +104,12 @@ void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
 EXPORT_SYMBOL(ioremap_cache);
 
 static pte_t bm_pte[PTRS_PER_PTE] __page_aligned_bss;
-#ifndef CONFIG_ARM64_64K_PAGES
+#ifndef CONFIG_ARM64_2_LEVELS
 static pte_t bm_pmd[PTRS_PER_PMD] __page_aligned_bss;
 #endif
+#ifdef CONFIG_ARM64_4_LEVELS
+static pte_t bm_pud[PTRS_PER_PUD] __page_aligned_bss;
+#endif
 
 static inline pud_t * __init early_ioremap_pud(unsigned long addr)
 {
@@ -144,6 +147,7 @@ void __init early_ioremap_init(void)
        unsigned long addr = fix_to_virt(FIX_BTMAP_BEGIN);
 
        pgd = pgd_offset_k(addr);
+       pgd_populate(&init_mm, pgd, bm_pud);
        pud = pud_offset(pgd, addr);
        pud_populate(&init_mm, pud, bm_pmd);
        pmd = pmd_offset(pud, addr);