Skip to content

drm/asahi: enable the calibrated 20-core T6040 GPU on J616s - #463

Merged
RyanTheTide merged 8 commits into
integration/aurorafrom
review/j616s-gpu-integration-v3
Oct 28, 2026
Merged

RyanTheTide merged 8 commits into
integration/aurorafrom
review/j616s-gpu-integration-v3

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

This enables the calibrated 20-core T6040 GPU on the J616s. The existing guard admits two clusters with 20 enabled cores and refuses other core counts; that guard is unchanged. m1n1 supplies the running chip's OPPs, selector maps, leakage, core mask and power ceiling. The kernel validates the complete handoff before starting the GPU and uses those values in its 25G83 initdata. Missing or invalid calibration refuses the GPU. Firmware admission still requires an exact loaded image, including both images from #453.

The series is rebased onto integration/aurora at af80fbe. It is split into firmware selection, calibration, initdata, hardware defaults, DT and bindings, host selftests and tools. The reader is wired when its consumers are present, and the old ceiling declaration is removed with its final hardware-default reference. #453's image admission work is kept from the base rather than replayed.

The m4pro agent proved the preceding m4p11/m4p12 stack on a J616s with m1n1 c2515d6571fe2165fbc15f6c19cc606b7d296956. Firmware was admitted, Vulkan reported Apple M4 Pro (G16S B1), vkcube ran, glmark2-es2 scored 6271, and a ten-minute soak had no Asahi or DART faults. The sampled peak was 77.5 C. The tested stack used integration ff1510c, #394, the GPU branch at eda1292 and #453. Those results belong to that earlier stack. The m4p13 build of this PR head is for the final hardware gate before merge.

The independent Wi-Fi schema repair is a separate prerequisite commit from #458 because complete T6040 DT validation needs it. It does not enable the GPU. It is isolated for review and can be dropped when the GPU series is refreshed after #458 lands. The GPU series changes no Kconfig definitions and leaves the one universal asahi.config byte-for-byte unchanged from integration. The unrelated ENERGY_MODEL and THERMAL_GOV_POWER_ALLOCATOR additions remain solely in #438; the four default-governor overrides from the development branch were also dropped.

The unchanged Fedora base has an existing resolution issue: the common fragment asks for the power allocator as the default thermal governor, but Fedora disables the governor itself. #438 fixes that independent issue. This series does not add GPU-specific overrides. The gate reproduces integration's config resolution and requires the GPU head to match it exactly. Full kernel builds still use fatal compiler and DRM warnings.

The companion m1n1 PR is required. It publishes the version-2 T6040 handoff; older loaders leave the GPU unable to probe. The firmware domains stay powered while the loaded GPU image lives.

J616s CTS is still open. #455 changes the G16 governor and PMP idle floor; its interaction with this T6040 G17 path still needs a combined test. This PR does not claim that qualification.

Jonathan Goyvaerts' original T6040 bring-up and shared loaded-image identity work are retained. The 25G83 encoder constants derive from Gravity Linux work by Cody Ho and Niklas Sheth. That file retains its attribution and uses GPL-2.0-only.

Validation passed on a0a9485. Both universal and Fedora-base Image/modules/DTBs builds passed with fatal C, Rust and DRM warnings, verified from the actual compiler commands. All 8 review commits compile the Asahi driver. Asahi KUnit passed 89/89 cases across 24 suites in ARM64 QEMU. All 23 asahi-m4 and all 63 apple-dcp host groups passed without skips, using GNU make 4.4.1. The T6040 calibration and G17 host suites passed. GPU and Wi-Fi binding checks and full T6040 DT validation passed with empty diagnostics. The companion loader's 30-case fixture and fresh Rust/C chainloading release build also passed. These were CPU-only gates. The kernel builds retain pre-existing kernel-doc diagnostics and one Fedora modpost warning for pmp-report-test.ko missing MODULE_DESCRIPTION(); none refers to a file changed by this series. The loader retains nine warnings from unchanged Rust sources. No new warning suppression was added.

The exact 7.3.0-aurora-m4p13 test kernel is published with SHA256SUMS and READY for the m4pro agent's final J616s hardware gate. It includes the matching DTBs, modules and source pins. The universal asahi.config remains unchanged, including the separately documented existing Fedora governor mismatch. No merge has been performed.

Companion PR aurora-silicon/m1n1#52

Enablement inventory

The T6040 changes introduce no module parameter, kernel parameter, Kconfig definition or platform opt-in flag. The kernel's existing unconditional apple,agx-t6040 OF entry selects hw::t6040::CONFIG and the G17 backend. The board DT enables the GPU and mailbox; m1n1 honours an explicitly disabled GPU and disables it on invalid calibration. Successful fill supplies the version-2 calibration and six memory reservations. An older loader cannot satisfy the kernel's handoff validation.

The existing asahi module exposes the following parameters. None was added or changed by this series, and no non-default value is required to enable T6040. The module must be loaded when built as a module; ordinary OF module alias loading suffices.

