On Mon, 15 Jan 2024 at 04:34, Bin Meng <bin.meng@windriver.com> wrote:
>
> By default QEMU generates a 1 MiB sized device tree. Let's pack it
> to save some room.
>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
>
> hw/arm/boot.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/hw/arm/boot.c b/hw/arm/boot.c
> index ff1173299f..511ec10ed0 100644
> --- a/hw/arm/boot.c
> +++ b/hw/arm/boot.c
> @@ -662,6 +662,17 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
> binfo->modify_dtb(binfo, fdt);
> }
>
> + /*
> + * By default QEMU generates a 1 MiB sized device tree.
> + * Let's pack it to save some room.
> + */
> + if (binfo->get_dtb) {
> + rc = fdt_pack(fdt);
> + /* Should only fail if we've built a corrupted tree */
> + g_assert(rc == 0);
We generally use plain old assert(), not g_assert().
> + size = fdt_totalsize(fdt);
> + }
> +
> qemu_fdt_dumpdtb(fdt, size);
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM