Skip to content

J514s: SEP and Touch ID (T6030) - #581

Closed
adammharris wants to merge 469 commits into
aurora-silicon:aurora-wipfrom
adammharris:feat/t6030-j514s-touchid
Closed

adammharris wants to merge 469 commits into
aurora-silicon:aurora-wipfrom
adammharris:feat/t6030-j514s-touchid

Conversation

@adammharris

@adammharris adammharris commented Oct 29, 2026 •

Copy link
Copy Markdown

Touch ID on the 14" M3 Pro MacBook Pro (J514s, T6030).

Changes

  • t6030.dtsi: adds the SEP, its DART and mailbox, and spi2 with the Mesa sensor child, all disabled. The SEP and its DART sit at the same addresses as on T8122, with the same BIT(40) DMA window (vm-base 0x10000004000, vm-size 0xffff0000). The mailbox uses AIC 366–369, the DART AIC 372, and spi2 is at 0x289108000 on AIC 876.
  • t6030-j514s.dts: enables the mailbox, spi2 and the sensor. Power is NUB GPIO 33, active high. As on J613, the data-ready line (AP GPIO 200) is left out and the driver polls. The calibration comes from the Mac's own iBoot system container as apple/mesacal-j514s.bin.
  • soc: apple: sep: adds a T6030 profile, which is T8122 with J514s's spi2 base. The J514s sensor is the same 0x3352 part, in SPI mode 1, with the variant-5 key store and xART guard level 1 from the first boot. Only apple,t6030 + apple,j514s is matched. J516s shares the SoC, but its ADT hasn't been read, so it stays off.
  • tools/aurora-sep/tests/test_t6030_sep.py: checks the compiled J514s tree against the ADT values, checks that J516s leaves the SEP and sensor off, and checks the profile match.

The values come from the J514s ADT (ioreg -p IODeviceTree, system firmware 27.0) with the /arm-io base of 0x210000000 added. The mailbox interrupts follow the ascending order the T6030 SIO mailbox already uses for its ADT list.

Testing

J514s, system firmware 27.0, with macOS on the same disk.

  • Read-only first boot (xart_writes=0 provision_keybag=0): the profile T6030/J514s is selected, the SEP attaches warm and advertises 12 endpoints, and the key store opens. /dev/sep-bio is published and the sensor's SPI driver binds at 8 MHz, mode 1. Nothing is written.
  • First boot with writes: the identity keybag is provisioned. The guard runs at level 1, protects all 10 existing macOS session records, and refuses nothing.
  • Sensor bring-up: the identifier appears 18 ms after power-on, then REGISTER_SERIAL, SESSION_SHARE and SESSION_COMMIT complete.
  • Enrolment and matching: fprintd-enroll and fprintd-verify work with Aurora's libfprint.
  • Persistence: a match still works after a reboot and after suspend and resume.
  • macOS: Touch ID still works in macOS afterwards.
  • Tests: test_t6030_sep.py and test_t8122_sep.py pass with the kernel's dtc. t6030-j514s.dtb and t6030-j516s.dtb build with W=1 and no new warnings.

The hardware test ran on this change applied to a 7.2.11 J514s tree. It is the same diff apart from the profile's doc comment.

Not tested:

  • J516s, since there's no ADT for it.
  • The data-ready interrupt path: GPIO 200 is described in the ADT, but left out here.

The same change for omacom's 7.2.11 integration/aurora is in omacom/linux-aurora#282. That base matches the tree the hardware test ran on.

🤖 Generated with Claude Code

@adammharris
adammharris marked this pull request as ready for review October 29, 2026 19:56
RyanTheTide and others added 16 commits November 9, 2026 21:14
Devices with multiple power-domains entries are not attached by the platform bus. Attach each domain with an active device link before touching the controller, while leaving the single-domain attachment to the bus.

Preallocate one notifier per attached domain and extend the PCIe-C sleep hold to cover all of them. Internal hosts leave their links running in suspend-to-idle and cannot recover from a power cycle, so veto power-off on every domain until resume. Unwind partial holds on error and abort suspend rather than lose an internal link.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The internal host needs both the general-purpose and storage/PHY chains listed by the ADT clock gates. On J616s APCIE_SYS_GP reaches APCIE_GP, while APCIE_PHY_SW reaches both storage chains and ANS. On T8112 APCIE_ST adds the ANS/storage chain that NVMe happens to keep powered today.

