From: Simon Glass Date: Wed, 21 Oct 2020 21:02:47 -0600 Subject: [PATCH v2 14/30] x86: nhlt: Fix a few bugs in the table generation In-Reply-To: <20201022030303.584490-1-sjg@chromium.org> References: <20201022030303.584490-1-sjg@chromium.org> Message-ID: <20201022030303.584490-13-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/lib/acpi_nhlt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/lib/acpi_nhlt.c b/arch/x86/lib/acpi_nhlt.c index 968e2639f36..dda2af48af4 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; -- 2.29.0.rc1.297.gfa9743e501-goog