Skip to content

arm64: dts: apple: AOP motion sensors on every laptop, J180d die 0 SIO alias, M2 Pro/Max/Ultra scaler - #2793

Closed
RyanTheTide wants to merge 3 commits into
mainfrom
spec12/aop-motion-v2
Closed

RyanTheTide wants to merge 3 commits into
mainfrom
spec12/aop-motion-v2

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #2248, #2250 and #2252 (same changes, commit trailers fixed).

Three small spec12 changes, one commit each, in this order:

arm64: dts: apple: t600x, t8112: describe the AOP motion sensor on every laptop (was #2248)

Problem

The AOP accelerometer and gyroscope were described only on the J316s and J413 (165f4bd, 0064b75), because those were the two machines whose device trees were at hand. Their sibling laptops have the same AOP service but get no motion sensor.

Change

Move the accel and gyro children from t6000-j316s.dts and t8112-j413.dts to t600x-j314-j316.dtsi and the AOP node in t8112.dtsi. This reaches the J314s, J314c and J316c (M1 Pro/Max MacBook Pro) and the J415 and J493 (M2 laptops). The J473 (M2 mini) gets them under its disabled AOP node, where they do nothing. T8103, T602x and the desktops are not touched.

Testing

  • dtc before/after: the J316s and J413 DTBs are byte-identical. J314s, J314c, J316c, J415, J493 and J473 gain only the two nodes. J375c, J375d, J293 and J313 are unchanged.
  • The sensor appears only where the hardware has it. aop.rs (register_service) creates the device only when the firmware announces the service. aop_motion.rs starts it only with the calibration m1n1 copies from the ADT; without that it logs one info line and returns -ENODEV.

Still to run

  • J316s and J413: aop-sensors-accel and aop-sensors-gyro still listed in /sys/bus/iio/devices/*/name.
  • J314s, J314c, J316c, J415, J493 owners: the same two devices appear.

arm64: dts: apple: t6022-j180d: alias the die 0 SIO (was #2250)

Problem

On the Mac Pro (J180d) the die 0 HDMI port's audio controller (dpaudio1) is enabled, but it takes its DMA from the die 0 SIO (dmas = <&sio 0x66>). The loader sets up and enables each SIO it finds through an alias, and t6022-jxxxd.dtsi only aliases the die 1 SIO (sio1). So the die 0 SIO stays disabled and the die 0 HDMI port has no audio.

Change

Add the sio alias for the die 0 SIO in t6022-j180d.dts. This is the SIO hunk of #1115, split from that PR's Neural Engine changes so it can be reviewed on its own. The Mac Studio (J475d) is not changed: every display output it has, and their audio, runs from die 1.

Testing

DTB diff against 0abc2f3: J180d gains only the alias; J475d is unchanged.

Still to run

A J180d owner: die 0 SIO status reads okay, aplay -l lists the HDMI card, and audio plays to an HDMI sink.

media: apple: scaler: add the M2 Pro, Max and Ultra engines (was #2252)

Problem

The scaler (MSR) driver did not list the M2 Pro, Max and Ultra engines (T6020/T6021/T6022), so those Macs had no hardware scaler. d34ed1e left T602x out, and c91d838 described the T602x nodes as disabled until a driver qualified them.

Change

Match apple,t6020-scaler, apple,t6021-scaler and apple,t6022-scaler with the T8112 variant data. Enable the engines and their DARTs in t6020-peripherals.dtsi, t6021-peripherals.dtsi and t6022-peripherals.dtsi: one engine on M2 Pro, two on M2 Max, four on M2 Ultra. The T602x nodes use the T8112 register map: three ranges at the same offsets and sizes, two DART streams and the apple,scaler fallback. apple,scaler.yaml already groups these compatibles with apple,t8112-scaler.

Testing

  • make W=1 drivers/media/platform/apple/scaler/ (arm64, LLVM): no warnings before or after.
  • DTBs for all 23 M1/M2-family boards built before and after: 15 are identical, including the J316s and J413. The 8 T602x boards change only the scaler and scaler-DART status lines.
  • KUnit was not run: the scaler tests cover the CSC and format tables, not the match table.

Still to run

An M2 Pro/Max/Ultra owner: one probe line per engine with no DART faults, v4l2-compliance -s on the scaler node, and a 1080p NV12 to BGRx v4l2convert pipeline that reaches EOS. Please also report the engine id value (J413 reads 0x10c000a).

Per-SoC detail
  • T6020 (j414s, j416s, j474s): scaler@40b000000.
  • T6021 (j414c, j416c, j475c): @40b000000 and @491000000.
  • T6022 (j180d, j475d): four engines, two per die.
  • Each scaler DART names its die's MSR domain (4109497, by Diljit Singh). The engine also votes the T602x media fabric domain (ps_afr). The probe reads only the ID, running and IRQ status registers, with the engine powered, and a job that does not complete is caught by the 500 ms watchdog.
  • The scaler has no ID check at probe, so a wrong engine generation would only show up as a job timeout.

…ery laptop

The AOP accelerometer and gyroscope children were described only in
t6000-j316s.dts and t8112-j413.dts, the two machines whose Apple device
trees were at hand. The other 14" and 16" M1 Pro/Max MacBook Pros
(J314s, J314c, J316c) and the other M2 laptops (J415, J493) share the
same AOP and are left without them.

Nothing in the description is board specific. The AOP core creates a
service device only when the firmware announces the "accel" or "gyro"
service, and gives it the AOP child of the same name. The driver then
starts the sensor only with the calibration the bootloader copies into
that child from the Apple device tree, and returns -ENODEV with one
info line otherwise. On a machine without the sensor the child stays
unused.

Move the children to t600x-j314-j316.dtsi, next to the AOP enable of
every M1 Pro/Max laptop, and to the AOP node in t8112.dtsi, next to the
las and als services that are already there. The T8112 Mac mini (J473)
keeps its AOP disabled, so the children are inert there.

The J316s and J413 DTBs are byte-identical before and after.

Fixes: 165f4bd ("arm64: dts: apple: describe reference Mac motion and peripheral endpoints")
Signed-off-by: Ryan Murray <[email protected]>
The Mac Pro's die 0 HDMI port has its audio controller (dpaudio1)
enabled, and that controller takes its DMA from the die 0 SIO. The
loader sets up and enables each SIO it finds through an alias, and
t6022-jxxxd.dtsi only aliases the die 1 SIO (sio1), so the die 0 SIO
stays disabled and the die 0 HDMI port has no audio.

Add the sio alias for the die 0 SIO. The Mac Studio (J475d) is not
changed: all its display outputs, and their audio, run from die 1.

This is the SIO hunk of linux#1115, split from that PR's Neural
Engine changes so it can be reviewed on its own.

Signed-off-by: Ryan Murray <[email protected]>
The scaler matched T8103, T6000, T8112 and the M4/A18 Pro engines, but
not T6020, T6021 or T6022. Their device trees describe the MSR engines
(one on M2 Pro, two on M2 Max, four on M2 Ultra) and keep them disabled
because nothing would bind.

The driver needs two things from a variant: the number of register
ranges and whether the engine has the MSR20 control block (M4 and
later). The T602x nodes have the T8112 register map: three ranges of
0x28000, 0x4000 and 0x4000 bytes at +0, +0x210000 and +0x204000, two
DART streams, and the "apple,scaler" fallback. The scaler binding
already puts apple,t6020/t6021/t6022-scaler in the same constraint
group as apple,t8112-scaler. They are M2-generation engines, before
MSR20. Use the T8112 data for them.

Enable the engines and their DARTs in the T6020, T6021 and T6022
peripheral trees, so every board with the SoC gets them. The DARTs name
the MSR domain of their own die since
commit 4109497 ("arm64: dts: apple: t602x: give the scaler and external DCP DARTs their power domains"),
so the DART's first register read finds its block powered.
The engines additionally vote the T602x media fabric domain (ps_afr),
which the driver links through its power-domain list.

T8103, T6000/T6001/T6002 and T8112 device trees are unchanged.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Review at 6f0d2c1 (non-author, draft). No blocker found in the three commits; none of them has a hardware row yet, and the scaler commit should have a boot row before it merges.

  • Merges cleanly onto integration/aurora 6748d83. Three commits, human sign-offs only. arm64: dts: apple: t600x, t8112: describe the AOP motion sensor on every laptop #2248, arm64: dts: apple: t6022-j180d: alias the die 0 SIO #2250 and media: apple: scaler: add the M2 Pro, Max and Ultra engines #2252 are closed.
  • AOP motion (1812236): the nodes are moved, not changed; J316s and J413 keep the same compatibles. aop_motion.rs matches the generic apple,aop-accel/apple,aop-gyro, and apple,aop-motion.yaml lists the t6000 and t8112 compatibles, so the binding holds for J314s/J314c/J316c/J415/J493. On J473 the AOP node stays disabled.
  • SIO alias (90dd5ee): t6022-jxxxd.dtsi aliases only sio1 = &sio_die1; the loader walks the aliases sio and sio1, so the die 0 SIO was never set up on J180d. J475d is untouched.
  • Scaler (6f0d2c1): the T602x nodes have three ranges (0x28000, 0x4000, 0x4000 at +0, +0x210000, +0x204000), two streams and three power domains, and apple_scaler_t8112 needs exactly num_reg = 3, no MSR20. The driver attaches every listed domain when there is more than one, so ps_afr and the ASE core domain are on while the engine is runtime-active. The DARTs name ps_msr0/ps_msr1 (and the die 1 ones), so the DART probe does not touch an unpowered block.

Small points, not blocking:

  • Scaler: this turns on 1, 2 or 4 engines and their DARTs on eight boards with no boot on any of them. A wrong power domain on a DART is not a quiet failure at boot. Please get one boot row on a T6020 and one on a T6022 (die 1 engines) before merge, in addition to the v4l2-compliance/pipeline row already listed.
  • Scaler: apple_scaler_t8112.hw_version is 13, and the probe line prints it. On T602x that line will report 13 without anyone having read the engine's version. Either a T602x variant with the version from the hardware description, or leave it and correct after the first row reports the id register.
  • Scaler: three more match entries that carry identical data. Since every node already has the apple,scaler fallback and the binding groups these with T8112, a note on why the fallback cannot carry the T8112-class data would help; media: apple: scaler: M3 family engines, keep CAPTURE at the OUTPUT size #2804 adds the M3 ones on top in the same way.
  • AOP motion: the title says "every laptop", but the T8103 and T602x laptops are not covered (the binding has no compatible for them). A sentence saying they are left for a follow-up would avoid the question.
  • SIO alias: this is the same hunk as in the open arm64: dts: apple: t6002/t6022: enable the die 0 ANE and J180 die 0 SIO (needs an Ultra tester) #1115; whichever lands second needs a rebase.
  • Rows still open, as listed: IIO device names on J316s/J413 (unchanged) and on one newly covered laptop; J180d die 0 SIO okay plus HDMI audio; the scaler rows above.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent source review at 6f0d2c1deacd. The T8112 motion nodes now live under the shared AOP. I checked that they still need an advertised service, so a J473 with an AOP enabled later should not register desktop motion sensors by default. Please verify that in the J473 AOP bring-up and confirm both J413 devices still report calibrated data. The scaler and SIO changes have independent hardware dependencies and should retain their own validation.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Folded into #2804, which carries this PR's commits unchanged; review continues there.

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