Skip to content

Commit 14bce18

Browse files
maluka-dmytrorobherring
authored andcommitted
of/fdt: Restore possibility to use both ACPI and FDT from bootloader
There are cases when the bootloader provides information to the kernel in both ACPI and DTB, not interchangeably. One such use case is virtual machines in Android. When running on x86, the Android Virtualization Framework (AVF) boots VMs with ACPI like it is usually done on x86 (i.e. the virtual LAPIC, IOAPIC, HPET, PCI MMCONFIG etc are described in ACPI) but also passes various AVF-specific boot parameters in DTB. This allows reusing the same implementations of various AVF components on both arm64 and x86. Commit 7b937cc ("of: Create of_root if no dtb provided by firmware") removed the possibility to do that, since among other things it introduced forcing emptying the bootloader-provided DTB if ACPI is enabled (probably assuming that if ACPI is available, a DTB can only be useful for applying overlays to it afterwards, for testing purposes). So restore this possibility. Instead of completely preventing using ACPI and DT together, rely on arch-specific setup code to prevent using both to set up the same things (see various acpi_disabled checks under arch/). Fixes: 7b937cc ("of: Create of_root if no dtb provided by firmware") Signed-off-by: Dmytro Maluka <dmaluka@chromium.org> Link: https://lore.kernel.org/r/20250105172741.3476758-3-dmaluka@chromium.org Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
1 parent 1f74413 commit 14bce18

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/of/fdt.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#define pr_fmt(fmt) "OF: fdt: " fmt
1010

11-
#include <linux/acpi.h>
1211
#include <linux/crash_dump.h>
1312
#include <linux/crc32.h>
1413
#include <linux/kernel.h>
@@ -1220,14 +1219,7 @@ void __init unflatten_device_tree(void)
12201219
/* Save the statically-placed regions in the reserved_mem array */
12211220
fdt_scan_reserved_mem_reg_nodes();
12221221

1223-
/* Don't use the bootloader provided DTB if ACPI is enabled */
1224-
if (!acpi_disabled)
1225-
fdt = NULL;
1226-
1227-
/*
1228-
* Populate an empty root node when ACPI is enabled or bootloader
1229-
* doesn't provide one.
1230-
*/
1222+
/* Populate an empty root node when bootloader doesn't provide one */
12311223
if (!fdt) {
12321224
fdt = (void *) __dtb_empty_root_begin;
12331225
/* fdt_totalsize() will be used for copy size */

0 commit comments

Comments
 (0)