]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
acpi: Kconfig symbol CONFIG_QFW_ACPI
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 19 Dec 2023 15:04:00 +0000 (16:04 +0100)
committerSimon Glass <sjg@chromium.org>
Sun, 7 Jan 2024 20:49:15 +0000 (13:49 -0700)
We have two implementations of write_acpi_tables(). One for writing ACPI
tables based on ACPI_WRITER() entries another based on copying tables from
QEMU.

Create a symbol CONFIG_QFW_ACPI that signifies copying ACPI tables from
QEMU and use it consistently.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/misc/Kconfig
drivers/misc/qfw.c
lib/acpi/Makefile
lib/acpi/acpi_writer.c

index ed7ecedd3acae860ff7ef9a2d31088c618027820..e8e4400516f8318c19cb37f4aaecb8b232310296 100644 (file)
@@ -540,6 +540,13 @@ config QFW
          Hidden option to enable QEMU fw_cfg interface and uclass. This will
          be selected by either CONFIG_CMD_QFW or CONFIG_GENERATE_ACPI_TABLE.
 
+config QFW_ACPI
+       bool
+       default y
+       depends on QFW && GENERATE_ACPI_TABLE && !SANDBOX
+       help
+         Hidden option to read ACPI tables from QEMU.
+
 config QFW_PIO
        bool
        depends on QFW
index e3b6b4cd741a1c5f9c9bd17b43776cadf1ffdb4e..307334faf48f4a11ce15eae983c5a3bbdb2fde5b 100644 (file)
@@ -21,7 +21,7 @@
 #include <tables_csum.h>
 #include <asm/acpi_table.h>
 
-#if defined(CONFIG_GENERATE_ACPI_TABLE) && !defined(CONFIG_SANDBOX)
+#ifdef QFW_ACPI
 /*
  * This function allocates memory for ACPI tables
  *
@@ -259,7 +259,7 @@ ulong acpi_get_rsdp_addr(void)
        file = qfw_find_file(dev, "etc/acpi/rsdp");
        return file->addr;
 }
-#endif
+#endif /* QFW_ACPI */
 
 static void qfw_read_entry_io(struct qfw_dev *qdev, u16 entry, u32 size,
                              void *address)
index c1c9675b5d2a236c36ef5fed01ae43539ead14d3..cc2868488a061116fc07d3f396cebf522dc2ff1e 100644 (file)
@@ -12,7 +12,7 @@ obj-$(CONFIG_$(SPL_)ACPIGEN) += acpi_table.o
 obj-y += acpi_writer.o
 
 # With QEMU the ACPI tables come from there, not from U-Boot
-ifndef CONFIG_QEMU
+ifndef CONFIG_QFW_ACPI
 obj-y += base.o
 obj-y += csrt.o
 obj-y += mcfg.o
index a8dc207557b42838a675a7030091fffde7dd0055..bbb9b54786d366eacf049697793e440b0909d347 100644 (file)
@@ -48,7 +48,7 @@ int acpi_write_one(struct acpi_ctx *ctx, const struct acpi_writer *entry)
        return 0;
 }
 
-#ifndef CONFIG_QEMU
+#ifndef CONFIG_QFW_ACPI
 static int acpi_write_all(struct acpi_ctx *ctx)
 {
        const struct acpi_writer *writer =
@@ -115,7 +115,7 @@ ulong acpi_get_rsdp_addr(void)
 
        return map_to_sysmem(gd->acpi_ctx->rsdp);
 }
-#endif /* QEMU */
+#endif /* QFW_ACPI */
 
 void acpi_setup_ctx(struct acpi_ctx *ctx, ulong start)
 {