paddr_t offset;
void *fdt_virt;
uint32_t size;
+ int rc;
/*
* Check whether the physical FDT address is set and meets the minimum
/* The FDT is mapped using 2MB superpage */
BUILD_BUG_ON(BOOT_FDT_VIRT_START % SZ_2M);
- create_mappings(xen_second, BOOT_FDT_VIRT_START, paddr_to_pfn(base_paddr),
- SZ_2M >> PAGE_SHIFT, SZ_2M);
+ rc = map_pages_to_xen(BOOT_FDT_VIRT_START, maddr_to_mfn(base_paddr),
+ SZ_2M >> PAGE_SHIFT,
+ PAGE_HYPERVISOR_RO | _PAGE_BLOCK);
+ if ( rc )
+ panic("Unable to map the device-tree.\n");
+
offset = fdt_paddr % SECOND_SIZE;
fdt_virt = (void *)BOOT_FDT_VIRT_START + offset;
if ( (offset + size) > SZ_2M )
{
- create_mappings(xen_second, BOOT_FDT_VIRT_START + SZ_2M,
- paddr_to_pfn(base_paddr + SZ_2M),
- SZ_2M >> PAGE_SHIFT, SZ_2M);
+ rc = map_pages_to_xen(BOOT_FDT_VIRT_START + SZ_2M,
+ maddr_to_mfn(base_paddr + SZ_2M),
+ SZ_2M >> PAGE_SHIFT,
+ PAGE_HYPERVISOR_RO | _PAGE_BLOCK);
+ if ( rc )
+ panic("Unable to map the device-tree\n");
}
return fdt_virt;