Skip to content

kboot: pass the AOP motion sensor calibration to the OS - #35

Merged
RyanTheTide merged 1 commit into
mainfrom
feat/aop-motion-cal
Oct 31, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
feat/aop-motion-cal

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Copy the AOP accelerometer and gyroscope calibration from the ADT into the OS device tree. Ported from aurora-silicon/m1n1#61.

kboot reads accel-{range-intr,nominal-extr,range-extr}-cal and the matching gyro- properties from /arm-io/aop/iop-aop-nub/{accel,gyro}. It writes them as apple,range-intrinsic-cal, apple,nominal-extrinsic-cal and apple,range-extrinsic-cal on the accel and gyro children of the OS AOP node. The Linux aop_motion driver sends these packets to the AOP before it starts the reports. A missing service, child or property is skipped and logged, so boards without motion services are unaffected.

Hardware result (J616s, M4 Pro)

Stage 2 is aura main 999b72e plus this commit (same tree as 174a42c; only the message changed) plus the aurora-wip DTB. Kernel 7.3.0-aurora-tt3.

  • All six properties are in the live DT under /proc/device-tree/aop@510600000/{accel,gyro}. They are byte-identical to the macOS 27.0 (26A428) ADT values: 60/56/56 bytes, single location-0 entries.
  • Boot is clean. journalctl -b -p 3 is empty, all three DCPs bind, the panel and both external displays come up, and ALS, LAS and the audio cards probe.
  • With the kernel fix that keeps the T6040 AOP nCal boot argument at its firmware default (linked from the kernel PR), both IIO devices report.
    • Accel at rest: |a| = 9.64 m/s^2 over 291 samples, range 9.62 to 9.65.
    • Gyro: about 0.4 deg/s static bias.

Tests

  • Host pytest suite: tests/python, test_t8122_gpu_reader.py, test_t8122_gpu_resources.py.
  • Cross build: make ARCH=aarch64-linux-gnu- CHAINLOADING=1 EXTRA_CFLAGS='-Wstack-usage=2048 -Os'.

🤖 Generated with Claude Code

The AOP accelerometer and gyroscope take the machine's calibration from
the OS, as three per-sensor packets. Copy the accel and gyro
calibration properties from the ADT AOP services into the matching
children of the OS AOP node, where the OS driver reads them. A missing
service or property is skipped.

Ported from aurora-silicon/m1n1#61.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit 6ec6b43 into main Oct 31, 2026
12 of 14 checks passed
@RyanTheTide
RyanTheTide deleted the feat/aop-motion-cal branch October 31, 2026 23:59
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merged with every check green except Pytest (macos-14 + llvm-brew). That job failed in 1 s, twice, with no runner assigned, because GitHub is running a scheduled macOS 14 runner image brownout (images retire 2026-11-02, actions/runner-images#13518). macos-15, both ubuntu, arm64-native, build and format-check all pass. Host pytest locally: 561 passed, 17 skipped.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Follow-up evidence: with this calibration copy and linux#745 (merged as 3412c752), Ryan's motion test on J616s passed. Accel tilt tracked about 90 deg left/right and the front lift, |a| was 9.6 m/s^2 at rest, and integrating gyro z gave 92 deg for a quarter-turn spin.

🤖 Generated with Claude Code

@RyanTheTide RyanTheTide mentioned this pull request Nov 1, 2026
dmitzsaz pushed a commit to dmitzsaz/aura that referenced this pull request Nov 6, 2026
…-bringup

kboot: add J713/T8132 (M4 MacBook Air) boot handoffs
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.

1 participant