return 0;
}
+static int do_dm_dump_drivers(cmd_tbl_t *cmdtp, int flag, int argc,
+ char * const argv[])
+{
+ dm_dump_drivers();
+
+ return 0;
+}
+
static cmd_tbl_t test_commands[] = {
U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""),
U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""),
U_BOOT_CMD_MKENT(devres, 1, 1, do_dm_dump_devres, "", ""),
+ U_BOOT_CMD_MKENT(drivers, 1, 1, do_dm_dump_drivers, "", ""),
};
static __maybe_unused void dm_reloc(void)
"Driver model low level access",
"tree Dump driver model tree ('*' = activated)\n"
"dm uclass Dump list of instances for each uclass\n"
- "dm devres Dump list of device resources for each device"
+ "dm devres Dump list of device resources for each device\n"
+ "dm drivers Dump list of drivers and their compatible strings\n"
);
puts("\n");
}
}
+
+void dm_dump_drivers(void)
+{
+ struct driver *d = ll_entry_start(struct driver, driver);
+ const int n_ents = ll_entry_count(struct driver, driver);
+ struct driver *entry;
+ const struct udevice_id *match;
+
+ puts("Driver Compatible\n");
+ puts("--------------------------------\n");
+ for (entry = d; entry < d + n_ents; entry++) {
+ for (match = entry->of_match; match->compatible; match++)
+ printf("%-20.20s %s\n",
+ match == entry->of_match ? entry->name : "",
+ match->compatible);
+ if (match == entry->of_match)
+ printf("%-20.20s\n", entry->name);
+ }
+}