Keep the J616s interim always-on states until the host can cold-initialize its internal links after resume.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…r chain

The T8140 ADT gates APCIE_GP, APCIE_SYS_GP, APCIE_ST, APCIE_SYS_ST, ANS and APCIE_PHY_SW for apcie0. APCIE_PHY_SW already has all of the other domains as ancestors, so attach the host to that leaf instead of APCIE_GP alone. This removes its dependency on NVMe keeping the storage and PHY chain on.

The host retains this chain during suspend-to-idle while the radio wake path leaves the internal link running.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…t8112

arm64: dts: apple: j316s, j413: enable the AOP accelerometer and gyroscope
Maverick keeps a second fired-event latch in control bit 1, next to
the event register. The arm path preserved that bit, so after one
alarm had fired (or firmware had left the latch set) the alarm was
armed as 0x43. The comparator still matched and cleared ARM, but no
new event edge latched and the SPMI interrupt never fired.

Clear the control event bit on every control write, so the alarm is
armed as 0x41 and each match raises interrupt 2.

On a J316s (M1 Pro) with this series, two awake alarms each raised
the RTC interrupt once and cleared wakealarm, and six 15 s s2idle
suspends woke on the RTC interrupt after 15.5-16.0 s.

Extend the host model with Maverick's write-zero-to-clear control
latch and its stale-edge suppression. Stowe keeps its exact control
value checks, so the T8112 path is unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
The domain-attachment helper is a no-op without CONFIG_PM. Keep the host usable in that configuration instead of treating its zero return as a missing domain.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…real-pmgr

arm64: dts: apple: adt-coverage: fix the j413 and j316s PMGR waivers
drm/apple: timestamp fixed ProMotion modes on legacy firmware
The fixed job words at 0x2e300-0x2e318 belong to the MSR20 generation
(M4, M4 Pro/Max, A18 Pro). Older engines have a 0x28000 aperture, so
writing them faults. Move those words to a table that only MSR20
variants emit, and refuse a job whose register list does not fit the
aperture instead of writing past it.

Add the T8112 (hardware-version 13) and T6000 (hardware-version 12)
engines. Both have three register ranges and run the same jobs as the
MSR20 engines without that control block.

Tested with msrv4l2, which converts NV12, NV12M and P010 to ARGB32 and
ARGB32 to NV12M at 1080p, 20 jobs each, against a software reference:

  M2 (T8112)     PASS, max error 1, about 1.0 ms per job
  M1 Pro (T6000) PASS, max error 1, about 2.15 ms per job

