mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
dm: Allow driver model tests only for sandbox
The GPIO tests require the sandbox GPIO driver, so cannot be run on other platforms. Similarly for the 'dm test' command. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
89876a55a6
commit
b6a49a7ae7
2 changed files with 11 additions and 2 deletions
|
@ -15,4 +15,6 @@ obj-$(CONFIG_DM_TEST) += ut.o
|
||||||
# subsystem you must add sandbox tests here.
|
# subsystem you must add sandbox tests here.
|
||||||
obj-$(CONFIG_DM_TEST) += core.o
|
obj-$(CONFIG_DM_TEST) += core.o
|
||||||
obj-$(CONFIG_DM_TEST) += ut.o
|
obj-$(CONFIG_DM_TEST) += ut.o
|
||||||
|
ifneq ($(CONFIG_SANDBOX),)
|
||||||
obj-$(CONFIG_DM_GPIO) += gpio.o
|
obj-$(CONFIG_DM_GPIO) += gpio.o
|
||||||
|
endif
|
||||||
|
|
|
@ -93,16 +93,23 @@ static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_DM_TEST
|
||||||
static int do_dm_test(cmd_tbl_t *cmdtp, int flag, int argc,
|
static int do_dm_test(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
char * const argv[])
|
char * const argv[])
|
||||||
{
|
{
|
||||||
return dm_test_main();
|
return dm_test_main();
|
||||||
}
|
}
|
||||||
|
#define TEST_HELP "\ndm test Run tests"
|
||||||
|
#else
|
||||||
|
#define TEST_HELP
|
||||||
|
#endif
|
||||||
|
|
||||||
static cmd_tbl_t test_commands[] = {
|
static cmd_tbl_t test_commands[] = {
|
||||||
U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""),
|
U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""),
|
||||||
U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""),
|
U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""),
|
||||||
|
#ifdef CONFIG_DM_TEST
|
||||||
U_BOOT_CMD_MKENT(test, 1, 1, do_dm_test, "", ""),
|
U_BOOT_CMD_MKENT(test, 1, 1, do_dm_test, "", ""),
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
@ -128,6 +135,6 @@ U_BOOT_CMD(
|
||||||
dm, 2, 1, do_dm,
|
dm, 2, 1, do_dm,
|
||||||
"Driver model low level access",
|
"Driver model low level access",
|
||||||
"tree Dump driver model tree\n"
|
"tree Dump driver model tree\n"
|
||||||
"dm uclass Dump list of instances for each uclass\n"
|
"dm uclass Dump list of instances for each uclass"
|
||||||
"dm test Run tests"
|
TEST_HELP
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue