A10 Boot process and an UPDATED Uboot for the A10
June 24, 2012 06:21PM
Allwinner A1X kernel development is occurring at a very rapid pace. Many changes are forthcoming. Therefore the u-boot versions below have been deprecated and will be unsupported by a10linux.org. For best results you should use the latest u-boot. Newer u-boot versions will be available at http://a10linux.org.

The A10 boot process is very different from Kirkwood. Here is how it works for us:

  • brom in the chip, which can not be modified - brom loads a program from external storage (mmc, nand, usb, in that order unless recovery button is pressed, usb 1st only if in recovery) called boot0 (the SPL - Second Program Loader: sun4i-spl.bin).
  • boot0 (the SPL - Second Program Loader: sun4i-spl.bin) initializes the hardware
  • the SPL (boot0) loads u-boot (boot1)
  • u-boot (boot1) inits all other hardware and provides hardware abstracts and services
  • the hardware configuration information is in a config file called script.bin which is loaded along with u-boot in a similar way that an initrd is loaded (Other names for script.bin : evb.bin, mele.bin sys_config.bin - it can be any name. A *.fex file is the same file in text form that can be edited and converted back to binary using a tool built with u-boot.)
  • u-boot boots the kernel.

Here is an updated u-boot package for the Allwinner A10 SD card.
sha256sum: 65414ba4e0f9162af013160ff8f71ea8aa850cafaddb0c6410eb4716f398d866

The above u-boot has been updated with a new environment to add clarity to the u-boot environment and add more reliability to the mmc boot process. It will soon be updated further to add additional functionality.

The archive also has the SPL loader and a mele and tablet script.bin. Copy the script.bin version you need to script.bin on the first SD card partition. Script.bin.tablet has also been converted into a fex file for you to browse and/or convert back into script.bin once you have edited it. There are instructions in the archive on how to properly copy the files to your SD card. The instructions are also posted here and must be followed exactly.

Failure to specify the correct drive below can corrupt the hard disk on the computer you are using to copy the files.

Be careful before hitting the return button. You have been warned! Do not hold me responsible if you mistype the commands.

Here are the instructions.
  • Extract the archive.
  • Insert your SD card. Back up your data. Be certain that there is nothing on the SD card that you need to keep.
  • Make a note of the SD card device, if you are in Linux use dmesg | tail. (If you are not in Linux then get in Linux.)
  • The SD card device is the the root device. Not a partition. It should be something like /dev/sd(b, or higher). Most likely it is not /dev/sda, which is most likely your hdd. If you are using an mmc reader the SD device may be /dev/mmcblk(0 or higher).
  • Check for existing partitions on the SD card: fdisk -l /dev/sdb or fdisk -l /dev/mmcblk0 (or whatever you SD is).
  • If there are any partitions that you do not recognize from your SD then stop, and check you have the correct device.
  • Delete any existing partitions on the SD card:
  • Make certain all the partitions are gone. Then create a new 32-100 MB (32MB recommended) first partition as type c, and the second 512MB (no GUI) to 2GB (full LXDE GUI rootfs) rootfs partition as type 83. The first partition should start at sector 2048 to leave sufficient space for uboot & environment. Partition 1 size smaller than 32MB is unsupported.
  • Be certain in fdisk to write your changes. If you want you can also create a 256-512MB swap partition as type 82 after the first two. You can also add more partitions such as a /home partition after the first two. Be certain to format swap later if you create it:
      mkswap -L "A10_SWAP" /dev/sdb3  
  • Format the first partition as FAT:
      mkfs.vfat -n "A10-BOOT" /dev/sdb1 or mkfs.vfat -n "A10-BOOT" /dev/mmcblk0p1  
  • Format the second partition as ext4:
      mkfs.ext4 -L "A10_ROOT" /dev/sdb2 or mkfs.ext4 -L "A10_ROOT" /dev/mmcblk0p2.  
  • Mount the first partition:
      mount /dev/sdb1 /mnt/misc  
  • Copy the correct script.bin from your device to the first partition (rename it to script.bin if it is not already):
      cp script.bin.tablet /mnt/misc/script.bin or cp script.bin.mele /mnt/misc/script.bin  
  • Install the SPL loader to the 8th block of the SD: (be certain you have the correct device before you hit enter!)
      dd if=sun4i-spl.bin of=/dev/sdb bs=1024 seek=8  
  • Install u-boot to block 32 of the SD: (be certain you have the correct device before you hit enter!)
      dd if=u-boot.bin of=/dev/sdb bs=1024 seek=32  
  • Run sync to ensure the write buffers are flushed

Guess what? That's it! You now have an A10 bootable SD card! Congratulations!

