mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM
@ 2026-11-20  4:46 John Hubbard
  2026-11-20  4:46 ` [PATCH 1/9] rust: pci: add domain_nr() accessor John Hubbard
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: John Hubbard @ 2026-11-20  4:46 UTC (permalink / raw)
  To: Danilo Krummrich, Alexandre Courbot
  Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
	David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
	Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
	linux-pci, rust-for-linux, John Hubbard

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 [1], 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 BROM and BOOTVEC programming, out of the PIO and DMA load paths
* the core reset and 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).

The series also has one patch that the handlers do not use, and that the
rest of the r000 series requires: the PCI domain accessor. The patch is
its v2 posting [2] with the Reviewed-by tags from Alex and Gary.

The series applies on drm-rust-next at 0dbf41fd03ab, on top of one build
fix that is in v7.4-rc2 and not yet in drm-rust-next:
commit 57d916a3eb76 ("rust: bindings: derive Zeroable for bindgen's
opaque array wrappers"). A branch with everything applied:

    https://github.com/johnhubbard/linux/tree/nova-core-run-falcon-binaries-v0/

Changes since v3 of the r000 series. The two handlers and the dispatcher
come from v3 patches 15, 17 and 18:

* The handlers now use the core reset and 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.

[1] https://lore.kernel.org/all/20260918010719.1176945-1-jhubbard@nvidia.com/
[2] https://lore.kernel.org/all/20261111200549.160806-1-jhubbard@nvidia.com/


John Hubbard (9):
  rust: pci: add domain_nr() accessor
  gpu: nova-core: falcon: factor out the wait for the GSP suspend
  gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming
  gpu: nova-core: gsp: factor out the core reset and the core resume
  gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages
  gpu: nova-core: falcon: select the BAR2 engine ID for framebuffer DMA
  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               |  46 +-
 drivers/gpu/nova-core/falcon/gsp.rs           |  15 +
 .../gpu/nova-core/firmware/gen_bootloader.rs  |   8 +-
 drivers/gpu/nova-core/gsp.rs                  |   1 +
 drivers/gpu/nova-core/gsp/boot.rs             |   8 +-
 drivers/gpu/nova-core/gsp/load_exec.rs        | 493 ++++++++++++++++++
 drivers/gpu/nova-core/gsp/sequencer.rs        |  48 +-
 drivers/gpu/nova-core/regs.rs                 |   2 +
 drivers/gpu/nova-core/sbuffer.rs              |   1 -
 rust/helpers/pci.c                            |   5 +
 rust/kernel/pci.rs                            |  16 +
 11 files changed, 582 insertions(+), 61 deletions(-)
 create mode 100644 drivers/gpu/nova-core/gsp/load_exec.rs


base-commit: 0dbf41fd03abee01a37a83336ed84cd5812af633
prerequisite-patch-id: dba3141a4ed9123a37958daa1a27e82669d64941
-- 
2.56.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-11-20  4:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20  4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
2026-11-20  4:46 ` [PATCH 1/9] rust: pci: add domain_nr() accessor John Hubbard
2026-11-20  4:46 ` [PATCH 2/9] gpu: nova-core: falcon: factor out the wait for the GSP suspend John Hubbard
2026-11-20  4:46 ` [PATCH 3/9] gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming John Hubbard
2026-11-20  4:46 ` [PATCH 4/9] gpu: nova-core: gsp: factor out the core reset and the core resume John Hubbard
2026-11-20  4:47 ` [PATCH 5/9] gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages John Hubbard
2026-11-20  4:47 ` [PATCH 6/9] gpu: nova-core: falcon: select the BAR2 engine ID for framebuffer DMA John Hubbard
2026-11-20  4:47 ` [PATCH 7/9] gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler John Hubbard
2026-11-20  4:47 ` [PATCH 8/9] gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler John Hubbard
2026-11-20  4:47 ` [PATCH 9/9] gpu: nova-core: gsp: add the load-and-execute event dispatcher John Hubbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®