Skip to content

gpu: nova-core: Boot GSP to RISC-V active

Alexandre Courbot dri-devel lkml nouveau rust-for-linux 3 versions – Applied

Status from this message: Pushed to drm-rust-next after fixing the last issue spotted by Mikko -

Get series with b4
b4 am [email protected] change-id 20251027-gsp_boot-c6bb048a304e

Versions newest first

  1. v9 Latest15 patches 3 repliesApplied
  2. v816 patches 4 repliesSuperseded
  3. v714 patches 0 repliesSuperseded

Changes in v9 from the cover letter

- More doccomments.
- Use the MessageFromGsp trait instead of an arbitrary closure to extract incoming messages from the message queue.
- Split the message receiving method into a non-generic transport layer receive, and the generic part validating and constructing the message.
- Use well-defined types for sending and receiving messages instead of error-prone tuples.
- Link to v8: https://lore.kernel.org/r/[email protected]

Patches in v9 Applied

#Subject and filesSizeRepliesApplied
1/15gpu: nova-core: compute layout of more framebuffer regions required for GSPdrivers/gpu/nova-core/fb.rs drivers/gpu/nova-core/firmware/gsp.rs drivers/gpu/nova-core/firmware/riscv.rs +5 more+314 -110 replies
2/15gpu: nova-core: Set correct DMA maskdrivers/gpu/nova-core/driver.rs+16 -00 replies
3/15gpu: nova-core: num: add functions to safely convert a const value to a smaller typedrivers/gpu/nova-core/num.rs+51 -02 replies
4/15gpu: nova-core: Create initial Gspdrivers/gpu/nova-core/gpu.rs drivers/gpu/nova-core/gsp.rs drivers/gpu/nova-core/gsp/fw.rs +1 more+200 -100 replies
5/15gpu: nova-core: gsp: Create wpr metadatadrivers/gpu/nova-core/fb.rs drivers/gpu/nova-core/firmware/gsp.rs drivers/gpu/nova-core/firmware/riscv.rs +3 more+73 -70 replies
6/15gpu: nova-core: Add a slice-buffer (sbuffer) datastructuredrivers/gpu/nova-core/nova_core.rs drivers/gpu/nova-core/sbuffer.rs+233 -00 replies
7/15gpu: nova-core: Add zeroable trait to bindingsdrivers/gpu/nova-core/gsp/fw/r570_144.rs drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs+12 -90 replies
8/15rust: enable slice_flatten feature and provide it through an extension traitinit/Kconfig rust/kernel/lib.rs rust/kernel/prelude.rs +1 more+59 -00 replies
9/15gpu: nova-core: gsp: Add GSP command queue bindings and handlingdrivers/gpu/nova-core/gsp.rs drivers/gpu/nova-core/gsp/cmdq.rs drivers/gpu/nova-core/gsp/fw.rs +3 more+1410 -40 replies
10/15gpu: nova-core: gsp: Create rmargsdrivers/gpu/nova-core/gsp.rs drivers/gpu/nova-core/gsp/cmdq.rs drivers/gpu/nova-core/gsp/fw.rs+85 -40 replies
11/15gpu: nova-core: gsp: Add SetSystemInfo commanddrivers/gpu/nova-core/gsp.rs drivers/gpu/nova-core/gsp/boot.rs drivers/gpu/nova-core/gsp/cmdq.rs +4 more+235 -30 replies
12/15gpu: nova-core: gsp: Add SetRegistry commanddrivers/gpu/nova-core/gsp/boot.rs drivers/gpu/nova-core/gsp/commands.rs drivers/gpu/nova-core/gsp/fw/commands.rs +2 more+165 -70 replies
13/15gpu: nova-core: falcon: Add support to check if RISC-V is activedrivers/gpu/nova-core/falcon.rs drivers/gpu/nova-core/regs.rs+15 -10 replies
14/15gpu: nova-core: falcon: Add support to write firmware versiondrivers/gpu/nova-core/falcon.rs drivers/gpu/nova-core/regs.rs+14 -00 replies
15/15gpu: nova-core: gsp: Boot GSPdrivers/gpu/nova-core/falcon.rs drivers/gpu/nova-core/firmware/riscv.rs drivers/gpu/nova-core/gsp/boot.rs+64 -60 replies

Reviews trailers per patch

7 of 15 patches have a Reviewed-by or Acked-by.

PatchDanilo KrummrichLyude PaulMiguel OjedaAlice RyhlMikko Perttunen
1/15A-b
2/15
3/15R-b
4/15
5/15
6/15R-b
7/15
8/15A-b A-b R-b
9/15
10/15
11/15
12/15
13/15R-b
14/15R-b
15/15R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v9 thread

Cover letter [PATCH v9 00/15] gpu: nova-core: Boot GSP to RISC-V active

This revision features a more adequate method for receiving messages, and some general cleanup. It looks solid to me, and although there are further minor improvements I want to eventually see I think it makes an adequate first milestone.

