arm64/xen: Add missing #address-cells and #size-cells properties

The properties #address-cells and #size-cells are used to know the
number of cells for ranges provided by "regs". If they don't exist, the
value are resp. 2 and 1.

Currently, when multiboot nodes are created it is assumed that #address-cells
and #size-cells are exactly 2. However, they are never set by GRUB and
will result to later failure when the device-tree is generated by GRUB
or contain different values.

To prevent this failure, create the both properties in the chosen nodes.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Julien Grall 2017-11-29 17:08:12 +00:00 committed by Daniel Kiper
parent 5033080eb6
commit d34977cb66

View file

@ -115,6 +115,17 @@ prepare_xen_hypervisor_params (void *xen_boot_fdt)
if (chosen_node < 1) if (chosen_node < 1)
return grub_error (GRUB_ERR_IO, "failed to get chosen node in FDT"); return grub_error (GRUB_ERR_IO, "failed to get chosen node in FDT");
/*
* The address and size are always written using 64-bits value. Set
* #address-cells and #size-cells accordingly.
*/
retval = grub_fdt_set_prop32 (xen_boot_fdt, chosen_node, "#address-cells", 2);
if (retval)
return grub_error (GRUB_ERR_IO, "failed to set #address-cells");
retval = grub_fdt_set_prop32 (xen_boot_fdt, chosen_node, "#size-cells", 2);
if (retval)
return grub_error (GRUB_ERR_IO, "failed to set #size-cells");
grub_dprintf ("xen_loader", grub_dprintf ("xen_loader",
"Xen Hypervisor cmdline : %s @ %p size:%d\n", "Xen Hypervisor cmdline : %s @ %p size:%d\n",
xen_hypervisor->cmdline, xen_hypervisor->cmdline, xen_hypervisor->cmdline, xen_hypervisor->cmdline,