162306a36Sopenharmony_ci.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci=================
462306a36Sopenharmony_ciDevlink Selftests
562306a36Sopenharmony_ci=================
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciThe ``devlink-selftests`` API allows executing selftests on the device.
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciTests Mask
1062306a36Sopenharmony_ci==========
1162306a36Sopenharmony_ciThe ``devlink-selftests`` command should be run with a mask indicating
1262306a36Sopenharmony_cithe tests to be executed.
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ciTests Description
1562306a36Sopenharmony_ci=================
1662306a36Sopenharmony_ciThe following is a list of tests that drivers may execute.
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci.. list-table:: List of tests
1962306a36Sopenharmony_ci   :widths: 5 90
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci   * - Name
2262306a36Sopenharmony_ci     - Description
2362306a36Sopenharmony_ci   * - ``DEVLINK_SELFTEST_FLASH``
2462306a36Sopenharmony_ci     - Devices may have the firmware on non-volatile memory on the board, e.g.
2562306a36Sopenharmony_ci       flash. This particular test helps to run a flash selftest on the device.
2662306a36Sopenharmony_ci       Implementation of the test is left to the driver/firmware.
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ciexample usage
2962306a36Sopenharmony_ci-------------
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci.. code:: shell
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci    # Query selftests supported on the devlink device
3462306a36Sopenharmony_ci    $ devlink dev selftests show DEV
3562306a36Sopenharmony_ci    # Query selftests supported on all devlink devices
3662306a36Sopenharmony_ci    $ devlink dev selftests show
3762306a36Sopenharmony_ci    # Executes selftests on the device
3862306a36Sopenharmony_ci    $ devlink dev selftests run DEV id flash
39