int optimus_burn_package_in_sdmmc(const char* sdc_cfg_file) { int rcode = 0; #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_device_probe("mmc", "0"); if (rcode) { DWN_ERR("Fail to detect device mmc 0\n"); return __LINE__; } setenv("usb_update","0"); rcode = optimus_burn_with_cfg_file(sdc_cfg_file); return rcode; }
/* * <aml_key_burn probe> device_format interface */ static int do_opt_keysburn_probe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int rc = 0; const char* device_format = argv[2];//vfat const char* device_interf = argv[3];//sdc/udisk if(4 > argc){ _AML_KEY_ERR("failed:argc: %d < 4\n", argc); return __LINE__; } if(!strcmp(device_format, "vfat")){ _optKeyInfo.fileFmt = DEV_FILE_FMT_VFAT; } else{ _AML_KEY_ERR("failed:device_format %s unsupported yet\n", device_format); return __LINE__; } if(!strcmp("sdc", device_interf)) { static int _mmcprobe = 0; if(!_mmcprobe) { rc = run_command("mmcinfo 0", 0); if(rc){ _AML_KEY_ERR("failed: in mmcinfo\n"); return __LINE__; } rc = optimus_device_probe("mmc", "0"); if(rc){ _AML_KEY_ERR("Fail to detect device mmc 0\n"); return __LINE__; } _mmcprobe = 1; } _optKeyInfo.intf = DEV_INTF_EXT_SDMMC; } else if(!strcmp("udisk", device_interf)) { static int _udiskProbe = 0; if(!_udiskProbe) { rc = run_command("usb start 0", 0); if(rc){ _AML_KEY_ERR("Fail in mmcinfo\n"); return __LINE__; } rc = optimus_device_probe("usb", "0"); if(rc){ _AML_KEY_ERR("Fail to detect device mmc 0\n"); return __LINE__; } _udiskProbe = 1; } _optKeyInfo.intf = DEV_INTF_EXT_UDISK; } else{ _AML_KEY_ERR("device_interf %s unsupported\n", device_interf); return -__LINE__; } return rc; }