u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] acpi: acpi_table: Fix compilation on QFW enabled platforms
@ 2024-11-14 11:50 Patrick Rudolph
  2024-11-14 11:50 ` [PATCH 2/2] configs: Add QEMU riscv ACPI defconfig Patrick Rudolph
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Rudolph @ 2024-11-14 11:50 UTC (permalink / raw)
  To: u-boot, Simon Glass; +Cc: Patrick Rudolph, Tom Rini

On ACPI enabled platforms where QFW passes in the pre-generated
ACPI tables do not attempt to fill MADT and FADT. On all other
platforms MADT and FADT must be filled by SoC or mainboard code.

Fixes a compilation error on QEMU platforms that enable:
- CONFIG_QFW_ACPI

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
 lib/acpi/acpi_table.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c
index 150f75027a..e44b6f3800 100644
--- a/lib/acpi/acpi_table.c
+++ b/lib/acpi/acpi_table.c
@@ -241,6 +241,10 @@ int acpi_write_fadt(struct acpi_ctx *ctx, const struct acpi_writer *entry)
 	struct acpi_table_header *header;
 	struct acpi_fadt *fadt;
 
+	/* On QFW ACPI enabled platforms this is never called */
+	if (IS_ENABLED(CONFIG_QFW_ACPI))
+		return 0;
+
 	fadt = ctx->current;
 	header = &fadt->header;
 
@@ -281,6 +285,10 @@ int acpi_write_madt(struct acpi_ctx *ctx, const struct acpi_writer *entry)
 	struct acpi_madt *madt;
 	void *current;
 
+	/* On QFW ACPI enabled platforms this is never called */
+	if (IS_ENABLED(CONFIG_QFW_ACPI))
+		return 0;
+
 	madt = ctx->current;
 
 	memset(madt, '\0', sizeof(struct acpi_madt));
-- 
2.46.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] configs: Add QEMU riscv ACPI defconfig
  2024-11-14 11:50 [PATCH 1/2] acpi: acpi_table: Fix compilation on QFW enabled platforms Patrick Rudolph
@ 2024-11-14 11:50 ` Patrick Rudolph
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Rudolph @ 2024-11-14 11:50 UTC (permalink / raw)
  To: u-boot, Bin Meng; +Cc: Patrick Rudolph, Tom Rini

Build test QEMU riscv with ACPI enabled.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
 board/emulation/qemu-riscv/MAINTAINERS |  1 +
 configs/qemu-riscv64_acpi_defconfig    | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 configs/qemu-riscv64_acpi_defconfig

diff --git a/board/emulation/qemu-riscv/MAINTAINERS b/board/emulation/qemu-riscv/MAINTAINERS
index 3d7453f1b4..83c5f6f864 100644
--- a/board/emulation/qemu-riscv/MAINTAINERS
+++ b/board/emulation/qemu-riscv/MAINTAINERS
@@ -10,3 +10,4 @@ F:	configs/qemu-riscv32_spl_defconfig
 F:	configs/qemu-riscv64_defconfig
 F:	configs/qemu-riscv64_smode_defconfig
 F:	configs/qemu-riscv64_spl_defconfig
+F:      configs/qemu-riscv64_acpi_defconfig
diff --git a/configs/qemu-riscv64_acpi_defconfig b/configs/qemu-riscv64_acpi_defconfig
new file mode 100644
index 0000000000..7594b84322
--- /dev/null
+++ b/configs/qemu-riscv64_acpi_defconfig
@@ -0,0 +1,25 @@
+CONFIG_RISCV=y
+CONFIG_SYS_MALLOC_LEN=0x800000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
+CONFIG_ENV_SIZE=0x20000
+CONFIG_DEFAULT_DEVICE_TREE="qemu-virt64"
+CONFIG_SYS_BOOTM_LEN=0x4000000
+CONFIG_SYS_LOAD_ADDR=0x80200000
+CONFIG_TARGET_QEMU_VIRT=y
+CONFIG_ARCH_RV64I=y
+CONFIG_FIT=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_DISPLAY_CPUINFO=y
+CONFIG_DISPLAY_BOARDINFO=y
+CONFIG_CMD_BOOTEFI_SELFTEST=y
+CONFIG_CMD_NVEDIT_EFI=y
+# CONFIG_CMD_MII is not set
+CONFIG_CMD_QFW=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM_MTD=y
+CONFIG_FLASH_SHOW_PROGRESS=0
+CONFIG_SYS_MAX_FLASH_BANKS=2
+CONFIG_ACPI=y
+CONFIG_GENERATE_ACPI_TABLE=y
-- 
2.46.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-14 11:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14 11:50 [PATCH 1/2] acpi: acpi_table: Fix compilation on QFW enabled platforms Patrick Rudolph
2024-11-14 11:50 ` [PATCH 2/2] configs: Add QEMU riscv ACPI defconfig Patrick Rudolph

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).