Skip to content

arm64: dts: apple: t8142-j815: external displays over USB-C (on #2383) - #1806

Merged
RyanTheTide merged 4 commits into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/t8142-dp-altmode-wip
Nov 21, 2026
Merged

RyanTheTide merged 4 commits into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/t8142-dp-altmode-wip

Conversation

@m0d16l14n1

@m0d16l14n1 m0d16l14n1 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #2383 (J813 and J815 share the same SoC nodes, including the sleep controller the external-display file refers to). Its three commits come first here and drop out once it merges. The new commit is the last one.

Rebased onto integration/aurora cc14570, #2383's three commits included, since #2383 conflicts too. Two DTS conflicts:

The DTS content of the last commit is unchanged. The J813/J815 DTBs build, and CHECK_DTBS with the DCP and display-subsystem schemas is clean.

What's left of this PR

Most of what this PR started with is now in integration/aurora:

  • the T8142 DisplayPort PHY sequence, the PIPE boot hold, USB without the LIOA bank, and the DP Alt Mode USB fallback;
  • DPTX ordering, the apple,t8142-dcpext processors, and the DPTX controller endpoints;
  • t8142-j813-dcpext.dtsi itself, with the firmware clocks and the LIOA windows.

The branch has been rebuilt on top of that, and one change remains:

  1. arm64: dts: apple: t8142-j815: External displays on the USB-C ports. The J815 includes t8142-j813-dcpext.dtsi as the J813 does: the same two USB-C ports and the same blocks behind them. Decompiled, the J815's new nodes are identical to the J813's apart from phandle numbers:

    • dcpext0/1 and their mailboxes, DARTs and firmware clocks;
    • the display crossbars;
    • the ATC PHYs;
    • the Type-C routes and ports.

    Everything stays disabled until the loader hands the processors over.

The crossbar needs no config change: the shared asahi.config builds MUX_APPLE_DPXBAR as a module, and it autoloads from its OF table (apple,t8142-display-crossbar). dcpext defers until it binds. On the J815 kernel (DRM_APPLE=y, MUX_APPLE_DPXBAR=m), both external DCPs bind 8.35 s into boot. An earlier j813.config change was dropped after review.

DisplayPort audio is no longer in this PR. On the J813 the cards and ELD come up, but playback underruns at once (gig3m's 11-14 run: the ADMAC completes descriptors about every 192 µs and nothing paces it). I haven't found a fix since, and we can't test it on the J815. It will come back as its own PR once playback works.

Loader

The hand-off (dt_set_t8142_dcpext) is aurora-silicon/aura#391, rebased on current aura main and now built into every image, not only the ESP Stage 2. Without it both nodes stay disabled and nothing changes.

Testing

  • J813 (gig3m, sithglan), on earlier heads of this PR with the aura hand-off (now aura#391):

    • both ports drive a monitor (1920x1080@60, and 2560x1440@59.95 through a dock with its USB3 hub at 10000M);
    • hot-unplug keeps the panel going;
    • a monitor and a USB keyboard at once work, both ways round;
    • an s2idle test cycle with the monitor attached comes back with a picture.

    Those heads carried the same display code that's now upstream, plus this DT.

  • J815 (us), with no external display to plug in: the boot with this DT (plus the DP-audio graph that's no longer here) and the aura hand-off gives:

    • FDT: dcpext0 handoff: okay and dcpext1 handoff: okay;
    • both processors bind (apple-drm display-subsystem: bound 506e00000.dcp, then 3aae00000.dcp);
    • DP-1 and DP-2 connectors appear next to eDP-1, disconnected.

    The PR's J815 nodes are a subset of that booted tree; the rest is the audio graph and tunables the loader adds.

  • DTBs (before this rebase): J704, J813 and J815 build. J704 and J813 were byte-identical to arm64: dts: apple: t8142: Give J813 and J815 the same SoC nodes #2383's head. CHECK_DTBS shows no new warnings.

  • checkpatch clean.

J813 row on the previous head (gig3m, 11-21): a monitor on each USB-C port in turn, with the internal panel up throughout.

Part of the J815 bring-up; board results are summarised in discussion #135.

Assisted-by: LLM (Claude:Opus 5.5)

@gig3m

gig3m commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

J813 run (MacBook Air 13-inch M5, Mac17,3, 27.0 stub). No display yet. Three stops before any cable matters, two of them in the device tree.

Built as asked: kernel 143c4c4 (plus one local primary-plane format patch), aura 91e2ffbe as ESP Stage 2. Nothing plugged in at each boot.

Boot 1, branch as it is. Boots, desktop fine. Both /chosen/aurora,dcpextN-handoff read no device tree node. The loader needs a phandle on the dcpext node (fdt_get_phandle in dt_set_t8142_dcpext), and the node has none: the alias is a path and nothing else refers to it. The J815 DTB from this branch has none either.

Boot 2, loader creating the phandle. Both hand-overs okay, nodes enabled. Then on both:

apple-dcp 506e00000.dcp: external display processor unusable (bind failed: -22); the other displays go on without it

The nodes have no apple,clock-ids, and the clock setup in dcp.c returns -EINVAL without it. The J813 ADT gives /arm-io/dispext0 clock-ids [369, 432] and /arm-io/dispext1 [372, 433].

Boot 3, unpatched loader, device tree fixed (diff below). Both hand-overs okay, both processors DCP booted, card1-DP-1 and card1-DP-2 exist. But at boot, on both:

apple-dcp 506e00000.dcp: DPTX transport ready but port 0 service not announced
apple-dcp 506e00000.dcp: Failed to start DPTX endpoint: -110

Plug tests on boot 3:

  • USB keyboard, front port then rear port: works on both.
  • Monitor (USB-C, powered from the port), front port: no signal. The same monitor and cable show a picture on this Mac in macOS 27.2.1.
apple-dcp 506e00000.dcp: allocated Type-C DPTX PHY 0
apple-dcp 506e00000.dcp: dcp_dptx_connect: dptx service for port 0 not enabled   (x6)
sn201202x 1-0c: cable revalidation failed after 3 attempts
apple-dcp 506e00000.dcp: Type-C DPTX reconnect failed after 5 retries: -19
  • Monitor, rear port: the same on 3aae00000.dcp with allocated Type-C DPTX PHY 1.
  • Monitor in the rear port and keyboard in the front port: keyboard works.
  • New at every USB unplug, on the PHY of that port: phy-apple-atc 403000000.phy: Failed to lock pipehandler. Not seen on this Mac before this branch. USB kept working.
  • sn201202x 1-0c: cable revalidation failed after 3 attempts on every monitor plug, with a cable that works in macOS.

The device-tree change for boot 3. The clock rates are my reading of /arm-io clock-frequencies (369 is 300 MHz, 372 is 468.75 MHz, 432 and 433 have no entry), so treat them as a guess:

diff --git i/arch/arm64/boot/dts/apple/t8142-j813-dcpext.dtsi w/arch/arm64/boot/dts/apple/t8142-j813-dcpext.dtsi
index 983793a03769..7e3c7f138611 100644
--- i/arch/arm64/boot/dts/apple/t8142-j813-dcpext.dtsi
+++ w/arch/arm64/boot/dts/apple/t8142-j813-dcpext.dtsi
@@ -67,7 +67,12 @@ dcpext0: dcp@506e00000 {
 		mboxes = <&dcpext0_mbox>;
 		mbox-names = "mbox";
 		iommus = <&dcpext0_dart 23>;
-		clocks = <&clkref>;
+		/* J813 test: firmware clocks, /arm-io/dispext0 clock-ids, as the internal DCP lists its own. */
+		apple,clock-ids = <369 432>;
+		clocks = <&clkref>, <&dcp_fw_clk369>, <&dcp_fw_clk432>;
+		clock-names = "clock-154", "firmware-0", "firmware-1";
+		/* The loader finds its power domains through this phandle. */
+		phandle = <&dcpext0>;
 		apple,bw-scratch = <&pmgr_dcpext0 0 5 0>;
 		apple,bw-doorbell = <&pmgr_dcpext0 1 6>;
 		apple,iomfb-surfaces = <0 0 1 0>;
@@ -133,7 +138,12 @@ dcpext1: dcp@3aae00000 {
 		mboxes = <&dcpext1_mbox>;
 		mbox-names = "mbox";
 		iommus = <&dcpext1_dart 23>;
-		clocks = <&clkref>;
+		/* J813 test: firmware clocks, /arm-io/dispext1 clock-ids, as the internal DCP lists its own. */
+		apple,clock-ids = <372 433>;
+		clocks = <&clkref>, <&dcp_fw_clk372>, <&dcp_fw_clk433>;
+		clock-names = "clock-154", "firmware-0", "firmware-1";
+		/* The loader finds its power domains through this phandle. */
+		phandle = <&dcpext1>;
 		apple,bw-scratch = <&pmgr_dcpext1 0 5 0>;
 		apple,bw-doorbell = <&pmgr_dcpext1 1 6>;
 		apple,iomfb-surfaces = <0 0 1 0>;
@@ -254,3 +264,34 @@ &dispext1_dart {
 &dcpext1_dart {
 	apple,dma-range = <0x100 0x0 0x10 0x0>;
 };
+
+/*
+ * J813 test: rates from /arm-io clock-frequencies (ids 0x100..0x1ad): 369 is
+ * 300 MHz, 372 is 468.75 MHz; 432 and 433 have no entry.
+ */
+/ {
+	dcp_fw_clk369: clock-dcp-firmware-369 {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <300000000>;
+		clock-output-names = "dcp_firmware_369";
+	};
+	dcp_fw_clk432: clock-dcp-firmware-432 {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <0>;
+		clock-output-names = "dcp_firmware_432";
+	};
+	dcp_fw_clk372: clock-dcp-firmware-372 {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <468750000>;
+		clock-output-names = "dcp_firmware_372";
+	};
+	dcp_fw_clk433: clock-dcp-firmware-433 {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <0>;
+		clock-output-names = "dcp_firmware_433";
+	};
+};

Not tested: two displays at once, sleep, a USB-C to DP/HDMI adapter. I have the full dmesg of each step if you want one.

Assisted-by: Claude Fable 5.2

m0d16l14n1 added a commit to m0d16l14n1/linux that referenced this pull request Nov 14, 2026
…rmware clocks

Without apple,clock-ids the external processors failed to bind ("bind
failed: -22"): the DCP's clock setup needs the firmware's clock list, as
the internal disp0 node has it. The J813 and J815 ADTs agree:
/arm-io/dispext0 clock-ids 369 and 432, dispext1 372 and 433. Describe
them as disp0's are, with fixed rates from /arm-io clock-frequencies
(entries 0x71 and 0x74, ids from 0x100: 300 MHz and 468.75 MHz; 432 and
433 have no entry).

Found and measured by gig3m on a J813 (aurora-silicon#1806, the
same values); checked against the J815's live ADT.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 14, 2026
dt_set_t8142_dcpext() refused every dcpext node with "no device tree
node": it needs the node's phandle for the power-domain walk, which finds
the node again by phandle as the tree changes, but dtc only gives a node
a phandle when something refers to it, and nothing refers to dcpext0/1.
Give it one as other hand-offs here do (fdt_generate_phandle).

Found by gig3m on a J813 (aurora-silicon/linux#1806): with a loader
change that creates the phandle, both hand-offs read "okay". Also
reformats the carveout call (clang-format 20.1.8).

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

@gig3m Thank you for the J813 run. All three stops are addressed. Kernel head is 7346085; the loader is j815/t8142-dp-altmode-wip at b97ef3a8.

  1. No phandle on the dcpext node (aura b97ef3a8). dt_set_t8142_dcpext() now gives the node a phandle when it has none (fdt_generate_phandle), as the other hand-offs in kboot.c do. Nothing in the DT has to refer to it.

  2. No apple,clock-ids (90ee825). This uses your values, which the J815's live ADT matches exactly: dispext0 369/432, dispext1 372/433. The rates are clock-frequencies entries 0x71/0x74: 300 MHz and 468.75 MHz, with no entry for 432/433. It's in t8142-j813-dcpext.dtsi, so both Airs get it.

  3. port 0 service not announced, -110 (002bae8). The T8142 dcpext had the T6050 external profile, which opens firmware 27's DPTX_ENDPOINT_V2 (0x2c) and no DPTX controller. macOS 27.2 on a J815, read from its IORegistry under iop-dcpextN-nub in a hypervisor run, binds these per processor:

    • AppleDCPDPTXController (dcpav-/dcpdp-controller-epic, units 0 and 1) on 0x24;
    • AppleDCPDPTXRemotePort (dcpdptx-port-epic, units 0 and 1) on 0x2a;
    • HDCP on 0x2b, and nothing on 0x2c.

    dmitzsaz's J704 tree opens the same. The profile now opens the controller first, takes the ports on 0x2a and expects two of them. Type-C still uses port 0.

Also fixed:

  • dt-checks: the DCP binding gains apple,t8142-dcpext, and the ATC PHY binding gains T8142's lioa window (134c625). Local CHECK_DTBS on j813/j815 leaves only the existing disp0_piodma alias warning.
  • host-tests: the apple-dcp and atc fixtures follow the PHY and route changes (7346085). apple-dcp 88/88 and atc-usb3 37/37 locally.

Still open, and not addressed here:

  • phy-apple-atc … Failed to lock pipehandler at every unplug. It's probably the park_dummy_phy behaviour from the J704 PHY flags. I'd like your dmesg around one unplug, if you still have it.
  • sn201202x … cable revalidation failed with a cable that works in macOS.

None of this is booted yet, on either Air. If you try it again, the most useful logs are the AFK lines for endpoints 24 and 2a at boot (dyndbg on afk.c), then one monitor plug on each port.

Assisted-by: Claude Opus 5.5

@m0d16l14n1
m0d16l14n1 force-pushed the j815/t8142-dp-altmode-wip branch from 1b8cd02 to ee86c16 Compare November 14, 2026 11:37
@gig3m

gig3m commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Retest on J813 (Mac17,3, boot firmware 27.0): both ports light up a monitor.

Kernel: integration/aurora d89d8c0 + this PR at ee86c16 (+ #1732, #1805). Loader: aura main 2175c483 + j815/t8142-dp-altmode-wip b97ef3a8, as Stage 2 on the ESP.

Boot, nothing plugged

  • /chosen/aurora,dcpext0-handoff and dcpext1-handoff: both okay.
  • Both processors probe. card1-DP-1 and card1-DP-2 exist, disconnected.
  • Endpoint 0x24: four AppleDCPDPTXController services per processor (channels 1, 3, 5, 7). Endpoint 0x2a: two AppleDCPDPTXRemotePort per processor (channels 1, 3).

Monitor, one port at a time (1920x1080@60, USB-C)

  • Front port (403000000.phy, dcp@506e00000): DP-1 connected, picture.
  • Unplug: DP-1 disconnected, panel carries on.
  • Rear port (40b000000.phy, dcp@3aae00000): DP-2 connected, picture.
  • Internal panel, Wi-Fi, Bluetooth, ALS and Touch ID enclave unaffected.

USB, after the monitor had been on each port (NuPhy Air75 V2 keyboard, full speed)

  • Rear (40a280000.usb) and front (402280000.usb): enumerates, keys work, clean disconnect.

Still there

  • Failed to lock pipehandler, on both ports. It follows the xHCI removal at the switch from USB to DP, about 1 s before allocated Type-C DPTX PHY. The unplug from DP mode does not print it. It also follows each keyboard unplug, so it comes with every xHCI teardown from USB mode. Nothing seems to break because of it.
  • AFK service DCPDPService admission failed: -19 and dcpdp-service-epic ... unsupported on channel 3 at each plug; the display works anyway.

No cable revalidation failed this time.

Not tested: SuperSpeed devices, a monitor and a USB device at the same time, two monitors, an adapter, sleep with a monitor attached.

AFK lines for 0x24 and 0x2a at boot
[    0.394572] apple-dcp 506e00000.dcp: AFK[ep:24]: new service AppleDCPDPTXController on channel 1
[    0.395251] apple-dcp 3aae00000.dcp: AFK[ep:24]: new service AppleDCPDPTXController on channel 1
[    0.395312] apple-dcp 506e00000.dcp: AFK[ep:24]: new service AppleDCPDPTXController on channel 3
[    0.396032] apple-dcp 3aae00000.dcp: AFK[ep:24]: new service AppleDCPDPTXController on channel 3
[    0.396094] apple-dcp 506e00000.dcp: AFK[ep:24]: new service AppleDCPDPTXController on channel 5
[    0.396819] apple-dcp 3aae00000.dcp: AFK[ep:24]: new service AppleDCPDPTXController on channel 5
[    0.396828] apple-dcp 506e00000.dcp: AFK[ep:24]: new service AppleDCPDPTXController on channel 7
[    0.397582] apple-dcp 3aae00000.dcp: AFK[ep:24]: new service AppleDCPDPTXController on channel 7
[    0.401029] apple-dcp 506e00000.dcp: AFK[ep:2a]: new service AppleDCPDPTXRemotePort on channel 1
[    0.401819] apple-dcp 506e00000.dcp: AFK[ep:2a]: new service AppleDCPDPTXRemotePort on channel 3
[    0.402272] apple-dcp 3aae00000.dcp: AFK[ep:2a]: new service AppleDCPDPTXRemotePort on channel 1
[    0.403075] apple-dcp 3aae00000.dcp: AFK[ep:2a]: new service AppleDCPDPTXRemotePort on channel 3
Front port: plug, then unplug
[  160.788864] xhci-hcd xhci-hcd.7.auto: remove, state 1
[  160.810101] xhci-hcd xhci-hcd.7.auto: USB bus 2 deregistered
[  160.810110] xhci-hcd xhci-hcd.7.auto: remove, state 4
[  160.811576] xhci-hcd xhci-hcd.7.auto: USB bus 1 deregistered
[  160.813845] phy-apple-atc 403000000.phy: Failed to lock pipehandler
[  161.796725] apple-dcp 506e00000.dcp: dcp_dptx_disconnect(port=0)
[  161.796735] apple-dcp 506e00000.dcp: allocated Type-C DPTX PHY 0
[  161.821274] apple-dcp 506e00000.dcp: AFK service DCPDPService admission failed: -19
[  161.823702] apple-dcp 506e00000.dcp: AFK optional dcpdp-service-epic (DCPDPService) is unsupported on channel 3
[  162.031802] apple-dcp 506e00000.dcp: dcp_hotplug() connected:0 valid_mode:0 nr_modes:15
[  162.032925] apple-dcp 506e00000.dcp: dcp_hotplug() connected:1 valid_mode:0 nr_modes:15
[  162.292603] apple-dcp 506e00000.dcp: set_digital_out_mode finished:8252
[  163.306884] apple-dcp 506e00000.dcp: dcp_hotplug() connected:1 valid_mode:0 nr_modes:15
[  163.310607] apple-dcp 506e00000.dcp: set_digital_out_mode finished:8498
[  219.763909] xhci-hcd xhci-hcd.7.auto: remove, state 4
[  219.764783] xhci-hcd xhci-hcd.7.auto: USB bus 2 deregistered
[  219.764792] xhci-hcd xhci-hcd.7.auto: remove, state 4
[  219.767334] xhci-hcd xhci-hcd.7.auto: USB bus 1 deregistered
[  219.769717] apple-dcp 506e00000.dcp: dcp_hotplug() connected:0 valid_mode:1 nr_modes:15
[  219.862994] apple-dcp 506e00000.dcp: dcp_dptx_disconnect(port=0)
Rear port: monitor plug, unplug, then keyboard
[  225.870664] xhci-hcd xhci-hcd.7.auto: remove, state 1
[  225.871272] xhci-hcd xhci-hcd.7.auto: USB bus 2 deregistered
[  225.871279] xhci-hcd xhci-hcd.7.auto: remove, state 4
[  225.872020] xhci-hcd xhci-hcd.7.auto: USB bus 1 deregistered
[  225.874191] phy-apple-atc 40b000000.phy: Failed to lock pipehandler
[  225.876584] xhci-hcd xhci-hcd.7.auto: irq 125, io mem 0x40a280000
[  226.877977] apple-dcp 3aae00000.dcp: dcp_dptx_disconnect(port=0)
[  226.877989] apple-dcp 3aae00000.dcp: allocated Type-C DPTX PHY 1
[  226.900963] apple-dcp 3aae00000.dcp: AFK service DCPDPService admission failed: -19
[  226.903148] apple-dcp 3aae00000.dcp: AFK optional dcpdp-service-epic (DCPDPService) is unsupported on channel 3
[  227.114955] apple-dcp 3aae00000.dcp: dcp_hotplug() connected:0 valid_mode:0 nr_modes:15
[  227.116225] apple-dcp 3aae00000.dcp: dcp_hotplug() connected:1 valid_mode:0 nr_modes:15
[  227.382889] apple-dcp 3aae00000.dcp: set_digital_out_mode finished:8245
[  228.387896] apple-dcp 3aae00000.dcp: dcp_hotplug() connected:1 valid_mode:0 nr_modes:15
[  228.398168] apple-dcp 3aae00000.dcp: set_digital_out_mode finished:8500
[  290.379701] xhci-hcd xhci-hcd.7.auto: remove, state 4
[  290.380232] xhci-hcd xhci-hcd.7.auto: USB bus 2 deregistered
[  290.380239] xhci-hcd xhci-hcd.7.auto: remove, state 4
[  290.381093] xhci-hcd xhci-hcd.7.auto: USB bus 1 deregistered
[  290.382475] apple-dcp 3aae00000.dcp: dcp_hotplug() connected:0 valid_mode:1 nr_modes:15
[  290.482654] apple-dcp 3aae00000.dcp: dcp_dptx_disconnect(port=0)
[  325.662525] xhci-hcd xhci-hcd.7.auto: irq 125, io mem 0x40a280000
[  325.898963] usb 1-1: new full-speed USB device number 2 using xhci-hcd
[  326.023570] usb 1-1: Product: NuPhy Air75 V2
[  332.927555] usb 1-1: USB disconnect, device number 2
[  333.723366] xhci-hcd xhci-hcd.7.auto: remove, state 4
[  333.723988] xhci-hcd xhci-hcd.7.auto: USB bus 2 deregistered
[  333.724001] xhci-hcd xhci-hcd.7.auto: remove, state 4
[  333.725736] xhci-hcd xhci-hcd.7.auto: USB bus 1 deregistered
[  333.727896] phy-apple-atc 40b000000.phy: Failed to lock pipehandler

I have the full dmesg of each step (with dyndbg on afk.c) if you want one.

Assisted-by: Claude Fable 5.2

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

Great to hear that! Thanks a lot for testing and logs

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

Added possible audio support here, still not sure, couldn't test it

@gig3m

gig3m commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

DisplayPort audio on J813 (e4bdeb8, aura b97ef3a8 on main 2175c483): the cards come up, playback does not work yet. Two findings.

1. The loader drops the control tunables on J813. Kernel: apple-admac ... has no apple,tunable-ced: left as it is on both display ADMACs. aura's Stage 2 log:

kboot: ACIO tunable has invalid size 0
ADT: unable to convert 'ssw-tunables' tunable
kboot: no ADT tunables for admac-dispext0-control (/arm-io/admac-dispext0-ced-ssw: 409736, DT: 73528)

In the J813 ADT both tables are 336 bytes (14 entries). ced-tunables has 14 real entries. ssw-tunables has one (off 0, size 4, mask 1, value 1) and then 13 entries of zeros, and dt_append_acio_tunable() refuses a size that is not 4. With the table ended at its first all-zero entry, both are copied (admac-dispext0-control: ADT tunables copied; DT has apple,tunable-ced 168 bytes, apple,tunable-ssw 12 bytes):

+        if (!tunable->size && !tunable->offset && !tunable->mask && !tunable->value) {
+            n_tunables = j;
+            break;
+        }
+
         if (tunable->size != 4) {

2. With the tunables in place, the stream still underruns at once. Monitor on the rear port (DP-2, 1920x1080@60, HDMI adapter), card DisplayPort_1: jack on, ELD filled, av_service_connect: starting audio service, plugged:1, PipeWire makes the sink. On playback (S24_LE, 2 ch, 48 kHz, period 1024) the PCM loops between XRUN and SETUP and PipeWire logs snd_pcm_avail after recover: Broken pipe. apple-admac with dyndbg: each 0x2000-byte descriptor is reported done about 192 us after the one before (stamps 0x1200 apart), where 1024 frames should take 21 ms. About 36 start/stop cycles a second. The same with and without the tunables.

The display processor does not complain: no link method ... answered error, and the link query answers 1 (audiosrv: link state 0x1) around every start. No apple-admac error status either (only the report bit). So the firmware says the link runs while nothing paces the ADMAC. 8192 bytes per 4608 ticks is a steady 16 bytes every 9 ticks.

One cycle (with tunables)
[   85.206991] apple-admac 3aa140000.dma-controller: ch0 start
[   85.206993] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff02000 len=0x2000 flags=0xc0002
[   85.206997] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff04000 len=0x2000 flags=0xc0003
[   85.207001] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff06000 len=0x2000 flags=0xc0004
[   85.207005] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff08000 len=0x2000 flags=0xc0005
[   85.207197] apple-admac 3aa140000.dma-controller: ch0 report: stamp=0x8193ebde flags=0x1800000
[   85.207199] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff0a000 len=0x2000 flags=0xc0006
[   85.207389] apple-admac 3aa140000.dma-controller: ch0 report: stamp=0x8193fdde flags=0x2800000
[   85.207390] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff0c000 len=0x2000 flags=0xc0007
[   85.207581] apple-admac 3aa140000.dma-controller: ch0 report: stamp=0x81940fdf flags=0x3800000
[   85.207582] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff0e000 len=0x2000 flags=0xc0008
[   85.207773] apple-admac 3aa140000.dma-controller: ch0 report: stamp=0x819421df flags=0x4800000
[   85.207774] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff10000 len=0x2000 flags=0xc0009
[   85.207965] apple-admac 3aa140000.dma-controller: ch0 report: stamp=0x819433de flags=0x5800000
[   85.207966] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff12000 len=0x2000 flags=0xc000a
[   85.223532] apple-admac 3aa140000.dma-controller: ch0 stop
[   85.223541] apple-admac 3aa140000.dma-controller: ch0 stop
[   85.231656] apple-admac 3aa140000.dma-controller: ch0 stop
[   85.231668] apple-admac 3aa140000.dma-controller: ch0 descriptor: addr=0x0x0000010ffff00000 len=0x2000 flags=0xc0001

Also new on this run: a boot with the monitor already attached (rear port, cold reboot). DP-2 came up on its own: allocated Type-C DPTX PHY 1 at 2.9 s, mode set at 3.5 s, and no Failed to lock pipehandler anywhere in that boot.

Not tested: the front port, a native USB-C monitor with speakers, other rates or formats. I have the full dmesg of both runs.

Assisted-by: Claude Fable 5.2

@gig3m

gig3m commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Five more cases from the "not tested" list, J813, kernel at ee86c16:

  • Monitor and USB keyboard at once, both ways round: monitor front (DP-1) with the keyboard rear (40a280000.usb), then monitor rear (DP-2) with the keyboard front (402280000.usb). Picture stays, keys work, in both.
  • Suspend with the monitor attached (rear port, keyboard in the front): one 20 s pm_test=platform s2idle cycle, rc=0. On resume dcp@3aae00000 does dcp_dptx_disconnect(port=0), dcp_hotplug() connected:1, dcp_poweron(), and sets 1920x1080@60 again; DP-2 is connected with a picture on both screens, the keyboard and Wi-Fi are back. This is the test suspend (devices suspended, CPU held 20 s), not a lid-closed sleep.
  • Lid closed with the monitor attached: logind takes it as docked and does not suspend; the compositor (Hyprland) disables eDP-1 and keeps DP-2 at 1920x1080@60. The external picture stays and the USB keyboard keeps working.
  • Unplugged with the lid closed: keyboard, then monitor. logind suspends in the same second as the display's dcp_hotplug() connected:0 (real s2idle, 22 s). Lid open wakes it: internal panel back, Wi-Fi up, no failed units.

Failed to lock pipehandler in this boot, four times: at each monitor plug (front, then rear) and after each keyboard unplug (rear, then front). None around the suspends.

Still not tested: two monitors, SuperSpeed devices, a real (not test) sleep with a monitor.

Assisted-by: Claude Fable 5.2

m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 15, 2026
On the J813 (and the J815, same ADT layout) both display ADMACs lost their
control tunables: admac-dispextN-ced-ssw's ssw-tunables is 336 bytes, one
real entry (offset 0, size 4, mask 1, value 1) then 13 all-zero entries,
and dt_append_acio_tunable() refused the size-0 entry, so neither
apple,tunable-ced nor apple,tunable-ssw reached the DT ("ACIO tunable has
invalid size 0", "no ADT tunables for admac-dispext0-control").

Found and tested by gig3m on a J813 (aurora-silicon/linux#1806): with the
table ended at its first all-zero entry both tables are copied
(apple,tunable-ced 168 bytes, apple,tunable-ssw 12 bytes). DP audio
playback still underruns on its own; that is a separate problem.

Suggested-by: gig3m (GitHub)
Assisted-by: Claude Opus 5.5
@sithglan

Copy link
Copy Markdown
Contributor

@m0d16l14n1 a J813 result on the macOS 27.2 (26B123) stub, with Linux at EL2: the external display works.

  • The kernel is this PR's display commits on our J813 tree. The loader is aura with your three commits, enrolled.
  • Both hand-offs are okay.
  • An EIZO EV2780 behind a dock on the rear port (DP Alt Mode, pin D) runs at 2560x1440@59.95 as card1-DP-2 under sway. The dock's USB3 hub stays at 10000M.

Three fixes that came out of it, as m0d16l14n1#2 against this branch:

  • j813.config lacks MUX_APPLE_DPXBAR. Without it, both dcpext wait for the display crossbars until the deferred probe timeout and end unusable (-110).
  • USB under an older loader. Without the loader's LIOA/common banks, a DP Alt Mode partner loses USB entirely (phy init failed --> -95). The fix serves its USB as T8132 does.
  • The apple-dcp host test. On e4bdeb8, service-rebind fails: the DP audio commit's dcp_av_audio_endpoint() is missing from the recovery fixture.

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

The branch is rewritten (old head 3595ab8; the description above has the details) and the PR is out of draft. Most of the display work has landed in integration/aurora since, so it's now two commits on top of #2383: the J815 include of t8142-j813-dcpext.dtsi, and sithglan's MUX_APPLE_DPXBAR fix for j813.config. DisplayPort audio is split out until playback works.

@gig3m @sithglan, thank you both for the J813 runs that got this working. If you have a monitor handy, a quick re-run on c2bee55 with the aura branch named above would be the J813 row for this final shape.

Assisted-by: Claude Opus 5.5

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for rebuilding this on top of what has already landed. Sharing t8142-j813-dcpext.dtsi with the J815 is clean, and the board-file changes look right.

One thing in the last commit: arch/arm64/configs/j813.config:50 adds CONFIG_MUX_APPLE_DPXBAR=y. We avoid per-machine kernel build configs: a driver that a board needs should come from the shared config, so every machine with the block gets it the same way. The shared asahi.config already builds it, as a module (asahi.config:186).

If the crossbar has to be there before dcpext probes, the robust fix is probe ordering: a device-link or softdep from the dcpext side, or module autoload through the crossbar's OF match table. That works the same whether the driver is built in or a module. If it really must be built in, please change it in the shared config for everyone and say why in the commit. The deferred-probe timeout (-110) you saw is a good thing to quote there.

We can run boot and no-regression rows on our M1 Pro, M2, M4 Pro and A18 Pro.

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

The loader side is now a PR: aurora-silicon/aura#391 (the same three commits, rebased on aura main, with the hand-off built into every image). @gig3m @sithglan, for a re-run, please use that instead of the old j815/t8142-dp-altmode-wip aura branch.

Assisted-by: Claude Opus 5.5

@m0d16l14n1
m0d16l14n1 force-pushed the j815/t8142-dp-altmode-wip branch from c2bee55 to 4e6ffec Compare November 20, 2026 13:11
@gig3m

gig3m commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

J813 (MacBook Air 13" M5, macOS 27.2 stub), one external display on each USB-C port in turn: an XYM F156P1 portable monitor on a plain USB-C cable (DP alt mode), 1920x1080.

Setup:

Result:

  • Front port (port 1, dcp@506e00000): hot-plugged with the desktop running. 15 modes, 1920x1080@60 set, and Hyprland drives it as DP-1 with a good picture.
  • Rear port (port 2, dcp@3aae00000): the cable moved over without a reboot. 1920x1080@60, DP-2, good picture.
  • The internal panel stayed up throughout.
  • On both ports the DCP logs AFK optional dcpdp-service-epic (DCPDPService) is unsupported, which I take to be the DisplayPort audio side that's split out of this PR.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the J813 row on both USB-C ports, and to gig3m for running it. Nothing else is open from our side on 4e6ffec.

GitHub now reports a conflict with integration/aurora, so it can't merge as it is. Could you rebase it? The DTS content can stay as it is; the rows cover it.

RyanTheTide and others added 4 commits November 21, 2026 19:37
The N1 PCIe functions (with their aliases) and the video encoder's
status overrides were each written twice in t8142-j813.dts, the second
copies coming in with merges. Drop the second copy of each. The built
t8142-j813.dtb is byte-identical before and after.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
t8142-j813-j815-sleep.dtsi describes suspend-to-RAM for both M5 Airs,
but only t8142-j813.dts included it, and the nodes around it were in
the J813 board file alone: the CPU cluster power gate, the internal
display's power words (dcp_power, and the DCP's apple,display-power),
the DCP DART's PS write-disable word and the PMU's SPMI wake source.
J815 therefore had no sleep controller, no DCP firmware stop, and its
boot P core never powered down in WFI.

All of them are words of the T8142 PMGR, DCP and nub-spmi0, the same on
both boards (the sleep dtsi already lists NUB.SPMI0.SW3 among the wake
sources taken from the J815 ADT). Move the cluster gate, dcp_power and
the DCP/DART properties into t8142-j813-j815.dtsi, the PMU source into
the sleep node, and include the sleep dtsi from t8142-j815.dts.

t8142-j813.dtb keeps every node and value (only the order of /soc
children changes). t8142-j815.dtb gains exactly J813's nodes, except
that the sleep node lists only the DCP as display coprocessor until
J815 describes its external displays.

Fixes: 4de8bf0 ("arm64: dts: apple: t8142-j813: Describe suspend-to-RAM")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
J815 enables the Neural Engine and both JPEG engines; J813 left them
disabled although they are the same T8142 nodes, with the same ADT
entries (J813 27.0.1 ADT: ane ane-type 528, IRQs 751 and 764; jpeg0,
jpeg1 and dart-jpeg IRQs 1156, 1159 and 1157). The boot loader hands
the ANE preload over by the apple,t8142-ane compatible and disables the
node when there is none; the JPEG engines need no firmware.

Move the video encoder, ANE and JPEG enables into t8142-j813-j815.dtsi
so both boards share them. t8142-j815.dtb is unchanged; t8142-j813.dtb
changes only in those nine status properties.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The J815 has the J813's two USB-C ports with the same blocks behind them:
dispext0/1 with their DARTs, the ATC PHYs' DisplayPort side, the display
crossbars and the routes to the Type-C connectors. Include
t8142-j813-dcpext.dtsi as the J813 does. Everything in it stays disabled
until the loader hands the processors over and enables them.

On a J815 (macOS 27.2 stub) with the hand-off, nothing plugged in: both
hand-offs are okay, both external processors bind to the display
subsystem, and DP-1 and DP-2 appear as disconnected connectors next to
the panel.

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 21, 2026
…nning

iBoot preloads dcpext0 and dcpext1 with the internal DCP's image on the
T8142 Airs (J813, J815) and leaves them running idle, each with its own
data carveouts (region-id-73/74 and 88/89) and a locked firmware DART.
Linux had no way to adopt them, so a display on a USB-C port never lit.

For each disabled apple,t8142-dcpext node, in its own FDT transaction:
check that iBoot started the processor (ADT nub, DISPEXTn power words,
locked and translating firmware stream), keep the inherited page tables,
reserve the carveouts (per controller) and the live firmware segments, publish the
firmware version, add the external frontend's DART to the display
subsystem, and enable the node with its mailbox, DARTs, power domains
and Type-C routes. A processor that fails a check stays disabled with
its routes, so the port keeps working as USB. The outcome is recorded in
/chosen as aurora,dcpextN-handoff.

The scanout and PIODMA streams may be idle: a stream that is not locked
or has no translating root has nothing to keep. Once a translating root
is seen, any failure to collect or reserve its tables refuses that
processor, so the kernel is never handed a table the DART still walks.

dt_reserve_m5_display_segments() takes the alias and nub now; for an
external processor it only inspects a DART that iBoot locked. The
segment bound stays 128 MiB for every processor: on the J815 the
external ones list 30.9 MiB and the internal one 111.4 MiB. If disp0
already lists the external frontend's DART (the J704 tree does), it is
not appended a second time.

It is built into every image: with it, each Stage 1 flavour keeps at
least 15.7 KiB of room below the DCP log buffer with clang and with gcc
(tools/stage1_size.sh).

Follows dmitzsaz's J704 hand-off (aura 3f29689, 9b44044).

Tested with the kernel side (aurora-silicon/linux#1806), together with
the phandle fix that follows:
- J813, 27.0 stub (gig3m): both hand-offs okay, both processors probe,
  and a monitor lights up on either port, hot-unplug included;
- J813, 27.2 stub at EL2 (sithglan): 2560x1440 through a dock on the
  rear port, the dock's USB3 hub at 10 Gb/s;
- J815, 27.2 stub, nothing plugged in: both hand-offs okay, both
  processors bind, DP-1 and DP-2 appear disconnected.

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 21, 2026
dt_set_t8142_dcpext() refused every dcpext node with "no device tree
node": it needs the node's phandle for the power-domain walk, which finds
the node again by phandle as the tree changes, but dtc only gives a node
a phandle when something refers to it, and nothing refers to dcpext0/1.
Give it one as other hand-offs here do (fdt_generate_phandle).

Found by gig3m on a J813 (aurora-silicon/linux#1806): with a loader
change that creates the phandle, both hand-offs read "okay".

Signed-off-by: Nick <nekreshen@yandex.ru>
@m0d16l14n1
m0d16l14n1 force-pushed the j815/t8142-dp-altmode-wip branch from 4e6ffec to 185dc8f Compare November 21, 2026 12:51
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 21, 2026
…nning

iBoot preloads dcpext0 and dcpext1 with the internal DCP's image on the
T8142 Airs (J813, J815) and leaves them running idle, each with its own
data carveouts (region-id-73/74 and 88/89) and a locked firmware DART.
Linux had no way to adopt them, so a display on a USB-C port never lit.

For each disabled apple,t8142-dcpext node, in its own FDT transaction:
check that iBoot started the processor (ADT nub, DISPEXTn power words,
locked and translating firmware stream), keep the inherited page tables,
reserve the carveouts (per controller) and the live firmware segments, publish the
firmware version, add the external frontend's DART to the display
subsystem, and enable the node with its mailbox, DARTs, power domains
and Type-C routes. A processor that fails a check stays disabled with
its routes, so the port keeps working as USB. The outcome is recorded in
/chosen as aurora,dcpextN-handoff.

The scanout and PIODMA streams may be idle: a stream that is not locked
or has no translating root has nothing to keep. Once a translating root
is seen, any failure to collect or reserve its tables refuses that
processor, so the kernel is never handed a table the DART still walks.
The lock and the root are read from the registers before a DART view is
made, so a locked, translating stream whose view cannot be made refuses
the processor too.

dt_reserve_m5_display_segments() takes the alias and nub now; for an
external processor it only inspects a DART that iBoot locked. The
segment bound stays 128 MiB for every processor: on the J815 the
external ones list 30.9 MiB and the internal one 111.4 MiB. If disp0
already lists the external frontend's DART (the J704 tree does), it is
not appended a second time.

It is built into every image: with it, each Stage 1 flavour keeps at
least 15.7 KiB of room below the DCP log buffer with clang and with gcc
(tools/stage1_size.sh).

Follows dmitzsaz's J704 hand-off (aura 3f29689, 9b44044).

Tested with the kernel side (aurora-silicon/linux#1806), together with
the phandle fix that follows:
- J813, 27.0 stub (gig3m): both hand-offs okay, both processors probe,
  and a monitor lights up on either port, hot-unplug included;
- J813, 27.2 stub at EL2 (sithglan): 2560x1440 through a dock on the
  rear port, the dock's USB3 hub at 10 Gb/s;
- J815, 27.2 stub, nothing plugged in: both hand-offs okay, both
  processors bind, DP-1 and DP-2 appear disconnected.

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 21, 2026
dt_set_t8142_dcpext() refused every dcpext node with "no device tree
node": it needs the node's phandle for the power-domain walk, which finds
the node again by phandle as the tree changes, but dtc only gives a node
a phandle when something refers to it, and nothing refers to dcpext0/1.
Give it one as other hand-offs here do (fdt_generate_phandle).

Found by gig3m on a J813 (aurora-silicon/linux#1806): with a loader
change that creates the phandle, both hand-offs read "okay".

Signed-off-by: Nick <nekreshen@yandex.ru>
@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

@RyanTheTide rebased onto cc14570. #2383 conflicts with integration too, so its three commits are rebased here as well. There were two DTS conflicts:

This PR's own commit is unchanged apart from the trailer, and CHECK_DTBS is clean.

Assisted-by: LLM (Claude:Opus 5.5)

m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 21, 2026
…nning

iBoot preloads dcpext0 and dcpext1 with the internal DCP's image on the
T8142 Airs (J813, J815) and leaves them running idle, each with its own
data carveouts (region-id-73/74 and 88/89) and a locked firmware DART.
Linux had no way to adopt them, so a display on a USB-C port never lit.

For each disabled apple,t8142-dcpext node, in its own FDT transaction:
check that iBoot started the processor (ADT nub, DISPEXTn power words,
locked and translating firmware stream), keep the inherited page tables,
reserve the carveouts (per controller) and the live firmware segments, publish the
firmware version, add the external frontend's DART to the display
subsystem, and enable the node with its mailbox, DARTs, power domains
and Type-C routes. A processor that fails a check stays disabled with
its routes, so the port keeps working as USB. The outcome is recorded in
/chosen as aurora,dcpextN-handoff.

The scanout and PIODMA streams may be idle: a stream that is not locked
or has no translating root has nothing to keep. Once a translating root
is seen, any failure to collect or reserve its tables refuses that
processor, so the kernel is never handed a table the DART still walks.
The lock and the root are read from the registers before a DART view is
made, so a locked, translating stream whose view cannot be made refuses
the processor too.

dt_reserve_m5_display_segments() takes the alias and nub now; for an
external processor it only inspects a DART that iBoot locked. The
segment bound stays 128 MiB for every processor: on the J815 the
external ones list 30.9 MiB and the internal one 111.4 MiB. If disp0
already lists the external frontend's DART (the J704 tree does), it is
not appended a second time.

It is built into every image: with it, each Stage 1 flavour keeps at
least 15.7 KiB of room below the DCP log buffer with clang and with gcc
(tools/stage1_size.sh).

Follows dmitzsaz's J704 hand-off (aura 3f29689, 9b44044).

Tested with the kernel side (aurora-silicon/linux#1806), together with
the phandle fix that follows:
- J813, 27.0 stub (gig3m): both hand-offs okay, both processors probe,
  and a monitor lights up on either port, hot-unplug included;
- J813, 27.2 stub at EL2 (sithglan): 2560x1440 through a dock on the
  rear port, the dock's USB3 hub at 10 Gb/s;
- J815, 27.2 stub, nothing plugged in: both hand-offs okay, both
  processors bind, DP-1 and DP-2 appear disconnected.

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 21, 2026
dt_set_t8142_dcpext() refused every dcpext node with "no device tree
node": it needs the node's phandle for the power-domain walk, which finds
the node again by phandle as the tree changes, but dtc only gives a node
a phandle when something refers to it, and nothing refers to dcpext0/1.
Give it one as other hand-offs here do (fdt_generate_phandle).

Found by gig3m on a J813 (aurora-silicon/linux#1806): with a loader
change that creates the phandle, both hand-offs read "okay".

Signed-off-by: Nick <nekreshen@yandex.ru>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the rebase. 185dc8f is clean against integration/aurora and CI is green. Since it now carries #2383's three commits, it should go in with #2383 or after it. Nothing else is open from our side.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide
RyanTheTide merged commit 9923648 into aurora-silicon:integration/aurora Nov 21, 2026
2 checks passed
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
…nning

iBoot preloads dcpext0 and dcpext1 with the internal DCP's image on the
T8142 Airs (J813, J815) and leaves them running idle, each with its own
data carveouts (region-id-73/74 and 88/89) and a locked firmware DART.
Linux had no way to adopt them, so a display on a USB-C port never lit.

For each disabled apple,t8142-dcpext node, in its own FDT transaction:
check that iBoot started the processor (ADT nub, DISPEXTn power words,
locked and translating firmware stream), keep the inherited page tables,
reserve the carveouts (per controller) and the live firmware segments, publish the
firmware version, add the external frontend's DART to the display
subsystem, and enable the node with its mailbox, DARTs, power domains
and Type-C routes. A processor that fails a check stays disabled with
its routes, so the port keeps working as USB. The outcome is recorded in
/chosen as aurora,dcpextN-handoff.

The scanout and PIODMA streams may be idle: a stream that is not locked
or has no translating root has nothing to keep. Once a translating root
is seen, any failure to collect or reserve its tables refuses that
processor, so the kernel is never handed a table the DART still walks.
The lock and the root are read from the registers before a DART view is
made, so a locked, translating stream whose view cannot be made refuses
the processor too.

The tables alone are not enough on a port iBoot lit at boot: the
frontend keeps scanning out of the pages they map after the hand-off.
Once the carveouts and the firmware segments are reserved, every page
the scanout and PIODMA streams map must lie in a no-map reservation or
a /memreserve/ entry; one page outside refuses the processor, and the
log names the first such IOVA and its address. A translating stream
logs how many pages it maps.

dt_reserve_m5_display_segments() takes the alias and nub now; for an
external processor it only inspects a DART that iBoot locked. The
segment bound stays 128 MiB for every processor: on the J815 the
external ones list 30.9 MiB and the internal one 111.4 MiB. If disp0
already lists the external frontend's DART (the J704 tree does), it is
not appended a second time.

It is built into every image: with it, each Stage 1 flavour keeps at
least 12.7 KiB of room below the DCP log buffer with clang and with gcc
(tools/stage1_size.sh; the least is gcc's stage1-dev-audit text).

Follows dmitzsaz's J704 hand-off (aura 3f29689, 9b44044).

Tested with the kernel side (aurora-silicon/linux#1806), together with
the phandle fix that follows:
- J813, 27.0 stub (gig3m): both hand-offs okay, both processors probe,
  and a monitor lights up on either port, hot-unplug included;
- J813, 27.2 stub at EL2 (sithglan): 2560x1440 through a dock on the
  rear port, the dock's USB3 hub at 10 Gb/s;
- J815, 27.2 stub, nothing plugged in: both hand-offs okay, both
  processors bind, DP-1 and DP-2 appear disconnected.

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
dt_set_t8142_dcpext() refused every dcpext node with "no device tree
node": it needs the node's phandle for the power-domain walk, which finds
the node again by phandle as the tree changes, but dtc only gives a node
a phandle when something refers to it, and nothing refers to dcpext0/1.
Give it one as other hand-offs here do (fdt_generate_phandle).

Found by gig3m on a J813 (aurora-silicon/linux#1806): with a loader
change that creates the phandle, both hand-offs read "okay".

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
…nning

iBoot preloads dcpext0 and dcpext1 with the internal DCP's image on the
T8142 Airs (J813, J815) and leaves them running idle, each with its own
data carveouts (region-id-73/74 and 88/89) and a locked firmware DART.
Linux had no way to adopt them, so a display on a USB-C port never lit.

For each disabled apple,t8142-dcpext node, in its own FDT transaction:
check that iBoot started the processor (ADT nub, DISPEXTn power words,
locked and translating firmware stream), keep the inherited page tables,
reserve the carveouts (per controller) and the live firmware segments, publish the
firmware version, add the external frontend's DART to the display
subsystem, and enable the node with its mailbox, DARTs, power domains
and Type-C routes. A processor that fails a check stays disabled with
its routes, so the port keeps working as USB. The outcome is recorded in
/chosen as aurora,dcpextN-handoff.

The scanout and PIODMA streams may be idle: a stream that is not locked
or has no translating root has nothing to keep. Once a translating root
is seen, any failure to collect or reserve its tables refuses that
processor, so the kernel is never handed a table the DART still walks.
The lock and the root are read from the registers before a DART view is
made, so a locked, translating stream whose view cannot be made refuses
the processor too.

The tables alone are not enough on a port iBoot lit at boot: the
frontend keeps scanning out of the pages they map after the hand-off.
Once the carveouts and the firmware segments are reserved, every page
the scanout and PIODMA streams map must lie in a no-map reservation or
a /memreserve/ entry; one page outside refuses the processor, and the
log names the first such IOVA and its address. A translating stream
logs how many pages it maps.

dt_reserve_m5_display_segments() takes the alias and nub now; for an
external processor it only inspects a DART that iBoot locked. The
segment bound stays 128 MiB for every processor: on the J815 the
external ones list 30.9 MiB and the internal one 111.4 MiB. If disp0
already lists the external frontend's DART (the J704 tree does), it is
not appended a second time.

It is built into every image: with it, each Stage 1 flavour keeps at
least 12.7 KiB of room below the DCP log buffer with clang and with gcc
(tools/stage1_size.sh; the least is gcc's stage1-dev-audit text).

Follows dmitzsaz's J704 hand-off (aura 3f29689, 9b44044).

Tested with the kernel side (aurora-silicon/linux#1806), together with
the phandle fix that follows:
- J813, 27.0 stub (gig3m): both hand-offs okay, both processors probe,
  and a monitor lights up on either port, hot-unplug included;
- J813, 27.2 stub at EL2 (sithglan): 2560x1440 through a dock on the
  rear port, the dock's USB3 hub at 10 Gb/s;
- J815, 27.2 stub, nothing plugged in: both hand-offs okay, both
  processors bind, DP-1 and DP-2 appear disconnected.

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
dt_set_t8142_dcpext() refused every dcpext node with "no device tree
node": it needs the node's phandle for the power-domain walk, which finds
the node again by phandle as the tree changes, but dtc only gives a node
a phandle when something refers to it, and nothing refers to dcpext0/1.
Give it one as other hand-offs here do (fdt_generate_phandle).

Found by gig3m on a J813 (aurora-silicon/linux#1806): with a loader
change that creates the phandle, both hand-offs read "okay".

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
…nning

iBoot preloads dcpext0 and dcpext1 with the internal DCP's image on the
T8142 Airs (J813, J815) and leaves them running idle, each with its own
data carveouts (region-id-73/74 and 88/89) and a locked firmware DART.
Linux had no way to adopt them, so a display on a USB-C port never lit.

For each disabled apple,t8142-dcpext node, in its own FDT transaction:
check that iBoot started the processor (ADT nub, DISPEXTn power words,
locked and translating firmware stream), keep the inherited page tables,
reserve the carveouts (per controller) and the live firmware segments, publish the
firmware version, add the external frontend's DART to the display
subsystem, and enable the node with its mailbox, DARTs, power domains
and Type-C routes. A processor that fails a check stays disabled with
its routes, so the port keeps working as USB. The outcome is recorded in
/chosen as aurora,dcpextN-handoff.

The scanout and PIODMA streams may be idle: a stream that is not locked
or has no translating root has nothing to keep. Once a translating root
is seen, any failure to collect or reserve its tables refuses that
processor, so the kernel is never handed a table the DART still walks.
The lock and the root are read from the registers before a DART view is
made, so a locked, translating stream whose view cannot be made refuses
the processor too.

The tables alone are not enough on a port iBoot lit at boot: the
frontend keeps scanning out of the pages they map after the hand-off.
Once the carveouts and the firmware segments are reserved, every page
the scanout and PIODMA streams map must lie in a no-map reservation or
a /memreserve/ entry; one page outside refuses the processor, and the
log names the first such IOVA and its address. A translating stream
logs how many pages it maps.

dt_reserve_m5_display_segments() takes the alias and nub now; for an
external processor it only inspects a DART that iBoot locked. The
segment bound stays 128 MiB for every processor: on the J815 the
external ones list 30.9 MiB and the internal one 111.4 MiB. If disp0
already lists the external frontend's DART (the J704 tree does), it is
not appended a second time.

It is built into every image: with it, each Stage 1 flavour keeps at
least 12.7 KiB of room below the DCP log buffer with clang and with gcc
(tools/stage1_size.sh; the least is gcc's stage1-dev-audit text).

Follows dmitzsaz's J704 hand-off (aura 3f29689, 9b44044).

Tested with the kernel side (aurora-silicon/linux#1806), together with
the phandle fix that follows:
- J813, 27.0 stub (gig3m): both hand-offs okay, both processors probe,
  and a monitor lights up on either port, hot-unplug included;
- J813, 27.2 stub at EL2 (sithglan): 2560x1440 through a dock on the
  rear port, the dock's USB3 hub at 10 Gb/s;
- J815, 27.2 stub, nothing plugged in: both hand-offs okay, both
  processors bind, DP-1 and DP-2 appear disconnected.

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
dt_set_t8142_dcpext() refused every dcpext node with "no device tree
node": it needs the node's phandle for the power-domain walk, which finds
the node again by phandle as the tree changes, but dtc only gives a node
a phandle when something refers to it, and nothing refers to dcpext0/1.
Give it one as other hand-offs here do (fdt_generate_phandle).

Found by gig3m on a J813 (aurora-silicon/linux#1806): with a loader
change that creates the phandle, both hand-offs read "okay".

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
…nning

iBoot preloads dcpext0 and dcpext1 with the internal DCP's image on the
T8142 Airs (J813, J815) and leaves them running idle, each with its own
data carveouts (region-id-73/74 and 88/89) and a locked firmware DART.
Linux had no way to adopt them, so a display on a USB-C port never lit.

For each disabled apple,t8142-dcpext node, in its own FDT transaction:
check that iBoot started the processor (ADT nub, DISPEXTn power words,
locked and translating firmware stream), keep the inherited page tables,
reserve the carveouts (per controller) and the live firmware segments, publish the
firmware version, add the external frontend's DART to the display
subsystem, and enable the node with its mailbox, DARTs, power domains
and Type-C routes. A processor that fails a check stays disabled with
its routes, so the port keeps working as USB. The outcome is recorded in
/chosen as aurora,dcpextN-handoff.

The scanout and PIODMA streams may be idle: a stream that is not locked
or has no translating root has nothing to keep. Once a translating root
is seen, any failure to collect or reserve its tables refuses that
processor, so the kernel is never handed a table the DART still walks.
The lock and the root are read from the registers before a DART view is
made, so a locked, translating stream whose view cannot be made refuses
the processor too.

The tables alone are not enough on a port iBoot lit at boot: the
frontend keeps scanning out of the pages they map after the hand-off.
Once the carveouts and the firmware segments are reserved, every page
the scanout and PIODMA streams map must lie in a no-map reservation or
a /memreserve/ entry; one page outside refuses the processor, and the
log names the first such IOVA and its address. A translating stream
logs how many pages it maps.

dt_reserve_m5_display_segments() takes the alias and nub now; for an
external processor it only inspects a DART that iBoot locked. The
segment bound stays 128 MiB for every processor: on the J815 the
external ones list 30.9 MiB and the internal one 111.4 MiB. If disp0
already lists the external frontend's DART (the J704 tree does), it is
not appended a second time.

It is built into every image: with it, each Stage 1 flavour keeps at
least 8.4 KiB of room below the DCP log buffer with clang and with gcc
(tools/stage1_size.sh; the least is gcc's stage1-dev-audit text).

Follows dmitzsaz's J704 hand-off (aura 3f29689, 9b44044).

Tested with the kernel side (aurora-silicon/linux#1806), together with
the phandle fix that follows:
- J813, 27.0 stub (gig3m): both hand-offs okay, both processors probe,
  and a monitor lights up on either port, hot-unplug included;
- J813, 27.2 stub at EL2 (sithglan): 2560x1440 through a dock on the
  rear port, the dock's USB3 hub at 10 Gb/s;
- J815, 27.2 stub, nothing plugged in: both hand-offs okay, both
  processors bind, DP-1 and DP-2 appear disconnected.

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
dt_set_t8142_dcpext() refused every dcpext node with "no device tree
node": it needs the node's phandle for the power-domain walk, which finds
the node again by phandle as the tree changes, but dtc only gives a node
a phandle when something refers to it, and nothing refers to dcpext0/1.
Give it one as other hand-offs here do (fdt_generate_phandle).

Found by gig3m on a J813 (aurora-silicon/linux#1806): with a loader
change that creates the phandle, both hand-offs read "okay".

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
…nning

iBoot preloads dcpext0 and dcpext1 with the internal DCP's image on the
T8142 Airs (J813, J815) and leaves them running idle, each with its own
data carveouts (region-id-73/74 and 88/89) and a locked firmware DART.
Linux had no way to adopt them, so a display on a USB-C port never lit.

For each disabled apple,t8142-dcpext node, in its own FDT transaction:
check that iBoot started the processor (ADT nub, DISPEXTn power words,
locked and translating firmware stream), keep the inherited page tables,
reserve the carveouts (per controller) and the live firmware segments, publish the
firmware version, add the external frontend's DART to the display
subsystem, and enable the node with its mailbox, DARTs, power domains
and Type-C routes. A processor that fails a check stays disabled with
its routes, so the port keeps working as USB. The outcome is recorded in
/chosen as aurora,dcpextN-handoff.

The scanout and PIODMA streams may be idle: a stream that is not locked
or has no translating root has nothing to keep. Once a translating root
is seen, any failure to collect or reserve its tables refuses that
processor, so the kernel is never handed a table the DART still walks.
The lock and the root are read from the registers before a DART view is
made, so a locked, translating stream whose view cannot be made refuses
the processor too.

The tables alone are not enough on a port iBoot lit at boot: the
frontend keeps scanning out of the pages they map after the hand-off.
Once the carveouts and the firmware segments are reserved, every page
the scanout and PIODMA streams map must lie in a no-map reservation or
a /memreserve/ entry; one page outside refuses the processor, and the
log names the first such IOVA and its address. A translating stream
logs how many pages it maps.

dt_reserve_m5_display_segments() takes the alias and nub now; for an
external processor it only inspects a DART that iBoot locked. The
segment bound stays 128 MiB for every processor: on the J815 the
external ones list 30.9 MiB and the internal one 111.4 MiB. If disp0
already lists the external frontend's DART (the J704 tree does), it is
not appended a second time.

It is built into every image: with it, each Stage 1 flavour keeps at
least 8.4 KiB of room below the DCP log buffer with clang and with gcc
(tools/stage1_size.sh; the least is gcc's stage1-dev-audit text).

Follows dmitzsaz's J704 hand-off (aura 3f29689, 9b44044).

Tested with the kernel side (aurora-silicon/linux#1806), together with
the phandle fix that follows:
- J813, 27.0 stub (gig3m): both hand-offs okay, both processors probe,
  and a monitor lights up on either port, hot-unplug included;
- J813, 27.2 stub at EL2 (sithglan): 2560x1440 through a dock on the
  rear port, the dock's USB3 hub at 10 Gb/s;
- J815, 27.2 stub, nothing plugged in: both hand-offs okay, both
  processors bind, DP-1 and DP-2 appear disconnected.

Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1 added a commit to m0d16l14n1/aura that referenced this pull request Nov 22, 2026
dt_set_t8142_dcpext() refused every dcpext node with "no device tree
node": it needs the node's phandle for the power-domain walk, which finds
the node again by phandle as the tree changes, but dtc only gives a node
a phandle when something refers to it, and nothing refers to dcpext0/1.
Give it one as other hand-offs here do (fdt_generate_phandle).

Found by gig3m on a J813 (aurora-silicon/linux#1806): with a loader
change that creates the phandle, both hand-offs read "okay".

Signed-off-by: Nick <nekreshen@yandex.ru>
RyanTheTide added a commit that referenced this pull request Nov 22, 2026
Conflicts: t8142-j813.dts, t8142-j815.dts (took integration: #1806 moved the board enables to t8142-j813-j815.dtsi and cluster_pwrgate there); dropped the now-redundant venc/ANE/JPEG enables from t8142-j813-j815.dtsi.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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.

4 participants