[PATCH v2 0/7] gpu: nova-core: gsp: add r000 load+exec handlers

From: Eliot Courtney

Date: Wed Dec 02 2026 - 07:07:39 EST


Patches 1-7 from v1 (the falcon `load`/`boot` rework and `zerocopy`
prep) were applied to drm-rust-next, so v2 only has the remaining r000
load+exec handler patches based on John's series [1].

This is based on drm-rust-next.

[1]: https://lore.kernel.org/20261120044704.165223-1-jhubbard@xxxxxxxxxx

John's cover letter, trimmed to what still applies:
> This series adds the code that runs a falcon binary on behalf of the
> r000 GSP-RM during boot. It is the next part of the r000 GSP firmware
> series [2], which moves nova-core onto the GSP firmware of the r615 and
> later releases. The patches do not depend on the switch to r000, so they
> are posted on their own, in order to make the rest of that series
> smaller. With these applied, the driver still boots the r570 firmware.
>
> Some background (perhaps a refresher for some readers): the GSP falcon
> has two cores, a falcon core and a RISC-V core, and only one of the two
> is active at a time. GSP-RM runs on the RISC-V core.
>
> During boot, the r000 GSP-RM requires a binary to run on the falcon
> core. GSP-RM raises a load-and-execute event and suspends the RISC-V
> core. The driver then resets the GSP falcon, loads and runs the binary,
> and resumes GSP-RM. There are two such events:
>
> * On GA102 and later, the binary is a Heavy-Secured (HS) binary that
> GSP-RM has placed in the framebuffer.
>
> * On Turing and GA100, the binary is an image that the generic falcon
> bootloader loads. The event carries a descriptor of the image.
>
> The series adds a handler for each of the two events, and a dispatcher
> that selects the handler from the command ID of an event. The handlers
> share steps with code that the driver already has, so the series first
> factors those steps out:
>
> * the wait for the GSP suspend, out of the shutdown path
> * the core resume, out of the CPU sequencer
>
> The only change in what the driver does with the r570 firmware is a
> slight change in the appearance of two error messages (mentioned below).
>
> Changes since v3 of the r000 series. The two handlers and the dispatcher
> come from v3 patches 15, 17 and 18:
>
> * GSP-RM is now resumed with the core resume of the CPU sequencer.
>
> * Typesafe handler code: a handler receives its decoded parameters, and
> the dispatcher decodes the payload of the event, instead of using two
> raw byte slices to describe the payload.
>
> * The selection of the BAR2 engine ID is now introduced in a separate,
> small patch.
>
> * Fixed two error messages in GSP-RM resume.
>
> An LLM coding assistant (Claude Code) helped write every patch, and
> drafted the commit messages and this letter, all of which I've edited by
> hand afterwards.
>
> [2] https://lore.kernel.org/all/20260918010719.1176945-1-jhubbard@xxxxxxxxxx/

Signed-off-by: Eliot Courtney <ecourtney@xxxxxxxxxx>
---
Changes since boot-rework2 v2 and John's v1 [1]:
- Merge the two series into one (Alex)
- Add a comment on V2-only bootloader-loaded FWSEC in patch #3 (Alex)
- Add patch #7, which derives the `zerocopy` traits for
`BootloaderDmemDescV2`
- Drop John's 1/9 (in drm-rust-next as 002b9422b314) and 3/9 (patch #1
programs BROM and BOOTVEC in `boot`)
- Rework John's patches on top of patches #1-#6
- Link to boot-rework2 v2: https://patch.msgid.link/20261129-boot-rework2-v2-0-622f3560e18a@xxxxxxxxxx

---
Changes in v2:
- Drop patches #1-#7, applied to drm-rust-next
- Rebase on drm-rust-next
- Leave out the module doc until patch #5 adds it (Alex)
- Always write `Bar2Fn0` on dma cfg reg (Alex)
- Load the generic bootloader in place instead of passing it in (Alex)
- Return `EIO` without resuming GSP-RM when `MAILBOX0` is non-zero (Alex)
- Link to v1: https://patch.msgid.link/20261130-falcon-v1-0-cb94f87b5674@xxxxxxxxxx

---
John Hubbard (7):
gpu: nova-core: falcon: factor out the wait for the GSP suspend
gpu: nova-core: gsp: factor out the core resume
gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages
gpu: nova-core: falcon: select the BAR2 engine ID for DMA transfers
gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler
gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler
gpu: nova-core: gsp: add the load-and-execute event dispatcher

drivers/gpu/nova-core/falcon.rs | 15 +-
drivers/gpu/nova-core/falcon/gsp.rs | 15 +
drivers/gpu/nova-core/firmware/gen_bootloader.rs | 2 +-
drivers/gpu/nova-core/gsp.rs | 1 +
drivers/gpu/nova-core/gsp/boot.rs | 8 +-
drivers/gpu/nova-core/gsp/load_exec.rs | 511 +++++++++++++++++++++++
drivers/gpu/nova-core/gsp/sequencer.rs | 42 +-
drivers/gpu/nova-core/regs.rs | 2 +
drivers/gpu/nova-core/sbuffer.rs | 1 -
9 files changed, 553 insertions(+), 44 deletions(-)
---
base-commit: 73a8f8366b2389c2506959ab3e408c3c5161ac1a
change-id: 20261130-falcon-adc42c387291

Best regards,
--
Eliot Courtney <ecourtney@xxxxxxxxxx>