aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-04-30 13:00:20 -0400
committerTom Rini <trini@konsulko.com>2020-04-30 13:00:20 -0400
commit9f0a6df3a57469061582c6b27fc869829681beca (patch)
tree80b1a3707a5a4f6fd1d9db03ce24e12e0d47b781 /include
parent6d7dacf726ca043a3f5487549bbfa506c990c813 (diff)
parent249154672d43db6c7978fd9b67d224e9dec09867 (diff)
downloadu-boot-9f0a6df3a57469061582c6b27fc869829681beca.zip
u-boot-9f0a6df3a57469061582c6b27fc869829681beca.tar.gz
u-boot-9f0a6df3a57469061582c6b27fc869829681beca.tar.bz2
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
- DM ACPI support (Part A) - Improve support for chain-loading x86 U-Boot
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_table.h65
-rw-r--r--include/asm-generic/global_data.h1
-rw-r--r--include/cbfs.h2
-rw-r--r--include/dm/acpi.h37
-rw-r--r--include/init.h2
5 files changed, 105 insertions, 2 deletions
diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h
index 194be9a..3681c5c 100644
--- a/include/acpi/acpi_table.h
+++ b/include/acpi/acpi_table.h
@@ -23,6 +23,8 @@
#if !defined(__ACPI__)
+struct acpi_ctx;
+
/*
* RSDP (Root System Description Pointer)
* Note: ACPI 1.0 didn't have length, xsdt_address, and ext_checksum
@@ -505,6 +507,69 @@ int acpi_get_table_revision(enum acpi_tables table);
*/
int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags);
+/**
+ * acpi_fill_header() - Set up a new table header
+ *
+ * This sets all fields except length, revision, checksum and aslc_revision
+ *
+ * @header: ACPI header to update
+ * @signature: Table signature to use (4 characters)
+ */
+void acpi_fill_header(struct acpi_table_header *header, char *signature);
+
+/**
+ * acpi_align() - Align the ACPI output pointer to a 16-byte boundary
+ *
+ * @ctx: ACPI context
+ */
+void acpi_align(struct acpi_ctx *ctx);
+
+/**
+ * acpi_align64() - Align the ACPI output pointer to a 64-byte boundary
+ *
+ * @ctx: ACPI context
+ */
+void acpi_align64(struct acpi_ctx *ctx);
+
+/**
+ * acpi_inc() - Increment the ACPI output pointer by a bit
+ *
+ * The pointer is NOT aligned afterwards.
+ *
+ * @ctx: ACPI context
+ * @amount: Amount to increment by
+ */
+void acpi_inc(struct acpi_ctx *ctx, uint amount);
+
+/**
+ * acpi_inc_align() - Increment the ACPI output pointer by a bit and align
+ *
+ * The pointer is aligned afterwards to a 16-byte boundary
+ *
+ * @ctx: ACPI context
+ * @amount: Amount to increment by
+ */
+void acpi_inc_align(struct acpi_ctx *ctx, uint amount);
+
+/**
+ * acpi_add_table() - Add a new table to the RSDP and XSDT
+ *
+ * @ctx: ACPI context
+ * @table: Table to add
+ * @return 0 if OK, -E2BIG if too many tables
+ */
+int acpi_add_table(struct acpi_ctx *ctx, void *table);
+
+/**
+ * acpi_setup_base_tables() - Set up context along with RSDP, RSDT and XSDT
+ *
+ * Set up the context with the given start position. Some basic tables are
+ * always needed, so set them up as well.
+ *
+ * @ctx: Context to set up
+ */
+void acpi_setup_base_tables(struct acpi_ctx *ctx, void *start);
+
#endif /* !__ACPI__*/
#include <asm/acpi_table.h>
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index d9e220c..8c78792 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -166,5 +166,6 @@ typedef struct global_data {
#define GD_FLG_SPL_EARLY_INIT 0x04000 /* Early SPL init is done */
#define GD_FLG_LOG_READY 0x08000 /* Log system is ready for use */
#define GD_FLG_WDT_READY 0x10000 /* Watchdog is ready for use */
+#define GD_FLG_SKIP_LL_INIT 0x20000 /* Don't perform low-level init */
#endif /* __ASM_GENERIC_GBL_DATA_H */
diff --git a/include/cbfs.h b/include/cbfs.h
index f3bc8ca..d915f94 100644
--- a/include/cbfs.h
+++ b/include/cbfs.h
@@ -135,7 +135,7 @@ void file_cbfs_get_next(const struct cbfs_cachenode **file);
*/
const struct cbfs_cachenode *file_cbfs_find(const char *name);
-struct cbfs_priv *priv;
+struct cbfs_priv;
/**
* cbfs_find_file() - Find a file in a given CBFS
diff --git a/include/dm/acpi.h b/include/dm/acpi.h
index 4925791..7563a4c 100644
--- a/include/dm/acpi.h
+++ b/include/dm/acpi.h
@@ -25,6 +25,24 @@
#if !defined(__ACPI__)
/**
+ * struct acpi_ctx - Context used for writing ACPI tables
+ *
+ * This contains a few useful pieces of information used when writing
+ *
+ * @current: Current address for writing
+ * @rsdp: Pointer to the Root System Description Pointer, typically used when
+ * adding a new table. The RSDP holds pointers to the RSDT and XSDT.
+ * @rsdt: Pointer to the Root System Description Table
+ * @xsdt: Pointer to the Extended System Description Table
+ */
+struct acpi_ctx {
+ void *current;
+ struct acpi_rsdp *rsdp;
+ struct acpi_rsdt *rsdt;
+ struct acpi_xsdt *xsdt;
+};
+
+/**
* struct acpi_ops - ACPI operations supported by driver model
*/
struct acpi_ops {
@@ -38,6 +56,15 @@ struct acpi_ops {
* other error
*/
int (*get_name)(const struct udevice *dev, char *out_name);
+
+ /**
+ * write_tables() - Write out any tables required by this device
+ *
+ * @dev: Device to write
+ * @ctx: ACPI context to use
+ * @return 0 if OK, -ve on error
+ */
+ int (*write_tables)(const struct udevice *dev, struct acpi_ctx *ctx);
};
#define device_get_acpi_ops(dev) ((dev)->driver->acpi_ops)
@@ -72,6 +99,16 @@ int acpi_get_name(const struct udevice *dev, char *out_name);
*/
int acpi_copy_name(char *out_name, const char *name);
+/**
+ * acpi_write_dev_tables() - Write ACPI tables required by devices
+ *
+ * This scans through all devices and tells them to write any tables they want
+ * to write.
+ *
+ * @return 0 if OK, -ve if any device returned an error
+ */
+int acpi_write_dev_tables(struct acpi_ctx *ctx);
+
#endif /* __ACPI__ */
#endif
diff --git a/include/init.h b/include/init.h
index 9ef88c9..b5a167b 100644
--- a/include/init.h
+++ b/include/init.h
@@ -20,7 +20,7 @@ struct global_data;
#ifdef CONFIG_EFI_STUB
#define ll_boot_init() false
#else
-#define ll_boot_init() true
+#define ll_boot_init() (!(gd->flags & GD_FLG_SKIP_LL_INIT))
#endif
/*