Skip to content

kboot_gpu: T8142: reserve the GPU firmware's data as fw-data - #143

Merged
RyanTheTide merged 2 commits into
aurora-silicon:mainfrom
sithglan:thomas/t8142-gpu-fw-data
Nov 10, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:mainfrom
sithglan:thomas/t8142-gpu-fw-data

Conversation

@sithglan

@sithglan sithglan commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Base: main (56bc59c). Branch: thomas/t8142-gpu-fw-data (two commits: 0b8cc5a, 665cb5c).

macOS 27.0's M5 GPU firmware gives each role a __DATA_SHARED_RO segment, where it keeps its
crash log. iBoot places it right after that role's __DATA; the ADT names it sgx
gfx-data-shared-ro / gfx1-data-shared-ro. The Linux J813 GPU series (aurora-silicon/linux#1413)
maps those crash logs through /reserved-memory/fw-data, which covers both
roles' __DATA and __DATA_SHARED_RO. Today that node carries a fixed address in the DT.

This fills it with the span iBoot used, when the four segments are contiguous in that order.

  • Firmware without __DATA_SHARED_RO (before 27.0), or segments placed apart, leave the node
    as the DT has it (the latter with a log line).
  • A DT without the node is filled as before.
  • The other T8142 regions (uat-*, gfx-data, gfx1-data) are unchanged.

On the J813 under macOS 27.0 (26A428) the ADT gives:

region base size
gfx-data 0x10002444000 0xc0000
gfx-data-shared-ro 0x10002504000 0x8000
gfx1-data 0x1000250c000 0xb4000
gfx1-data-shared-ro 0x100025c0000 0x8000

So fw-data becomes 0x10002444000 + 0x184000: the region the Linux DT reserves today.

The first commit makes the GPU host fixture link again. kboot_gpu.c now calls
pmgr_adt_power_enable_traced_saved(), pmgr_restore_modes() and dt_set_gpu_t8152(),
which the fixture had no stand-ins for.

Testing

  • tests/run-kboot-gpu-g15.sh on an arm64 host (Debian, gcc 16; kboot_gpu.c's T6040
    rounding is AArch64 inline asm, so the fixture does not build on x86). Four new T8142
    scenarios:

    • t8142-fw-data: contiguous segments become fw-data;
    • t8142-fw-data-no-shared-ro: firmware without the segment leaves the node as it is;
    • t8142-fw-data-apart: segments placed apart leave it too, with the log line;
    • t8142-no-fw-data-node: a DT without the node is filled as before.

    All four pass. With main's kboot_gpu.c the first and third fail, as they should.

  • The other 75 scenarios: 65 pass, both with and without this change. The ten
    t8122-j613-standin-* scenarios fail on main as well; that is not from this branch.

  • The full build with clang 22 has no new warnings. dt_set_gpu's stack-usage warning
    (2128 bytes) is the same on main.

  • On the J813 (macOS 27.0 stub), chainloaded in place from the DebugUSB proxy. The J813 boots
    an enrolled aura (thomas/j813-27-smp2), not main, so the test image is that branch plus this
    change's kboot_gpu.c part (local test branch thomas/j813-27-smp2-fwdata-test). It booted
    Linux with a DTB whose fw-data was <0 0 0 0>; aura logged FDT: Adding reserved-memory node fw-data (10002444000..100025c8000) to RAM map. Linux saw fw-data = 0x10002444000 +
    0x184000, status okay, and the GPU ran as with the DT's fixed address. I have not booted aura
    main itself on the J813.

Reviewers: @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10

The fixture stopped linking: kboot_gpu.c now calls
pmgr_adt_power_enable_traced_saved(), pmgr_restore_modes() and
dt_set_gpu_t8152(), which it has no stand-ins for. Add inert ones (the
saved variant enables like pmgr_adt_power_enable(); no fixture is a
T8152).

The fixture builds only on an arm64 host (kboot_gpu.c's T6040 rounding
uses AArch64 inline asm). Of its 75 scenarios, 65 pass; the ten
t8122-j613-standin-* scenarios fail with and without this change.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
macOS 27.0's M5 GPU firmware gives each role a __DATA_SHARED_RO segment,
where it keeps its crash log, and iBoot places it right after that
role's __DATA (sgx gfx-data-shared-ro and gfx1-data-shared-ro). The
Linux J813 GPU series maps those crash logs through a
/reserved-memory/fw-data node that covers both roles' __DATA and
__DATA_SHARED_RO. The DT has to give that node a fixed address until
the boot loader fills it.

Fill it with the span iBoot used, when the four segments are contiguous
in that order. Firmware without __DATA_SHARED_RO, or segments placed
apart, leave the node as the DT has it; a DT without the node is filled
as before.

On the J813 under macOS 27.0 (26A428), the ADT gives gfx-data
0x10002444000+0xc0000, gfx-data-shared-ro 0x10002504000+0x8000,
gfx1-data 0x1000250c000+0xb4000 and gfx1-data-shared-ro
0x100025c0000+0x8000, so fw-data is 0x10002444000+0x184000: the
region the Linux DT reserves today.

Host tests (tests/kboot_gpu_g15_host.c): t8142-fw-data,
t8142-fw-data-no-shared-ro, t8142-fw-data-apart, t8142-no-fw-data-node.
Without this change the first and third fail.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants