From patchwork Wed Dec 1 16:03:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1562303 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=RJUDLsxw; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4J443H4jchz9sRN for ; Thu, 2 Dec 2021 03:16:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C12D88319B; Wed, 1 Dec 2021 17:14:26 +0100 (CET) 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="RJUDLsxw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 934EE830FC; Wed, 1 Dec 2021 17:05:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) (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 8E5DD830D3 for ; Wed, 1 Dec 2021 17:04:44 +0100 (CET) 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-oo1-xc2d.google.com with SMTP id p2-20020a4adfc2000000b002c2676904fdso7955074ood.13 for ; Wed, 01 Dec 2021 08:04:44 -0800 (PST) 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=b7r6EpDrw9FCE/SHpLprITT9XFtytZVeVB02OmlzWIc=; b=RJUDLsxwFbosGR12K3AJN/9vDL90sDBtQC34bEHI3Dj9fy2CE5ufM5esLSGIlkj7Dd HhrpXXMKvUiz6LFNQUgougNXs336LXma01Lc+Xwb0zW6Jmh5mNB7bk5GXliASXJDXGXP f3aADjfhZz5h9qXX9v2tlqsdvtBHpRn7lQeHY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b7r6EpDrw9FCE/SHpLprITT9XFtytZVeVB02OmlzWIc=; b=05HEJKJZGqdupZoAddrnwUNDs/dkDGYF/ndGpcaGM103JoaeIV9ndnq5KSDBSVXYNU YzdvTRiqaII6rq6HapaWaZqIJBV+FtAd7V3djJerjx0il+FvzXnFuUL60s0pxMcZ5lDm C08FDdt+wCbObpVF84umPyMbN37V0CvKZbfuR9Sq7MsN2h2iO/jMqujqgb0c+IgiOKG7 dvIqbhB6g+hF7Aj2I66MNGYoszs7epoRxHmOf5CS3hJB/Lek9QTPT4YrtxvxAV1IKvTJ tu5TBPw3u+uAy4U/GsUunHVDnnygS7t0UchnigI+ptEVpbIdOMaCLOoeluXsNu1XLfLc gi5Q== X-Gm-Message-State: AOAM532Q6ZbVmsk4KfKFfPm1LRkkEw3UA9i+HPfwGHXMnH2i/YljcrMU p91Ba9xkRAv77Ka/8qFlvyrm1In1fpzkPA== X-Google-Smtp-Source: ABdhPJy0f9mR00m1Czxv0GwQOmZ6zJVTNae7I372EPxlLgWhd8jRSTXF86drqA2cSraLQa7Tsj76JA== X-Received: by 2002:a4a:1d82:: with SMTP id 124mr4840096oog.91.1638374683081; Wed, 01 Dec 2021 08:04:43 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a3sm89902oil.32.2021.12.01.08.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Dec 2021 08:04:42 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Bin Meng , =?utf-8?q?Marek_Beh=C3=BAn?= , Simon Glass , =?utf-8?q?Pali_Roh=C3=A1r?= Subject: [PATCH 28/40] x86: Move device-specific ACPI tables to a writer function Date: Wed, 1 Dec 2021 09:03:02 -0700 Message-Id: <20211201160315.2203099-29-sjg@chromium.org> X-Mailer: git-send-email 2.34.0.rc2.393.gf8c9666880-goog In-Reply-To: <20211201160315.2203099-1-sjg@chromium.org> References: <20211201160315.2203099-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 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.103.2 at phobos.denx.de X-Virus-Status: Clean Move this over to use a writer function, moving the code from the x86 implementation. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- arch/x86/lib/acpi_table.c | 2 -- lib/acpi/acpi_writer.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c index b7557f7f3fd..8275c36ad31 100644 --- a/arch/x86/lib/acpi_table.c +++ b/arch/x86/lib/acpi_table.c @@ -519,8 +519,6 @@ ACPI_WRITER(5mcfg, "MCFG", acpi_write_mcfg, 0); int write_acpi_tables_x86(struct acpi_ctx *ctx, const struct acpi_writer *entry) { - acpi_write_dev_tables(ctx); - acpi_rsdp_addr = (unsigned long)ctx->rsdp; debug("ACPI: done\n"); diff --git a/lib/acpi/acpi_writer.c b/lib/acpi/acpi_writer.c index d2505e6eaa4..59f951cba45 100644 --- a/lib/acpi/acpi_writer.c +++ b/lib/acpi/acpi_writer.c @@ -90,6 +90,18 @@ ulong write_acpi_tables(ulong start_addr) return addr; } + +int write_dev_tables(struct acpi_ctx *ctx, const struct acpi_writer *entry) +{ + int ret; + + ret = acpi_write_dev_tables(ctx); + if (ret) + return log_msg_ret("write", ret); + + return 0; +} +ACPI_WRITER(8dev, NULL, write_dev_tables, 0); #endif /* QEMU */ void acpi_setup_ctx(struct acpi_ctx *ctx, ulong start)