aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-12-01 09:02:50 -0700
committerSimon Glass <sjg@chromium.org>2022-01-25 11:44:36 -0700
commit94ba15a3f13ff5b510d426d13854014bb9cb4713 (patch)
tree4037486b4814b9fe7f1a8c1d6ea7d2d1d90c7599 /include
parent31c27eb83084e77921b82e7e631ecd6ae8b904da (diff)
downloadu-boot-94ba15a3f13ff5b510d426d13854014bb9cb4713.zip
u-boot-94ba15a3f13ff5b510d426d13854014bb9cb4713.tar.gz
u-boot-94ba15a3f13ff5b510d426d13854014bb9cb4713.tar.bz2
x86: Move base tables to a writer function
Use the new ACPI writer to write the base tables at the start of the area, moving this code from the x86 implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_table.h10
-rw-r--r--include/dm/acpi.h23
2 files changed, 21 insertions, 12 deletions
diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h
index f34bd63..fcc9caa 100644
--- a/include/acpi/acpi_table.h
+++ b/include/acpi/acpi_table.h
@@ -679,16 +679,6 @@ void acpi_inc_align(struct acpi_ctx *ctx, uint amount);
int acpi_add_table(struct acpi_ctx *ctx, void *table);
/**
- * acpi_setup_base_tables() - Set up base tables - RSDP, RSDT and XSDT
- *
- * Writes the basic tables to the given context, which must first be set up with
- * acpi_setup_ctx().
- *
- * @ctx: Context to write base tables to
- */
-void acpi_setup_base_tables(struct acpi_ctx *ctx);
-
-/**
* acpi_write_rsdp() - Write out an RSDP indicating where the ACPI tables are
*
* @rsdp: Address to write RSDP
diff --git a/include/dm/acpi.h b/include/dm/acpi.h
index f6e5479..2021a69 100644
--- a/include/dm/acpi.h
+++ b/include/dm/acpi.h
@@ -72,9 +72,11 @@ struct acpi_ctx {
/**
* enum acpi_writer_flags_t - flags to use for the ACPI writers
+ *
+ * ACPIWF_ALIGN64 - align to 64 bytes after writing this one (default is 16)
*/
enum acpi_writer_flags_t {
- ACPIWF_ALIGN64_,
+ ACPIWF_ALIGN64 = 1 << 0,
};
struct acpi_writer;
@@ -103,7 +105,7 @@ struct acpi_writer {
int flags;
};
-/* Declare a new ACPI table writer */
+/* Declare a new ACPI-table writer */
#define ACPI_WRITER(_name, _table, _write, _flags) \
ll_entry_declare(struct acpi_writer, _name, acpi_writer) = { \
.name = #_name, \
@@ -112,6 +114,10 @@ struct acpi_writer {
.flags = _flags, \
}
+/* Get a pointer to a given ACPI-table writer */
+#define ACPI_WRITER_GET(_name) \
+ ll_entry_get(struct acpi_writer, _name, acpi_writer)
+
/**
* struct acpi_ops - ACPI operations supported by driver model
*/
@@ -309,6 +315,19 @@ int acpi_write_one(struct acpi_ctx *ctx, const struct acpi_writer *entry);
*/
void acpi_setup_ctx(struct acpi_ctx *ctx, ulong start);
+/**
+ * acpi_write_one() - Call a single ACPI writer entry
+ *
+ * This handles aligning the context afterwards, if the entry flags indicate
+ * that.
+ *
+ * @ctx: ACPI context to use
+ * @entry: Entry to call
+ * @return 0 if OK, -ENOENT if this writer produced an empty entry, other -ve
+ * value on error
+ */
+int acpi_write_one(struct acpi_ctx *ctx, const struct acpi_writer *entry);
+
#endif /* __ACPI__ */
#endif