Existing parameter Default T6040 use
debug_flags 0 Shared probe/debug logging; no enablement role
mem_limit_pct 67 Shared device memory-accounting limit
client_mem_limit_pct 50 Shared client memory-accounting limit
oom_attribution 1 Shared creator RSS accounting
robust_isolation 0 Existing shared UAT binding policy; no required override
fault_control 0xb Legacy firmware control; G17 explicitly refuses soft-fault advertising regardless of this value
compute_preempt -1 Legacy workqueue, no T6040 enablement role
initial_tvb_size 0x8 Legacy TVB initialization, no T6040 enablement role
stats_export 1 Legacy stats export; G17 registers without a firmware stats decoder
g15_deadline_ms, g15_compute_deadline_ms 5000, 1000 Other backend only
g15_repoll_us, g15_resnap_us 15, 100 Other backend only
g15_idle_standby_us, g15_idle_min_conf 0, 500 Other backend only
g15_recovery, g15_stream_gate 1, 1 Other backend only
g15_pb_max_blocks, g15_early_tiling, g15_accept_text_prefix 3072, 0, 0 Other backend only
g16_deadline_ms, g16_compute_deadline_ms 5000, 5000 Other backend only
g16_repoll_us, g16_resnap_us 15, 100 Other backend only
g16_recovery, g16_stream_gate 1, 1 Other backend only

The relevant existing Kconfig dependencies are listed below. No new or per-device Kconfig option is needed. All ordinary framework dependencies and selects remain those already declared by these symbols in the base tree.

Existing symbols Reason
DRM_ASAHI Builds the shared driver including the unconditional G17 backend
RUST, DRM=y, ARM64, ARCH_APPLE, MMU, IOMMU_SUPPORT, ARM64_16K_PAGES / PAGE_SIZE_16KB Existing DRM_ASAHI hardware/build dependencies; 16 KiB pages are required by GPU mappings; COMPILE_TEST and !GENERIC_ATOMIC64 are the existing alternative compile-test condition, not a device gate
APPLE_PMP, APPLE_PMP_REPORT PMP supplier and shared GPU report vote; DT identifies the supplier
RUST_DRM_SCHED, DRM_SCHED, RUST_DRM_GEM_SHMEM_HELPER, DRM_GEM_SHMEM_HELPER, RUST_DRM_GPUVM Existing scheduler/GEM/GPUVM helpers selected by DRM_ASAHI
CRYPTO_LIB_SHA256 Existing exact loaded-image identity checks
RUST_APPLE_RTKIT, RUST_APPLE_MAILBOX, APPLE_RTKIT, APPLE_MAILBOX, PM Existing firmware transport and power framework
OF, OF_ADDRESS, OF_RESERVED_MEM, OF_DYNAMIC, PM_GENERIC_DOMAINS, PM_GENERIC_DOMAINS_OF, APPLE_PMGR_PWRSTATE Existing DT, reserved-memory and PMGR power-domain providers
APPLE_AIC, APPLE_DART Existing interrupt and PMP IOMMU providers named by DT; no new device-specific setting
DRM_APPLE Existing native display path for on-screen presentation; no T6040 GPU enablement role
CPU_FREQ, UCLAMP_TASK Existing optional host refill assistance and scheduling hint; neither enables or gates T6040
DRM_ASAHI_MAPLE_TREE Existing compile guard for another VM allocator; not required or defined by this series
DRM_ASAHI_DEBUG_ALLOCATOR Existing alternate allocator; not needed, no override
DRM_ASAHI_G15, DRM_ASAHI_G16 Other backends; neither is needed to compile or enable T6040
KUNIT In-tree calibration/firmware identity tests only; not a runtime prerequisite
EXPERT, DRM_WERROR, WERROR Gate recipe uses EXPERT=y, DRM_WERROR=y, WERROR=n and make W=e because the DRM option depends on !WERROR. Actual C -Werror and Rust -Dwarnings are checked. These are test settings, not GPU enablement
NETFILTER_NETLINK, MULTIPLEXER Existing Fedora-base recipe normalizes the older stock config to y for the current bool symbols; these preserve distro support and do not enable the GPU
LOCALVERSION, LOCALVERSION_AUTO Test-package naming only: the Fedora image has the requested m4p13 release with automatic hash suffixes off; neither controls GPU support
SERIAL_AMBA_PL010, SERIAL_AMBA_PL010_CONSOLE, SERIAL_AMBA_PL011, SERIAL_AMBA_PL011_CONSOLE Existing arm64 QEMU preset console settings for the execution kernel only; no physical GPU enablement role
KUNIT_ALL_TESTS Disabled in the execution kernel so the named Asahi suites can run; not a runtime device option
DEBUG_KERNEL, PROVE_LOCKING KUnit execution-kernel diagnostics only

