diff options
author | Tom Rini | 2023-09-24 12:43:00 -0400 |
---|---|---|
committer | Tom Rini | 2023-09-24 12:43:00 -0400 |
commit | 90c81f407dd4a7747385b10f9b8f732202c45cde (patch) | |
tree | e7200b32d45c2754df3f9445a48b6d113d968a33 /cmd | |
parent | 1e94b46f73cedcebbff73799203f3266c5b28d90 (diff) | |
parent | ae84514feee209091d331a8baaa344ed8d8e905b (diff) |
Merge tag 'dm-next-23sep23' of https://source.denx.de/u-boot/custodians/u-boot-dm into next
buildman file-keeping and build-progress improvements
dm tree enhancement
adjust meaning of bootph-pre-ram/sram
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dm.c | 48 |
1 files changed, 38 insertions, 10 deletions
@@ -59,11 +59,26 @@ 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[]) { - bool sort; - - sort = argc > 1 && !strcmp(argv[1], "-s"); - - dm_dump_tree(sort); + bool extended = false, sort = false; + char *device = NULL; + + for (; argc > 1; argc--, argv++) { + if (argv[1][0] != '-') + break; + + if (!strcmp(argv[1], "-e")) { + extended = true; + } else if (!strcmp(argv[1], "-s")) { + sort = true; + } else { + printf("Unknown parameter: %s\n", argv[1]); + return 0; + } + } + if (argc > 1) + device = argv[1]; + + dm_dump_tree(device, extended, sort); return 0; } @@ -71,7 +86,20 @@ static int do_dm_dump_tree(struct cmd_tbl *cmdtp, int flag, int argc, static int do_dm_dump_uclass(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - dm_dump_uclass(); + bool extended = false; + char *uclass = NULL; + + if (argc > 1) { + if (!strcmp(argv[1], "-e")) { + extended = true; + argc--; + argv++; + } + if (argc > 1) + uclass = argv[1]; + } + + dm_dump_uclass(uclass, extended); return 0; } @@ -91,8 +119,8 @@ 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 [-s] Dump tree of driver model devices (-s=sort)\n" - "dm uclass Dump list of instances for each uclass" + "dm tree [-s][-e][name] Dump tree of driver model devices (-s=sort)\n" + "dm uclass [-e][name] Dump list of instances for each uclass" ; #endif @@ -102,5 +130,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, 2, 1, do_dm_dump_tree), - U_BOOT_SUBCMD_MKENT(uclass, 1, 1, do_dm_dump_uclass)); + U_BOOT_SUBCMD_MKENT(tree, 4, 1, do_dm_dump_tree), + U_BOOT_SUBCMD_MKENT(uclass, 3, 1, do_dm_dump_uclass)); |