Skip to content

A9 iPhones: start the AOP (v4 boot args); n66 motion sensors with measured mount matrices - #219

Merged
henrikklee merged 2 commits into
OrchardLinux:mainfrom
ricktav:n66/aop
Nov 23, 2026
Merged

henrikklee merged 2 commits into
OrchardLinux:mainfrom
ricktav:n66/aop

Conversation

@ricktav

@ricktav ricktav commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

The AOP on the A9 iPhones now starts, and on the n66 (iPhone 6s Plus, Samsung) the accelerometer and gyroscope work with measured mount matrices. This builds on 12bcfd3, which enabled the AOP and added the aopfw-s8000aop recipe.

Driver fix: version-4 boot arguments (drivers/soc-apple/0035)

Without this fix, the AOP does not start with the iOS 15 firmware.

  • The firmware has a version-4 RTKit header. aop-s8000.bin has zeros at 0x48/0x4c, so the current driver reads an empty boot-argument block.
  • The driver then logs unexpected boot arguments in apple/aop-s8000.bin: -2 and never starts the AOP.
  • Version 4 keeps the offset and size at 0x40/0x44. In this image they point to the real block at 0x4f3a8.
  • After the fix, the AOP reports ready and the MPU6800 (accel and gyro), HSCDTD601A and BMP280 come up.

Mount matrices (devices/t8010/0041, after 12bcfd3's 0040)

Measured on an n66 in six held poses: flat face up, flat face down, portrait, upside down, and both landscapes.

  • Accelerometer: diag(1,1,-1) fits every pose. Under iio-sensor-proxy each one gives the right orientation.
  • Gyroscope: its rates follow the accelerometer's rotation with the identity matrix.
  • The AOP firmware reports in the device's own axes, so both matrices go into s800x-iphone.dtsi and cover all six A9 iPhones.

Status

  • n66: accelerometer and gyroscope are working. The gyro note says its x sign is only weakly determined and its rate scale is not checked.
  • n66m, n69, n69u, n71, n71m: accelerometer stays untested, with the note "mount matrix measured on the N66".
  • The matrix is regenerated.

Tests

  • 926 OK (2 skipped).
  • audit-patches --device n66 passes.
  • The DTBs of all six iPhones have the AOP, the mailbox, aop-s8000 firmware and the matrices. J71s keeps aop-ipad6f.

🤖 Generated with Claude Code

drivers/soc-apple/0035 finds the boot arguments in version 4 RTKit image
headers as well as version 5. aopfw-s8000aop is an iOS 15 image with a
version 4 header; without this the driver reads an empty boot argument
block and the AOP that devices/t8010/0040 enables never starts.
devices/t8010/0041 adds the accelerometer matrix diag(1,1,-1) and the
gyroscope identity measured on an N66 (six poses, RAM boot 2026-11-23) to
the shared s800x-iphone.dtsi.

Assisted-by: LLM
RAM boot 2026-11-23: the AOP reports ready, the accel and gyro come up as
iio devices, and six held poses fit diag(1,1,-1) with every orientation
right under iio-sensor-proxy. The gyro rates follow the accel rotation
with the identity matrix; its x sign is weakly fixed and the scale is not
checked. The other A9 iPhones share the matrices and stay untested.

Assisted-by: LLM
@henrikklee
henrikklee merged commit cebc559 into OrchardLinux:main Nov 23, 2026
12 checks passed
henrikklee added a commit that referenced this pull request Nov 23, 2026
…ers; CHANGELOG

#219 refused AOP images whose header lacks the magic or has a version
other than 4 or 5. Only version 4 needs the new location; every other
image now keeps the location the driver used before, so the iPads whose
AOP starts today (iPad 7, iPad 6 and others on iPadOS 16 and 17) cannot
lose it to a header version this change did not look at.

Assisted-by: LLM
henrikklee added a commit that referenced this pull request Nov 23, 2026
#219's AOP patch already takes soc-apple 0035.

Assisted-by: LLM
@henrikklee

Copy link
Copy Markdown
Contributor

Thanks! This is on main now: the A9 iPhones' AOP starts with the iOS 15 firmware, and the mount matrices are in the shared iPhone file.

One change on top: the driver uses the version 4 location only when the header says version 4, and keeps the old location for every other image instead of refusing it. That way the iPads whose AOP starts today can't lose it to a header version this change didn't check. The iPhone 7 runs iOS 15 too and may benefit; it stays untested.

One request: your kernel patches here carry Signed-off-by: ricktav <…@users.noreply.github.com>. Could you reply with your Signed-off-by in the form Signed-off-by: Your Name <your@email>? We will put it on the patches.

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