Files
makronix/mobile/docs/PORTING.md
T
lotherkandClaude Opus 5.5 c520f2ea26 mobile: hotdogb DTS in the kernel series, OTG, BTF, wall clock, warnings fixed
- kernel/patches 0007-0012: the DTS of the baseline moves into the tree
  (0007, with the PON modes), the ABL framebuffer is reserved memory (0008),
  msm's fbdev marks its memory virtual (0009), the MDSS no longer resets
  the Ethernet MAC (0010; the real dispcc reset leaves the panel white,
  measured), u_serial closes a hung-up port once (0011, the gs_close WARN),
  USB dual role with the pm8150b Type-C port (0012).
- KERNEL_DTB in device.conf: tools/build-kernel.sh builds the DTB in the
  tree, mkbootimg takes it from there; the binary DTB and its pin are gone.
- kernel.config: BTF (pahole 1.32 on the host).
- rtc-offset: the wall clock across reboots on the read-only PMIC RTC;
  tools/phone-time.sh sets it from the host.

Measured: kernel 7.0.0-sm8150-g3c5fa409ca54, 10 of 10 warm reboots, no
WARNING in dmesg, display good, Type-C data role device on the laptop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:24:46 +00:00

1.9 KiB

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 lists of the root (packages.aarch64.list); 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.