u-boot/test/cmd/pci_mps.c
Tom Rini d678a59d2d Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d, reversing
changes made to 2ee6f3a5f7.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19 08:16:36 -06:00

43 lines
1.1 KiB
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Tests that the PCI Maximum Payload Size (MPS) command can set the sandbox
* PCI Express device to safe mode and determine the correct payload size.
*
* Copyright 2023 Microsoft
* Written by Stephen Carlson <stcarlso@linux.microsoft.com>
*/
#include <common.h>
#include <console.h>
#include <test/suites.h>
#include <test/ut.h>
#define PCI_MPS_TEST(_name, _flags) UNIT_TEST(_name, _flags, pci_mps_test)
/* Test "pci_mps" command in safe "s" mode */
static int test_pci_mps_safe(struct unit_test_state *uts)
{
/* Enumerate PCI Express first */
ut_assertok(run_command("pci e", 0));
ut_assert_console_end();
/* Test pci_mps s */
ut_assertok(run_command("pci_mps s", 0));
ut_assert_nextline("Setting MPS of all devices to 256B");
ut_assert_console_end();
return 0;
}
PCI_MPS_TEST(test_pci_mps_safe, UT_TESTF_CONSOLE_REC);
int do_ut_pci_mps(struct cmd_tbl *cmdtp, int flag, int argc,
char * const argv[])
{
struct unit_test *tests = UNIT_TEST_SUITE_START(pci_mps_test);
const int n = UNIT_TEST_SUITE_COUNT(pci_mps_test);
return cmd_ut_category("cmd_pci_mps", "pci_mps_test_", tests, n,
argc, argv);
}