I am considering merging this before -rc6, so it can make it into 6.19. If there are reasons not to, please scream. :)

A branch including this series and its dependencies is available at [1].

[1] https://github.com/Gnurou/linux/tree/b4/gsp_boot

Changes in v9:
- More doccomments.
- Use the MessageFromGsp trait instead of an arbitrary closure to extract incoming messages from the message queue.
- Split the message receiving method into a non-generic transport layer receive, and the generic part validating and constructing the message.
- Use well-defined types for sending and receiving messages instead of error-prone tuples.
- Link to v8: https://lore.kernel.org/r/[email protected]

Changes in v8:
- Add lots of doccomments.
- Refactor and simplify GSP command sending - now uses a single trait and a single method.
- Leverage the new from_bytes_prefix family of methods to simplify GSP command queue code a bit.
- Simplify RM arguments.
- Split the GspSetSystemInfo and SetRegistry commands into their own patch.
- Add a is_empty method to SBufferIter and use it to detect when a command's variable length payload has not been entirely written.
- Harmonize imports according to new format rules.
- Link to v7: https://lore.kernel.org/r/[email protected]

Changes in v7:
- Remove as conversions by using the features of the num module.
- Add build-time conversion of constant integer values to smaller types.
- Thanks to the two items above, make more functions infallible.
- Remove unneeded nr_ptes member of the Cmdq.
- Use repr(u32) for MsgFunction to simplify it.
- Use from_ref instead of casting references into pointers with as.
- Add message header version type to remove use of magic number.
- Switch some parameters to usize to limit type conversions.
- Add comments for undocumented functions.
- Remove function_number method of GspMsgElement and return invalid function numbers as the error value of function instead.
- Work around the renaming of slice::flatten to slice::as_flattened in Rust 1.80 (thanks Miguel!).
- Fix clippy warning with Rust 1.78.
- Link to v6: https://lore.kernel.org/r/[email protected]/

---
Alexandre Courbot (3):
gpu: nova-core: compute layout of more framebuffer regions required for GSP
gpu: nova-core: num: add functions to safely convert a const value to a smaller type
rust: enable slice_flatten feature and provide it through an extension trait

Alistair Popple (9):
gpu: nova-core: Set correct DMA mask
gpu: nova-core: Create initial Gsp
gpu: nova-core: gsp: Create wpr metadata
gpu: nova-core: Add zeroable trait to bindings
gpu: nova-core: gsp: Add GSP command queue bindings and handling
gpu: nova-core: gsp: Create rmargs
gpu: nova-core: gsp: Add SetSystemInfo command
gpu: nova-core: gsp: Add SetRegistry command
gpu: nova-core: gsp: Boot GSP

Joel Fernandes (3):
gpu: nova-core: Add a slice-buffer (sbuffer) datastructure
gpu: nova-core: falcon: Add support to check if RISC-V is active
gpu: nova-core: falcon: Add support to write firmware version

 drivers/gpu/nova-core/driver.rs                   |  16 +
 drivers/gpu/nova-core/falcon.rs                   |  15 +
 drivers/gpu/nova-core/fb.rs                       |  72 ++-
 drivers/gpu/nova-core/firmware/gsp.rs             |   7 +-
 drivers/gpu/nova-core/firmware/riscv.rs           |  11 +-
 drivers/gpu/nova-core/gpu.rs                      |   2 +-
 drivers/gpu/nova-core/gsp.rs                      | 156 ++++-
 drivers/gpu/nova-core/gsp/boot.rs                 |  85 ++-
 drivers/gpu/nova-core/gsp/cmdq.rs                 | 680 +++++++++++++++++++++
 drivers/gpu/nova-core/gsp/commands.rs             | 129 ++++
 drivers/gpu/nova-core/gsp/fw.rs                   | 608 ++++++++++++++++++-
 drivers/gpu/nova-core/gsp/fw/commands.rs          | 106 ++++
 drivers/gpu/nova-core/gsp/fw/r570_144.rs          |   6 +-
 drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs | 703 ++++++++++++++++++++++
 drivers/gpu/nova-core/nova_core.rs                |   1 +
 drivers/gpu/nova-core/num.rs                      |  51 ++
 drivers/gpu/nova-core/regs.rs                     |  17 +-
 drivers/gpu/nova-core/sbuffer.rs                  | 228 +++++++
 init/Kconfig                                      |   3 +
 rust/kernel/lib.rs                                |   4 +
 rust/kernel/prelude.rs                            |   3 +
 rust/kernel/slice.rs                              |  49 ++
 22 files changed, 2918 insertions(+), 34 deletions(-)

---
base-commit: 80b3dc0a5a2e51fb2b8f3406f5ee20ad4a652316
change-id: 20251027-gsp_boot-c6bb048a304e

Best regards,

Signature · 1 line
Alexandre Courbot <[email protected]>