]> Git Repo - u-boot.git/blame - cmd/dm.c
mmc: fsl_esdhc_spl: Add support for builds without CONFIG_SYS_MMC_U_BOOT_OFFS
[u-boot.git] / cmd / dm.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
06811959
SG
2/*
3 * Copyright (c) 2013 Google, Inc
4 *
5 * (C) Copyright 2012
6 * Marek Vasut <[email protected]>
06811959
SG
7 */
8
9#include <common.h>
cbb2df20 10#include <command.h>
2cb4ddb9 11#include <dm/root.h>
304fbef1 12#include <dm/util.h>
a56642c7 13
dee2f5ae
SG
14static int do_dm_dump_driver_compat(struct cmd_tbl *cmdtp, int flag, int argc,
15 char * const argv[])
06811959 16{
dee2f5ae 17 dm_dump_driver_compat();
06811959
SG
18
19 return 0;
20}
21
09140113
SG
22static int do_dm_dump_devres(struct cmd_tbl *cmdtp, int flag, int argc,
23 char *const argv[])
40b6f2d0
MY
24{
25 dm_dump_devres();
26
27 return 0;
28}
29
09140113
SG
30static int do_dm_dump_drivers(struct cmd_tbl *cmdtp, int flag, int argc,
31 char *const argv[])
7b9d60fc
SA
32{
33 dm_dump_drivers();
34
35 return 0;
36}
37
2cb4ddb9
SG
38#if CONFIG_IS_ENABLED(DM_STATS)
39static int do_dm_dump_mem(struct cmd_tbl *cmdtp, int flag, int argc,
40 char *const argv[])
41{
42 struct dm_stats mem;
43
44 dm_get_mem(&mem);
45 dm_dump_mem(&mem);
46
47 return 0;
48}
49#endif /* DM_STATS */
50
dee2f5ae
SG
51static int do_dm_dump_static_driver_info(struct cmd_tbl *cmdtp, int flag,
52 int argc, char * const argv[])
2e488368 53{
dee2f5ae 54 dm_dump_static_driver_info();
2e488368
NF
55
56 return 0;
57}
58
dee2f5ae
SG
59static int do_dm_dump_tree(struct cmd_tbl *cmdtp, int flag, int argc,
60 char *const argv[])
2e488368 61{
dee2f5ae
SG
62 dm_dump_tree();
63
64 return 0;
65}
66
67static int do_dm_dump_uclass(struct cmd_tbl *cmdtp, int flag, int argc,
68 char *const argv[])
69{
70 dm_dump_uclass();
2e488368
NF
71
72 return 0;
73}
74
2cb4ddb9
SG
75#if CONFIG_IS_ENABLED(DM_STATS)
76#define DM_MEM_HELP "dm mem Provide a summary of memory usage\n"
77#define DM_MEM U_BOOT_SUBCMD_MKENT(mem, 1, 1, do_dm_dump_mem),
78#else
79#define DM_MEM_HELP
80#define DM_MEM
81#endif
82
7f0836a1
OP
83#if CONFIG_IS_ENABLED(SYS_LONGHELP)
84static char dm_help_text[] =
dee2f5ae 85 "compat Dump list of drivers with compatibility strings\n"
7b9d60fc 86 "dm devres Dump list of device resources for each device\n"
2e488368 87 "dm drivers Dump list of drivers with uclass and instances\n"
2cb4ddb9 88 DM_MEM_HELP
dee2f5ae 89 "dm static Dump list of drivers with static platform data\n"
a7091f3f 90 "dm tree Dump tree of driver model devices ('*' = activated)\n"
dee2f5ae 91 "dm uclass Dump list of instances for each uclass"
7f0836a1
OP
92 ;
93#endif
94
95U_BOOT_CMD_WITH_SUBCMDS(dm, "Driver model low level access", dm_help_text,
dee2f5ae 96 U_BOOT_SUBCMD_MKENT(compat, 1, 1, do_dm_dump_driver_compat),
7f0836a1
OP
97 U_BOOT_SUBCMD_MKENT(devres, 1, 1, do_dm_dump_devres),
98 U_BOOT_SUBCMD_MKENT(drivers, 1, 1, do_dm_dump_drivers),
2cb4ddb9 99 DM_MEM
dee2f5ae
SG
100 U_BOOT_SUBCMD_MKENT(static, 1, 1, do_dm_dump_static_driver_info),
101 U_BOOT_SUBCMD_MKENT(tree, 1, 1, do_dm_dump_tree),
102 U_BOOT_SUBCMD_MKENT(uclass, 1, 1, do_dm_dump_uclass));
This page took 0.42191 seconds and 4 git commands to generate.