The next step is to copy the kernel uImage to the first partition.

Then you need to extract the rootfs to the second partition.

It is recommended to have /boot in your /etc/fstab. If you don't like the use of fat for the first partition and would rather use ext2/3 for the /boot partition see the post below. We will be releasing an updated u-boot shortly that can use either fat, ext2, or ext3 for the /boot partition, and that will also hopefully automatically load the proper script.bin . When that u-boot is released the installation instructions above will be updated to reflect the change. Supposedly fat boots faster, however.

Building and compiling Uboot for the A10 works fine. I am using Uboot compiled on a Dockstar to boot my tablet.

Work is ongoing to enable u-boot multi-boot from SD, USB, SATA and flash. Netconsole is also needed, and we will try to enable it once we get u-boot Ethernet support implemented for devices like the Mele that have an Ethernet port .

A serial console is available on the Mele boxes. Serial ports on tablets are available from the SD card slot (SDIO). An adapter is required. There is also a serial port that is exposed on the tablet PCBs if the back casing is removed.

You don't need to flash the NAND to try a new Uboot. This u-boot should be installed to SD cards only.

The A10 supports USB boot, but you would need to use the "recovery" button to boot from USB and have a u-boot version that supports USB. We will be working toward getting USB boot capability into a future u-boot. On the A10 USB is normally specified as the last device to boot. Without using the "recovery" button USB would only be tried if the flash was corrupted.

Edited 18 time(s). Last edit at 07/29/2012 05:06AM by gnexus.
Mele Serial Cable and U-boot console
July 08, 2012 08:03AM
U-boot output is finally here!

This one is the NAND uboot for Android.

HELLO! BOOT0 is starting!                                                                  
boot0 version : 1.2.2                                                                      
dram size =512                                                                             
Succeed in opening nand flash.
Succeed in reading Boot1 file head.
The size of Boot1 is 0x00036000.
The file stored in 0X00000000 of block 2 is perfect.
Check is correct.
Ready to disable icache.
Succeed in loading Boot1.
Jump to Boot1.
[       0.122] boot1 version : 1.2.6
[       0.122] pmu type = 3
[       0.150] axi:ahb:apb=3:2:2
[       0.150] set dcdc2=1400, clock=1008 successed
[       0.152] key
[       0.164] no key found
[       0.164] flash init start
[       1.516] flash init finish
[       1.517] fs init ok
[       1.518] fattype FAT16
[       1.518] fs mount ok
[       1.524] script finish
[       1.525] power finish
[       1.529] BootMain start
[       1.529] 0
[       1.538] gpio config
[       1.538] gpio ok
[       1.538] gpio finish
[       1.540] The all optional count is 1
[       1.544] recovery config
[       1.548] test for multi os boot with display
[       1.551] show pic finish
[       1.554] load kernel start
[       1.572] load kernel successed
[       1.572] s

U-Boot 2011.09-rc1-00008-gcb44509-dirty (Jan 11 2012 - 17:55:17) Allwinner Technology 

CPU:   SUNXI Family
Board: A10-EVB
DRAM:  512 MiB
NAND:  3800 MiB
In:    serial
Out:   serial
Err:   serial
--------fastboot partitions--------
-total partitions:9-
-name-        -start-       -size-      
BOOTFS      : 100000        1000000     
LROOTFS     : 1100000       2000000     
LSYSTEMFS   : 3100000       10000000    
LDATAFS     : 13100000      60000000    
MISC        : 73100000      100000      
LRECOVERYFS : 73200000      2000000     
LCACHEFS    : 75200000      8000000     
env         : 7d200000      200000      
UDISK       : 7d400000      70400000    
Hit any key to stop autoboot:  0 
boot_normal=run setargs_normal;fatload nand 0 50000000 linux/uimage;bootm 50000000
boot_recovery=run setargs_recovery;fatload nand 0 50000000 linux/uimage;bootm 50000000
bootcmd=run boot_normal
setargs_normal=setenv bootargs console=${console} root=${nand_root} init=${init} loglevel=${loglevel} mac_addr=${mac}
setargs_recovery=setenv bootargs console=${console} root=${nand_root_recovery} init=${init} loglevel=${loglevel} mac_addr=${mac}

Environment size: 666/131068 bytes

Edited 1 time(s). Last edit at 07/17/2012 11:15AM by gnexus.
Re: Building and compiling Uboot for the A10
July 17, 2012 07:52AM
I have compiled an updated u-boot with a new environment which can use either FAT, ext2, or ext3 for the /boot partition.
Personally I think it is nice to get rid of the DOS partition ;) But supposedly FAT loads faster.