No DART faults; the engine runtime-suspends when idle. KUnit
apple-scaler 14/14 passes.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The scaler (MSR, hardware-version 13) and its DART work on the M2 with
apple-scaler. Enable both for all T8112 boards.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
reset_resume re-arms the work that puts the trackpad back into
multitouch mode 500 ms after resume. When the next suspend starts
within that window, the work is still pending: its timer fires during
the following suspend or resume, before the SPI HID transport is
powered again, and the feature report fails with -ENODEV ("unable to
request touch data (-19)"). The touch mode is then not restored after
that resume.

Cancel the work in suspend. reset_resume schedules it again as before;
a plain resume, where the device kept its state, re-queues it only if
suspend stopped it while it was pending.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
The scaler (MSR, hardware-version 12) and its DART work on the M1 Pro
with apple-scaler. Enable both on the T6000 (M1 Pro) boards.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The T8112 error handler has 19 interrupts: one AMCC aggregate line, two
SEP lines (memory protection and clock/process monitor) and sixteen DCS
lines (eight channels and their calibration partners). Claim the SEP
lines and leave AMCC and DCS unclaimed, as on T6000 and T6041.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
apple_soc_edac now matches the T8112 error handler. Enable it.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The MTP PM model now runs the production magicmouse_suspend() from the
transport's suspend notification. It checks that pending multitouch
enable work is cancelled at suspend and queued once on resume, and that
idle work stays idle.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please retarget this to integration/aurora and rebase. A test merge into the current integration/aurora conflicts in arch/arm64/boot/dts/apple/t6030-j514s.dts and drivers/soc/apple/profile.rs.

arm64: dts: apple: t8132-j773g: Keep the PMC power state on
…cross-sleep

HID: magicmouse: hold the multitouch enable work across system sleep
Since XDomains are removed from the bus without holding tb->lock,
tb_xdomain_remove() only takes an XDomain out of the topology; the
caller unregisters it later with tb_domain_unregister_unplugged_xdomains().
tb_domain_remove() never does that. Stopping the connection manager
removes the root switch, which marks every XDomain unplugged and calls
tb_xdomain_remove(), but the XDomain stays registered on the bus and its
service drivers stay bound.

When the domain is then freed, a bound thunderbolt-net keeps its
protocol handler on the global list with xd->tb pointing at the freed
domain. A host router driver that removes and re-adds its domain when
the link restarts (the Apple ACIO driver does so when the partner
reboots) then gets a new domain with the same index: adding the new
XDomain fails with a duplicate "0-1" sysfs name, and the stale
thunderbolt-net answers the partner's ThunderboltIP login, which now
arrives on the new control channel, through the freed one:

  Unable to handle kernel paging request at virtual address ...
  pc : queued_spin_lock_slowpath+0x18c/0x5d0
  Call trace:
   queued_spin_lock_slowpath+0x18c/0x5d0 (P)
   _raw_spin_lock_irqsave+0x9c/0xa8
   __mutex_unlock_slowpath+0x90/0x338
   mutex_unlock+0x34/0x70
   tb_cfg_request+0x218/0x250 [thunderbolt]
   tb_xdomain_response+0x74/0xb0 [thunderbolt]
   tbnet_login_response+0x9c/0x238 [thunderbolt_net]
   tbnet_handle_packet+0xd0/0x358 [thunderbolt_net]
   tb_xdomain_handle_request+0xf0/0x1f0 [thunderbolt]
   tb_domain_event_cb+0x60/0xa8 [thunderbolt]
   tb_ctl_handle_event+0x38/0x170 [thunderbolt]
   tb_ctl_rx_callback+0x1b8/0x528 [thunderbolt]
   ring_work+0x138/0x280 [thunderbolt]

Unregister the unplugged XDomains in tb_domain_remove() once tb->lock
is dropped and the domain workqueue is drained, before the connection
manager is deinitialized and the domain device goes away. The control
channel is already stopped at that point, so requests the service
drivers send while unbinding (thunderbolt-net's logout) fail with
-ENOTCONN instead of waiting for a timeout.

Fixes: a8937f3 ("thunderbolt: Remove XDomain from the bus without holding tb->lock")
Closes: aurora-silicon/linux#1318
Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
tbnet_remove() unregisters the network device first and the
ThunderboltIP protocol handler after it. In between, a login or logout
packet from the remote host still reaches tbnet_handle_packet(), which
can queue login, connect or disconnect work for a device that is being
torn down. A logout queues the disconnect work without checking whether
the interface is up, and nothing cancels it after tbnet_stop() has run,
so it can run after free_netdev().

Take the handler off the list first, then unregister the netdev, and
cancel any disconnect work that is still pending before freeing it.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
t8132: resolve pmgr_cio in the M4 PMGR policy (J604 boots on its own DT); J604 boot framebuffer without ps_dptx_phy
The scaler (MSR, hardware-version 22) and its DART work on the J700
with apple-scaler. Enable both.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
…d VEN

Three of the seven endpoint interrupts have a known role: the transport
error (3), host wake (5) and receive data ready (6). Name all seven so
that a driver can request them by name, and describe the VEN enable
line.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The T6000 and T8112 Stockholm follower uses the same register map as
the model-96 part, with follower ID 0x1c and IRQ base 0xa0. Its commands
are not acknowledged until about 10 ms after VEN rises. Add it as a
second model for the apple,t6000- and apple,t8112-stockholm-spmi
compatibles.

The T8112 AOP SPMI controller has no AP interrupt, so neither do its
followers. In that case check that the follower answers, then park VEN
low.

Tested on the M2: "follower 0x1c present, no interrupt path; parked
off" on every load.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Enable the AOP SPMI bus and the Stockholm NFC controller on it, with VEN
on SMC GPIO 15. apple-stockholm finds the controller and keeps it off.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
tb_approve_xdomain_paths() looks up the destination and NHI ports
before it takes tb->lock. A service driver can still ask for paths
while the domain is being stopped: thunderbolt-net enables them from
its connected work, which a ThunderboltIP login queued just before the
control channel was stopped. By then tb_stop() may have removed the
routers and cleared tb->root_switch, so tb_switch_find_port() follows
a NULL pointer, and the XDomain's parent router is a removed switch.

Take tb->lock first and return -ENODEV when the XDomain is unplugged
or the root switch is gone. tb_disconnect_xdomain_paths() already
skips an unplugged XDomain the same way.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
arm64: dts: apple: t8142-j704: enable the MacBook Pro (14-inch, M5)
RyanTheTide and others added 27 commits November 10, 2026 07:01
tbnet_connect_failed_locked() now starts a new login after
TBNET_LOGIN_DELAY and tbnet_stop() cancels the login answer worker.
Give the fixture the new struct tbnet members and constants, and count
a login retry apart from the Rx refill retry, whose 100 ms delay the
fixture still checks.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
CD321x now watches for the USB4/Thunderbolt router to register a new
switch also when the router is already there at probe, so that it
takes the new switch after an unbind and bind. Update the typec-probe
case: a port probed with its router holds the watch until it is
unregistered, and a watch that cannot start leaves the port probed with
the router it has.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
thunderbolt: Keep the thunderbolt-net link up across partner restarts
…string

The ADT's iop-pmp nub carries segment-names as a NUL-terminated string
("__TEXT;__DATA" on J813, "__TEXT;__DATA;__ETEXT" on J714s). A DTB has
no types, so dt-validate decodes those bytes as a string and the
uint8-array pattern rejects them on every board that carries the value
(t8142-j813 today). Give the property its own string type and keep it
out of the opaque-bytes pattern; the bytes in the DTB do not change.

Signed-off-by: Diljit Singh <hey@djdev.me>
The binding requires reg-names when a DART has a second region. The ADT
dart-pmp0 instance list names them DART and DAPF (it also carries
dapf-instance-0), so call them "dart" and "dapf". No driver looks them
up by name.

Signed-off-by: Diljit Singh <hey@djdev.me>
arm64: dts: apple: t6050-j714s: Run the PMP and report the GPU to it
The M1 Pro MacBook Pros expose no CPU, GPU or SoC rail voltage, though
their SMC reports every output of the cluster, GPU and SoC voltage
regulators on the CLVR SPMI buses, and macOS reads the same keys.

Add them as hwmon voltage channels: VC10-VC13 (CPU P clusters),
VC20-VC23 (GPU) and VC30-VC33 (SoC), plus the two main PMU bucks that
follow the E cluster (VP0b, VP2b). The keys were mapped on a J316s by
holding every cluster at its lowest step and loading one at a time:
VC10/VC11 follow the second P cluster (571-906 mV and 770-1060 mV from
the lowest to the highest step), VC12/VC13 the first (566-906 mV,
768-1058 mV), VP0b/VP2b the E cluster (547-834 mV, 768-924 mV).
VC20-VC23 read 0 mV while the GPU is power-gated and 700-800 mV under
load; VC32/VC33 rise with GPU load, VC30/VC31 stay flat.

Linux sends nothing on the CLVR buses; the channels are SMC key reads.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
arm64: dts: apple: t6000: add the SMC rail voltages
…C port (#1391)

* arm64: dts: apple: t6050-j714c: Run the PMP and report the GPU to it

Enable the PMP on the M5 Max 14-inch the way the J714s does since #1376:
the PMP with its boot arguments, mailbox, DART and power states, the PMP
report, the PMC's agent 0 and the GPU's request in the report. They stay
enabled together, so the GPU never waits on a disabled report. The CLPC
keeps its vote; the PMC takes the higher of the two.

The values come from ADTs of the same silicon, not from a J714c unit:
- apple,board-id is 10, the J714c's board ID (0x0a; the N1 platform ID
  above has it too).
- apple,dram-vendor-id is 255 and pmc/pmc-pmgr are 1/63, as a J716c reports
  them. They are only fallbacks: the boot loader copies /chosen and the
  PMGR's values over them.
- t6050-max-pmp-tunables.dtsi is the 173 iop-pmp0-nub properties of a
  J716cAP 27.0 ADT, raw bytes, in the format of the J714s file. The
  J714cAP and J716cAP firmware ADTs have identical PMP nodes (props and
  all 29 variant sub-nodes), and the h17c-family variant tables of that
  firmware ADT reproduce 166 of the 173 values; the other seven (the
  AGX DVFS voltages, the segment ranges and names, pre-loaded and three
  variant picks) are runtime values iBoot fills in.

Not run on a J714c.

* arm64: dts: apple: t6050-j716c: Move the right USB-C port into t6050-max-atc2.dtsi

The J714cAP and J716cAP firmware ADTs carry identical nodes for the right
USB-C port: the HPM on nub-spmi-a1, ATC2's PHY, USB controller and DARTs,
the USB4/Thunderbolt router and the PCIe tunnel. Move the J716c's
description of them into t6050-max-atc2.dtsi so the J714c can include it
instead of a second copy.

The host DROM (apple,thunderbolt-drom) stays in the board file: this J716c
unit's DROM carries a router UUID from an earlier boot.

No change to the J716c: its DTB is byte-identical before and after, and
so are the other ten T6050 board DTBs.

* arm64: dts: apple: t6050-j714c: Enable the right USB-C port

Include t6050-max-atc2.dtsi on the J714c: the right USB-C port's PD
controller (nub-spmi-a1, hpm2), ATC2's PHY, USB controller and DARTs, the
USB4/Thunderbolt router and the PCIe tunnel. The J714cAP firmware ADT
describes them with the same values as the J716cAP one. The ADT also has
the PD controllers hpm0 and hpm1 on nub-spmi-a0 and an hpm5; this commit
does not describe them or the ports behind them (ATC0, ATC1, ATC3).

The nodes the J714c board did not reach are now in t6050-max.dtsi's
J714c-and-J716c blocks (ATC2, ACIO2, APCIEC2 and nub-spmi-a1), and
t6050-peripherals.dtsi stops adding its own staged nub-spmi-a1 and
apciec2_dart for the J714c.

apple,thunderbolt-drom is the template value of the J714cAP ADT, not
a unit's UUID; the boot loader replaces it. Not run on a J714c.

Checked offline: all 11 T6050 board DTBs build with dtc, and the ten
other than the J714c are byte-identical to the base tree. dt-validate of
the J714c DTB has one warning, the PCIe "port0" in the apciec2 node, which
the J716c DTB has already; the J714c had none before.
…1396)

Enable the debug dock connection status register (read through the
apple,debug-dock debugfs view).

On J700, enable uart4 and uart5, which carry the Wi-Fi and Bluetooth
firmware debug output, with their receive pins muxed. Neither is a
console; the ports stay closed until a user opens them. The PMGR clock
provider is not enabled on T8140 yet, so both are clocked from the
24 MHz reference.

dtc W=1 and CHECK_DTBS report nothing for the changed nodes.


Assisted-by: LLM

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
…r chain (#1397)

The T8140 ADT gates APCIE_GP, APCIE_SYS_GP, APCIE_ST, APCIE_SYS_ST, ANS and APCIE_PHY_SW for apcie0. APCIE_PHY_SW already has all of the other domains as ancestors, so attach the host to that leaf instead of APCIE_GP alone. This removes its dependency on NVMe keeping the storage and PHY chain on.

The host retains this chain during suspend-to-idle while the radio wake path leaves the internal link running.

Assisted-by: LLM

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T6050 Max CPU nodes had no cpu-map, so Linux sees eighteen CPUs in
one package with no clusters. parse_dt_topology() also reads each CPU's
capacity-dmips-mhz only while it walks cpu-map, so without one no
capacity reaches the scheduler. Describe the three clusters as the ADT
does: MPIDR Aff1 0 and 1 are the M clusters, 2 the P cluster, each with
its own L2. The boot loader prunes the entries of cores it did not
start. The two-die description keeps its flat layout for now.

Signed-off-by: Diljit Singh <hey@djdev.me>
Without capacity-dmips-mhz every T6050 CPU reports a capacity of 1024,
so the scheduler treats the six P cores (apple,everest, CPUs 12-17)
like the twelve M cores and an unpinned single heavy thread lands on an
M core most of the time (4 of 5 runs on J714sAP).

Measured on J714sAP with every cluster pinned to 4284 MHz, which both
OPP tables have, and each core's clock read with a dependent-add chain:
per MHz an M core runs zstd -3 compression at 0.736, decompression at
0.871 and a Python dict loop at 0.728 of a P core (geometric mean
0.776). Small L1-resident integer, branch, sort, hash and FP loops run
at 0.92-1.01, which shows the execution units match but not how general
code runs. So M 794 and P 1024; with the 4380 and 4608 MHz tops the
M cores' capacity is 754. The values take effect through the cpu-map
the previous commit adds.

Signed-off-by: Diljit Singh <hey@djdev.me>
…400)

wait_render_capacity() retried at once whenever reclaim reported that it
returned something. Under lower-window starvation reclaim keeps reporting
returns (vacated pools the firmware has not released yet, or backing that
another refused publisher takes first), so a publisher could make millions
of placement attempts, each vacating idle pools and notifying the firmware,
until its 2 s deadline. Each reclaim also notified the render domain,
which ended the other refused publishers' waits at once.

Allow one immediate retry after a returning reclaim per pause, and make
every later refused attempt sleep for at least a backoff pause, starting
at 50 us and doubling up to 2 ms, even when a notification ends the domain
wait sooner. The 2 s bound is unchanged; a starved wait now makes about
3,000 attempts instead of one per reclaim.

g17-capacity-backoff-tests.py runs the production wait against a fake
clock: a reclaim storm and a quiet domain both end with EBUSY at 2.000 s
(3,028 and 401 attempts), a release 5 ms in is placed at 5.0 ms, and the
pre-change retry rule and an unpaused wake both fail it.

Assisted-by: LLM

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
arm64: dts: apple: t6050: Give the M and P cores their capacities
A busy T6050 cluster in the upper half of its range asked for the top
DCS and fabric states, 6 and 3, even for a loop that touches no memory.
macOS's CLPC votes one state lower on each: traced on J714sAP under
macOS 26A428, its voter word reads 0x25 (DCS 5, fabric 2) for 99% of an
18-thread CPU loop, 0 for 89% of idle and mostly 0 with one busy thread.

Map the top two quartiles to DCS 5 and fabric 2. GPU work keeps both top
states: the GPU driver's input now takes the higher of the map's top and
the SoC's gpu states, which only T6050 sets, because bandwidth-bound GPU
work runs about 11% slower at DCS 5.

Signed-off-by: Diljit Singh <hey@djdev.me>
tps6598x_pr_set() reads STATUS as soon as the SWSk or SWSr task
completes and returns -EPROTO unless the port role has already changed.
The task completes when the PR_Swap has been accepted, but the port role
changes only after the power supply transition that follows. On a
MacBook Air (M2) with its port linked to another Mac,

  echo sink > /sys/class/typec/port1/power_role

fails with "Protocol error", yet the swap completes: a moment later the
port reads sink, the battery charges again and the link stays up.

Poll STATUS until the port role matches, for at most the time the
PR_Swap timers allow the two PS_RDY messages, and report -EPROTO only
if it never does.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
usb: typec: tipd: Wait for the power role swap to settle
The host test that builds the CLPC demand code outside the kernel has
no max3() in its shim. Nest max() instead, as the line did before.

Signed-off-by: Diljit Singh <hey@djdev.me>
…1403)

