core: dump: add symbol for remained dm device

Symbol:
	"**" : pre-reloc node and the device is remained in dm tree.
	"* " : pre-reloc node but the device is already being removed from dm tree.

=> dm tree
 Class      Probed        Driver               Name

Change-Id: Ie242117d4d323ba24894dd99ab061d187230621d
----------------------------------------------------------
 root       [ + ]   root_driver                root_driver
 rsa_mod_ex [   ]   mod_exp_sw                 |-- mod_exp_sw
 clk        [   ]   fixed_rate_clock           |-- external-gmac-clockm0 *
 clk        [   ]   fixed_rate_clock           |-- external-gmac-clockm1 *
 syscon     [ + ]   rv1126_syscon              |-- syscon@fe000000 *
 syscon     [ + ]   rv1126_syscon              |-- syscon@fe020000 *
 ......
 mtd        [   ]   rk_nandc_v6                |-- nandc@ffc80000 **
 blk        [   ]   mtd_blk                    |   `-- nandc@ffc80000.blk
 spi        [   ]   rockchip_sfc               |-- sfc@ffc90000 *
 mtd        [   ]   spi_nand                   |   |-- flash@0 **
 blk        [   ]   mtd_blk                    |   |   `-- flash@0.blk
 spi_flash  [   ]   spi_flash_std              |   `-- flash@1 **
 blk        [   ]   mtd_blk                    |       `-- flash@1.blk
 ......

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5bf643b9a2b29a86ac7315462ad9f65f30e18442
This commit is contained in:
Joseph Chen 2020-07-08 12:22:20 +08:00 committed by Jianhong Chen
parent 8f5dfc4a5c
commit 659e640a99
1 changed files with 10 additions and 4 deletions

View File

@ -14,6 +14,7 @@ static void show_devices(struct udevice *dev, int depth, int last_flag)
{
int i, is_last;
struct udevice *child;
int pre_reloc, remained;
/* print the first 11 characters to not break the tree-format. */
printf(" %-10.10s [ %c ] %-25.25s ", dev->uclass->uc_drv->name,
@ -34,9 +35,14 @@ static void show_devices(struct udevice *dev, int depth, int last_flag)
}
}
printf("%s %s\n", dev->name,
dev_read_bool(dev, "u-boot,dm-pre-reloc") ||
dev_read_bool(dev, "u-boot,dm-spl") ? "*" : "");
pre_reloc = dev_read_bool(dev, "u-boot,dm-pre-reloc") ||
dev_read_bool(dev, "u-boot,dm-spl");
if (pre_reloc)
remained = !list_empty(&dev->uclass_node);
else
remained = 0;
printf("%s %s%s\n", dev->name, pre_reloc ? "*" : "", remained ? "*" : "");
list_for_each_entry(child, &dev->child_head, sibling_node) {
is_last = list_is_last(&child->sibling_node, &dev->child_head);
@ -66,7 +72,7 @@ void dm_dump_all(void)
static void dm_display_line(struct udevice *dev)
{
printf(" %c [ %c ] %s @ %08lx",
dev_read_bool(dev, "u-boot,dm-pre-reloc") ||
dev_read_bool(dev, "u-boot,dm-pre-pre_reloc") ||
dev_read_bool(dev, "u-boot,dm-spl") ? '*' : ' ',
dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ',
dev->name, (ulong)map_to_sysmem(dev));