diff options
author | Simon Glass <sjg@chromium.org> | 2023-01-17 20:47:12 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-24 02:11:39 +0300 |
commit | 3d01254140fc9e5e900d739cb97bd9fba6aa2b68 (patch) | |
tree | f0ab5ee057999c7b07d19beefd3761ddeb6696a8 /cmd | |
parent | c0f19fedaa742adbe0f4e29e9a956ea05fe22057 (diff) | |
download | u-boot-3d01254140fc9e5e900d739cb97bd9fba6aa2b68.tar.xz |
dm: core: Support sorting devices with dm tree
Add a -s flag to sort the top-level devices in order of uclass ID.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dm.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -59,7 +59,11 @@ static int do_dm_dump_static_driver_info(struct cmd_tbl *cmdtp, int flag, static int do_dm_dump_tree(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - dm_dump_tree(); + bool sort; + + sort = argc > 1 && !strcmp(argv[1], "-s"); + + dm_dump_tree(sort); return 0; } @@ -87,7 +91,7 @@ static char dm_help_text[] = "dm drivers Dump list of drivers with uclass and instances\n" DM_MEM_HELP "dm static Dump list of drivers with static platform data\n" - "dm tree Dump tree of driver model devices ('*' = activated)\n" + "dm tree [-s] Dump tree of driver model devices (-s=sort)\n" "dm uclass Dump list of instances for each uclass" ; #endif @@ -98,5 +102,5 @@ U_BOOT_CMD_WITH_SUBCMDS(dm, "Driver model low level access", dm_help_text, U_BOOT_SUBCMD_MKENT(drivers, 1, 1, do_dm_dump_drivers), DM_MEM U_BOOT_SUBCMD_MKENT(static, 1, 1, do_dm_dump_static_driver_info), - U_BOOT_SUBCMD_MKENT(tree, 1, 1, do_dm_dump_tree), + U_BOOT_SUBCMD_MKENT(tree, 2, 1, do_dm_dump_tree), U_BOOT_SUBCMD_MKENT(uclass, 1, 1, do_dm_dump_uclass)); |