From patchwork Sun Aug 13 01:25:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1820649 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256 header.s=mail20150812 header.b=nZy8o6W3; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256 header.s=mail20150812 header.b=kcAttg9Y; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RNfxp0hL3z1yfS for ; Sun, 13 Aug 2023 11:26:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4239180805; Sun, 13 Aug 2023 03:26:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=mailbox.org header.i=@mailbox.org header.b="nZy8o6W3"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="kcAttg9Y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DFE9A80834; Sun, 13 Aug 2023 03:26:17 +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.1 required=5.0 tests=BAYES_00,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 mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 13FEA807F1 for ; Sun, 13 Aug 2023 03:26:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.vasut+renesas@mailbox.org Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4RNfxf50l8z9sX0; Sun, 13 Aug 2023 03:26:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1691889974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gmMZw5VveMdXWTiQeH77FTIykjwuLm8ISZ92ZIDupQE=; b=nZy8o6W3ErZg+kaiLJKJpNTCH+wA3/ZgQOuDAy9oQkqNblRB+gxKAGz+HMfhhS7yoGEDAE xmHuVocVNyxy4VprO7j3flK4payYfNHm2r20uNxry2Dn0NJcCQe3Uu9pOKYZGE5SDQOmO7 gvXa5f3XnuuJyzEkOdYNN3QvWQAawkruhIJUni2gX9trYmfcQSienR2As0yR9ADFghgO9S 9GBmKZMPLbjYqTq7QUY8oQawQ7y6ehC3C21oPOS65foFdMVPlUtUtQz9zWg1vUfIcadgD8 I215SfgzX+FrvyZC4azXGuDOAhm1hScJqZjsQPLwYMcJJMfHb34lKcVCyZVTew== From: Marek Vasut DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1691889972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gmMZw5VveMdXWTiQeH77FTIykjwuLm8ISZ92ZIDupQE=; b=kcAttg9YZbyr3jhlzmwRJ4cbeanPXAkHx2zYkaA7Lt/QeCCEQYnBO8TR91SUAXZZrys+vB lM8c81W0KVXt52aFi/DUei8o6jeWGln1pvTaOGH4x87R/XZfFmceL3tHLBiFlLehsP8UmX RlPIa/ucPD9E3rGfYPD/4xI5lVLV9ZHwMMxOoiEie3P9fqpeysGqMJgjw9/6xr2tjisbsf JIXJxPDc3wQCHl8wKzvsteSxBZ+rUj5c1OxGoDr7reLCKxE1AaP5TEURhSpysFtE/nMSGN EqB3nAlmGzDarKrVGK7HMdhrQX9WqbvShlwy8v6zE/Fo8qJj/pa/AqlIk6U/dQ== To: u-boot@lists.denx.de Cc: Marek Vasut , Simon Glass Subject: [PATCH] test: acpi: Handle both 32bit and 64bit ACPI tables Date: Sun, 13 Aug 2023 03:25:59 +0200 Message-Id: <20230813012559.361067-1-marek.vasut+renesas@mailbox.org> MIME-Version: 1.0 X-MBO-RS-META: u38a8g7p64rbope6r15sky577u6buerm X-MBO-RS-ID: 09c75be8b9eb3f2c4d1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Handle both 32bit and 64bit systems, i.e. sandbox and sandbox64 the same way drivers/cpu/cpu_sandbox.c sets those ACPI tables up. This fixes "$ ./u-boot -Tc 'ut dm dm_test_acpi_write_tables'" test failure on sandbox64. Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- Cc: Simon Glass --- test/dm/acpi.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/dm/acpi.c b/test/dm/acpi.c index 77eb524b59f..5997bda649b 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -221,7 +221,8 @@ static int dm_test_acpi_create_dmar(struct unit_test_state *uts) ut_assertnonnull(cpu); ut_assertok(acpi_create_dmar(&dmar, DMAR_INTR_REMAP)); ut_asserteq(DMAR_INTR_REMAP, dmar.flags); - ut_asserteq(32 - 1, dmar.host_address_width); + ut_asserteq((IS_ENABLED(CONFIG_PHYS_64BIT) ? 64 : 32) - 1, + dmar.host_address_width); return 0; } @@ -277,13 +278,16 @@ static int dm_test_acpi_write_tables(struct unit_test_state *uts) */ ut_asserteq_ptr(dmar + 3, ctx.current); ut_asserteq(DMAR_INTR_REMAP, dmar->flags); - ut_asserteq(32 - 1, dmar->host_address_width); + ut_asserteq((IS_ENABLED(CONFIG_PHYS_64BIT) ? 64 : 32) - 1, + dmar->host_address_width); ut_asserteq(DMAR_INTR_REMAP, dmar[1].flags); - ut_asserteq(32 - 1, dmar[1].host_address_width); + ut_asserteq((IS_ENABLED(CONFIG_PHYS_64BIT) ? 64 : 32) - 1, + dmar[1].host_address_width); ut_asserteq(DMAR_INTR_REMAP, dmar[2].flags); - ut_asserteq(32 - 1, dmar[2].host_address_width); + ut_asserteq((IS_ENABLED(CONFIG_PHYS_64BIT) ? 64 : 32) - 1, + dmar[2].host_address_width); /* Check that the pointers were added correctly */ for (i = 0; i < 3; i++) {