[PATCH 2/2] RFC: x86: acpi: Add some debugging

Simon Glass sjg at chromium.org
Thu Aug 24 20:23:33 CEST 2023


Enable some debugging to help see what is going on.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/x86/lib/tables.c  | 1 +
 lib/acpi/acpi_writer.c | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c
index 67bc0a72aebc..7c6b32e6e335 100644
--- a/arch/x86/lib/tables.c
+++ b/arch/x86/lib/tables.c
@@ -3,6 +3,7 @@
  * Copyright (C) 2015, Bin Meng <bmeng.cn at gmail.com>
  */
 
+#define LOG_DEBUG
 #define LOG_CATEGORY LOGC_ACPI
 
 #include <common.h>
diff --git a/lib/acpi/acpi_writer.c b/lib/acpi/acpi_writer.c
index 946f90e8e7b1..b1118b602069 100644
--- a/lib/acpi/acpi_writer.c
+++ b/lib/acpi/acpi_writer.c
@@ -5,6 +5,7 @@
  * Copyright 2021 Google LLC
  */
 
+#define LOG_DEBUG
 #define LOG_CATEGORY LOGC_ACPI
 
 #include <common.h>
@@ -21,8 +22,8 @@ int acpi_write_one(struct acpi_ctx *ctx, const struct acpi_writer *entry)
 {
 	int ret;
 
-	log_debug("%s: writing table '%s'\n", entry->name,
-		  entry->table);
+	log_debug("%s: writing table '%s' at %p\n", entry->name,
+		  entry->table, ctx->current);
 	ctx->tab_start = ctx->current;
 	ret = entry->h_write(ctx, entry);
 	if (ret == -ENOENT) {
@@ -57,11 +58,15 @@ static int acpi_write_all(struct acpi_ctx *ctx)
 	const struct acpi_writer *entry;
 	int ret;
 
+	log_debug("writing acpi tables\n");
+
 	for (entry = writer; entry != writer + n_ents; entry++) {
 		ret = acpi_write_one(ctx, entry);
+		log_debug("- return code %d\n", ret);
 		if (ret && ret != -ENOENT)
 			return log_msg_ret("one", ret);
 	}
+	log_debug("writing acpi tables done ok\n");
 
 	return 0;
 }
-- 
2.42.0.rc1.204.g551eb34607-goog



More information about the U-Boot mailing list