Blame view
cmd/dm.c
1.77 KB
83d290c56 SPDX: Convert all... |
1 |
// SPDX-License-Identifier: GPL-2.0+ |
068119597 dm: Add a 'dm' co... |
2 3 4 5 6 |
/* * Copyright (c) 2013 Google, Inc * * (C) Copyright 2012 * Marek Vasut <marex@denx.de> |
068119597 dm: Add a 'dm' co... |
7 8 9 |
*/ #include <common.h> |
cbb2df201 CONFIG_NEEDS_MANU... |
10 |
#include <command.h> |
068119597 dm: Add a 'dm' co... |
11 12 |
#include <dm.h> #include <malloc.h> |
0eb25b619 common: Make sure... |
13 |
#include <mapmem.h> |
068119597 dm: Add a 'dm' co... |
14 15 16 |
#include <errno.h> #include <asm/io.h> #include <dm/root.h> |
304fbef15 dm: Move the tree... |
17 |
#include <dm/util.h> |
a56642c7b dm_test: improve ... |
18 19 20 21 |
static int do_dm_dump_all(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { |
304fbef15 dm: Move the tree... |
22 |
dm_dump_all(); |
a56642c7b dm_test: improve ... |
23 24 25 |
return 0; } |
068119597 dm: Add a 'dm' co... |
26 27 28 |
static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { |
304fbef15 dm: Move the tree... |
29 |
dm_dump_uclass(); |
068119597 dm: Add a 'dm' co... |
30 31 32 |
return 0; } |
40b6f2d02 devres: add debug... |
33 34 35 36 37 38 39 |
static int do_dm_dump_devres(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { dm_dump_devres(); return 0; } |
068119597 dm: Add a 'dm' co... |
40 41 42 |
static cmd_tbl_t test_commands[] = { U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""), U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""), |
40b6f2d02 devres: add debug... |
43 |
U_BOOT_CMD_MKENT(devres, 1, 1, do_dm_dump_devres, "", ""), |
068119597 dm: Add a 'dm' co... |
44 |
}; |
d6df048bc dm: cmd: Relocate... |
45 46 47 48 49 50 51 52 53 |
static __maybe_unused void dm_reloc(void) { static int relocated; if (!relocated) { fixup_cmdtable(test_commands, ARRAY_SIZE(test_commands)); relocated = 1; } } |
068119597 dm: Add a 'dm' co... |
54 55 56 57 |
static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *test_cmd; int ret; |
d6df048bc dm: cmd: Relocate... |
58 59 60 |
#ifdef CONFIG_NEEDS_MANUAL_RELOC dm_reloc(); #endif |
57f54d55b dm: test: Allow '... |
61 |
if (argc < 2) |
068119597 dm: Add a 'dm' co... |
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
return CMD_RET_USAGE; test_cmd = find_cmd_tbl(argv[1], test_commands, ARRAY_SIZE(test_commands)); argc -= 2; argv += 2; if (!test_cmd || argc > test_cmd->maxargs) return CMD_RET_USAGE; ret = test_cmd->cmd(test_cmd, flag, argc, argv); return cmd_process_error(test_cmd, ret); } U_BOOT_CMD( |
57f54d55b dm: test: Allow '... |
76 |
dm, 3, 1, do_dm, |
068119597 dm: Add a 'dm' co... |
77 |
"Driver model low level access", |
138c8a756 dm: fix alignment... |
78 79 |
"tree Dump driver model tree ('*' = activated) " |
40b6f2d02 devres: add debug... |
80 81 82 |
"dm uclass Dump list of instances for each uclass " "dm devres Dump list of device resources for each device" |
068119597 dm: Add a 'dm' co... |
83 |
); |