platform: generic: Pack the FDT after applying fixups

This minimizes the size that will be reserved by the OS for the FDT, and
it prevents the FDT buffer from containing uninitialized memory, which
can be important for some simulation platforms and for attestation.

Closes: https://github.com/riscv-software-src/opensbi/issues/388
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20250722233923.1356605-1-samuel.holland@sifive.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Samuel Holland
2025-07-22 16:39:20 -07:00
committed by Anup Patel
parent 525ac970b3
commit bbe9a23060

View File

@@ -245,6 +245,8 @@ int generic_final_init(bool cold_boot)
fdt_fixups(fdt);
fdt_domain_fixup(fdt);
fdt_pack(fdt);
return 0;
}