paddr_t base_paddr = fdt_paddr & SECOND_MASK;
paddr_t offset;
void *fdt_virt;
+ uint32_t size;
/*
* Check whether the physical FDT address is set and meets the minimum
if ( fdt_magic(fdt_virt) != FDT_MAGIC )
return NULL;
- if ( fdt_totalsize(fdt_virt) > MAX_FDT_SIZE )
+ size = fdt_totalsize(fdt_virt);
+ if ( size > MAX_FDT_SIZE )
return NULL;
+ if ( (offset + size) > SZ_2M )
+ {
+ create_mappings(boot_second, BOOT_FDT_VIRT_START + SZ_2M,
+ paddr_to_pfn(base_paddr + SZ_2M),
+ SZ_2M >> PAGE_SHIFT, SZ_2M);
+ }
+
return fdt_virt;
}
{
lpae_t pte = {0};
write_pte(xen_second + second_table_offset(BOOT_FDT_VIRT_START), pte);
- flush_xen_data_tlb_range_va(BOOT_FDT_VIRT_START, SECOND_SIZE);
+ write_pte(xen_second + second_table_offset(BOOT_FDT_VIRT_START + SZ_2M),
+ pte);
+ flush_xen_data_tlb_range_va(BOOT_FDT_VIRT_START, BOOT_FDT_SLOT_SIZE);
}
extern void relocate_xen(uint64_t ttbr, void *src, void *dst, size_t len);
/* ... DTB */
pte = boot_second[second_table_offset(BOOT_FDT_VIRT_START)];
xen_second[second_table_offset(BOOT_FDT_VIRT_START)] = pte;
+ pte = boot_second[second_table_offset(BOOT_FDT_VIRT_START + SZ_2M)];
+ xen_second[second_table_offset(BOOT_FDT_VIRT_START + SZ_2M)] = pte;
/* ... Boot Misc area for xen relocation */
dest_va = BOOT_RELOC_VIRT_START;
* 0 - 2M Unmapped
* 2M - 4M Xen text, data, bss
* 4M - 6M Fixmap: special-purpose 4K mapping slots
- * 6M - 8M Early boot mapping of FDT
- * 8M - 10M Early relocation address (used when relocating Xen)
+ * 6M - 10M Early boot mapping of FDT
+ * 10M - 12M Early relocation address (used when relocating Xen)
* and later for livepatch vmap (if compiled in)
*
* ARM32 layout:
- * 0 - 10M <COMMON>
+ * 0 - 12M <COMMON>
*
* 32M - 128M Frametable: 24 bytes per page for 16GB of RAM
* 256M - 1G VMAP: ioremap and early_ioremap use this virtual address
*
* ARM64 layout:
* 0x0000000000000000 - 0x0000007fffffffff (512GB, L0 slot [0])
- * 0 - 10M <COMMON>
+ * 0 - 12M <COMMON>
*
* 1G - 2G VMAP: ioremap and early_ioremap
*
#define XEN_VIRT_START _AT(vaddr_t,0x00200000)
#define FIXMAP_ADDR(n) (_AT(vaddr_t,0x00400000) + (n) * PAGE_SIZE)
#define BOOT_FDT_VIRT_START _AT(vaddr_t,0x00600000)
-#define BOOT_RELOC_VIRT_START _AT(vaddr_t,0x00800000)
+#define BOOT_FDT_SLOT_SIZE MB(4)
+#define BOOT_FDT_VIRT_END (BOOT_FDT_VIRT_START + BOOT_FDT_SLOT_SIZE)
+
+#define BOOT_RELOC_VIRT_START _AT(vaddr_t,0x00a00000)
#ifdef CONFIG_LIVEPATCH
-#define LIVEPATCH_VMAP_START _AT(vaddr_t,0x00800000)
+#define LIVEPATCH_VMAP_START _AT(vaddr_t,0x00a00000)
#define LIVEPATCH_VMAP_END (LIVEPATCH_VMAP_START + MB(2))
#endif