Files
makronix/mobile/docs/PORTING.md
T
lotherkandClaude Sonnet 5.5 73c9de51a6 licence: the CNCL line in every file Makronix wrote (tools, docs, www, mobile, top level)
consmirror.c: the BSD notice is replaced (Makronix's own file).  Files with
changes of other sessions pending are left for their commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 11:50:26 +00:00

38 lines
2.0 KiB
Markdown

# Adding a phone
Nothing in `tools/` changes. You add data.
1. **SoC.** If `soc/<soc>/soc.conf` exists, use it. If not, copy
`soc/sm8150/soc.conf` and set `ARCH`, `CROSS_COMPILE`, `KERNEL_IMAGE`, the
boot image addresses and header version, `FASTBOOT_PRODUCT` and the slot
names. The boot image addresses are in the stock boot image
(`unpackbootimg`); do not guess them.
`PKG_ARCH` there names the platform of the root `packages.list` (`@aarch64` lines);
a new CPU architecture needs those lists, not a copy of the package set.
2. **Device directory** `devices/<codename>/` with
- `device.conf` -- `SOC`, `DEVICE_NAME`, `KERNEL_CONFIG`, `CMDLINE`, and
`KERNEL_DTB` (the DTS is a patch in `kernel/patches/`, the DTB is built
with the kernel) or, for a first boot with a stock DTB, `DTB` (a
binary here, pinned by `DTB_SHA256_PREFIX`); optional
`INITRAMFS_SHA256_PREFIX`, and `BOOT_PAD` if the bootloader wants a
partition-sized image;
- `kernel.config`, `cmdline`;
- `AGENTS.md` -- what makes this phone different, and what has been
measured on it.
3. **Check it is the right phone.** Read `fastboot getvar product` and the
model string from a running system; put the former in `FASTBOOT_PRODUCT`.
Sibling phones (7T and 7T Pro) share a SoC and differ in panel and
firmware: name them separately and never share a panel sequence.
4. **Build and compare.** `make bootimg DEVICE=<codename>`. If you have the
stock boot image, compare the header (`unpackbootimg`) before flashing.
5. **First flash** to the test slot only; the fallback slot stays untouched
until the new image has booted and been confirmed.
6. **Record** what you measured (display, touch, USB, what is off) in the
device's `AGENTS.md`.
Tool limits today: boot header v2 only (`mkbootimg.sh` refuses others),
`FLASH_METHOD=fastboot` only. A phone that needs another format adds it to
the tool and to this list, once.
<!-- License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree. -->