Skip to content

iio: apple-oscar: switch on the PMIC 32 kHz clock on the iPad mini 3 - #108

Merged
henrikklee merged 2 commits into
OrchardLinux:mainfrom
en3r0:iio-apple-oscar-clk32
Dec 2, 2026
Merged

henrikklee merged 2 commits into
OrchardLinux:mainfrom
en3r0:iio-apple-oscar-clk32

Conversation

@en3r0

@en3r0 en3r0 commented Dec 2, 2026

Copy link
Copy Markdown

The M7 on the iPad mini 3 (J85M) never answered: its firmware halts with "PMU 32kclk is not working" because the D2089's 32 kHz clock output is off, so every in_accel, gyro and compass read timed out (the symptom in the J85M notes in OrchardLinux/orchard).

Apple's device tree gives the mini 3 function-oscar1_clock = <pmu 'GPIc' 0 0x79fb 0x49fb>; the mini 2 has none. iOS 12.5.8's GPIc applies mask 0xfb, value 0x49 (on) or 0x79 (off) to a PMIC register that its index 0 selects.

What this does

  • A D2089 clock-output switch (register 0x400) as a regulator, like the other M7 switches.
  • An optional clk32-supply on apple,s5l8960x-oscar, enabled before the core supply and disabled after it. Boards without the property are unchanged.
  • The supply described in s5l8960x-mini3.dtsi, with bindings.

Caveats

  • The index-to-register mapping was not found in iOS. Register 0x400 was inferred from a PMIC dump (0x400 = 0x79, 0x401 = 0x49) and confirmed on hardware.
  • A clock provider would be the usual form for a PMIC clock output; this follows the existing M7 switches.
  • The ordering against the other supplies is untested.
  • The device tree lives in the shared mini 3 file, so the J86M and J87M get it too; not tested there.

How it was tested

  • Built with clang 23 (LLVM=1): the driver, the regulator and the j85m, j86m and j87m device trees; the j85 tree has no new node.
  • One iPad mini 3 (J85M): the whole kernel RAM-booted by the ibss route (no module option, no manual register write). oscar-clk32 registered and read enabled, the M7 reported AOFB-27~91224 AppleOscar1-41.200.1~942 OscarMotion-2245.16.14~21, and in_accel read z = 66588 (scale 0.000149637, about 1 g) flat.
  • Earlier, with the register written by a debug module on the installed system, the screen auto-rotated to landscape.
  • Not run: dt_binding_check and checkpatch.

🤖 Generated with Claude Code

The M7 firmware checks its 32 kHz clock at start and halts with "PMU 32kclk
is not working" when it is off, so the M7 never answers and every
accelerometer, gyroscope and compass read times out.

Apple's device tree gives the iPad mini 3 (J85M) an oscar1_clock function,
<pmu 'GPIc' 0 0x79fb 0x49fb>, and not the iPad mini 2. iOS 12.5.8's 'GPIc'
applies mask 0xfb, value 0x49 (on) or 0x79 (off) to a PMIC register chosen
by index 0. That mapping was not found in iOS; register 0x400 was inferred
from a register dump (0x400 = 0x79, 0x401 = 0x49) and confirmed on hardware.

Add a D2089 clock-output switch as a regulator, like the other M7 switches,
and an optional clk32-supply on the M7 that the driver enables before the
core supply and disables after it. Describe it in the mini 3 device tree.
A clock provider would be the usual form for a PMIC clock output.

Tested on one iPad mini 3 (J85M) in a RAM boot: oscar-clk32 registered and
enabled, the M7 reported its firmware (AppleOscar1-41.200.1) and the
accelerometer read about 1 g flat, with no module option. Not tested on
the J86M or J87M, which share the device tree file, or the iPad mini 2.

Assisted-by: LLM
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: en3r0 <en3r0.x@gmail.com>
en3r0 added a commit to en3r0/orchard that referenced this pull request Dec 2, 2026
Record the M7 on the iPad mini 3: with the 32 kHz clock output switched on
the M7 boots and in_accel reads about 1 g flat (kernel RAM-booted by the ibss
route with OrchardLinux/linux#108); the screen rotated to landscape on the
installed system with the same register written by hand. Gyroscope stays
untested: raw reads only.

Assisted-by: LLM
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: en3r0 <en3r0.x@gmail.com>
en3r0 added a commit to en3r0/orchard that referenced this pull request Dec 2, 2026
Seen on the installed Omarchy A 0.4.6 after a cold boot with
OrchardLinux/linux#108: resting readings varied by about 1e4 counts, and
turning the iPad by hand swung the gyro by about 1e7 and the compass heading
through 223 degrees. Units and calibration were not checked.

Assisted-by: LLM
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: en3r0 <en3r0.x@gmail.com>
# Conflicts:
#	drivers/iio/imu/apple-oscar.c
@henrikklee
henrikklee merged commit 452af88 into OrchardLinux:main Dec 2, 2026
4 checks passed
en3r0 added a commit to en3r0/orchard that referenced this pull request Dec 2, 2026
After a 3 minute s2idle on the installed Omarchy A with OrchardLinux/linux#108,
Wi-Fi reconnected by itself, the M7 sensors still read, and the paired
earbuds reconnected on request and played a tone.

Assisted-by: LLM
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: en3r0 <en3r0.x@gmail.com>
edulmartins pushed a commit to edulmartins/orchard that referenced this pull request Dec 3, 2026
With the PMIC 32 kHz clock switched on (OrchardLinux/linux#108, en3r0),
the M7 firmware boots and in_accel reads about 1 g lying flat. No
gyroscope or compass readings were reported, so those stay untested.

Assisted-by: LLM
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