Skip to content

kboot_gpu: leave the GPU disabled when its firmware has no initdata layout - #381

Merged
DjDeveloperr merged 2 commits into
mainfrom
satchlj/gpu-without-initdata-layout
Nov 21, 2026
Merged

DjDeveloperr merged 2 commits into
mainfrom
satchlj/gpu-without-initdata-layout

Conversation

@satchlj

@satchlj satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

kboot_gpu: when the G13/G14 GPU's firmware has no initdata layout, leave the GPU disabled and continue booting, instead of refusing the boot.

Why: rust_gpu_initdata_size() fails for a firmware build without a layout, and dt_set_gpu() then returned -1, which stopped kboot. The MacBook Air M2 (J413, T8112 G14G) on the macOS 27.2 stub hits this: Aura has no G14G 27.2 layout.

Change: check for the layout first. Without one, reserve iBoot's GPU carveouts as before (uat-handoff, uat-pagetables, uat-ttbs), set the GPU node disabled and return 0. The GPU's power state is not touched and no firmware ABI is published. Firmware that has a layout goes through the unchanged path. The compat-version switch is moved into a helper so that both uses share it.

Selection: whether an initdata layout exists, not the chip or firmware name. Other G13/G14 Macs on a firmware without a layout (for example M1 machines on 27.2) now boot with the GPU disabled, where before the boot was refused. Not tested on those.

Testing

  • Builds (aarch64 gcc, RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1).
  • J413 on the 27.2 stub: a local equivalent keyed on T8112 + 27.2 has been in phellos's default loader since 2026-11-18 (GPU disabled, carveouts reserved, desktop software-rendered). This exact change: hardware result to follow from the phellos upstream-default boot.

🤖 Generated with Claude Code

…ayout

On the G13/G14 path, a firmware build without an initdata layout made
rust_gpu_initdata_size() fail, and dt_set_gpu() then refused the whole
boot. The MacBook Air M2 (J413, T8112 G14G) on the macOS 27.2 stub hits
this: Aura has no G14G layout for 27.2.

Check for the layout first. Without one, reserve iBoot's GPU carveouts as
before, set the GPU node disabled and continue, without touching the
GPU's power state or publishing a firmware ABI. Firmware with a layout is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf.

Hardware result on MacBook Air M2 (J413, T8112), macOS 27.2 (26B123) stub: pass. The change is now part of phellos's default.

Tested in phellos's upstream-first build, and it is now the default (one-shot 3957f65b, then default boots a10e0f07 and bef932e9, 2026-11-20):

🤖 Generated with Claude Code

@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: hardware run.

PR head Checked Result
bcb51d49 Default boot on 27.2 with the GPU left disabled (status "disabled", no DRM render node), rest of the boot healthy Pass

Build: phellos (MacBook Air M2, J413, macOS 27.2 / 26B123 stub), default rebuilt 2026-11-20 = linux integration/aurora 458f759d + aurora-silicon/linux#2519 aurora-silicon/linux#1832 aurora-silicon/linux#1831 aurora-silicon/linux#2264 aurora-silicon/linux#2525 aurora-silicon/linux#2526 aurora-silicon/linux#2543 aurora-silicon/linux#2544 aurora-silicon/linux#2545; Aura main 0beafec + #377 #227 (isp.c only) #381 #382; U-Boot aurora-wip 37baf8f7 + aurora-silicon/u-boot#67; Stage 2 DTB t8112-j413-fw27.dtb. One-shot boot under the SoC watchdog, then made the default (two default boots healthy).

satchlj added a commit that referenced this pull request Nov 21, 2026
Review of the handoff (RyanTheTide), and phellos (J413, 27.2 stub) with it
in the default Stage 2: the GPU binds, but the kernel's 27.2 backend is
compute-only and the greeter's compositor and Qt pick its render node for
GL; their submits fail with EINVAL and both abort, so there is no login
screen.

- Publish the handoff only with the boot config line
  chosen.asahi,t8112-gpu=1, which a compute trial sets. Without it an
  identified image is logged and the GPU stays disabled, as with #381.
- On the handoff path, the operating-point block no longer fails the
  boot: a missing perf-state-count or perf-state-table-count, a bad
  perf-states or perf-states-sram length, no operating-points-v2, an
  operating-point count mismatch, a failed in-place write, the leakage
  coefficients or calc_power() now leave the GPU disabled. Other chips
  keep the strict behaviour.
