Skip to content

RFC: dapf: program dart-mtp with the legacy writer for a cold-started MTP on the J715 - #430

Closed
kazuhidet wants to merge 2 commits into
aurora-silicon:mainfrom
kazuhidet:j715/rfc-mtp-cold-start
Closed

kazuhidet wants to merge 2 commits into
aurora-silicon:mainfrom
kazuhidet:j715/rfc-mtp-cold-start

Conversation

@kazuhidet

Copy link
Copy Markdown
Contributor

When the J715 boots without U-Boot (m1n1 stage 1 -> aura -> Linux),
nothing keeps the MTP helper alive, so Linux cold-starts the MTP. On
T8132, dapf_init() preserves the filter state instead of programming it.
The MTP firmware's first access (an AOP-side PMGR register, SID 0) then
faults with "CTE invalid", and the keyboard and trackpad never come up
(RTKit endpoint discovery -62).

On the J715, program dart-mtp's DAPF with the legacy m1n1 writer, as m1n1
stage 2 does, before the handoff and power checks. With this, and with
the tree's cold-start layout for the MTP (DART stream 0 and the 16 KiB
SRAM window), the MTP says hello and the keyboard and trackpad work.

Not meant to be merged as is: a board exception for one boot flow. A
halted or cold-start handoff mode for the MTP is probably the better fix.

This PR builds on #429, so it shows that commit too. The matching tree layout (mtp and its input@0 on DART stream 0, the SRAM window at 0x394050000/0x4000) is described in aurora-silicon/linux#2663. I'm happy to test another approach.

The J715 (15-inch M4 Air, Mac16,13) shares t8132-j713-j715.dtsi with the
J713 and states the same DAPF handoff contract in its tree
(linux-enablement-mac,dapf-handoff lists the AOP, MTP and PMP).
dapf_init_fdt() only knew the J713 and J604, so on a J715 it returned
without handing anything off.

Add apple,j715 to that list.

Tested on a J715 with OS firmware 26.5 (AOP microphone capture) and
26.6.2 (desktop boot).

Signed-off-by: Kazuhide Takahashi <kazuhide.t@linux-powered.com>
… MTP on the J715

When the J715 boots without U-Boot (m1n1 stage 1 -> aura -> Linux),
nothing keeps the MTP helper alive, so Linux cold-starts the MTP. On
T8132, dapf_init() preserves the filter state instead of programming it.
The MTP firmware's first access (an AOP-side PMGR register, SID 0) then
faults with "CTE invalid", and the keyboard and trackpad never come up
(RTKit endpoint discovery -62).

On the J715, program dart-mtp's DAPF with the legacy m1n1 writer, as m1n1
stage 2 does, before the handoff and power checks. With this, and with
the tree's cold-start layout for the MTP (DART stream 0 and the 16 KiB
SRAM window), the MTP says hello and the keyboard and trackpad work.

Not meant to be merged as is: a board exception for one boot flow. A
halted or cold-start handoff mode for the MTP is probably the better fix.

Signed-off-by: Kazuhide Takahashi <kazuhide.t@linux-powered.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Early note on this draft (no full review yet):

  1. src/dapf.c:575 and src/dapf.c:704: the legacy writer is admitted by board (J715AP) and path (/arm-io/dart-mtp). Any T8132 Mac whose MTP is cold-started by Linux has the same need, so key it on the handoff mode instead: when the tree says the MTP is not handed off live (for example a cold-start/halted handoff property next to linux-enablement-mac,dapf-handoff), program that DART's filter; keep today's "preserve" behaviour when the property is absent.
  2. src/dapf.c:790: adding apple,j715 to the boards[] list extends a per-board table. The commit message says the J715 tree already states the handoff contract in linux-enablement-mac,dapf-handoff; read that property and drop the board list, so the next Mac that carries it works without a code change.

Assisted-by: LLM (Claude:Opus 5.5)

@kazuhidet

Copy link
Copy Markdown
Contributor Author

Closing: as suggested in #429, the existing linux-enablement-mac,dapf-halted-handoff covers this. With the J715 tree naming /arm-io/mtp there (and the J604's DART stream layout for the MTP), aura main programs dart-mtp as a halted consumer, Linux cold-starts the MTP, and the keyboard and trackpad work on a J715 with no board exception. Details in #429; the device tree change goes to aurora-silicon/linux.

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