If you would like to try ext2/3 for your /boot partition you can use this u-boot (once it is ready-still need to fix the env.)

Edited 5 time(s). Last edit at 07/18/2012 02:20PM by gnexus.
The README file in http://download.doozan.com/a10/u-boot.sun4i.mmc_boot.22072012.tar.bz2 says:

Mount the first partition:
mount /dev/sdb2 /mnt/misc

It should say:

Mount the first partition:
mount /dev/sdb1 /mnt/misc

Re: A10 Boot process and an UPDATED Uboot for the A10
July 25, 2012 12:27PM

The u-boot and kernels are going to be changing rapidly. Hopefully we can keep the bugs and typos to a minimum with user feedback such as yours.

Fixed. I will u/l the updated version shortly and update the shasum on the link..
Re: A10 Boot process and an UPDATED Uboot for the A10
July 30, 2012 06:03AM
Hello. May u can help me with u-boot. I downloaded the latest u-boot source from git and compiled it. But my uboot on boot load evb.bin instead of script.bin. Can you tell me why?

git clone git://github.com/hno/uboot-allwinner
make sun4i CROSS_COMPILE=arm-none-linux-gnueabi-

Thanks. And sory for my English. I am from Russia.
Re: A10 Boot process and an UPDATED Uboot for the A10
July 30, 2012 07:17AM
What commands did you put in your boot.scr file?

The uBoot you compiled does not try to read evb.bin nor system.bin. It only understands how to read boot.scr and run the commands found in there.

You can see the 'default' environment that your uBoot uses here:

-- Jeff
Re: A10 Boot process and an UPDATED Uboot for the A10
July 30, 2012 09:19AM
I don't have a boot.scr file. Does script.bin must be loaded as default config or not?

"boot_mmc=fatload mmc 0 0x43000000 script.bin; fatload mmc 0 0x48000000 ${kernel}; bootm 0x48000000\0"

Edited 2 time(s). Last edit at 07/30/2012 09:21AM by =DENIS=.
Re: A10 Boot process and an UPDATED Uboot for the A10
July 30, 2012 07:21PM
I (and many other ppl) had major problems with the spl on GIT ... after a lot of pain turns out the maintainers are not too careful about commits which often kill the spl (particularly) and uboot... IMHO its better particularly for newbies (of which i include myself) to use either a static working fork or something like jeffs compiled spl and uboot which work just fine
Re: A10 Boot process and an UPDATED Uboot for the A10
July 31, 2012 03:33AM
But I use the allwinner-uboot fork. It default load evb.bin instead script.bin, although code line:

"boot_mmc=fatload mmc 0 0x43000000 script.bin; fatload mmc 0 0x48000000 ${kernel}; bootm 0x48000000\0"

Sorry for my English.
Re: A10 Boot process and an UPDATED Uboot for the A10
July 31, 2012 08:06AM
Are you sure that your uBoot is running? What is the output of printenv?

There are two copies of uBoot on your device: the first one is pre-installed and should be on the first nand partition. The second uBoot is your, which must be installed to your MMC along with the sun4i-spl.bin loader:

dd if=sun4i-spl.bin of=/dev/sdb bs=1024 seek=8  
dd if=u-boot.bin of=/dev/sdb bs=1024 seek=32
Re: A10 Boot process and an UPDATED Uboot for the A10
July 31, 2012 04:59PM
Yes, I am sure. Because linux is loading. but I am in some perplexed, because uboot must load script.bin, but it load evb.bin. ( without boot.scr ).
Re: A10 Boot process and an UPDATED Uboot for the A10
August 10, 2012 10:55AM
The u-boot @ github/hno has been updated to support uEnv.txt out of the box, and you could add that feature yourself be editing your existing environment.
Re: A10 Boot process and an UPDATED Uboot for the A10
August 10, 2012 04:36PM
Hopefully this will prove useful for anyone interested in the boot1 bootloader.

It would be useful to find out if there are additional features in the boot1 on other A10 boards.
Sorry if this is a newbie question, but here goes anyway: I'm having some trouble with applying these instructions for my MK802. I followed the directions as described above (from here actually: http://a10linux.org/a10_boot.html and http://a10linux.org/kernel_page.html ) in conjunction with this rootfs package of Lubuntu: http://a10linux.org/Ubuntu_12.04_LTS_rootfs.html.

