public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
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	[thread overview]
Message-ID: <20230308003234.465014-4-stcarlso@linux.microsoft.com> (raw)
In-Reply-To: <20230308003234.465014-1-stcarlso@linux.microsoft.com>

From: Stephen Carlson <stcarlso@linux.microsoft.com>

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 <stcarlso@linux.microsoft.com>
---
 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 <hs@denx.de>
 S:	Maintained
 F:	drivers/pci/pci_mpc85xx.c
 
+PCI MPS
+M:	Stephen Carlson <stcarlso@linux.microsoft.com>
+S:	Maintained
+F:	cmd/pci_mps.c
+F:	test/py/tests/test_pci_mps.py
+
 POWER
 M:	Jaehoon Chung <jh80.chung@samsung.com>
 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


  parent reply	other threads:[~2023-03-08  0:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08  0:32 [PATCH 0/3] Add command to set MPS of all PCI Express devices stcarlso
2023-03-08  0:32 ` [PATCH 1/3] cmd: pci: Add command to set MPS of all PCIe devices stcarlso
2023-03-08  0:32 ` [PATCH 2/3] drivers: pci: sandbox: Add stub sandbox PCI MPS support stcarlso
2023-03-08  0:32 ` stcarlso [this message]
2023-03-08 17:16   ` [PATCH 3/3] test: Add test for new command pci_mps Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230308003234.465014-4-stcarlso@linux.microsoft.com \
    --to=stcarlso@linux.microsoft.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox