From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F6D1C6FA99 for ; Wed, 8 Mar 2023 00:33:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A1F6F85C86; Wed, 8 Mar 2023 01:33:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com 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=linux.microsoft.com header.i=@linux.microsoft.com header.b="EM0/p41H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4BBEC85B6A; Wed, 8 Mar 2023 01:32:50 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by phobos.denx.de (Postfix) with ESMTP id 8E91485C66 for ; Wed, 8 Mar 2023 01:32:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=stcarlso@linux.microsoft.com Received: from STCARLSO-0732.corp.microsoft.com (unknown [131.107.159.124]) by linux.microsoft.com (Postfix) with ESMTPSA id 1600A20C14DA for ; Tue, 7 Mar 2023 16:32:39 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1600A20C14DA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1678235559; bh=DNX75Y6t6rq56u5qLtsRscbWwNFVex8OP5cl2SDNaXY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EM0/p41HR/vw8D+254eBZoo+Q8gc6b769I2Xpehj4WCPSLjg9eJrbfjcxBvW4z39k dOtis3ymiDQ7Y0uk079aacDZBTqaBX0MjJQoF0EsJqmQ3H06izNGvdeIGvl/sBaoJ8 pzqcxwX10Qjn5KgPH2zsoOEaJTB/t9JWzsdNjhKI= From: stcarlso@linux.microsoft.com To: u-boot@lists.denx.de Subject: [PATCH 3/3] test: Add test for new command pci_mps Date: Tue, 7 Mar 2023 16:32:34 -0800 Message-Id: <20230308003234.465014-4-stcarlso@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308003234.465014-1-stcarlso@linux.microsoft.com> References: <20230308003234.465014-1-stcarlso@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Stephen Carlson Adds a test for the new pci_mps command to ensure that it can set the Maximum Payload Size (MPS) of all devices to 256 bytes in the sandbox environment. Enables the pci_mps command in the sandbox environment so that this test can be run. Signed-off-by: Stephen Carlson --- MAINTAINERS | 6 ++++++ configs/sandbox_defconfig | 1 + test/py/tests/test_pci_mps.py | 13 +++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 test/py/tests/test_pci_mps.py diff --git a/MAINTAINERS b/MAINTAINERS index 3e8e193ecc..83948b6aa7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1242,6 +1242,12 @@ M: Heiko Schocher S: Maintained F: drivers/pci/pci_mpc85xx.c +PCI MPS +M: Stephen Carlson +S: Maintained +F: cmd/pci_mps.c +F: test/py/tests/test_pci_mps.py + POWER M: Jaehoon Chung S: Maintained diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 34c342b6f5..cd6bb8e2c4 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -77,6 +77,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_MUX=y CONFIG_CMD_OSD=y CONFIG_CMD_PCI=y +CONFIG_CMD_PCI_MPS=y CONFIG_CMD_READ=y CONFIG_CMD_REMOTEPROC=y CONFIG_CMD_SPI=y diff --git a/test/py/tests/test_pci_mps.py b/test/py/tests/test_pci_mps.py new file mode 100644 index 0000000000..8d33490f9f --- /dev/null +++ b/test/py/tests/test_pci_mps.py @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0+ + +import pytest + +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_pci') +@pytest.mark.buildconfigspec('cmd_pci_mps') +def test_pci_mps_safe(u_boot_console): + """Tests that PCI MPS can be set to safe mode and uses 256 bytes.""" + + response = u_boot_console.run_command('pci e; pci_mps s') + expected_response = 'to 256B' + assert(expected_response in response) -- 2.25.1