int v2_usbburning(unsigned timeout) { int cfg = EXT_CLOCK; #if defined(CONFIG_SILENT_CONSOLE) gd->flags &= ~GD_FLG_SILENT; #endif printf("Enter USB burn\n"); set_usb_phy_config(cfg); usb_parameter_init(timeout); if(usb_pcd_init()) { printf("Fail in usb_pcd_init\n"); return __LINE__; } #if (MESON_CPU_TYPE_MESON8 <= MESON_CPU_TYPE) AML_WATCH_DOG_DISABLE(); //disable watchdog #endif// #if (MESON_CPU_TYPE_MESON8 <= MESON_CPU_TYPE) while(1) { //watchdog_clear(); //Elvis Fool if(usb_pcd_irq()) break; } return 0; }
int optimus_burn_package_in_sdmmc(const char* sdc_cfg_file) { int rcode = 0; #if defined(CONFIG_AML_MESON_8) AML_WATCH_DOG_DISABLE(); //disable watchdog #endif//#ifdef CONFIG_AML_MESON_8 DWN_MSG("mmcinfo\n"); rcode = run_command("mmcinfo", 0); if(rcode){ DWN_ERR("Fail in init mmc, Does sdcard not plugged in?\n"); return __LINE__; } #if 0//this asserted by 'run update' and 'aml_check_is_ready_for_sdc_produce' rcode = do_fat_get_fileSz(sdc_cfg_file); if(!rcode){ printf("The [%s] not exist in bootable mmc card\n", sdc_cfg_file); return __LINE__; } #endif//#if 0 rcode = optimus_burn_with_cfg_file(sdc_cfg_file); return rcode; }
unsigned main(unsigned __TEXT_BASE,unsigned __TEXT_SIZE) { //Adjust 1us timer base timer_init(); serial_init(UART_CONTROL_SET(CONFIG_BAUDRATE,CONFIG_CRYSTAL_MHZ*1000000)); serial_put_dword(get_utimer(0)); AML_WATCH_DOG_DISABLE();//disable Watchdog debug_rom(__FILE__,__LINE__); return 0; }