1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2015 Google, Inc
12 static void show_devices(struct udevice *dev, int depth, int last_flag)
15 struct udevice *child;
17 /* print the first 11 characters to not break the tree-format. */
18 printf(" %-10.10s [ %c ] %-10.10s ", dev->uclass->uc_drv->name,
19 dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ', dev->driver->name);
21 for (i = depth; i >= 0; i--) {
22 is_last = (last_flag >> i) & 1;
36 printf("%s\n", dev->name);
38 list_for_each_entry(child, &dev->child_head, sibling_node) {
39 is_last = list_is_last(&child->sibling_node, &dev->child_head);
40 show_devices(child, depth + 1, (last_flag << 1) | is_last);
44 void dm_dump_all(void)
50 printf(" Class Probed Driver Name\n");
51 printf("----------------------------------------\n");
52 show_devices(root, -1, 0);
57 * dm_display_line() - Display information about a single device
59 * Displays a single line of information with an option prefix
61 * @dev: Device to display
63 static void dm_display_line(struct udevice *dev)
65 printf("- %c %s @ %08lx",
66 dev->flags & DM_FLAG_ACTIVATED ? '*' : ' ',
67 dev->name, (ulong)map_to_sysmem(dev));
68 if (dev->seq != -1 || dev->req_seq != -1)
69 printf(", seq %d, (req %d)", dev->seq, dev->req_seq);
73 void dm_dump_uclass(void)
79 for (id = 0; id < UCLASS_COUNT; id++) {
82 ret = uclass_get(id, &uc);
86 printf("uclass %d: %s\n", id, uc->uc_drv->name);
87 if (list_empty(&uc->dev_head))
89 list_for_each_entry(dev, &uc->dev_head, uclass_node) {