Skip to content

Input: apple_z2: touch firmware by the unit's personality on iPhone 8 and 8 Plus - #113

Merged
henrikklee merged 6 commits into
mainfrom
z2-personality-firmware
Dec 2, 2026
Merged

henrikklee merged 6 commits into
mainfrom
z2-personality-firmware

Conversation

@henrikklee

Copy link
Copy Markdown

What users notice: an iPhone 8 or 8 Plus whose touch controller needs the other firmware personality gets a working touchscreen instead of a dead one. Each unit's ADT names its personality (multi-touch hid-merge-personality: C1F5D,3 or C1F5D,4 on the iPhone 8, C1F5E,3 or C1F5E,4 on the 8 Plus). m1n1 already passes it on as apple,hid-merge-personality, so no m1n1 change is needed. apple_z2 now loads <apple,firmware-prefix>-<personality>.bin.

This carries MasadaIV's #101 unchanged (three commits, MasadaIV as author: the D20/D201 personality selection and the HBPP 0x103 framing that C1F5D,4 containers declare) and adds three commits on top:

  • binding: firmware-name stays a complete file name; the new apple,firmware-prefix names the start of the per-personality files. There is no fixed list of personalities.
  • driver: the selection is shared by the main and D21 backends, so it covers every board whose device tree sets a prefix, not only D20/D201. Any personality made of [A-Za-z0-9,-] is accepted, so a new one only needs a recipe output. Without a personality from the bootloader, it loads firmware-name as before. With a personality that has no file, the load fails and the log names the file. It never loads another personality's firmware (orchard docs/firmware-recipes.md, "Firmware variants").
  • DT: t8015-8.dtsi (D20), D201 and t8015-8plus.dtsi (D21, D211) get prefixes. Their firmware-name keeps today's files: C1F5D,3 on the iPhone 8, C1F5E,4 (the tested one) on the 8 Plus.

Checked offline: checkpatch is clean on all three new commits. dtc builds t8015-d20/d201/d21/d211, and their touchscreen nodes name the prefix and the fallback. orchard's test_source_* pass against this tree (49 tests), as does the new orchard test test_source_z2_personality, which compiles apple_z2_fw_name on the host and runs it with C1F5D,4 / C1F5E,3 / no prefix / no personality / ../ / empty inputs.

Needs a device: C1F5D,4 through the public recipe with calibration from the ADT (a D201 ,4 unit, e.g. MasadaIV's), and C1F5E,3 on an 8 Plus. No unit with C1F5E,3 is known; the tested D21 runs C1F5E,4. Units whose files exist today are unaffected: D201/D20 C1F5D,3 and D21 C1F5E,4 load the same file names as before.

Merge order: 1. OrchardLinux/tools#130 (z2fw-from-mtprops@4), then a tools release. 2. this PR, which supersedes #101 and can merge in parallel with 1. 3. the orchard PR, last, with the kernel lock moved (tools/kernel-tree/take) to this PR's merge commit. Firmware without this kernel and this kernel without the new firmware both keep today's behaviour.

MasadaIV and others added 6 commits December 3, 2026 05:33
Allow the bootloader-supplied personality and document variant firmware-
name prefixes. Restrict the supported personality values only for D20
and D201.

Assisted-by: LLM
Signed-off-by: MasadaIV <6883111+MasadaIV@users.noreply.github.com>
Choose the distinct public firmware variant from the boot personality.
Honor explicitly declared 0x103 full-word calibration framing while
preserving legacy containers and other boards.

Assisted-by: LLM
Signed-off-by: MasadaIV <6883111+MasadaIV@users.noreply.github.com>
Let the driver append the variant selected from the boot personality.
Remove the D20 override so it inherits the shared iPhone 8 prefix.
The iPhone 8 Plus keeps its separate firmware filename.

Assisted-by: LLM
Signed-off-by: MasadaIV <6883111+MasadaIV@users.noreply.github.com>
A board whose controllers come with more than one firmware personality
names the start of its firmware files; the unit's personality, which the
bootloader passes as apple,hid-merge-personality, completes the name.
firmware-name stays a complete file name, the one used when the
bootloader passes no personality.

This replaces the D20/D201-only prefix meaning of firmware-name and the
list of personalities, so a new personality needs no binding change.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
Build the firmware name from apple,firmware-prefix and the personality
the bootloader passes on every board and in both the shared and the D21
backends, not only on the D20 and D201, and accept any personality
instead of a fixed list: a personality is one more file in the firmware
recipe, with no kernel change.

When the bootloader passes no personality, load firmware-name as before
rather than leaving the touchscreen off. When it passes one without a
file, the load fails and the log names the missing file; the unit never
gets another personality's firmware.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
… 8 Plus

Both iPhone 8 sizes come with two touch firmware personalities in their
IPSW: D20.mtprops has C1F5D,3 and C1F5D,4, D21.mtprops C1F5E,3 and
C1F5E,4. Name the files' prefix so the driver loads the one the unit's
ADT asks for. firmware-name is the file without a personality from the
bootloader, as before: C1F5D,3 on the iPhone 8, C1F5E,4 (the tested
one) on the iPhone 8 Plus.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants