U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Rudolph <patrick.rudolph@9elements.com>
To: u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>
Cc: Patrick Rudolph <patrick.rudolph@9elements.com>,
	Tom Rini <trini@konsulko.com>
Subject: [PATCH 1/2] acpi: acpi_table: Fix compilation on QFW enabled platforms
Date: Thu, 14 Nov 2024 12:50:43 +0100	[thread overview]
Message-ID: <20241114115049.2070780-1-patrick.rudolph@9elements.com> (raw)

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


             reply	other threads:[~2024-11-14 11:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 11:50 Patrick Rudolph [this message]
2024-11-14 11:50 ` [PATCH 2/2] configs: Add QEMU riscv ACPI defconfig Patrick Rudolph

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241114115049.2070780-1-patrick.rudolph@9elements.com \
    --to=patrick.rudolph@9elements.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox