/* ======================================================================== Name: usbApp Description: This function is called to use the USB boot ======================================================================== */ void usbApp(void) { char *arg[] = {"run", "bootcmd"}; char *usb[] = {"usb","reset"}; /* (re)Start the USB */ do_usb(NULL, 0, 2, usb); /* Set the Bootargs */ setenv("bootargs",""); setenv("bootcmd","fatload usb 0 84000000 app.ub;bootm 84000000"); /* Start the Factory Application */ do_run (NULL, 0, 2, arg); /* We should not come back ... */ while(1); }
//----------------------------------------------------------------------------- int mv_man_test_usb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { printf("*****Testing USB now**********\n"); argv[1]="reset"; do_usb(cmdtp,flag,2,argv); printf("******************************\n"); if(strncmp(usb_dev[2].mf,USB_DEVICE_VENDER_ID,8) == 0) { printf("USB Works!!\n"); g_testReport|= (0x01<<MAN_FUNC_ID_USB); } else printf("USB Failed,make sure you have pluged in usb disk for testing!!\n"); return 1; }