Mattijs Korpershoek | cb6fa2f | 2024-07-24 14:41:25 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
| 3 | Android Bootmeth |
| 4 | ================ |
| 5 | |
| 6 | Android provides a mechanism for booting its Operating System from eMMC storage, |
| 7 | described on `source.android.com <https://source.android.com/docs/core/architecture/bootloader>`_. |
| 8 | |
| 9 | Android has strong requirements about partitioning layout which are described |
| 10 | `here <https://source.android.com/docs/core/architecture/partitions>`_. |
| 11 | Because multiple partitions are required, this bootmeth only operates on whole mmc |
| 12 | devices which have a valid partition table. |
| 13 | |
| 14 | When invoked on a bootdev, this bootmeth searches for the ``misc`` partition in order |
| 15 | to read the *boot mode*, which can be one of following: |
| 16 | |
| 17 | Normal |
| 18 | Boot the regular Android Operating System. |
| 19 | |
| 20 | Recovery |
| 21 | Boot a slimmed down Recovery Operating System. Can be used |
| 22 | to factory reset the device or to apply system updates. |
| 23 | |
| 24 | Bootloader |
| 25 | Stay in U-Boot and wait for fastboot commands from the host. |
| 26 | |
| 27 | After the *boot mode* has been determined, this bootmeth will read the *slot suffix* |
| 28 | from the ``misc`` partition. For details about slots, see |
| 29 | `the AOSP documentation <https://source.android.com/docs/core/ota/ab#slots>`_. |
| 30 | |
| 31 | When both the *boot mode* and the *slot suffix* are known, the bootflow is created. |
| 32 | |
| 33 | When the bootflow is booted, the bootmeth reads the kernel, the boot arguments and |
| 34 | the vendor ramdisk. |
| 35 | It then boots the kernel using bootm. The relevant devicetree blob is extracted |
| 36 | from the ``boot`` partition based on the ``adtb_idx`` environment variable. |
| 37 | |
| 38 | The compatible string "u-boot,android" is used for the driver. It is present |
| 39 | if `CONFIG_BOOTMETH_ANDROID` is enabled. |