aboutsummaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-12-31 08:25:54 -0700
committerSimon Glass <sjg@chromium.org>2024-01-07 13:45:07 -0700
commita8efebe71978b3b21e04c7f104987ada879e0800 (patch)
treebd0394b2a6d67b3e40d13fe538576e91259a1708 /arch/x86
parent5e3adc44a4da72b25fa78e9f9847a8c297b3ebaf (diff)
downloadu-boot-a8efebe71978b3b21e04c7f104987ada879e0800.zip
u-boot-a8efebe71978b3b21e04c7f104987ada879e0800.tar.gz
u-boot-a8efebe71978b3b21e04c7f104987ada879e0800.tar.bz2
acpi: Write pointers to tables instead of addresses
Sandbox uses an API to map between addresses and pointers. This allows it to have (emulated) memory at zero and avoid arch-specific addressing details. It also allows memory-mapped peripherals to work. As an example, on many machines sandbox maps address 100 to pointer value 10000000. However this is not correct for ACPI, if sandbox starts another program (e.g EFI app) and passes it the tables. That app has no knowledge of sandbox's address mapping. So to make this work we want to store 10000000 as the value in the table. Add two new 'nomap' functions which clearly make this exeption to how sandbox works. This should allow EFI apps to access ACPI tables with sandbox, e.g. for testing purposes. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/lib/acpi_table.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c
index c5b33dc..b366e44 100644
--- a/arch/x86/lib/acpi_table.c
+++ b/arch/x86/lib/acpi_table.c
@@ -197,7 +197,7 @@ int acpi_write_tcpa(struct acpi_ctx *ctx, const struct acpi_writer *entry)
tcpa->platform_class = 0;
tcpa->laml = size;
- tcpa->lasa = map_to_sysmem(log);
+ tcpa->lasa = nomap_to_sysmem(log);
/* (Re)calculate length and checksum */
current = (u32)tcpa + sizeof(struct acpi_tcpa);
@@ -268,7 +268,7 @@ static int acpi_write_tpm2(struct acpi_ctx *ctx,
/* Fill the log area size and start address fields. */
tpm2->laml = tpm2_log_len;
- tpm2->lasa = map_to_sysmem(lasa);
+ tpm2->lasa = nomap_to_sysmem(lasa);
/* Calculate checksum. */
header->checksum = table_compute_checksum(tpm2, header->length);
@@ -430,7 +430,7 @@ int acpi_write_gnvs(struct acpi_ctx *ctx, const struct acpi_writer *entry)
u32 *gnvs = (u32 *)((u32)ctx->dsdt + i);
if (*gnvs == ACPI_GNVS_ADDR) {
- *gnvs = map_to_sysmem(ctx->current);
+ *gnvs = nomap_to_sysmem(ctx->current);
log_debug("Fix up global NVS in DSDT to %#08x\n",
*gnvs);
break;