# this is one special version for 1.0c BIOS
echo -off
echo *******************************************************************************
echo *
echo *   System will update the BIOS and restart several times to update the SPS.
echo *   After the update, the system will return to the shell.
echo *   Please do not interrupt the flash process.
echo *
echo *******************************************************************************

# check flash process
if exist \flash.part2 then
  rm -q \flash.part2 
  goto FLASH_ME_REGION
endif

# flash BIOS region
mv AfuEfix64.smc AfuEfix64.efi
AfuEfix64.efi %1 /P /B /N /K /R
mv AfuEfix64.efi AfuEfix64.smc

# create flash process file
echo "flash.part2" > \flash.part2

# reset the system
mv fdt.smc fdtx64.efi
fdtx64.efi -mauto %1
mv fdtx64.efi fdt.smc
echo **************************************************************************
echo *
echo *   System will reboot to change the operating mode in 10 seconds....
echo *   
echo *   Please also ensure to boot system from "'UEFI: Built-in EFI Shell'"  
echo *   boot device by pressing F11 hot key later for continuing process 
echo *   of programming BIOS.
echo *
echo **************************************************************************
echo 
Stall 10000000
reset

:FLASH_ME_REGION

# remove temporarily files
if exist \a.nsh then 
   rm -q \Startup.nsh
   mv \a.nsh \Startup.nsh
endif

# flash ME region
mv AfuEfix64.smc AfuEfix64.efi
AfuEfix64.efi %1 /ME
mv AfuEfix64.efi AfuEfix64.smc

if exist \a.tmp then 
   rm -q \a.tmp
endif
mv \Startup.nsh \a.tmp