Enable the ATC1 template of t6050-dieX.dtsi on the J714c and link it to
the port's PD controller: usb-pd@a on nub-spmi-a0, an SN201202x at SPMI
address 0xa. The J714cAP ADT names it hpm1, port-number 2,
port-location "left-front", acio-parent acio1, with atc-phy1, usb-drd1
and dart-usb1. The board file no longer disables nub-spmi-a0, atc1_phy,
atc1_phy_mbox, usb_drd1 and its two DARTs.

The atcphy1 alias lets the boot loader fill the PHY tunables.

The left-back port (ATC0, hpm0) is not described. The combo PHY binding
and driver exclude port index 0, the debug port that carries the boot
link, on purpose.

The port's USB4/Thunderbolt router (acio1) and its DisplayPort routes
are not described; the PHY runs in USB mode. The other ten T6050 board
DTBs are byte-identical.
arm64: idle: T6050 idles in WFI even with idle=nop
soc: apple: clpc: Hold T6050 CPU load at DCS 5 and fabric 2
…on GPIO lines (#1407)

The AOP and always-on GPIO banks are enabled with no consumer. Some of
their lines are already configured by the firmware when Linux boots
(non-reset mode, pulls or drive strength, one output driven high) and
nothing says what they are for.

Mark those lines in gpio-reserved-ranges so gpiolib never hands them
out and the driver's register map leaves their pad registers alone.
Lines still in the reset state stay available.

Assisted-by: LLM

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
…#1408)

* arm64: dts: apple: t6050-j714c: Describe the six speaker amplifiers

Enable i2c1 and i2c3 on the J714c and describe the six SN012776 speaker
amplifiers from the J714cAP ADT: left woofer 1, left woofer 2 and left
tweeter on i2c1 at 0x38, 0x39 and 0x3a, right woofer 1, right woofer 2
and right tweeter on i2c3 at 0x3b, 0x3c and 0x3d. The amplifiers share
one shutdown line, AP pin 107 (function-reset of the first), described
as the speaker_sdz fixed regulator with apple,sdz-group-fail-closed,
and one fault interrupt, pin 106.

Each amplifier's sense slots come from the ADT speaker-config, where the
transmit slot N belongs to speakerN: voltage sense in slot 4N, current
sense in slot 4N+2.

ps_i2c3 has no described parent (SIO), as for i2c1 and i2c2. Pins 106
and 107 join pin 80 in the exposed range of pinctrl_ap.

There is no sound card, no jack codec and no AOP audio change. The other
ten T6050 board DTBs are byte-identical.

* arm64: dts: apple: t6050-j714c: Clock i2c3 from the reference clock

The i2c3 stub of t6050-peripherals.dtsi takes <&peripheral_clocks 4>.
No driver in the tree provides apple,pmgr-clocks, so i2c3 and the three
amplifiers on it would never probe. The ADT gives i2c1, i2c2 and i2c3
the same clock-ids (4), and i2c1 and i2c2 take <&clkref>, so the J714c
does the same for i2c3.

The other ten T6050 board DTBs are byte-identical.
…ouch ID sensor

The SEP, its DART and mailbox, and spi2 are already described (disabled)
in t6030-coprocessors.dtsi and t6030-peripheral-buses.dtsi. Touch ID
needs two things more, as the J514s ADT (system firmware 27.0) records
them:

- The SEP DART only accepts IOVAs in the window iBoot programmed: vm-base
  0x10000004000, vm-size 0xffff0000, the same BIT(40) aperture as on
  T8122. Describe it with apple,dma-range and apple,dma-offset.
- The Mesa sensor sits on spi2, chip select 0, at 8 MHz with CPHA. Add it
  as spi2's child.

Everything stays disabled: apple_sep enables the SEP and its DART when it
loads, and boards enable the mailbox, the bus and the sensor.

Assisted-by: LLM
Signed-off-by: Adam Harris <amh421@icloud.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enable the SEP mailbox, spi2 and the Mesa sensor (0x3352) on the 14" M3
Pro. Per the J514s ADT, the sensor is powered from NUB GPIO 33, active
high. As on J613, its data-ready line (AP GPIO 200) is left out and the
driver polls. The calibration comes from this Mac's own iBoot system
container as apple/mesacal-j514s.bin.

J516s shares the SoC, but its sensor wiring is unchecked, so it stays
off.

Assisted-by: LLM
Signed-off-by: Adam Harris <amh421@icloud.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The J514s SEP is pre-booted by iBoot and speaks the variant-5 key store,
and its sensor is the same 0x3352 part T8122 carries, in SPI mode 1. So
J514s takes the T8122 profile with its own spi2 base, including the wide
DMA mask and xART guard level 1 from the first boot. Only J514s is
matched; the other T6030 Mac (J516s) has not had its ADT read.

Add a test that checks the J514s device tree against the ADT values and
that J516s leaves the SEP and the sensor off.

Tested on J514s, system firmware 27.0, with macOS on the same disk:
- the SEP attaches warm and advertises 12 endpoints
- the keybag is provisioned; the guard protects all 10 existing macOS
  session records and has refused nothing
- the sensor answers 18 ms after power-on and registers its serial
- enrolment and a match work, and a match still works after a reboot
  and after suspend
- macOS Touch ID still works afterwards

Assisted-by: LLM
Signed-off-by: Adam Harris <amh421@icloud.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.

8 participants