summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2020-01-17 14:48:09 -0500
committerSimon Glass <sjg@chromium.org>2020-02-05 19:33:46 -0700
commit7b9d60fc1ff67b3959a7db394084b27268a7686d (patch)
tree6196a41c5c8016aa5803d83dff50d83f4d5a543b /drivers/core
parent2f7c53cbd3e8094d2c4398b293a68304b7af721c (diff)
downloadu-boot-7b9d60fc1ff67b3959a7db394084b27268a7686d.tar.gz
cmd: Add command to dump drivers and compatible strings
This adds a subcommand to dm to dump out what drivers are installed, and their compatible strings. I have found this useful in ensuring that I have the correct drivers compiled, and that I have put in the correct compatible strings. Signed-off-by Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/dump.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/core/dump.c b/drivers/core/dump.c
index 4704049aee..e73ebeabcc 100644
--- a/drivers/core/dump.c
+++ b/drivers/core/dump.c
@@ -96,3 +96,22 @@ void dm_dump_uclass(void)
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);
+ }
+}