Documentation
On this page

Guides

Device bring-up

The setup script: the mechanical part of a bring-up.

mapple_device_setup_scripts (source available with release 1) is the first step of a port. It reads a phone’s open-source Android device and kernel trees, and optionally the phone’s own device tree and partition table, and does the part of a bring-up that sources can answer. It does not guess: every fact says where it was read (file:line), and what the sources cannot say is listed as a gap with the read-only command that settles it. It copies facts only: no GPL code, firmware or vendor file. Same inputs, same bytes out. MediaTek phones only for now.

Run it

python3 bringup.py <codename> \
    --android-device DIR --android-kernel DIR \
    --fdt live.dtb --gpt gpt.bin \
    --ours kernel/mediatek/mt6781 --ours mapple/loader \
    --title "realme 8i" --maintainer you --out out

It needs Python 3 and dtc (to read the phone’s own tree).

InputWhatWithout it
--android-devicethe Android device tree: BoardConfig.mk, rootdir/, proprietary-files.txtrequired
--android-kernelthe kernel tree: the device-tree sources and the defconfigrequired
--fdtthe phone’s own tree, /sys/firmware/fdt, serials maskedno DRAM size, LK’s reservations, framebuffer, ramoops
--gptthe first blocks of the disk holding the GPT, GUIDs maskedno partition sizes, no room check for our partition
--ourstrees of our drivers to compare with (repeatable)no match report

LK’s reservations, the framebuffer and the panel are only in the phone’s own tree; where Android placed its run-time pools only /proc/iomem says. Pull both as the porting guide shows, and mask serials and GUIDs before the files leave the phone.

What comes out

FileWhat
<codename>/device.conf, configs/, boot-args.txtthe device repository’s skeleton; every status missing, with what was found
adt-input.confthe numbers the device-tree builder needs: RAM, interrupt controller, timer, framebuffer, block bases
report.mdfor each fact, which of our files name it; what nothing of ours names
BRIEF.mdfacts, gaps, next steps, and the read-only phone commands that settle the rest
facts.jsonthe same, for diffing

Read BRIEF.md first, then report.md: a fact that nothing of ours names is a driver to write. Check the brief against the phone before you trust it: on the realme 8i the trees were wrong about the big cores, the PMIC part and the torch chip.

What the sources cannot say

Registers as LK leaves them (the UFS controller, the display layer), the SSPM and DVFS tables, the thermal calibration, rail values, EMI MPU behaviour, and where Android placed its run-time memory pools. They are listed, not guessed.

Proof

proof/spaced.sh regenerates the realme 8i from its trees and a masked copy of its own tree and GPT, and compares with the real device repository, the device-tree builder’s constants and the bring-up’s phone notes: 60 checks, none differ unexplained, one explained (the torch part), and two runs give the same bytes. Then follow the porting guide.

Source: mapple_device_setup_scripts at 801cb7b.

Applies to MediaTek phones, release 1 · Updated 14 November 2026