From: Grazvydas Ignotas Date: Thu, 17 Jun 2010 20:54:15 +0000 (+0300) Subject: enable USB serial support X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9c37208e5f21c0d76b2535dda461dd90752236c;p=pandora-u-boot.git enable USB serial support requested by DjWillis, costed ~14kB. --- diff --git a/board/pandora/menu.c b/board/pandora/menu.c index 86c1576c3f3..38cad6d112d 100644 --- a/board/pandora/menu.c +++ b/board/pandora/menu.c @@ -68,6 +68,17 @@ static int menu_do_poweroff(struct menu_item *item) return 0; } +static int menu_do_usb_serial(struct menu_item *item) +{ + printf("Switched to USB serial.\n"); + + setenv("stdout", "usbtty"); + setenv("stdin", "usbtty"); + setenv("stderr", "usbtty"); + setenv("bootcmd", ""); + return 1; +} + static int menu_do_serial(struct menu_item *item) { printf("Switched to serial.\n"); @@ -93,6 +104,7 @@ static int menu_do_script_cmd(struct menu_item *item) static struct menu_item default_menu_items[] = { { "default boot", menu_do_default, }, { "power off", menu_do_poweroff, }, + { "USB serial prompt", menu_do_usb_serial, }, { "serial prompt", menu_do_serial, }, }; @@ -164,8 +176,11 @@ found: } finish: - if (menu_item_count < ARRAY_SIZE(menu_items)) - menu_items[menu_item_count++] = &default_menu_items[2]; + for (i = 2; i < ARRAY_SIZE(default_menu_items); i++) { + if (menu_item_count >= ARRAY_SIZE(menu_items)) + break; + menu_items[menu_item_count++] = &default_menu_items[i]; + } setenv("stdout", "lcd"); } diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h index da566bbf07a..b09ae1d68c3 100644 --- a/include/configs/omap3_pandora.h +++ b/include/configs/omap3_pandora.h @@ -71,6 +71,15 @@ #define CONFIG_SYS_CONSOLE_IS_IN_ENV 1 #define CONFIG_SYS_DEVICE_NULLDEV 1 +/* USB */ +#define CONFIG_MUSB_UDC 1 +#define CONFIG_USB_OMAP3 1 +#define CONFIG_TWL4030_USB 1 + +/* USB device configuration */ +#define CONFIG_USB_DEVICE 1 +#define CONFIG_USB_TTY 1 + /* * Hardware drivers */ @@ -170,6 +179,7 @@ #define CONFIG_BOOTDELAY 0 #define CONFIG_EXTRA_ENV_SETTINGS \ + "usbtty=cdc_acm\0" \ "loadaddr=0x82000000\0" \ "bootargs=ubi.mtd=4 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs " \ "rw rootflags=bulk_read console=ttyS0,115200n8 " \