Skip to content

arm64: dts: apple: t6050-j716c: map upper 0x22..0x23 MMIO window in die0 - #3396

Closed
erikwb wants to merge 1 commit into
mainfrom
fix/j716c-die0-upper-mmio-ranges
Closed

erikwb wants to merge 1 commit into
mainfrom
fix/j716c-die0-upper-mmio-ranges

Conversation

@erikwb

@erikwb erikwb commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What: Extend &die0 ranges in arch/arm64/boot/dts/apple/t6050-j716c.dts to include the upper 0x22_00000000..0x23_ffffffff MMIO window so media and upper-MMIO nodes placed under &die0 on J716c (jpeg0_dart, jpeg0, jpeg1, ave0, ave0_dart, ave0_dart1, scaler0/1, apr1_dart, error_handler, and peripheral_clocks upper banks) translate cleanly instead of failing OF address translation. Companion to #3395 (feat/ave-t6050-26b123), and required on main after #2278 enabled t6050-media.dtsi on J716c.
Tested: At e82ed13d64e7 (and clean merge with origin/main 18058ea228e2): checkpatch --strict, all 11 t6050-*.dtb targets build (W=1 CHECK_DTBS=y, 0 untranslated reg resources, 0 new warnings on t6050-j716c.dtb, 10 non-J716c DTBs byte-identical), and hosted dt-checks/host-tests/pr-text/readiness pass. J716c (16-inch M5 Max, T6050) at e82ed13d64e7 (standalone probe row + paired with #3395 in batched trial kernel 3545ebecb76f, hunk-identical): 2281020000.iommu (2281020000-228102bfff in /proc/iomem), 22830a0000.iommu, 2283080000.iommu, 2281000000.jpeg, 2281060000.jpeg, and 2283100000.video-encoder bind and translate with all 8 observed upper-MMIO /proc/iomem entries present, 1080p30 H.264/HEVC encodes pass, venc0-sys off-0 at idle, 0 warnings on the standalone probe, initial boot smoke snapshot clean (1 failed system unit aurora-peripherals.service, same as baseline warm reboots; later checks recorded additional messages).
Risk: two-way door · J716c (16-inch M5 Max) only
Revert: git revert -m 1 <merge-commit> removes the &die0 ranges override from arch/arm64/boot/dts/apple/t6050-j716c.dts, restoring the lower-only 0x2..0x5_ffffffff window from t6050-base.dtsi; no persistent on-disk or firmware state is written.
Not yet: all other T6050 boards (J714s, J714c, J716s, J775c, J775d, J873s, K114c, K114s, K116c, K116s) and all non-T6050 Mac families are untested on hardware here because t6050-j716c.dts is J716c-only and every other DTB is byte-for-byte unchanged.

Details

t6050-base.dtsi maps only die 0's lower 0x2..0x5_ffffffff window (ranges = <0x2 0x0 0x2 0x0 0x4 0x0>;) in die0: soc@200000000. In t6050-peripherals.dtsi, #ifndef T6050_J716C creates a unit-less /soc bus with an empty ranges; (1:1 identity translation across the full address space) and attaches peripheral_clocks and the 0x22..0x23 upper-MMIO media/peripheral nodes (jpeg0_dart, jpeg0, jpeg1, ave0, ave0_dart, ave0_dart1, ave1, ave1_dart, ave1_dart1, scaler0, scaler0_dart, scaler1, scaler1_dart, apr1_dart, error_handler) to &{/soc} on J714s and every other non-J716c T6050 board.

Only T6050_J716C skips /soc and attaches those nodes directly under &die0 (soc@200000000) so loader /soc path lookups resolve unambiguously. Extending &die0 ranges with <0x22 0x0 0x22 0x0 0x2 0x0> in t6050-j716c.dts covers the upper die-0 MMIO aperture (0x22_00000000..0x23_ffffffff) for J716c while leaving J714s (already translated 1:1 via /soc { ranges; }) and all other T6050 DTBs unchanged.

Companion / merge order: #2278 (merged on main) enables ave0, ave0_dart, ave0_dart1, jpeg0_dart, jpeg0, and jpeg1 on J716c and the boards that include t6050-media.dtsi (10 direct includes across 11 T6050 boards; t6050-j775c.dts does not include it); #3396 provides the &die0 upper-MMIO translation needed for those nodes on J716c, and #3395 (feat/ave-t6050-26b123) admits the J716c 26B123 AVE firmware build.

Evidence
  • Local checks at e82ed13d64e7:
    • scripts/checkpatch.pl --strict --git e82ed13d64e7~1..e82ed13d64e7: 0 errors, 0 warnings, 0 checks (15 lines checked).
    • Built all 11 apple/t6050-*.dtb targets (j714c, j714s, j716c, j716s, j775c, j775d, j873s, k114c, k114s, k116c, k116s) with W=1 CHECK_DTBS=y: 0 new warnings on t6050-j716c.dtb (7 pre-existing: 6 unit_address_vs_reg in t6050-j716c-gpu-panel.dtsi and 1 simple_bus_reg on pmp@284e00000), 0 schema warnings on soc@200000000 or its ranges.
    • Byte-for-byte sha256 comparison (e82ed13d64e7~1 vs e82ed13d64e7) across all 11 t6050-*.dtb files: only t6050-j716c.dtb changed (8f55dd4c16d8 -> e97532284dd8); all 10 non-J716c DTBs are byte-identical.
    • Effective bus comparison (t6050-j716c.dtb vs t6050-j714s.dtb):
      • J716c: /soc@200000000 (ranges = <0x02 0x00 0x02 0x00 0x04 0x00 0x22 0x00 0x22 0x00 0x02 0x00>) parents iommu@2281020000, jpeg@2281000000, jpeg@2281060000, video-encoder@2283100000, iommu@22830a0000, and iommu@2283080000; no /soc node exists.
      • J714s: /soc (ranges;, 1:1 identity) parents those nodes; /soc@200000000 (ranges = <0x02 0x00 0x02 0x00 0x04 0x00>) contains only 0x02..0x05_ffffffff nodes.
  • Clean merge check with origin/main (18058ea228e2, including #2278 t6050-media.dtsi):
    • git merge origin/main merged cleanly with 0 conflicts; all 11 apple/t6050-*.dtb targets built with W=1 CHECK_DTBS=y (0 new warnings on t6050-j716c.dtb) and 0 untranslated reg entries across every /soc* bus (829–922 reg entries checked per DTB; 869 on t6050-j716c.dtb).
  • CI and review at e82ed13d64e7: dt-checks, host-tests, pr-text, and readiness all SUCCESS; approved at e82ed13d64e7 (technically resolving the J714s /soc objection from the earlier changes-requested review, while GitHub still reports REVIEW_REQUIRED / BLOCKED).
  • Hardware verification at e82ed13d64e7:
    • Standalone J716c probe row (default cmdline, e82ed13d64e7): /sys/bus/platform/devices/2281020000.iommu present; /proc/iomem: 2281020000-228102bfff : 2281020000.iommu dart; apple-ave 2283100000.video-encoder probed cleanly with H.264/HEVC encode passing and 0 kernel warnings.
    • Batched J716c row (16-inch M5 Max, T6050, firmware 27.2, AC, default command line) in a one-shot batched trial kernel (origin/main b897ccb4e71c plus 18 open PR heads, commit 3545ebecb76f; t6050-j716c.dts is hunk-identical there): kernel image SHA-256 d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312, one-shot Stage 2 SHA-256 b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d (default Stage 2 21edee972e1ff1718c6f41c32b91ee151afdc58cbb69f16f2f6a4d8d4c722170 and default kernel untouched): 2281020000.iommu, 22830a0000.iommu, 2283080000.iommu bound to apple-dart, 2281000000.jpeg and 2281060000.jpeg to apple-jpeg (JPEG encoder, HWREV 0x110010), 2283100000.video-encoder to apple-ave (26B123, d33ed3b4), with all 8 observed /proc/iomem entries present:
      • 2281000000-2281003fff : 2281000000.jpeg jpeg@2281000000
      • 2281020000-228102bfff : 2281020000.iommu dart
      • 2281060000-2281063fff : 2281060000.jpeg jpeg@2281060000
      • 2283050000-2283053fff : 2283100000.video-encoder mailbox
      • 2283080000-228308bfff : 2283080000.iommu dart
      • 22830a0000-22830abfff : 22830a0000.iommu dart
      • 2283100000-228355bfff : 2283100000.video-encoder codec
      • 2283800000-2283ffffff : 2283100000.video-encoder coproc
        Plus 1080p30 h264_v4l2m2m and hevc_v4l2m2m encodes, venc0-sys off-0 at idle. 5-item smoke: display eDP-1 3456x2234@120 enabled; input Apple MTP keyboard, trackpad and SMC lid devices enumerated (not exercised remotely); networking wlan0 connected, 0% loss over 3 pings; permitted audio sink AppleJ716 + AppleJ716HPAI present with speakerguardd v2 active (no playback outside the linux#3085 row); GPU Borealis Apple M5 Max (G17C B1), renderD128, vkcube --c 180 --wsi wayland clean. 1 failed system unit (aurora-peripherals.service, same as baseline warm reboots; 0 new failed units), 0 failed user units, 0 LSM denials (no SELinux/AppArmor loaded), 0 Oops/BUG/fault lines; initial boot smoke snapshot err+ 40 lines against 55 on the default boot, none that the default boot lacks (apple-dcp ... unable to match service ..., systemd-gpt-auto-generator; later checks in the session recorded additional messages). Redacted dmesg excerpt: [ 1.250760] sn201202x 1-08: port controller ready; [ 2.677310] apple-ave 2283100000.video-encoder: firmware build 26B123 (TEXT 0x158000 CRC d33ed3b4, DATA 0x134000); [ 5.907044] apple-dcp 392e00000.dcp: RTKit: syslog message: ... fControllerPowerState 0 ...; [ 135.265810] PM: suspend entry (s2idle) / [ 140.691796] PM: suspend exit (pm_test=devices).

t6050-peripherals.dtsi places the T6050 media nodes (ave0, ave0_dart,
ave0_dart1, jpeg0, jpeg1, jpeg0_dart, scaler0, scaler1) under &die0 on
J716c, while t6050-base.dtsi only maps 0x02_00000000..0x05_ffffffff in
die0's ranges property.

Without a translation entry covering 0x22_00000000..0x23_ffffffff,
OF address translation fails for every die-0 child whose reg property
lies in that window (such as ave0 at 0x22_82000000 and jpeg0_dart at
0x22_81020000), leaving those devices without their primary MMIO
resource when enabled.

Add the 1:1 0x22_00000000..0x23_ffffffff translation window to &die0 in
t6050-j716c.dts so all die-0 upper MMIO nodes translate cleanly without
affecting J714c.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb requested review from a team as code owners November 27, 2026 14:40
@erikwb
erikwb requested review from LiamRay11 and maralcbr November 27, 2026 14:40

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The 2-cell identity translation covers the two tested upper-aperture resources and retains the lower range. The shared t6050-peripherals.dtsi declares both registers, and t6050-j714s.dts also enables jpeg0_dart and ave0. That DTS has no die0 ranges override at this revision. Checking that J714c is byte-identical does not settle the J714s gap. Please compare the effective ranges and translated resources for J716c and J714s. If both have the same aperture, add the mapping to the appropriate shared die description and verify the changed DTBs. If apertures differ, document the address-map evidence for scoping it to J716c. Hosted DT schema checks are still queued.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Merge readiness at e82ed13d: not ready yet

Check Detail
CI at head ok 5 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at e82ed13d
Conflicts ok none
PR text ok Risk: two-way · J716c (16-inch M5 Max) only Revert: git revert -m 1 <merge-commit> removes the &die0 ranges override from arch/arm64/boot/dts/apple/t6050-j716c.dts, restoring the lower-only 0x2..0x5_ffffffff window from t6050-base.dtsi; no persistent on-disk or firmware state is written.

Areas: area:bringup

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@erikwb

erikwb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

There is no J714s translation gap at e82ed13d64e7: J714s and J716c place jpeg0_dart, ave0, and the other upper-MMIO inventory nodes under different parent buses in arch/arm64/boot/dts/apple/t6050-peripherals.dtsi.

In t6050-peripherals.dtsi:

  • Lines 77–88 (#ifndef T6050_J716C) define a unit-less /soc bus with an empty ranges; property (1:1 identity translation across the entire address space).
  • Lines 1249–1253 and 1322–1326 (#ifdef T6050_J716C &die0 #else &{/soc} #endif) attach peripheral_clocks and the shared 0x22..0x23 nodes (jpeg0_dart, jpeg0, jpeg1, ave0, ave0_dart, ave0_dart1, ave1, ave1_dart, ave1_dart1, scaler0, scaler0_dart, scaler1, scaler1_dart, apr1_dart, error_handler) to &die0 (soc@200000000) only when T6050_J716C is defined, and to &{/soc} on J714s and all other non-J716c T6050 boards.

Comparing the compiled DTBs (t6050-j716c.dtb vs t6050-j714s.dtb) at e82ed13d64e7:

  • J714s (t6050-j714s.dtb):
    • jpeg0_dart is /soc/iommu@2281020000 (reg = <0x22 0x81020000 0x0 0xc000 0x02 0x74000000 0x0 0x4000>) and ave0 is /soc/video-encoder@2283100000 (reg = <0x22 0x83100000 0x0 0x45c000 0x22 0x83050000 0x0 0x4000 0x22 0x83800000 0x0 0x800000>).
    • Their parent /soc has ranges; (empty 1:1 translation), so all resources already translate 1:1 (0x2281020000, 0x274000000, 0x2283100000, 0x2283050000, 0x2283800000).
    • /soc@200000000 (&die0) has ranges = <0x02 0x00 0x02 0x00 0x04 0x00>; and holds only 0x02..0x05_ffffffff children.
  • J716c (t6050-j716c.dtb):
    • /soc is absent (#ifndef T6050_J716C), so jpeg0_dart (/soc@200000000/iommu@2281020000) and ave0 (/soc@200000000/video-encoder@2283100000) — along with scaler0/1, ave1, jpeg0/1, apr1_dart, error_handler, event-log, and peripheral_clocks — sit directly under /soc@200000000 (&die0).
    • With t6050-j716c.dts extending &die0 ranges to <0x02 0x00 0x02 0x00 0x04 0x00 0x22 0x00 0x22 0x00 0x02 0x00>, every child resource translates 1:1.

Scoping the &die0 override to t6050-j716c.dts matches the #ifdef T6050_J716C bus split in t6050-peripherals.dtsi and avoids changing t6050-base.dtsi across the other 10 T6050 DTBs (j714c, j714s, j716s, j775c, j775d, j873s, k114c, k114s, k116c, k116s), where /soc@2220000000 and /soc@2308000000 are sibling buses and /soc already maps 0x22..0x23. Across all 11 built t6050-*.dtb files at e82ed13d64e7, every /soc* bus has 0 untranslated reg entries, CHECK_DTBS=y reports 0 warnings on soc@200000000 or ranges, and hosted dt-checks and host-tests CI have completed with SUCCESS.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train status at e82ed13d: not eligible yet, because the review App's change request at this head is active. Its point fits our one-implementation rule: t6050-j714s.dts also enables jpeg0_dart and ave0 from the shared t6050-peripherals.dtsi, and the J714s has no die0 ranges override. So if the upper 0x22..0x23 aperture is the same on both, the mapping belongs in the shared die description, verified on both changed DTBs. If the apertures differ, cite the ADT address-map evidence for keeping it J716c-only. Then the App re-reviews, and I merge under the 6-point rule after the Dj ping.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at e82ed13.

Checked: The earlier review assumed both machines put the media nodes under die0. At this head the shared include directs J714s to /soc with empty identity ranges and J716c to die0. The J716c override preserves the low window and adds the upper identity window without changing the common die map. The author supplied compiled-DTB paths and resource translations for both, with zero untranslated entries over eleven T6050 DTBs. Hosted dt-checks and host-tests pass.

@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Subsequently approved at e82ed13d64e7 (Verdict: MERGE), resolving the earlier J714s /soc objection technically while GitHub still reports REVIEW_REQUIRED (BLOCKED), confirming that only t6050-j716c.dts (#ifdef T6050_J716C) places the 0x22..0x23 media and peripheral nodes under &die0 (soc@200000000) while t6050-j714s.dts and the other 9 T6050 boards place them under /soc (ranges;) in arch/arm64/boot/dts/apple/t6050-peripherals.dtsi. Extending t6050-base.dtsi is unnecessary on those 10 boards where /soc already maps 0x22..0x23 and /soc@2220000000 / /soc@2308000000 are sibling buses.

Also verified at e82ed13d64e7 merged locally with origin/main (18058ea228e2, which landed #2278 t6050-media.dtsi enabling ave0 and jpeg0/jpeg1 on J716c and the boards that include it):

  • git merge origin/main has 0 conflicts.
  • All 11 apple/t6050-*.dtb targets build cleanly under W=1 CHECK_DTBS=y (0 new warnings on t6050-j716c.dtb) with 0 untranslated reg entries across every /soc* bus (869 checked on t6050-j716c.dtb; 829–922 per DTB).
  • All 10 non-J716c T6050 DTBs remain byte-for-byte identical (sha256 verified against e82ed13d64e7~1).

Hardware verification update:

  • Standalone J716c probe row at e82ed13d64e7 (kept separately): /sys/bus/platform/devices/2281020000.iommu present; /proc/iomem: 2281020000-228102bfff : 2281020000.iommu dart; apple-ave 2283100000.video-encoder probed cleanly with H.264/HEVC encode passing and 0 kernel warnings.
  • J716c at e82ed13d64e7 (paired with #3395 in batched trial kernel 3545ebecb76f, kernel SHA-256 d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312, Stage 2 SHA-256 b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d): 2281020000.iommu, 22830a0000.iommu, 2283080000.iommu bound to apple-dart, 2281000000.jpeg and 2281060000.jpeg to apple-jpeg (JPEG encoder, HWREV 0x110010), 2283100000.video-encoder to apple-ave (26B123, d33ed3b4), with all 8 observed /proc/iomem entries present (2281000000-2281003fff : 2281000000.jpeg jpeg@2281000000, 2281020000-228102bfff : 2281020000.iommu dart, 2281060000-2281063fff : 2281060000.jpeg jpeg@2281060000, 2283050000-2283053fff : 2283100000.video-encoder mailbox, 2283080000-228308bfff : 2283080000.iommu dart, 22830a0000-22830abfff : 22830a0000.iommu dart, 2283100000-228355bfff : 2283100000.video-encoder codec, 2283800000-2283ffffff : 2283100000.video-encoder coproc), 1080p30 h264_v4l2m2m and hevc_v4l2m2m encodes, venc0-sys off-0 at idle; initial boot smoke snapshot clean (1 failed system unit aurora-peripherals.service, same as baseline warm reboots; later checks recorded additional messages).

@RyanTheTide
RyanTheTide disabled auto-merge November 28, 2026 23:11
@erikwb

erikwb commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #3662, which makes the same J716c fix: it adds die 0's second MMIO window to &die0's ranges, using the window's base and size from the J716c ADT's /arm-io ranges[1] (0x22_2000_0000 + 0x1_e000_0000). On current main with #3662, every reg in the J716c DTB translates, and no node has a reg in 0x22_0000_0000..0x22_2000_0000, the part this PR's wider window adds. #3662 was tested on the J716c at its head and is linked to #3618.

@erikwb erikwb closed this Nov 30, 2026
erikwb added a commit that referenced this pull request Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants