1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2013 Google, Inc
6 * Marek Vasut <marex@denx.de>
19 static int do_dm_dump_all(cmd_tbl_t *cmdtp, int flag, int argc,
27 static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int argc,
35 static int do_dm_dump_devres(cmd_tbl_t *cmdtp, int flag, int argc,
43 static cmd_tbl_t test_commands[] = {
44 U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""),
45 U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""),
46 U_BOOT_CMD_MKENT(devres, 1, 1, do_dm_dump_devres, "", ""),
49 static __maybe_unused void dm_reloc(void)
54 fixup_cmdtable(test_commands, ARRAY_SIZE(test_commands));
59 static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
64 #ifdef CONFIG_NEEDS_MANUAL_RELOC
70 test_cmd = find_cmd_tbl(argv[1], test_commands,
71 ARRAY_SIZE(test_commands));
74 if (!test_cmd || argc > test_cmd->maxargs)
77 ret = test_cmd->cmd(test_cmd, flag, argc, argv);
79 return cmd_process_error(test_cmd, ret);
84 "Driver model low level access",
85 "tree Dump driver model tree ('*' = activated)\n"
86 "dm uclass Dump list of instances for each uclass\n"
87 "dm devres Dump list of device resources for each device"