However, when I pop the card in and turn on my device all I get is a blank screen with "no input detected" (the message my monitor spits out when it doesn't think anything is connected). I've used several other images from miniand they have seemed to work fine, but I was hoping to use one of these builds so that I can get access to usb audio drivers for a project I'm doing (Halloween costume). Any help would be greatly appreciated.

Current Configuration Details:

xxxxx@XubuVM64:~$ sudo fdisk /dev/sdb -l

Disk /dev/sdb: 16.0 GB, 16007561216 bytes
64 heads, 32 sectors/track, 15266 cylinders, total 31264768 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000728ca

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048       67583       32768   83  Linux
/dev/sdb2           67584     8456191     4194304   83  Linux
/dev/sdb3         8456192     9504767      524288   82  Linux swap / Solaris
xxxxx@XubuVM64:~$ sudo e2label /dev/sdb1
xxxxx@XubuVM64:~$ sudo e2label /dev/sdb2
xxxxx@XubuVM64:~$ tree /media/A10_BOOT/ -s
├── [       1024]  conf.d
│   ├── [         13]  env_reset
│   ├── [       2064]  README.uboot.conf.d
│   ├── [         15]  rescue_shell
│   ├── [      46600]  script.bin
│   ├── [      42144]  script.bin.mele
│   ├── [      46600]  script.bin.tablet
│   ├── [      24574]  script.fex.tablet.txt
│   └── [        112]  uboot.conf
├── [      84587]  config-3.0.39+-1.a10linux.sun4i
├── [      12288]  lost+found [error opening dir]
├── [    2138388]  uImage
└── [    6651794]  uInitrd

2 directories, 11 files
xxxxx@XubuVM64:~$ sudo more /media/A10_BOOT/conf.d/uboot.conf 
# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mmcblk0p1  /boot   ext3    defaults        1       1
/dev/mmcblk0p3  none    swap    defaults        0       0
proc            /proc   proc    defaults        0       0

(I wasn't sure what to put for <file system> in the above, so that was a bit of copy-paste guessing from my desktop linux's fstab)

Once again, any help would be greatly appreciated!
Re: A10 Boot process and an UPDATED Uboot for the A10
November 22, 2012 01:31PM
Hello folks and thanks for this very enlightening thread, I've learned a lot from here.

Hoping not to be off-topic, may I ask a question about the A10 process, u-boot and the Android recovery?
I mean the recovery partition for backups, zapping filesystems, not FEL mode which seems to be what "recovery" refers to in this topic, isn't it?
The standard <3e> recovery found on many devices or Clockworkmod Recovery is what I'm talking about here.

To keep it short, here's my question: how does u-boot receive the necessary information to fetch the kernel and the initrd ramdisk from the 'g' partition instead of the 'c' partition when a special key combination is pressed at power-on (on many Android tablets)?
It's my understanding that the closed-source first-stage boot.axf detects the key combination, but how does it pass this to u-boot?
In Gingerbread, boot.axf would open the recovery.ini file instead of linux.ini to get the name of the kernel to boot and the parameters.
In ICS u-boot comes into the play and recovery.ini is gone, so I've been scratching my head on this for quite a while.

Would anyone please tell? I'd be really grateful.
Hey sorry for reviving an old thread, but this is the most relevant one I could find to expose this question.

I've completed this procedure on a MicroSD card and at this point I have successfully compiled the kernel and installed linux on my device (A10 TV Box).

Thing is, I need to install and boot linux natively on the device (without using an external memory card), but I had no success on this.

Up until now I've duplicated the partition layout from the bootable MicroSD on the internal NAND and installed my base system on a ReiserFS partition, but I can't make the system boot from the NAND. on the NAND, The FAT partition is 32MB long and starts at sector 2048 as told. I copied the SPL and U-boot on the required sectors (as of the original post), but the kernel on the FAT partition is not being loaded.

Thinking that the original "android" SPL (or whatever code it runs at startup) should begin at the same base address (sector 2048), I analyzed the image of the original NAND contents, but this REALLY confused me.. I find what seems to be a partition table of some sort at the first disk block (first 4096 bytes), which "seems" to store information about the following partitions:


This first block is followed by a bunch of 0xFF (no data at all) up until the first MB (bytes 4097-1048575).

Right after that, I get the contents of the first partition (FAT filesystem) which i think it's label is "bootloader". But I can't find any SPL or u-boot..

Shouldn't the offset of the SPL be the same for the "Android" disk layout and the Linux one? Is the address 8192 (from which the processor fetches the first instruction of the SPL) hard-coded on the brom of the microprocessor? How can I accomplish booting Linux directly from the NAND device, or where can I find more information about this subject? I'm sorry for asking so may questions at once, but I've probably downloaded every single program/kernel/image related to the sun4i architecture and read quite a few threads, but I'm sorta lost at this point.

Any additional information you may need on my setup or if you need images (I'm installing a Gentoo Linux on it), just let me know!!

Thanks in advance!

Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.