Message ID | 20200426092529.v8.32.I8b14735c2286701cc6be7d36b85bbad8ca58babd@changeid |
---|---|
State | Superseded |
Delegated to: | Bin Meng |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) 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=jaev1BHQ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 499BkS0hc7z9sRY for <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2020 01:33:04 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 711AD81D7D; Sun, 26 Apr 2020 17:30:31 +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="jaev1BHQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B3D8F81D72; Sun, 26 Apr 2020 17:27:26 +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.0 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-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 087AD81D6F for <u-boot@lists.denx.de>; Sun, 26 Apr 2020 17:26:55 +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-il1-x141.google.com with SMTP id s10so14294089iln.11 for <u-boot@lists.denx.de>; Sun, 26 Apr 2020 08:26:54 -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=t2UvrmMZ0PpIUraklFM4a2TN9ePyTd20GXQ/4QE8xCU=; b=jaev1BHQmJLw7j7qLKAyhV/Ng6PSEGQzXW8QBIUgErdlWHw36PMczthCB0c+5Va4Gf iYy3b+et5swatylPe9bDTSZ+0hI5CkYFM1IGUnz+tE7JefykBpL+PBvj0IWTq09A3fKA +ukqXWeZbuTokhCKyUbXXCDsfFE+NY/zfMJbE= 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=t2UvrmMZ0PpIUraklFM4a2TN9ePyTd20GXQ/4QE8xCU=; b=Q50VmmehX2kx/Z/7y4zjW5HTv7NSqN31UbHB1Haf8zJec5Ngry5thGUo9GkwI3MMv8 1wUPC3n23NiogYW/40AmRnhMftXeXIPtu+3oU/9BKrRDJJ+7Y1HFrcmhlp8xU6pPt07w GyjErQ97AjuW54gWzxL/ZMW5GsXB/K+dFQ7rez3a96cTOuxiphT393x6pMfnAZVUwC6R mGulvO7dRYnpmfNl22Ano6XhFMgd98IXO1zTua1QbwrkHQtV63vJsU+zvWPYM3aigup8 bxsjT5QcT0HKFKaarps2ZXxVs1WfYOXtMze4wKNeW9Uor2C+NFRaOurJucNbVgZCePZn rSQQ== X-Gm-Message-State: AGi0PuY+TW6c4YJ1Ji7rtzi4NfTXzkxHlTS2mnx8ucIbUEOvO3+gIGvq jfbJ2l4qIoUgT8ZsiDgARkmBfZ7dXF5K4g== X-Google-Smtp-Source: APiQypKAlc6ohapbAlj9znevMGoIAf9IogM1D84kxVDxH1eXJEUX5NEOQKMhdKnMlY+ENvp0wdKlzg== X-Received: by 2002:a92:d1c4:: with SMTP id u4mr15432659ilg.183.1587914813737; Sun, 26 Apr 2020 08:26:53 -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 r16sm4437069ilb.32.2020.04.26.08.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 08:26:53 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Wolfgang Wallner <wolfgang.wallner@br-automation.com>, Bin Meng <bmeng.cn@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Simon Glass <sjg@chromium.org> Subject: [PATCH v8 32/35] x86: Allow devices to write to DSDT Date: Sun, 26 Apr 2020 09:26:15 -0600 Message-Id: <20200426092529.v8.32.I8b14735c2286701cc6be7d36b85bbad8ca58babd@changeid> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200426152618.125646-1-sjg@chromium.org> References: <20200426152618.125646-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
dm: Add programmatic generation of ACPI tables (part B)
|
expand
|
diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c index 0af9d47050..8587ed4344 100644 --- a/arch/x86/lib/acpi_table.c +++ b/arch/x86/lib/acpi_table.c @@ -431,7 +431,20 @@ ulong write_acpi_tables(ulong start_addr) memcpy(ctx->current, (char *)&AmlCode + sizeof(struct acpi_table_header), dsdt->length - sizeof(struct acpi_table_header)); - acpi_inc_align(ctx, dsdt->length - sizeof(struct acpi_table_header)); + + if (dsdt->length >= sizeof(struct acpi_table_header)) { + acpi_inject_dsdt(ctx); + memcpy(ctx->current, + (char *)AmlCode + sizeof(struct acpi_table_header), + dsdt->length - sizeof(struct acpi_table_header)); + acpi_inc(ctx, dsdt->length - sizeof(struct acpi_table_header)); + + /* (Re)calculate length and checksum. */ + dsdt->length = ctx->current - (void *)dsdt; + dsdt->checksum = 0; + dsdt->checksum = table_compute_checksum(dsdt, dsdt->length); + } + acpi_align(ctx); /* Pack GNVS into the ACPI table area */ for (i = 0; i < dsdt->length; i++) {
Call the new core function to inject ASL programmatically into the DSDT. This is made up of fragments generated by devices that have the inject_dsdt() method. The normal, compiled ASL file is added after this. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v8: None Changes in v3: None Changes in v2: None arch/x86/lib/acpi_table.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)