blob: 3c354163ef3b11c65bc174b494631a9c19ee5ff4 [file] [log] [blame]
Asherah Connorab1975b2021-03-19 18:21:41 +11001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2021 Asherah Connor <ashe@kivikakk.ee>
4 */
5
Asherah Connorab1975b2021-03-19 18:21:41 +11006#include <qfw.h>
7#include <dm.h>
8#include <asm/test.h>
9#include <dm/test.h>
10#include <test/ut.h>
11
12/*
13 * Exercise the device enough to be satisfied the initialisation and DMA
14 * interfaces work.
15 */
16
17static int dm_test_qfw_cpus(struct unit_test_state *uts)
18{
19 struct udevice *dev;
20
21 ut_assertok(uclass_first_device_err(UCLASS_QFW, &dev));
22 ut_asserteq(5, qfw_online_cpus(dev));
23
24 return 0;
25}
26
27DM_TEST(dm_test_qfw_cpus, UT_TESTF_SCAN_PDATA);
28
29static int dm_test_qfw_firmware_list(struct unit_test_state *uts)
30{
31 struct udevice *dev;
32 struct fw_file *file;
33
34 ut_assertok(uclass_first_device_err(UCLASS_QFW, &dev));
35 ut_assertok(qfw_read_firmware_list(dev));
36 ut_assertok_ptr((file = qfw_find_file(dev, "test-one")));
37
38 return 0;
39}
40
41DM_TEST(dm_test_qfw_firmware_list, UT_TESTF_SCAN_PDATA);