summaryrefslogtreecommitdiff
path: root/arch/x86/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-11-04 19:57:27 +0300
committerBin Meng <bmeng.cn@gmail.com>2020-11-06 04:51:29 +0300
commit8bcfb7917a61ef8230d85b6efc5a272fd20637ff (patch)
tree26d0d9654029ea974bffb61e5f9c7c0e5513b7ce /arch/x86/lib
parenta87fff80eeaaac3653e3d3c63ca73298fd38c02c (diff)
downloadu-boot-8bcfb7917a61ef8230d85b6efc5a272fd20637ff.tar.xz
x86: nhlt: Fix a few bugs in the table generation
At present these tables do not have the correct header, and there is an occasional incorrect value due to uninited data. Fix these bugs. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/lib')
-rw-r--r--arch/x86/lib/acpi_nhlt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/lib/acpi_nhlt.c b/arch/x86/lib/acpi_nhlt.c
index 1c1ea27c8f..0e8e669c7d 100644
--- a/arch/x86/lib/acpi_nhlt.c
+++ b/arch/x86/lib/acpi_nhlt.c
@@ -68,6 +68,7 @@ struct nhlt_endpoint *nhlt_add_endpoint(struct nhlt *nhlt, int link_type,
endp->device_type = device_type;
endp->direction = dir;
endp->virtual_bus_id = DEFAULT_VIRTUAL_BUS_ID;
+ endp->num_formats = 0;
nhlt->num_endpoints++;
@@ -395,7 +396,7 @@ int nhlt_serialise_oem_overrides(struct acpi_ctx *ctx, struct nhlt *nhlt,
/* Create header */
header = (void *)ctx->current;
memset(header, '\0', sizeof(struct acpi_table_header));
- acpi_fill_header(header, "NHLT");
+ memcpy(header->signature, "NHLT", 4);
header->length = sz;
header->revision = acpi_get_table_revision(ACPITAB_NHLT);
@@ -408,6 +409,7 @@ int nhlt_serialise_oem_overrides(struct acpi_ctx *ctx, struct nhlt *nhlt,
memcpy(header->oem_table_id, oem_table_id, oem_table_id_len);
}
header->oem_revision = oem_revision;
+ memcpy(header->aslc_id, ASLC_ID, 4);
cur.buf = (void *)(header + 1);
cur.start = (void *)header;