From patchwork Mon Sep 28 04:25:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1372336 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=GM7YPs2N; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C08gQ12yMz9sSn for ; Mon, 28 Sep 2020 14:29:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F1E858242B; Mon, 28 Sep 2020 06:27:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GM7YPs2N"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 54692823B0; Mon, 28 Sep 2020 06:26:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B6D8C823BE for ; Mon, 28 Sep 2020 06:26:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x244.google.com with SMTP id w16so10245571oia.2 for ; Sun, 27 Sep 2020 21:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mF2L10UH/Fm+tdKhgC7kPI+7jyOc1SHnKs146xaGNLc=; b=GM7YPs2N9VBmVJpmgN5EfaivohnVlkszjjQist0GLwFM3fcDY9DwcaeMvRPuqjEUMg 1B47mPAE7HhuntZHLJeKO8E923EwzafXhUCe0oHC0NBbRU6dY9LVegh6MMYPTBS4XhqM c1TM6Nx4i9TTDD62l3yyLeGNu9ebloP1Dijv4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mF2L10UH/Fm+tdKhgC7kPI+7jyOc1SHnKs146xaGNLc=; b=cKX/SBn6bdv7GwTaFzquv7OmeCm00OOriSgUsHMIBuHo1ev6q5N1qxeqGr+SC/LHL5 fFp1t/SSM1D9dF/mTVGMFky3upOTJhguLN8dUjbKFDn2hoWOBuES3+H9R9wO6m6ppaz5 lxSxVe7t9GqOTEKKhsNt6XXVEua7OUMy6p4Wq6/zGvQaDbqorxF7eSfJ9QpV5FHVwimT JT7Ntxu+Y3UZU9kgxa11B620lIfHvUo9owTOEN8UFIy88oU3dBM+EbCxIuKZusgulCey SlwTmsHh/BExntqW4/czBmVFNPLDssZ/KFhz8xlxOjtAGcP1gTFIhSDUdLwUAlYavavK bpiQ== X-Gm-Message-State: AOAM531jZuqnpNDwZ9i7JaA5Eu0aSNNy7U0PlBkTDzVZN6SKfOQ/n+Fa Kg2L5C9/wkRqjM6DTktc05Xwl4A+6cDi1b+E X-Google-Smtp-Source: ABdhPJzEqBl9834xmLkeQwcKe/5V5AJ4EQ0TY1jxrYvgLBLuuTETLqh537J4Mh8lDcKS5ZM7v+N3Ig== X-Received: by 2002:aca:52d6:: with SMTP id g205mr4950039oib.54.1601267195447; Sun, 27 Sep 2020 21:26:35 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id k51sm2620579otc.46.2020.09.27.21.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Sep 2020 21:26:35 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 16/32] x86: nhlt: Fix a few bugs in the table generation Date: Sun, 27 Sep 2020 22:25:55 -0600 Message-Id: <20200928042611.1696178-15-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog In-Reply-To: <20200928042611.1696178-1-sjg@chromium.org> References: <20200928042611.1696178-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean 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 --- 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;