- A missing perf-states-sram refuses the handoff (checked in dt_set_gpu()
  and again in dt_set_gpu_g14g_handoff()): the backend takes each
  operating point's SRAM voltage from it.
- Require the T8112 sgx compatible, gpu,t8112 (phellos's ADT), as the
  T8122 target requires gpu,t8122.

Signed-off-by: Satya Benson <satya@benson.earth>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed bcb51d4. The change is right. The layout check moved ahead of the perf-state parsing, and nothing between the old and new spots returns early except the gpu < 0 exit after the carveouts. So firmware that has a layout goes through exactly the old path. Without a layout, the carveouts are still reserved (uat-handoff/uat-pagetables/uat-ttbs), the GPU node goes disabled, and the boot continues instead of refusing (src/kboot_gpu.c:4446-4457). Selection is by whether a layout exists, not by chip.

I also checked it merges with main and with #402 (kboot_gpu.c merges cleanly in both orders). Once #402 lands, J413 on 27.2 will take the layout path and this becomes the fallback for the other G13/G14 Macs.

Hardware gate is met: J413 on the 27.2 stub at this exact head, on main 0beafec (GPU disabled, boot healthy, made default). Every other G13/G14 machine either runs unchanged code or was refusing to boot before. Main changed kboot_gpu.c since 5cf061c (T8122 26.x path only), so I'm updating the branch and will merge once CI is green on the new head.

Assisted-by: Claude Opus 5.5

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blockers, and nothing to add to Dj's review. I checked the same things he did and get the same result. The layout check now comes before any power-state or ABI write. On the no-layout path the three uat-* carveouts are still reserved. Firmware that has a layout runs the old path unchanged (same compat mapping, and rust_gpu_initdata_size() is called once with the same arguments). One small thing, take it or leave it: in src/kboot_gpu.c:4452-4454, when there is no gpu node the function returns 0 before the printf, so that case leaves no log line. Moving the printf above gpu = fdt_path_offset(...) would log it on every board.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr
DjDeveloperr merged commit 1d8bea4 into main Nov 21, 2026
16 checks passed
satchlj added a commit that referenced this pull request Nov 22, 2026
…d image

On macOS 27.2 iBoot loads T8112's G14G GPU firmware as three gfx-asc
segments (__TEXT;__DATA;__DATA_SHARED_RO), and aura has no initdata
layout for it, so #381 leaves the GPU disabled. Linux's g14_v27_2
backend (aurora-silicon/linux#2543-#2545) starts that firmware itself
from the loader's handoff instead.

Route on the loaded image, not on the release:

- firmware_gfx_version() also identifies images without an image-info
  header, by the uuid iBoot puts in /arm-io/gfx-asc/iop-gfx-nub and the
  __TEXT size. One row: the G14G 27.2 image (26B123).
- When the G13/G14 path has no initdata layout and the image is
  identified, the operating points and leakage are published as usual,
  then dt_set_gpu_g14g_handoff(): #393's T8122 handoff reader and
  region publication, parameterised by target (log tag, sgx compatible,
  GPU node compatible, first-segment VA). For G14G the GPU node is the
  apple,agx-g14g one and the segment VAs must run on from the first.
  It reserves no-map and links ttbs, pagetables, handoff, shared-l2,
  fw-text and fw-data (__DATA + the read-only tail), and publishes
  apple,firmware-version/-compat from the image,
  apple,coredump-copy-buffer from the nub and
  /chosen/aurora-gpu-resources/sgx adt-perf-states-sram (the ADT
  property, which the kernel's 27.2 backend reads), then sets the GPU
  node okay, all in one FDT transaction.
- An unidentified image, or an ADT the handoff reader refuses, leaves
  the GPU disabled as #381 does.

T8122's messages and DT output are unchanged: all 95 host scenarios of
tests/kboot_gpu_g15_host.c give byte-identical output against main
(83 pass, the same 12 stand-in/calibration fixtures fail on both).

Signed-off-by: Satya Benson <satya@benson.earth>
satchlj added a commit that referenced this pull request Nov 22, 2026
Review of the handoff (RyanTheTide), and phellos (J413, 27.2 stub) with it
in the default Stage 2: the GPU binds, but the kernel's 27.2 backend is
compute-only and the greeter's compositor and Qt pick its render node for
GL; their submits fail with EINVAL and both abort, so there is no login
screen.

- Publish the handoff only with the boot config line
  chosen.asahi,t8112-gpu=1, which a compute trial sets. Without it an
  identified image is logged and the GPU stays disabled, as with #381.
- On the handoff path, the operating-point block no longer fails the
  boot: a missing perf-state-count or perf-state-table-count, a bad
  perf-states or perf-states-sram length, no operating-points-v2, an
  operating-point count mismatch, a failed in-place write, the leakage
  coefficients or calc_power() now leave the GPU disabled. Other chips
  keep the strict behaviour.
- A missing perf-states-sram refuses the handoff (checked in dt_set_gpu()
  and again in dt_set_gpu_g14g_handoff()): the backend takes each
  operating point's SRAM voltage from it.
- Require the T8112 sgx compatible, gpu,t8112 (phellos's ADT), as the
  T8122 target requires gpu,t8122.

Signed-off-by: Satya Benson <satya@benson.earth>
satchlj added a commit that referenced this pull request Nov 22, 2026
…d image

On macOS 27.2 iBoot loads T8112's G14G GPU firmware as three gfx-asc
segments (__TEXT;__DATA;__DATA_SHARED_RO), and aura has no initdata
layout for it, so #381 leaves the GPU disabled. Linux's g14_v27_2
backend (aurora-silicon/linux#2543-#2545) starts that firmware itself
from the loader's handoff instead.

Route on the loaded image, not on the release:

- firmware_gfx_version() also identifies images without an image-info
  header, by the uuid iBoot puts in /arm-io/gfx-asc/iop-gfx-nub and the
  __TEXT size. One row: the G14G 27.2 image (26B123).
- When the G13/G14 path has no initdata layout and the image is
  identified, the operating points and leakage are published as usual,
  then dt_set_gpu_g14g_handoff(): #393's T8122 handoff reader and
  region publication, parameterised by target (log tag, sgx compatible,
  GPU node compatible, first-segment VA). For G14G the GPU node is the
  apple,agx-g14g one and the segment VAs must run on from the first.
  It reserves no-map and links ttbs, pagetables, handoff, shared-l2,
  fw-text and fw-data (__DATA + the read-only tail), and publishes
  apple,firmware-version/-compat from the image,
  apple,coredump-copy-buffer from the nub and
  /chosen/aurora-gpu-resources/sgx adt-perf-states-sram (the ADT
  property, which the kernel's 27.2 backend reads), then sets the GPU
  node okay, all in one FDT transaction.
- An unidentified image, or an ADT the handoff reader refuses, leaves
  the GPU disabled as #381 does.

T8122's messages and DT output are unchanged: all 95 host scenarios of
tests/kboot_gpu_g15_host.c give byte-identical output against main
(83 pass, the same 12 stand-in/calibration fixtures fail on both).

Signed-off-by: Satya Benson <satya@benson.earth>
satchlj added a commit that referenced this pull request Nov 22, 2026
Review of the handoff (RyanTheTide), and phellos (J413, 27.2 stub) with it
in the default Stage 2: the GPU binds, but the kernel's 27.2 backend is
compute-only and the greeter's compositor and Qt pick its render node for
GL; their submits fail with EINVAL and both abort, so there is no login
screen.

- Publish the handoff only with the boot config line
  chosen.asahi,t8112-gpu=1, which a compute trial sets. Without it an
  identified image is logged and the GPU stays disabled, as with #381.
- On the handoff path, the operating-point block no longer fails the
  boot: a missing perf-state-count or perf-state-table-count, a bad
  perf-states or perf-states-sram length, no operating-points-v2, an
  operating-point count mismatch, a failed in-place write, the leakage
  coefficients or calc_power() now leave the GPU disabled. Other chips
  keep the strict behaviour.
- A missing perf-states-sram refuses the handoff (checked in dt_set_gpu()
  and again in dt_set_gpu_g14g_handoff()): the backend takes each
  operating point's SRAM voltage from it.
- Require the T8112 sgx compatible, gpu,t8112 (phellos's ADT), as the
  T8122 target requires gpu,t8122.

Signed-off-by: Satya Benson <satya@benson.earth>
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.

3 participants