rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 00/16] gpu: nova-core: Boot GSP to RISC-V active
@ 2025-11-07 23:43 Alexandre Courbot
  2025-11-07 23:43 ` [PATCH v8 01/16] gpu: nova-core: compute layout of more framebuffer regions required for GSP Alexandre Courbot
                   ` (16 more replies)
  0 siblings, 17 replies; 19+ messages in thread
From: Alexandre Courbot @ 2025-11-07 23:43 UTC (permalink / raw)
  To: Danilo Krummrich, Alice Ryhl, David Airlie, Simona Vetter,
	Benno Lossin, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Andreas Hindborg, Trevor Gross
  Cc: John Hubbard, Alistair Popple, Joel Fernandes, Timur Tabi,
	Edwin Peer, nouveau, dri-devel, linux-kernel, rust-for-linux,
	Alexandre Courbot, Lyude Paul, Alexandre Courbot

Hopefully a close-to-mergeable revision. Lots of documentation added,
making the process of understanding the code hopefully easier, and I
have finally given more attention to the top patches.

This resulted in another refactor/simplification of the GSP command
sending, moving it closer to Alistair's original idea of separating the
commands from the objects representing them. This also means there is a
single trait for commands, and a single method to send them. A couple
Reviewed-by tags have been removed as that part of the code changed
quite a bit.

The message receive method in its current form won't be adequate as-is
for the long-term, but it is fit to boot GSP.

The hope is to merge this or a v9 before -rc6, so it can make it into
6.19. If there are reasons not to, please scream within a week or so. :)

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

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

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/20251029-gsp_boot-v7-0-34227afad347@nvidia.com

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/20251017054736.2984332-1-apopple@nvidia.com/

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Alexandre Courbot (5):
      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
      gpu: nova-core: gsp: Add SetRegistry command
      bitfields RANGE doc - not great

Alistair Popple (8):
      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: 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/bitfield.rs                 |  16 +-
 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                      | 145 ++++-
 drivers/gpu/nova-core/gsp/boot.rs                 |  86 ++-
 drivers/gpu/nova-core/gsp/cmdq.rs                 | 607 +++++++++++++++++++
 drivers/gpu/nova-core/gsp/commands.rs             | 122 ++++
 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          |   2 +-
 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                  | 227 +++++++
 init/Kconfig                                      |   3 +
 rust/kernel/lib.rs                                |   4 +
 rust/kernel/prelude.rs                            |   3 +
 rust/kernel/slice.rs                              |  49 ++
 23 files changed, 2839 insertions(+), 34 deletions(-)
---
base-commit: 80b3dc0a5a2e51fb2b8f3406f5ee20ad4a652316
change-id: 20251027-gsp_boot-c6bb048a304e

Best regards,
-- 
Alexandre Courbot <acourbot@nvidia.com>


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

end of thread, other threads:[~2025-11-08  2:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07 23:43 [PATCH v8 00/16] gpu: nova-core: Boot GSP to RISC-V active Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 01/16] gpu: nova-core: compute layout of more framebuffer regions required for GSP Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 02/16] gpu: nova-core: Set correct DMA mask Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 03/16] gpu: nova-core: num: add functions to safely convert a const value to a smaller type Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 04/16] gpu: nova-core: Create initial Gsp Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 05/16] gpu: nova-core: gsp: Create wpr metadata Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 06/16] gpu: nova-core: Add a slice-buffer (sbuffer) datastructure Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 07/16] gpu: nova-core: Add zeroable trait to bindings Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 08/16] rust: enable slice_flatten feature and provide it through an extension trait Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 09/16] gpu: nova-core: gsp: Add GSP command queue bindings and handling Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 10/16] gpu: nova-core: gsp: Create rmargs Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 11/16] gpu: nova-core: gsp: Add SetSystemInfo command Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 12/16] gpu: nova-core: gsp: Add SetRegistry command Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 13/16] gpu: nova-core: falcon: Add support to check if RISC-V is active Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 14/16] gpu: nova-core: falcon: Add support to write firmware version Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 15/16] gpu: nova-core: gsp: Boot GSP Alexandre Courbot
2025-11-07 23:43 ` [PATCH v8 16/16] bitfields RANGE doc - not great Alexandre Courbot
2025-11-08  0:10   ` Alexandre Courbot
2025-11-08  2:51 ` [PATCH v8 00/16] gpu: nova-core: Boot GSP to RISC-V active Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).