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");
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, },
};
}
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");
}
#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
*/
#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 " \