From patchwork Sun Aug 13 19:52:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1820787 X-Patchwork-Delegate: sjg@chromium.org 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=ryvq3xPg; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256 header.s=mail20150812 header.b=Sz+B2Anj; 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RP7VT3V0Nz1yYC for ; Mon, 14 Aug 2023 05:52:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2776985F3D; Sun, 13 Aug 2023 21:52:47 +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="ryvq3xPg"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="Sz+B2Anj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B3E2386233; Sun, 13 Aug 2023 21:52:45 +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-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) (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 E05A480842 for ; Sun, 13 Aug 2023 21:52:28 +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 smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (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-103.mailbox.org (Postfix) with ESMTPS id 4RP7V44vzTz9sQN; Sun, 13 Aug 2023 21:52:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1691956348; 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=tiPOg+ZFazpGp1CYMqCQozQHqzjCXIKSJWJFaSzEDBs=; b=ryvq3xPgdZRqEW3Av/wxWlDVbhKWVIbPW019JGEuwrUmej5pBzmJDiLNhkm9QgdYLn0nog YSRBz+4IXKJqzvmMuXLCEf1LNadCp0KzjwWmqfIBkzaMFiMQnZFnxaF+uYcr6NOPhEEkOw 5CaSVpiWNne584j6e2n0kJq0zCYh+lhPdJ1U6HAIQMwUp4ypRX6r0sOs7Bx3yx3jsnn8mO 1BnMY3RvsRTtl2/Bx6Sbq8p4yNrNmnWgWfFZs/+k7L9sKKgKtHCNwIKoJSBHDZkLpkmfzD +0ZU/HEsWKadPoY4gaQwomHr2bEE88fnKaB9WTZGNjfwD2Or9b8mGbQQpMb7Rw== From: Marek Vasut DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1691956346; 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=tiPOg+ZFazpGp1CYMqCQozQHqzjCXIKSJWJFaSzEDBs=; b=Sz+B2AnjosDI9vgTeyCtI8NO8LvlLkQi0gfGexTptzRPoaVLXT3kFyXtNnwy+mi0Y4DJcS XGphaJMutZaYjCUqsQAR1yRMqG8BeA1v+N3bIP0Z4Py6k2i0vtCznsPqq5aI71AqsKWp1e r1BmhDroWmrHX6m8rzUOkYLo5CCwfBkh1gZIakqKpWKkWqRaXF/AxRsuZHKd/XcPBjCViL w+um0dKu3jOX1HJnAmmLIu6Ntt97Wopr56lDj35PocBJJIRG0QaNx2fsmHiTPA6DVH9aJL OUi4hKfyrPPxKfOZLTDvElATBp+KEpkiOJ4rTdDhTDNdOQfiaSkOS/zMRUpTpQ== To: u-boot@lists.denx.de Cc: Marek Vasut , Simon Glass Subject: [PATCH] test: cpu: Handle both 32bit and 64bit CPUs Date: Sun, 13 Aug 2023 21:52:19 +0200 Message-Id: <20230813195219.159629-1-marek.vasut+renesas@mailbox.org> MIME-Version: 1.0 X-MBO-RS-META: r7hresktwsxdshxoqihibmuh8neqfk6f X-MBO-RS-ID: a375a44441a138866af 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 does, that is in case CONFIG_PHYS_64BIT is enabled, assume 64bit address width, else assume 32bit address width. This fixes ut_dm_dm_test_cpu test failure on sandbox64. Signed-off-by: Marek Vasut Reviewed-by: Simon Glass Reviewed-by: Simon Glass --- Cc: Simon Glass --- test/dm/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dm/cpu.c b/test/dm/cpu.c index d7e596ee396..5734cd0a92d 100644 --- a/test/dm/cpu.c +++ b/test/dm/cpu.c @@ -37,7 +37,7 @@ static int dm_test_cpu(struct unit_test_state *uts) ut_assertok(cpu_get_info(dev, &info)); ut_asserteq(info.cpu_freq, 42 * 42 * 42 * 42 * 42); ut_asserteq(info.features, 0x42424242); - ut_asserteq(info.address_width, 32); + ut_asserteq(info.address_width, IS_ENABLED(CONFIG_PHYS_64BIT) ? 64 : 32); ut_asserteq(cpu_get_count(dev), 42);