There is no T6040 /chosen opt-in or kernel command-line dependency. The existing asahi,t6030-*, asahi,t6031-* and asahi,t8122-* chosen switches belong to other loader branches and are not consulted by the T6040 dispatch. The existing loader initialization reads ADT /chosen/firmware-version and /chosen/system-firmware-version; the T6040 fill uses the resulting OS firmware identification for apple,firmware-version on the GPU node. These are firmware data inputs, not Linux /chosen opt-ins. Ordinary boot-memory description remains a shared loader input, not an enablement switch. No asahi.*= argument is required. nomodeset affects the pre-existing display handoff, not the T6040 GPU match; native on-screen presentation needs the existing DCP display path, which is not modified here. panic_on_warn=1, kunit.filter_glob=asahi*, kunit.enable=1, console=ttyAMA0 and kunit_shutdown=reboot are the existing parameters used only by the ARM64 QEMU KUnit gate; none enables a physical GPU.

The required GPU-node properties (including apple,t6040-handoff-version = 2, OPP tables, maps, leakage, power ceiling, core mask, firmware version and memory regions) describe validated hardware and firmware state. They are not operator opt-in flags. The admitted loaded TEXT images from #453 and the two-cluster, 20-enabled-core match data remain required. There is no firmware-admission bypass parameter on this path. DT power-domain retention and structural UAT quirks are compatible match data, not runtime flags.

The two DT apple,always-on properties retain the existing AFR and GFX PMGR domains while the loaded firmware image lives. They use the existing power-domain binding and are required for that lifetime; the PMP GPU report vote remains owned by the GPU consumer. They are not a new user-selectable platform-enable mechanism.

The package also verifies the existing distro/other-device settings SECURITY_SELINUX, NF_TABLES, BINFMT_MISC, USERFAULTFD, NTSYNC, INPUT_UINPUT, HIDRAW, ZRAM, WIREGUARD, ARM64_USER4K_EXPERIMENTAL, APPLE_SEP, MT7932_FULLMAC, BRCMFMAC and APPLE_PMC. These are preservation checks on the common recipe, not new GPU requirements or additions to asahi.config.

The QEMU execution kernel promotes DRM_ASAHI and APPLE_PMP from modules to built-in solely to run their tests in the booted image. The published Fedora candidate keeps the common fragment’s modular driver and supplier settings. These test-mode promotions add no new Kconfig definition or per-device fragment.

Carry the independent #458 prerequisite for complete T6040 DT validation.
Keep the PCI identity and family fallback and omit the redundant root-port
compatible. Its diff can disappear once #458 lands.

Link: #458

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Treat the OS version as a candidate-order hint. Continue to require an
exact admitted loaded TEXT image and preserve #453's images list. This
extends Jonathan Goyvaerts' shared identity work.

Originally-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Link: #428

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Validate version 2 of the per-chip handoff, sixteen raw OPPs and selector
slots, eleven populated selectors, zero tails and base state 1. There is
no single-unit fallback. The initdata patch wires the reader into probe
and firmware construction so this patch adds no unused compiled items.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Wire the reader into probe and firmware construction, validating OPPs and
enabled cores before firmware starts. Use the maps, leakage and power
ceiling in the 25G83 objects, replacing bin-specific output hashes with
layout and host encoder checks. Keep the Neo path unchanged.

The old ceiling declaration remains only for the hardware-default
reference removed by the next patch. Firmware uses the calibration.

Retain GPL-2.0-only and the Gravity Linux encoder attribution to Cody Ho
and Niklas Sheth. The original T6040 work is by Jonathan Goyvaerts.

Originally-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Link: #428
Link: https://github.com/GravityLinux/linux

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Keep the structural hardware description while requiring the loader maps
and power ceiling. Remove the last single-unit ceiling reference and its
declaration together, keeping this commit buildable independently.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Describe the calibration binding and use loader-filled regions and OPPs.
Enable the mailbox and keep the firmware domains powered while the image
lives. The GPU consumer owns the PMP report vote. Booting requires the
matching T6040 m1n1 handoff.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Use the current shared firmware type and extracted MMU helpers. Compare
the immutable ABI prefix while independently checking the additive tail
size and offsets. Keep the golden fixture bytes unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Exercise the production reader with synthetic properties, invalid tails
and OPPs. Cover candidate ordering and exact image refusal, and update
G17 fixtures for current queue ownership.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide marked this pull request as ready for review October 26, 2026 05:35
@RyanTheTide
RyanTheTide merged commit 0cbd115 into integration/aurora Oct 28, 2026
@RyanTheTide
RyanTheTide deleted the review/j616s-gpu-integration-v3 branch October 28, 2026 05:16
erikwb pushed a commit to erikwb/linux that referenced this pull request Oct 28, 2026
Trace calibration, firmware admission, queueing, power, recovery and
memory paths against the shared Neo backend. Separate changes already
present through aurora-silicon#463 and aurora-silicon#423 from firmware ABI restrictions and missing
hardware measurements. Record the public-source boundary for M5 Pro.

Assisted-by: LLM
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.

1 participant