Boot chain
The XP8800 uses the standard Qualcomm SDM630 boot flow. The primary boot loader (PBL) in mask ROM starts the XBL/UEFI firmware. The XBL/UEFI firmware then starts the Android Boot Loader (ABL).
The ABL is an AArch64 UEFI application. It loads an Android boot.img or a UEFI payload that can start.
Stages
flowchart TB
PBL["PBL (mask ROM)<br/>Qualcomm primary boot loader"]
XBL["XBL / UEFI firmware<br/>+ TZ, RPM, hyp, devcfg, pmic, cmnlib"]
ABL["abl_a — Android Boot Loader<br/>AArch64 UEFI app (LinuxLoader.efi)"]
AVB{"Bootloader unlocked?"}
SKIP["Skip AVB boot verification"]
ENFORCE["Enforce verified boot / dm-verity"]
BOOTIMG["Android boot.img<br/>gzip kernel + appended DTB"]
UBOOT["U-Boot (payload in boot.img)<br/>simplefb, storage, USB, extlinux/EFI"]
LINUX["Linux arm64<br/>+ sdm630-sonim-xp8.dtb + initramfs"]
PBL --> XBL --> ABL --> AVB
AVB -->|yes| SKIP
AVB -->|no| ENFORCE
SKIP --> BOOTIMG --> UBOOT --> LINUX
ENFORCE --> BOOTIMG
ABL is UEFI, not a raw ELF
The abl_a partition on disk is an ELF32 ARM container. But the real boot loader in it is a PE32+ EFI application for AArch64. An EFI Firmware Volume with an LZMA payload holds it. The PE debug path shows where it comes from:
.../out/target/product/XP8812/obj/ABL_OBJ/Build/DEBUG_CLANG35/AARCH64/QcomModulePkg/Application/LinuxLoader/LinuxLoader/DEBUG/LinuxLoader.dllConsequences:
- The ABL is a UEFI
LinuxLoader, and it reads an Androidboot.img. It can also start UEFI payloads such as U-Boot. - There is no
dtbopartition. Put the device tree directly after the gzip-compressed kernel in theboot.img. Do not put it in its own partition. - When the bootloader is unlocked, the ABL records “Device is unlocked, Skipping boot verification”. It then makes AVB less strict.
Android boot-image format
| Field | Value |
|---|---|
| Header | Android boot header v0 |
| Page size | 4096 bytes |
| Kernel offset | 0x00008000 |
| Ramdisk offset | 0x01000000 |
| Tags offset | 0x00000100 |
| Kernel | gzip Image.gz (ARM64) |
| Appended | The DTB catalog. The last DTB is dtb_101.dtb for the board. |
Usually, you make a custom boot image for this device as follows:
u-boot-nodtb.bin.gz ++ sdm630-sonim-xp8.dtb → boot.imgUse an empty ramdisk, 4096-byte pages, and the kernel offset above. These values agree with the stock boot.img header.
Installing a custom boot loader
During bring-up, a usual safe procedure is to chainload a custom boot loader in RAM first. Write it to boot_a only after it boots reliably.
fastboot boot of a small (~640 KiB) U-Boot image operates on this platform. Reports say that multi-megabyte TWRP images hang while the host sends them.
Slot behaviour and recovery
- The active slot at the inspection was
_a. - A new slot starts with retry count 7. After some boots that do not succeed, the bootloader marks the slot as unbootable and stops in fastboot. On an unlocked bootloader,
fastboot set_active arecovers the phone. - Keep
abl_bandboot_bstock. The stock ABL on_bhas noflashand noset_active. A change to_bcan brick the phone. - If
abl_ais corrupt, or XBL does not accept it, XBL does not useabl_b. Write the stockabl_aagain with EDL.
Fastboot hygiene
Query one variable in each command (getvar unlocked, getvar current-slot).
WARNING: DO NOT RUN getvar all. IT CAN RETURN unknown command OR STOP THE USB ENDPOINT.
After a fastboot write, wait (bytes / 15_000_000) + 5 seconds before the next command. The ABL sends its acknowledgment immediately. But it continues to write to the eMMC at 15 MB/s (approximately).