Skip to content

[Joshua's agent] soc: apple: aop: Start AFK endpoints 0x2f and 0x30 - #1850

Closed
joshuaswarren wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
joshuaswarren:w7h/aop-endpoints-0x2f-0x30
Closed

joshuaswarren wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
joshuaswarren:w7h/aop-endpoints-0x2f-0x30

Conversation

@joshuaswarren

Copy link
Copy Markdown
Contributor

The AFK endpoint table covers 0x20 to 0x2e. The T6050 firmware lists 0x2f and 0x30 in its endpoint map as well.

Without those two endpoints started, the AOP firmware on the MacBook Pro 14-inch (M5 Max, k114c) stalls after its early boot lines. We read its log from the host OSLog buffer (the pages rtkit allocates, read through /proc/kcore). The log shows one notice about endpoint 0x2f, repeated about 170 times. Only five endpoints send hellos. The firmware never prints its ready line and no sound card registers ("No soundcards found").

With 0x2f and 0x30 started and initialised, the repeat stops. The firmware prints its ready line, all 16 endpoints finish the AFK handshake, and two ALSA cards register (the AOP audio capture card and the macaudio card).

The change raises AFK_ENDPOINT_COUNT from 0xf to 0x11. has_endpoint() still skips endpoints a chip does not advertise. Two unit tests check the default start order and afk_endpoint_index().

Tested:

  • A debug build with the same two endpoints added (a different start order from this patch) ran on a k114c once. Result as above.
  • The unit tests fail with the old count and pass with the new one in a host-side harness that copies the two helpers. The kunit run is not done.

Not tested:

  • This exact patch on hardware. A kernel with the one-line count change is built and runs next.
  • Any other chip. For chips with an empty required_endpoints, a failed start of 0x2f or 0x30 now fails probe. Chips that do not advertise those endpoints are unaffected. A review from someone with T6040 or T8142 hardware would help.
  • Playback and capture on the new cards.

The AFK endpoint table covered 0x20 to 0x2e. The T6050 firmware also
lists 0x2f and 0x30 in its endpoint map. With those two not started, the
firmware stalled after its early boot lines: it logged one notice about
endpoint 0x2f in a loop, sent hellos on five endpoints only and never
printed its ready line. The sound cards did not register.

Raise AFK_ENDPOINT_COUNT to 0x11. Endpoints the firmware does not
advertise are still skipped by has_endpoint().

Tested on a MacBook Pro 14-inch (M5 Max, k114c): with 0x2f and 0x30
started the firmware prints its ready line, all 16 endpoints complete
the AFK handshake and two ALSA cards register. That run used a debug
build with a different start order; this exact patch is not yet run on
hardware. The unit tests check the default start order and the index
helper. They fail with the old count and pass with the new one (run in
a host harness; the kunit run is not done).

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] w7H: Hardware result for this patch's change. A kernel with AFK_ENDPOINT_COUNT set to 0x11 (the same one-line change) ran on the MacBook Pro 14-inch (M5 Max, k114c). The AOP module loaded once. The firmware reached its ready state, both ALSA cards registered (AOP audio capture and macaudio), and a 440 Hz tone played through the speaker PCM. The tone was heard at the machine. Amp fault status read zero on all six amps after each tone.

Speaker volumes stay at the lock ceiling until a speaker protection daemon unlocks them. That part is separate from this change and is why the first tones at low gain were silent.

Still open: the kunit run of apple_aop (host-side harness only so far), other chips (T6040, T8142), and jack and microphone tests. Marking this ready for review.

@joshuaswarren
joshuaswarren marked this pull request as ready for review November 13, 2026 17:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T17:32:40.914729Z 5ddc153 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Thanks @joshuaswarren, and thanks for tracking down the T6050 stall. This is the same one-line change as #1645 (@sithglan, opened earlier, on behalf of Jens). That PR has hardware runs on K116s, M1 Pro, M2 and M4 Pro. It's approved and merges once CI on its updated branch is green, so this PR is superseded. Credit to both of you: your M5 Max report showed that the T6050 firmware needs 0x2f and 0x30 too.

For the record, start_afk() already skips endpoints the firmware's map doesn't advertise, so the constant is only a ceiling and the driver starts exactly what the map lists up to 0x30.

Could you close this one? The KUnit tests would make a welcome follow-up PR. Today no CI job builds aop.rs (the SEP kunitconfig doesn't enable APPLE_AOP), so pair them with an AOP kunitconfig and CI entry. Also, start_afk() doesn't go through AfkOrder, so a test should target the start path itself.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Closing as superseded by #1645, thanks. We'll send the KUnit tests as a separate follow-up PR, with a CI job that builds aop.

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