]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
of/fdt: Restore possibility to use both ACPI and FDT from bootloader
authorDmytro Maluka <dmaluka@chromium.org>
Sun, 5 Jan 2025 17:27:41 +0000 (17:27 +0000)
committerRob Herring (Arm) <robh@kernel.org>
Fri, 24 Jan 2025 21:57:08 +0000 (15:57 -0600)
commit14bce187d1600710623d81888da3501bbc470ba2
tree5263968b9f3168d40e0a9a409bb5292d7f1cc69f
parent1f744135f996257229f98c0ed3efc9726ac8c77f
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 7b937cc243e5 ("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: 7b937cc243e5 ("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>
drivers/of/fdt.c