summaryrefslogtreecommitdiff
path: root/common/cmd_usb.c
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2012-09-26 00:14:36 +0200
committerTom Rini <trini@ti.com>2012-10-15 11:54:00 -0700
commit93c2582feaf88a899c2537698e91fbb58d488a5b (patch)
tree217525cc0ef1739fd98bfc918a611bd3dc10b9d6 /common/cmd_usb.c
parent676ae068d9af8c4848dc8f3a66d65e2bff066239 (diff)
downloadu-boot-imx-93c2582feaf88a899c2537698e91fbb58d488a5b.zip
u-boot-imx-93c2582feaf88a899c2537698e91fbb58d488a5b.tar.gz
u-boot-imx-93c2582feaf88a899c2537698e91fbb58d488a5b.tar.bz2
usb: add support for multiple usb controllers
Allows to initialize more than one USB controller at once. v2: print message when controller stop fails Signed-off-by: Lucas Stach <dev@lynxeye.de> Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'common/cmd_usb.c')
-rw-r--r--common/cmd_usb.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 181e727..c128455 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -381,8 +381,7 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
bootstage_mark_name(BOOTSTAGE_ID_USB_START, "usb_start");
usb_stop();
printf("(Re)start USB...\n");
- i = usb_init();
- if (i >= 0) {
+ if (usb_init() >= 0) {
#ifdef CONFIG_USB_STORAGE
/* try to recognize storage devices immediately */
usb_stor_curr_dev = usb_stor_scan(1);
@@ -391,6 +390,9 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* try to recognize ethernet devices immediately */
usb_ether_curr_dev = usb_host_eth_scan(1);
#endif
+#ifdef CONFIG_USB_KEYBOARD
+ drv_usb_kbd_init();
+#endif
}
return 0;
}
@@ -417,8 +419,14 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 1;
}
if (strncmp(argv[1], "tree", 4) == 0) {
- printf("\nDevice Tree:\n");
- usb_show_tree(usb_get_dev_index(0));
+ puts("USB device tree:\n");
+ for (i = 0; i < USB_MAX_DEVICE; i++) {
+ dev = usb_get_dev_index(i);
+ if (dev == NULL)
+ break;
+ if (dev->parent == NULL)
+ usb_show_tree(dev);
+ }
return 0;
}
if (strncmp(argv[1], "inf", 3) == 0) {