U-Boot + SPI for VIM2


Put together a new version of u-boot for installation in SPI. Checked on their models work. To install put together a special script (s905_autoscript), which allows you to install a new version of u-boot in SPI without using the UART. Please note that this test version, you need to be prepared for possible bugs.

Pay attention with the new boot loader in SPI can only work as long as the firmware is specifically designed for such work (Server_20171025)



During the tests I discovered a few nuances in the work of u-boot when you set it SPI.

  1. Impossible Libreelec and Linux to manage variables in u-boot (env). Is possible in Android as well, but I don’t know how to check it in Android. Utility fw_setenv works with data, but these changes do not apply to variables (env), which uses u-boot in SPI mode. Therefore, it is not possible to use a mode multisistema (selective startup, we need a system of several). In the startup mode, one system everything works fine.

  2. Command “kbi emmc bootmode w” switches do not work with u-boot from eMMC. You need to perform erasing u-boot in SPI. I noticed that no matter what mode is set with the command “kbi emmc bootmode w|spi” in SPI there is a boot loader - it is used first if to erase it, then used the bootloader from eMMC. I.e. the logic of the choice of the boot loader flashed into the processor. Indirectly this is indicated by the query string, which is displayed , if you erase (delete) all loaders in SPI and eMMC.

  3. Maybe I’m wrong (I haven’t checked it), but I think that the standard option write firmware via USB Tools or does not affect u-boot in SPI. So you need to be careful when working with u-boot in SPI. If the record is wrong, it is not correct via the firmware USB cable.

Question the register M affect the lock of u-boot in SPI ?

I yet do not risk to check it (to mess up u-boot to SPI and try to start the system with interlock M-register). :slight_smile:

  1. Important plus install u-boot in SPI. You can work with eMMC as with usual drive. You can create a partition table and create the desired number of partitions. This is especially useful for those using different Linux versions. In the near future I will try to write the instructions and add the necessary files to the website that would be easy to establish its version of Linux for the entire eMMC.



Im looking to boot my VIM2 from SPI flash and then use a tftp and NFS to boot the VIM2 - ws interested in your script for this as it would be great to not have to use the serial console to get it going as i will have a large quantity of boards and doing each one one at time would be tedious and time consuming. The link above doesn’t seem to be working any more.

Is it possible to set the u-boot image up so that the opitions to use for the NFS can be made part of the image, e.g. to get it working like http://wiki.emacinc.com/wiki/Booting_with_an_NFS_Root_Filesystem but without having to set stiff up at the uboot console?

thanks in advance!


I’ll see what I can do. But I warn you once - it will not be fast (a lot of other work).


If you can let me have a copy of your previous script and say it should be possible / point me in the right direction then I’m happy to have a go myself!

Thanks for the quick response!


The installation of u-boot in SPI.

  1. Format the SD card in FAT32 (it is recommended to use the minimum size of the SD card). Pay attention to the scripts designed ONLY for SD card. To use USB media, you need to collect a new version of the scripts (aml_*).
  2. Download and write to the prepared SD card three files at the link.
  3. Rename aml_autoscript_1 to aml_autoscript
  4. Connect the SD card to the VIM2 and start the update mode (either from the Android menu, or other described in the documentation).
  5. The start of the script takes a few seconds. After start and run, the script itself will shut down the VIM2 (pay attention to it).
  6. After the first script, you need to remove the SD card from VIM2, connect it to the PC. And on the PC rename the second script aml_autoscript_2 to aml_autoscript.
  7. Connect the SD card to the VIM2 and turn on the power. The second script should start automatically and in a few seconds VIM2 should shut down.
  8. Removing the SD card from the VIM2.

This completes the process of installing u-boot in SPI. When power is turned on, u-boot from SPI must be started. The source code for the u-boot build for SPI and the scripts are located on these links. I draw your attention to the variables ENV u-boot, which are now used to run the system on VIM2.


Brilliant - thanks for the comprehensive answer - will try this on Saturday!


Please note, to work with u-boot in SPI, on the Board where you will be checking, you must have a UART console. After debugging the whole process, the rest of the boards can do without UART.