3 * Texas Instruments Incorporated - http://www.ti.com/
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <remoteproc.h>
13 * dm_test_remoteproc_base() - test the operations after initializations
14 * @uts: unit test state
16 * Return: 0 if test passed, else error
18 static int dm_test_remoteproc_base(struct unit_test_state *uts)
20 if (!rproc_is_initialized())
21 ut_assertok(rproc_init());
23 /* Ensure we are initialized */
24 ut_asserteq(true, rproc_is_initialized());
27 /* platform data device 1 */
28 ut_assertok(rproc_stop(0));
29 ut_assertok(rproc_reset(0));
30 /* -> invalid attempt tests */
31 ut_asserteq(-EINVAL, rproc_start(0));
32 ut_asserteq(-EINVAL, rproc_ping(0));
34 ut_assertok(rproc_load(0, 1, 0));
35 ut_assertok(rproc_start(0));
36 ut_assertok(rproc_is_running(0));
37 ut_assertok(rproc_ping(0));
38 ut_assertok(rproc_reset(0));
39 ut_assertok(rproc_stop(0));
41 /* dt device device 1 */
42 ut_assertok(rproc_stop(1));
43 ut_assertok(rproc_reset(1));
44 ut_assertok(rproc_load(1, 1, 0));
45 ut_assertok(rproc_start(1));
46 ut_assertok(rproc_is_running(1));
47 ut_assertok(rproc_ping(1));
48 ut_assertok(rproc_reset(1));
49 ut_assertok(rproc_stop(1));
51 /* dt device device 2 */
52 ut_assertok(rproc_stop(0));
53 ut_assertok(rproc_reset(0));
54 /* -> invalid attempt tests */
55 ut_asserteq(-EINVAL, rproc_start(0));
56 ut_asserteq(-EINVAL, rproc_ping(0));
58 ut_assertok(rproc_load(2, 1, 0));
59 ut_assertok(rproc_start(2));
60 ut_assertok(rproc_is_running(2));
61 ut_assertok(rproc_ping(2));
62 ut_assertok(rproc_reset(2));
63 ut_assertok(rproc_stop(2));
67 DM_TEST(dm_test_remoteproc_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);