Bootable eMMC

Introduction
First of all, any eMMC can be also used as a regular SD card. Which means that it can be treated as a single large block device representing its full capacity. And the first stage bootloader (U-Boot SPL or Allwinner's boot0) is expected to be stored in a special hardcoded place between the MBR and the first partition, which does not play very nice with GPT partitioning. But if you are happy with this particular setup, then just go to the Bootable SD card page for further information and instructions.

eMMC supports separate boot partitions for storing the bootloader. They are not sharing the same block device with the data.

At least Allwinner H3 is expected to support eMMC boot paritions because the manual says "Supports eMMC boot operation and alternative boot operation". The JEDEC eMMC spec mentions "boot operation" and "alternative boot operation".

Information for devboard designers
TBD

The BROM implementation details
TBD

Software development and trying something here and now
Disabling eMMC boot partitions write protection in Linux (for more details, check https://www.kernel.org/doc/Documentation/mmc/mmc-dev-parts.txt):

echo 0 > /sys/block/mmcblk1boot0/force_ro echo 0 > /sys/block/mmcblk1boot1/force_ro

Just trying to write the SPL into boot partitions does not seem to work. So we need to inspect the BROM code to check what exactly it is doing. As an alternative, use the Fastboot approach.

Examination of function in the A64's BSP u-boot code suggests that booting from a eMMC boot partition is indeed supported and that BootROM expects the   code located at the first sector of such partition. At least for the A64 chip, this has been proven to be correct: when a boot partition is properly activated (as specified by the eMMC standard, JESD84-B51), the  gets loaded and the boot goes as usual.

The proper eMMC configuration allowing to boot from these partitions can be easily setup inside mainline u-boot with  option enabled. Executing these two commands in the u-boot's shell activates booting from the first boot partition:

# mmc bootbus    mmc bootbus 1 1 0 0 # mmc partconf    mmc partconf 1 1 1 0

Also, if you rely on U-boot proper residing immediately behind SPL (i.e. when you use ), make sure to update   value to.