blob: b6be5c5baa52de08c9af68ff372b49b5afa74996 [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}
Simon Glass1a92f832024-08-22 07:57:48 -060026DM_TEST(dm_test_qfw_cpus, UTF_SCAN_PDATA);
Asherah Connorab1975b2021-03-19 18:21:41 +110027
28static int dm_test_qfw_firmware_list(struct unit_test_state *uts)
29{
30 struct udevice *dev;
31 struct fw_file *file;
32
33 ut_assertok(uclass_first_device_err(UCLASS_QFW, &dev));
34 ut_assertok(qfw_read_firmware_list(dev));
35 ut_assertok_ptr((file = qfw_find_file(dev, "test-one")));
36
37 return 0;
38}
Simon Glass1a92f832024-08-22 07:57:48 -060039DM_TEST(dm_test_qfw_firmware_list, UTF_SCAN_PDATA);